public static final class ProfunctorFunctorWrapper.Instance<P extends K2,F extends K1,G extends K1> extends Object implements Profunctor ProfunctorFunctorWrapper.Mu<P,F,G>
| Modifier and Type | Class and Description |
|---|---|
static class |
ProfunctorFunctorWrapper.Instance.Mu |
| Constructor and Description |
|---|
Instance(Profunctor P proof,
Functor F fFunctor,
Functor G gFunctor) |
| Modifier and Type | Method and Description |
|---|---|
<A,B,C,D> (ProfunctorFunctorWrapper.Mu<P,F,G><A,B>) -> ProfunctorFunctorWrapper.Mu<P,F,G><C,D> |
dimap((C) -> A g,
(B) -> D h)
Takes a function from the output type
C to the input type A and a function from the input
type B to the output type D, and returns a function from a container of A, B to
a container of C, D. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdimap, dimap, lmap, rmappublic <A,B,C,D> (ProfunctorFunctorWrapper.Mu<P,F,G><A,B>) -> ProfunctorFunctorWrapper.Mu<P,F,G><C,D> dimap((C) -> A g, (B) -> D h)
ProfunctorC to the input type A and a function from the input
type B to the output type D, and returns a function from a container of A, B to
a container of C, D.
A straightforward example of an implementation of dimap is the method Function.andThen(Function).
For functions, the expression
dimap(g, h).apply(f)
is equivalent to
g.andThen(f).andThen(h)
dimap in interface Profunctor ProfunctorFunctorWrapper.Mu<P extends K2,F extends K1,G extends K1>A - The first input type.B - The second input type.C - The first output type.D - The second output type.g - A function from output to input.h - A function from input to output.Profunctor.dimap(App2, Function, Function)