C - The type of value stored in the const objects.public static final class Const.Instance<C> extends Object implements Applicative Const<C,_>
Applicative type class instance for Const. Applicative operations on the type
Const correspond to monoidal operations on the type C.| Constructor and Description |
|---|
Instance(Monoid<C> monoid)
Constructs a new instance using the given
Monoid type class instance. |
| Modifier and Type | Method and Description |
|---|---|
<A,R> (Const<C,A>) -> Const<C,R> |
lift1(Const<C,(A) -> R> function)
Lifts a wrapped transformation function into a function between containers.
|
<A,B,R> (Const<C,A>,Const<C,B>) -> Const<C,R> |
lift2(Const<C,(A,B) -> R> function)
Lifts a wrapped
BiFunction into a BiFunction between containers. |
<T,R> Const<C,R> |
map((? super T) -> ? extends R func,
Const<C,T> ts)
Maps the contents of
ts from T to R using the func. |
<A> Const<C,A> |
point(A a)
Wraps a value in a container, for example an object in a list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic <T,R> Const<C,R> map((? super T) -> ? extends R func, Const<C,T> ts)
ts from T to R using the func.
This method simply leaves the stored value unchanged.
public <A> Const<C,A> point(A a)
This method corresponds to Monoid.point().
point in interface Applicative Const<C,_>A - The type of the value.a - The input value.public <A,R> (Const<C,A>) -> Const<C,R> lift1(Const<C,(A) -> R> function)
This method corresponds to Monoid.add(Object, Object).
lift1 in interface Applicative Const<C,_>A - The input type.R - The output type.function - The container containing the transformation function.public <A,B,R> (Const<C,A>,Const<C,B>) -> Const<C,R> lift2(Const<C,(A,B) -> R> function)
ApplicativeBiFunction into a BiFunction between containers.lift2 in interface Applicative Const<C,_>A - The first input type.B - The second input type.R - The output type.function - The container containing the transformation function.