Uses of Class
fj.data.Either
Packages that use Either
Package
Description
Types that set the premise for the existence of Functional Java.
Functional control abstractions.
Parallelization strategies.
Common algebraic data types.
Optic data types adapted from the Scala Monocle library
and inspired by the
Haskell Lens library.
-
Uses of Either in fj
Modifier and TypeMethodDescriptionP1.traverseEither
(F<A, Either<X, B>> f) Traversable instance of P1 for EitherP2.traverseEither
(F<B, Either<X, C>> f) Modifier and TypeMethodDescriptionEqual.eitherEqual
(Equal<A> ea, Equal<B> eb) An equal instance for theEither
type.Hash.eitherHash
(Hash<A> ha, Hash<B> hb) A hash instance for theEither
type.F.eitherLeftK()
Promotes this function so that it returns its result on the left side of an Either.An order instance for theEither
type.F.eitherRightK()
Promotes this function so that it returns its result on the right side of an Either.Show.eitherShow
(Show<A> sa, Show<B> sb) A show instance for theEither
type.F.mapLeft()
Promotes this function to map over the left side of an Either.F.mapLeft()
Promotes this function to map over the left side of an Either.F.mapRight()
Promotes this function to map over the right side of an Either.F.mapRight()
Promotes this function to map over the right side of an Either.F.onLeft()
Returns a function that returns the left side of a given Either, or this function applied to the right side.F.onRight()
Returns a function that returns the right side of a given Either, or this function applied to the left side. -
Uses of Either in fj.control
Methods in fj.control that return EitherModifier and TypeMethodDescriptionEither
<P1<Trampoline<A>>, A> Trampoline.Codense.resume()
Either
<P1<Trampoline<A>>, A> Trampoline.Pure.resume()
abstract Either
<P1<Trampoline<A>>, A> Trampoline.resume()
Runs a single step of this computation.Either
<P1<Trampoline<A>>, A> Trampoline.Suspend.resume()
Methods in fj.control that return types with arguments of type EitherModifier and TypeMethodDescriptionstatic <A> F
<Trampoline<A>, Either<P1<Trampoline<A>>, A>> Trampoline.resume_()
-
Uses of Either in fj.control.parallel
Fields in fj.control.parallel with type parameters of type EitherMethods in fj.control.parallel that return types with arguments of type EitherModifier and TypeMethodDescriptionCallables.either()
Returns a transformation from a Callable to an Either.Turns the given Callable into either an exception or the value in the Callable.Callables.fromEither()
Returns a transformation from an Either to a Callable.Method parameters in fj.control.parallel with type arguments of type EitherModifier and TypeMethodDescriptionstatic <A> Callable
<A> Callables.fromEither
(F0<Either<Exception, A>> e) Turns a given Either value into the equivalent Callable.Constructor parameters in fj.control.parallel with type arguments of type Either -
Uses of Either in fj.data
Modifier and TypeClassDescriptionprivate static final class
Either.Left<A,
B> private static final class
Either.Right<A,
B> Modifier and TypeMethodDescriptionFunction application on this projection's value.Function application on this projection's value.final <X,
Y> Either <X, Y> Map the given functions across the appropriate side.Binds the given function across this projection's value if it has one.Binds the given function across this projection's value if it has one.Either.LeftProjection.either()
The either value underlying this projection.Either.RightProjection.either()
The either value underlying this projection.static <A,
B> Either <A, B> If the condition satisfies, return the given B in right, otherwise, return the given A in left.static <A,
B> Either <A, B> Joins an either through left.static <A,
B> Either <A, B> Joins an either through right.static <A,
B> Either <A, B> Either.left
(A a) Construct a left value of either.Map the given function across this either's left projection.Map the given function across this projection's value if it has one.Map the given function across this projection's value if it has one.static <A,
B> Either <A, B> Either.right
(B b) Construct a right value of either.Map the given function across this either's right.Anonymous bind through this projection.Anonymous bind through this projection.List.sequenceEither
(List<Either<L, B>> list) Sequence the given list and collect the output on the right side of an either.Option.sequenceEither
(Option<Either<L, B>> option) Sequence the given option and collect the output on the right side of an either.Seq.sequenceEither
(Seq<Either<L, B>> seq) Sequence the given seq and collect the output on the right side of an either.Stream.sequenceEither
(Stream<Either<L, B>> stream) Sequence the given stream and collect the output on the right side of an either.List.sequenceEitherLeft
(List<Either<B, R>> list) Sequence the given list and collect the output on the left side of an either.Option.sequenceEitherLeft
(Option<Either<B, R>> option) Sequence the given option and collect the output on the left side of an either.Seq.sequenceEitherLeft
(Seq<Either<B, R>> seq) Sequence the given seq and collect the output on the left side of an either.Stream.sequenceEitherLeft
(Stream<Either<B, R>> stream) Sequence the given stream and collect the output on the left side of an either.static final <E,
R, C> Either <Validation<E, C>, R> Validation.sequenceEitherLeft
(Validation<E, Either<C, R>> validation) Sequence the given validation and collect the output on the left side of an either.List.sequenceEitherRight
(List<Either<L, B>> list) Sequence the given list and collect the output on the right side of an either.Option.sequenceEitherRight
(Option<Either<L, B>> option) Sequence the given option and collect the output on the right side of an either.Seq.sequenceEitherRight
(Seq<Either<L, B>> seq) Sequence the given seq and collect the output on the right side of an either.Stream.sequenceEitherRight
(Stream<Either<L, B>> stream) Sequence the given stream and collect the output on the right side of an either.static final <E,
L, C> Either <L, Validation<E, C>> Validation.sequenceEitherRight
(Validation<E, Either<L, C>> validation) Sequence the given validation and collect the output on the right side of an either.Either.sequenceLeft
(List<Either<A, X>> a) Sequences through the left side of the either monad with a list of values.Either.sequenceRight
(List<Either<X, B>> a) Sequences through the right side of the either monad with a list of values.Either.swap()
If this is a left, then return the left value in right, or vice versa.Returns an either projection of this array; the given argument inLeft
if empty, or the first element inRight
.Returns an either projection of this array; the given argument inLeft
if empty, or the first element inRight
.Returns an either projection of this list; the given argument inLeft
if empty, or the first element inRight
.Returns an either projection of this optional value; the given argument inLeft
if no value, or the value inRight
.Option.toEither
(X x) Returns an either projection of this optional value; the given argument inLeft
if no value, or the value inRight
.Returns an either projection of this stream; the given argument inLeft
if empty, or the first element inRight
.Validation.toEither()
Returns an either projection of this validation.List.traverseEither
(F<A, Either<E, B>> f) Traverse through the List with given function.Option.traverseEither
(F<A, Either<L, B>> f) Traverse this option with the given function and collect the output on the right side of an either.Seq.traverseEither
(F<A, Either<L, B>> f) Traverse this seq with the given function and collect the output on the right side of an either.Stream.traverseEither
(F<A, Either<L, B>> f) Traverse this stream with the given function and collect the output on the right side of an either.List.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this list with the given function and collect the output on the left side of an either.Option.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this option with the given function and collect the output on the left side of an either.Seq.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this seq with the given function and collect the output on the left side of an either.Stream.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this stream with the given function and collect the output on the left side of an either.final <R,
C> Either <Validation<E, C>, R> Validation.traverseEitherLeft
(F<T, Either<C, R>> f) Traverse this validation with the given function and collect the output on the left side of an either.List.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this list with the given function and collect the output on the right side of an either.Option.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this option with the given function and collect the output on the right side of an either.Seq.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this seq with the given function and collect the output on the right side of an either.Stream.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this stream with the given function and collect the output on the right side of an either.final <L,
C> Either <L, Validation<E, C>> Validation.traverseEitherRight
(F<T, Either<L, C>> f) Traverse this validation with the given function and collect the output on the right side of an either.Modifier and TypeMethodDescriptionConversions.Array_Either()
A function that converts arrays to eithers.static <E,
T> F <Validation<E, T>, Either<E, T>> Validation.either()
Returns a function that constructs an either with a validation.First class catamorphism for either.Conversions.Either_ArrayA()
A function that converts eithers to arrays.Conversions.Either_ArrayB()
A function that converts eithers to arrays.static <A,
B> F <Either<A, B>, ArrayBlockingQueue<A>> Java.Either_ArrayBlockingQueueA
(boolean fair) A function that converts eithers to array blocking queues.static <A,
B> F <Either<A, B>, ArrayBlockingQueue<B>> Java.Either_ArrayBlockingQueueB
(boolean fair) A function that converts eithers to array blocking queues.Java.Either_ArrayListA()
A function that converts eithers to array lists.Java.Either_ArrayListB()
A function that converts eithers to array lists.Java.Either_BitSetA()
A function that converts eithers to bit sets.Java.Either_BitSetB()
A function that converts eithers to bit sets.static <A,
B> F <Either<A, B>, ConcurrentLinkedQueue<A>> A function that converts eithers to concurrent linked queues.static <A,
B> F <Either<A, B>, ConcurrentLinkedQueue<B>> A function that converts eithers to concurrent linked queues.static <A,
B> F <Either<A, B>, CopyOnWriteArrayList<A>> Java.Either_CopyOnWriteArrayListA()
A function that converts eithers to copy on write array lists.static <A,
B> F <Either<A, B>, CopyOnWriteArrayList<B>> Java.Either_CopyOnWriteArrayListB()
A function that converts eithers to copy on write array lists.static <A,
B> F <Either<A, B>, CopyOnWriteArraySet<A>> Java.Either_CopyOnWriteArraySetA()
A function that converts eithers to copy on write array sets.static <A,
B> F <Either<A, B>, CopyOnWriteArraySet<B>> Java.Either_CopyOnWriteArraySetB()
A function that converts eithers to copy on write array sets.static <A extends Delayed,
B>
F<Either<A, B>, DelayQueue<A>> Java.Either_DelayQueueA()
A function that converts eithers to delay queues.static <A,
B extends Delayed>
F<Either<A, B>, DelayQueue<B>> Java.Either_DelayQueueB()
A function that converts eithers to delay queues.Java.Either_EnumSetA()
A function that converts eithers to enum sets.Java.Either_EnumSetB()
A function that converts eithers to enum sets.Java.Either_HashSetA()
A function that converts eithers to hash sets.Java.Either_HashSetB()
A function that converts eithers to hash sets.static <A,
B> F <Either<A, B>, LinkedBlockingQueue<A>> Java.Either_LinkedBlockingQueueA()
A function that converts eithers to linked blocking queues.static <A,
B> F <Either<A, B>, LinkedBlockingQueue<B>> Java.Either_LinkedBlockingQueueB()
A function that converts eithers to linked blocking queues.static <A,
B> F <Either<A, B>, LinkedHashSet<A>> Java.Either_LinkedHashSetA()
A function that converts eithers to linked hash sets.static <A,
B> F <Either<A, B>, LinkedHashSet<B>> Java.Either_LinkedHashSetB()
A function that converts eithers to linked hash sets.static <A,
B> F <Either<A, B>, LinkedList<A>> Java.Either_LinkedListA()
A function that converts eithers to linked lists.static <A,
B> F <Either<A, B>, LinkedList<B>> Java.Either_LinkedListB()
A function that converts eithers to linked lists.Conversions.Either_ListA()
A function that converts eithers to lists.Conversions.Either_ListB()
A function that converts eithers to lists.Conversions.Either_OptionA()
A function that converts eithers to options.Conversions.Either_OptionB()
A function that converts eithers to options.static <A,
B> F <Either<A, B>, PriorityBlockingQueue<A>> A function that converts eithers to priority blocking queues.static <A,
B> F <Either<A, B>, PriorityBlockingQueue<B>> A function that converts eithers to priority blocking queues.Java.Either_StackA()
A function that converts eithers to stacks.Java.Either_StackB()
A function that converts eithers to stacks.Conversions.Either_StreamA()
A function that converts eithers to streams.Conversions.Either_StreamB()
A function that converts eithers to streams.Conversions.Either_StringA()
A function that converts eithers to strings.Conversions.Either_StringB()
A function that converts eithers to strings.static <B> F
<Either<Character, B>, StringBuffer> Conversions.Either_StringBufferA()
A function that converts eithers to string buffers.static <A> F
<Either<A, Character>, StringBuffer> Conversions.Either_StringBufferB()
A function that converts eithers to string buffers.static <B> F
<Either<Character, B>, StringBuilder> Conversions.Either_StringBuilderA()
A function that converts eithers to string builders.static <A> F
<Either<A, Character>, StringBuilder> Conversions.Either_StringBuilderB()
A function that converts eithers to string builders.static <A,
B> F <Either<A, B>, SynchronousQueue<A>> Java.Either_SynchronousQueueA
(boolean fair) A function that converts eithers to synchronous queues.static <A,
B> F <Either<A, B>, SynchronousQueue<B>> Java.Either_SynchronousQueueB
(boolean fair) A function that converts eithers to synchronous queues.Java.Either_TreeSetA()
A function that converts eithers to tree sets.Java.Either_TreeSetB()
A function that converts eithers to tree sets.Java.Either_VectorA()
A function that converts eithers to vectors.Java.Either_VectorB()
A function that converts eithers to vectors.ReturnsNone
if this projection has no value or if the given predicatep
does not hold for the value, otherwise, returns a right inSome
.ReturnsNone
if this projection has no value or if the given predicatep
does not hold for the value, otherwise, returns a left inSome
.Java.Future_P1()
Either.left_()
A function that constructs a left value of either.Either.leftMap_()
Return a function that maps a given function across this either's left projection.Either.leftMap_()
Return a function that maps a given function across this either's left projection.Conversions.List_Either()
A function that converts lists to eithers.Conversions.Option_Either()
A function that converts options to eithers.static <A,
B> F <Either<A, B>, PriorityQueue<A>> Java.Option_PriorityQueueA()
A function that converts eithers to priority queues.static <A,
B> F <Either<A, B>, PriorityQueue<B>> Java.Option_PriorityQueueB()
A function that converts eithers to priority queues.Either.right_()
A function that constructs a right value of either.Either.rightMap_()
Return a function that maps a given function across this either's right projection.Either.rightMap_()
Return a function that maps a given function across this either's right projection.Conversions.Stream_Either()
A function that converts streams to eithers.Conversions.String_Either()
A function that converts string to eithers.Conversions.StringBuffer_Either()
A function that converts string buffers to eithers.Conversions.StringBuilder_Either()
A function that converts string builders to eithers.Option.toEither()
A first-class version of the toEither method.Either.LeftProjection.traverseIO
(F<A, IO<C>> f) Anonymous bind through this projection.Either.RightProjection.traverseIO
(F<B, IO<C>> f) Traverse with a function that has IO effectEither.traverseIOLeft
(F<A, IO<C>> f) Traversable instance of LeftProjection of Either for IO.Either.traverseIORight
(F<B, IO<C>> f) Traversable instance of RightProjection of Either for IO.Either.LeftProjection.traverseList
(F<A, List<C>> f) Traverse with function that produces List (non-determinism).Either.RightProjection.traverseList
(F<B, List<C>> f) Traverse with function that produces List (non-determinism).Either.traverseListLeft
(F<A, List<C>> f) Traversable instance of LeftProjection of Either for List.Either.traverseListRight
(F<B, List<C>> f) Traversable instance of RightProjection of Either for List.Either.LeftProjection.traverseOption
(F<A, Option<C>> f) Either.RightProjection.traverseOption
(F<B, Option<C>> f) Traverse this right with the given function and collect the output as an option.Either.traverseOptionLeft
(F<A, Option<C>> f) Traversable instance of LeftProjection of Either for Option.Either.traverseOptionRight
(F<B, Option<C>> f) Traversable instance of RightProjection of Either for Option.Either.LeftProjection.traverseP1
(F<A, P1<C>> f) Traverse this left with the given function and collect the output as a p1.Either.RightProjection.traverseP1
(F<B, P1<C>> f) Traverse this right with the given function and collect the output as a p1.Either.LeftProjection.traverseStream
(F<A, Stream<C>> f) Either.RightProjection.traverseStream
(F<B, Stream<C>> f) Either.traverseStreamLeft
(F<A, Stream<C>> f) Traversable instance of LeftProjection of Either for Stream.Either.traverseStreamRight
(F<B, Stream<C>> f) Traversable instance of RightProjection of Either for Stream.static <E,
T> F <Either<E, T>, Validation<E, T>> Validation.validation()
Returns a function that constructs a validation with an either.Modifier and TypeMethodDescriptionFunction application on this projection's value.Function application on this projection's value.static <A,
B> Either <A, B> Joins an either through left.static <A,
B> Either <A, B> Joins an either through right.static <A> A
Takes anEither
to its contained value within left or right.Anonymous bind through this projection.Anonymous bind through this projection.static <E,
T> Validation <E, T> Validation.validation
(Either<E, T> e) Construct a validation using the given either value.Modifier and TypeMethodDescriptionBinds the given function across this projection's value if it has one.Binds the given function across this projection's value if it has one.static <A,
B> Either <A, B> Joins an either through left.static <A,
B> Either <A, B> Joins an either through right.static <A,
B> List <A> Returns all the left values in the given list.static <A,
B> List <B> Returns all the right values in the given list.List.sequenceEither
(List<Either<L, B>> list) Sequence the given list and collect the output on the right side of an either.Option.sequenceEither
(Option<Either<L, B>> option) Sequence the given option and collect the output on the right side of an either.Seq.sequenceEither
(Seq<Either<L, B>> seq) Sequence the given seq and collect the output on the right side of an either.Stream.sequenceEither
(Stream<Either<L, B>> stream) Sequence the given stream and collect the output on the right side of an either.List.sequenceEitherLeft
(List<Either<B, R>> list) Sequence the given list and collect the output on the left side of an either.Option.sequenceEitherLeft
(Option<Either<B, R>> option) Sequence the given option and collect the output on the left side of an either.Seq.sequenceEitherLeft
(Seq<Either<B, R>> seq) Sequence the given seq and collect the output on the left side of an either.Stream.sequenceEitherLeft
(Stream<Either<B, R>> stream) Sequence the given stream and collect the output on the left side of an either.static final <E,
R, C> Either <Validation<E, C>, R> Validation.sequenceEitherLeft
(Validation<E, Either<C, R>> validation) Sequence the given validation and collect the output on the left side of an either.List.sequenceEitherRight
(List<Either<L, B>> list) Sequence the given list and collect the output on the right side of an either.Option.sequenceEitherRight
(Option<Either<L, B>> option) Sequence the given option and collect the output on the right side of an either.Seq.sequenceEitherRight
(Seq<Either<L, B>> seq) Sequence the given seq and collect the output on the right side of an either.Stream.sequenceEitherRight
(Stream<Either<L, B>> stream) Sequence the given stream and collect the output on the right side of an either.static final <E,
L, C> Either <L, Validation<E, C>> Validation.sequenceEitherRight
(Validation<E, Either<L, C>> validation) Sequence the given validation and collect the output on the right side of an either.Either.sequenceLeft
(List<Either<A, X>> a) Sequences through the left side of the either monad with a list of values.Either.sequenceRight
(List<Either<X, B>> a) Sequences through the right side of the either monad with a list of values.List.traverseEither
(F<A, Either<E, B>> f) Traverse through the List with given function.Option.traverseEither
(F<A, Either<L, B>> f) Traverse this option with the given function and collect the output on the right side of an either.Seq.traverseEither
(F<A, Either<L, B>> f) Traverse this seq with the given function and collect the output on the right side of an either.Stream.traverseEither
(F<A, Either<L, B>> f) Traverse this stream with the given function and collect the output on the right side of an either.List.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this list with the given function and collect the output on the left side of an either.Option.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this option with the given function and collect the output on the left side of an either.Seq.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this seq with the given function and collect the output on the left side of an either.Stream.traverseEitherLeft
(F<A, Either<B, R>> f) Traverse this stream with the given function and collect the output on the left side of an either.final <R,
C> Either <Validation<E, C>, R> Validation.traverseEitherLeft
(F<T, Either<C, R>> f) Traverse this validation with the given function and collect the output on the left side of an either.List.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this list with the given function and collect the output on the right side of an either.Option.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this option with the given function and collect the output on the right side of an either.Seq.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this seq with the given function and collect the output on the right side of an either.Stream.traverseEitherRight
(F<A, Either<L, B>> f) Traverse this stream with the given function and collect the output on the right side of an either.final <L,
C> Either <L, Validation<E, C>> Validation.traverseEitherRight
(F<T, Either<L, C>> f) Traverse this validation with the given function and collect the output on the right side of an either.ModifierConstructorDescriptionprivate
LeftProjection
(Either<A, B> e) private
RightProjection
(Either<A, B> e) protected
Validation
(Either<E, T> e) -
Uses of Either in fj.data.hamt
Fields in fj.data.hamt declared as EitherConstructors in fj.data.hamt with parameters of type Either -
Uses of Either in fj.data.optic
Methods in fj.data.optic that return EitherModifier and TypeMethodDescriptionOptional.getOrModify
(S s) POptional.getOrModify
(S s) get the target of aPOptional
or modify the source in case there is no targetPPrism.getOrModify
(S s) get the target of aPPrism
or modify the source in case there is no targetPrism.getOrModify
(S s) Methods in fj.data.optic that return types with arguments of type EitherModifier and TypeMethodDescriptionFold.codiagonal()
Getter.codiagonal()
Setter.codiagonal()
Traversal.codiagonal()
Lens.modifyEitherF
(F<A, Either<L, A>> f) Optional.modifyEitherF
(F<A, Either<L, A>> f) PIso.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPIso
with an Applicative functionPLens.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPLens
with an Applicative functionPOptional.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPOptional
with an Applicative functionPPrism.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPPrism
with an Applicative functionPTraversal.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionTraversal.modifyEitherF
(F<A, Either<L, A>> f) PSetter.pCodiagonal()
PSetter.pCodiagonal()
static <S,
T> PTraversal <Either<S, S>, Either<T, T>, S, T> PTraversal.pCodiagonal()
static <S,
T> PTraversal <Either<S, S>, Either<T, T>, S, T> PTraversal.pCodiagonal()
join twoFold
with the same targetjoin twoGetter
with the same targetjoin twoLens
with the same targetjoin twoOptional
with the same targetjoin twoPLens
with the same targetjoin twoPLens
with the same targetjoin twoPOptional
with the same targetjoin twoPOptional
with the same targetjoin twoPSetter
with the same targetjoin twoPSetter
with the same targetPTraversal.sum
(PTraversal<S1, T1, A, B> other) join twoPTraversal
with the same targetPTraversal.sum
(PTraversal<S1, T1, A, B> other) join twoPTraversal
with the same targetjoin twoSetter
with the same targetjoin twoTraversal
with the same targetMethod parameters in fj.data.optic with type arguments of type EitherModifier and TypeMethodDescriptionLens.modifyEitherF
(F<A, Either<L, A>> f) Optional.modifyEitherF
(F<A, Either<L, A>> f) PIso.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPIso
with an Applicative functionPLens.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPLens
with an Applicative functionPOptional.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPOptional
with an Applicative functionPPrism.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPPrism
with an Applicative functionPTraversal.modifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionTraversal.modifyEitherF
(F<A, Either<L, A>> f) static <S,
T, A, B>
POptional<S, T, A, B> create aPOptional
using the canonical functions: getOrModify and setstatic <S,
T, A, B>
PPrism<S, T, A, B> create aPPrism
using the canonical functions: getOrModify and reverseGet