public static final class Forget.Instance<R> extends Object implements Cartesian Forget.Mu<R>, ReCocartesian Forget.Mu<R>
| Modifier and Type | Class and Description |
|---|---|
static class |
Forget.Instance.Mu<R> |
| Constructor and Description |
|---|
Instance() |
| Modifier and Type | Method and Description |
|---|---|
<A,B,C,D> (Forget.Mu<R><A,B>) -> Forget.Mu<R><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. |
<A,B,C> Forget.Mu<R><(A,C),(B,C)> |
first(Forget.Mu<R><A,B> input)
Converts the given transformation into one that transforms the first type of a
Pair. |
<A,B,C> Forget.Mu<R><(C,A),(C,B)> |
second(Forget.Mu<R><A,B> input)
Converts the given transformation into one that transforms the second type of a
Pair. |
<A,B,C> Forget.Mu<R><A,B> |
unleft(Forget.Mu<R><(A|C),(B|C)> input)
Converts a transformation on the left type in an
Either into a transformation on that type, discarding
the invariant right type. |
<A,B,C> Forget.Mu<R><A,B> |
unright(Forget.Mu<R><(C|A),(C|B)> input)
Converts a transformation on the right type in an
Either into a transformation on that type, discarding
the invariant left type. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdimap, dimap, lmap, rmappublic <A,B,C,D> (Forget.Mu<R><A,B>) -> Forget.Mu<R><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 Forget.Mu<R>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)public <A,B,C> Forget.Mu<R><(A,C),(B,C)> first(Forget.Mu<R><A,B> input)
CartesianPair. The second type
is not transformed - any values of that type are passed through the returned transformation unchanged.public <A,B,C> Forget.Mu<R><(C,A),(C,B)> second(Forget.Mu<R><A,B> input)
CartesianPair. The first type
is not transformed - any values of that type are passed through the returned transformation unchanged.second in interface Cartesian Forget.Mu<R>A - The input type.B - The output type.C - A "pass-through" type that is not transformed.input - The transformation.public <A,B,C> Forget.Mu<R><A,B> unleft(Forget.Mu<R><(A|C),(B|C)> input)
ReCocartesianEither into a transformation on that type, discarding
the invariant right type. This method is the inverse of Cocartesian.left(App2).unleft in interface ReCocartesian Forget.Mu<R>A - The input transformed type.B - The output transformed type.C - The invariant right type in the Either.input - The Either transformation.Either.public <A,B,C> Forget.Mu<R><A,B> unright(Forget.Mu<R><(C|A),(C|B)> input)
ReCocartesianEither into a transformation on that type, discarding
the invariant left type. This method is the inverse of Cocartesian.right(App2).unright in interface ReCocartesian Forget.Mu<R>A - The input transformed type.B - The output transformed type.C - The invariant left type in the Either.input - The Either transformation.Either.