R2
- The right type.public static final class Either.Instance<R2> extends Object implements Applicative (_|R2), Traversable (_|R2), CocartesianLike (_|R2)
Modifier and Type | Class and Description |
---|---|
static class |
Either.Instance.Mu<R2>
The witness type for
Either.Instance . |
Constructor and Description |
---|
Instance() |
Modifier and Type | Method and Description |
---|---|
<A> (A|R2) |
from((A|R2) input)
Converts the given
Either to the container type. |
<A,R> ((A|R2)) -> (R|R2) |
lift1(((A) -> R|R2) function)
Lifts a wrapped transformation function into a function between containers.
|
<A,B,R> ((A|R2),(B|R2)) -> (R|R2) |
lift2(((A,B) -> R|R2) function)
Lifts a wrapped
BiFunction into a BiFunction between containers. |
<T,R> (R|R2) |
map((? super T) -> ? extends R func,
(T|R2) ts)
Maps the contents of
ts from T to R using the func . |
<A> (A|R2) |
point(A a)
Wraps a value in a container, for example an object in a list.
|
<A> (A|R2) |
to((A|R2) input)
Converts the given container to an
Either . |
<F extends K1,A,B> |
traverse(Applicative F applicative,
(A) -> F<B> function,
(A|R2) input)
Applies a function that produces an
Applicative effect to each value contained within
input , then builds a container with an equivalent structure containing the (unboxed) results. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ap, ap, ap10, ap11, ap12, ap13, ap14, ap15, ap16, ap2, ap3, ap4, ap5, ap6, ap7, ap8, ap9, apply2, apply3, apply4, apply5, apply6, apply7, apply8, apply9, lift3, lift4, lift5, lift6, lift7, lift8, lift9
flip
public <T,R> (R|R2) map((? super T) -> ? extends R func, (T|R2) ts)
Functor
ts
from T
to R
using the func
.public <A> (A|R2) point(A a)
Applicative
point
in interface Applicative (_|R2)
A
- The type of the value.a
- The input value.public <A,R> ((A|R2)) -> (R|R2) lift1(((A) -> R|R2) function)
Applicative
lift1
in interface Applicative (_|R2)
A
- The input type.R
- The output type.function
- The container containing the transformation function.public <A,B,R> ((A|R2),(B|R2)) -> (R|R2) lift2(((A,B) -> R|R2) function)
Applicative
BiFunction
into a BiFunction
between containers.lift2
in interface Applicative (_|R2)
A
- The first input type.B
- The second input type.R
- The output type.function
- The container containing the transformation function.public <F extends K1,A,B> F<(B|R2)> traverse(Applicative F applicative, (A) -> F<B> function, (A|R2) input)
Traversable
Applicative
effect to each value contained within
input
, then builds a container with an equivalent structure containing the (unboxed) results.traverse
in interface CocartesianLike (_|R2)
traverse
in interface Traversable (_|R2)
F
- The type of the effect.A
- The input type.B
- The output type.applicative
- An instance of the Applicative
type class which defines the behavior of F
.function
- The function to apply.input
- The input container.function
to each element, if the function was
successful for every element.public <A> (A|R2) to((A|R2) input)
CocartesianLike
Either
.to
in interface CocartesianLike (_|R2)
A
- The type of the contained values.input
- The container.Either
representing an equivalent container.public <A> (A|R2) from((A|R2) input)
CocartesianLike
Either
to the container type.from
in interface CocartesianLike (_|R2)
A
- The type of the contained values.input
- The Either
.