public static enum OptionalBox.Instance extends Enum<OptionalBox.Instance> implements Applicative OptionalBox.Mu, Traversable OptionalBox.Mu
Modifier and Type | Class and Description |
---|---|
static class |
OptionalBox.Instance.Mu |
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
<A,R> (OptionalBox.Mu<A>) -> OptionalBox.Mu<R> |
lift1(OptionalBox.Mu<(A) -> R> function)
Lifts a wrapped transformation function into a function between containers.
|
<A,B,R> (OptionalBox.Mu<A>,OptionalBox.Mu<B>) -> OptionalBox.Mu<R> |
lift2(OptionalBox.Mu<(A,B) -> R> function)
Lifts a wrapped
BiFunction into a BiFunction between containers. |
<T,R> OptionalBox.Mu<R> |
map((? super T) -> ? extends R func,
OptionalBox.Mu<T> ts)
Maps the contents of
ts from T to R using the func . |
<A> OptionalBox.Mu<A> |
point(A a)
Wraps a value in a container, for example an object in a list.
|
<F extends K1,A,B> |
traverse(Applicative F applicative,
(A) -> F<B> function,
OptionalBox.Mu<A> 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. |
static OptionalBox.Instance |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OptionalBox.Instance[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
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 static final OptionalBox.Instance INSTANCE
public static OptionalBox.Instance[] values()
for (OptionalBox.Instance c : OptionalBox.Instance.values()) System.out.println(c);
public static OptionalBox.Instance valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic <T,R> OptionalBox.Mu<R> map((? super T) -> ? extends R func, OptionalBox.Mu<T> ts)
Functor
ts
from T
to R
using the func
.map
in interface Functor OptionalBox.Mu
T
- The input type.R
- The output type.func
- The transformation function.ts
- The input container that will be transformed.public <A> OptionalBox.Mu<A> point(A a)
Applicative
point
in interface Applicative OptionalBox.Mu
A
- The type of the value.a
- The input value.public <A,R> (OptionalBox.Mu<A>) -> OptionalBox.Mu<R> lift1(OptionalBox.Mu<(A) -> R> function)
Applicative
lift1
in interface Applicative OptionalBox.Mu
A
- The input type.R
- The output type.function
- The container containing the transformation function.public <A,B,R> (OptionalBox.Mu<A>,OptionalBox.Mu<B>) -> OptionalBox.Mu<R> lift2(OptionalBox.Mu<(A,B) -> R> function)
Applicative
BiFunction
into a BiFunction
between containers.lift2
in interface Applicative OptionalBox.Mu
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<OptionalBox.Mu<B>> traverse(Applicative F applicative, (A) -> F<B> function, OptionalBox.Mu<A> 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 Traversable OptionalBox.Mu
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.