Functional
map
μ
std::reduce(std::execution::seq, v.cbegin(), v.cend())
public <A, B, C, D> FunctionType<App2<Grate.Mu<A2, B2>, A, B>, App2<Grate.Mu<A2, B2>, C, D>> dimap(final Function<C, A> g, final Function<B, D> h)
profunctors
filter
map
collection.filter(…).map(…).flatMap(…).filter(…).map(…).filter(…).forEach(…)
filter
map
profunctors
interface Mu extends Profunctor.Mu {}
upgrades.flatMapIndexed { idx, entry -> entry.map { Pair(it.key.position.add(-2.0*idx, 0.0, 0.0), Pair(it.value, it.value.data)) } }
functors
filter
interface Mu extends Profunctor.Mu {}
profunctors
map
filter
filter
map
flatmap
Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
collection.filter(…).map(…).flatMap(…).filter(…).map(…).filter(…).forEach(…)
filter
(+ 1 1)
map
filter
Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
functors
μ
reduce
filter
public <A, B, C, D> FunctionType<App2<Grate.Mu<A2, B2>, A, B>, App2<Grate.Mu<A2, B2>, C, D>> dimap(final Function<C, A> g, final Function<B, D> h)
functors
list.map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…).map(…)
μ
category theory
default Function15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Function<T16, R>> curry15()
profunctors
filter
μ
profunctors
map
map
filter
Category Theory
() -> a -> b -> (c, d, e) -> f -> a(b)(c)[d](e, f)
map
interface Mu extends Profunctor.Mu {}