S
- the input that might fail to map to its output and the guaranteed output from the other directionA
- the output that might fail to be produced and the input that guarantees its output in the other
directionpublic static interface Prism.Simple<S,A> extends Prism<S,S,A,A>
prism
with unified S/T
and A/B
types.Prism.Simple<S,A>
Modifier and Type | Method and Description |
---|---|
static <S,A> Prism.Simple<S,A> |
adapt(Optic<? super Cocartesian<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Adapt an
Optic with compatible bounds to a simple Prism . |
static <S,A> Prism.Simple<S,A> |
adapt(Prism<S,S,A,A> prism)
Adapt a
Prism with compatible bounds to a simple Prism . |
static <S,A> Prism.Simple<S,A> |
adapt(ProtoOptic<? super Cocartesian<?,?,?>,S,S,A,A> protoOptic)
Adapt a
ProtoOptic with compatible bounds to a simple Prism . |
static <S,A> Prism.Simple<S,A> |
fromPartial(Fn1<? super S,? extends A> partialSa,
Fn1<? super A,? extends S> as)
Static factory method for creating a
simple Prism from a partial function
S -> A and a total function A -> T . |
andThen, apply, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, fromPartial, lazyZip, mapA, mapB, mapS, mapT, prism, prism, prism, pure, purePrism, simplePrism, trampolineM, unPrism, zip
toOptic
static <S,A> Prism.Simple<S,A> adapt(Prism<S,S,A,A> prism)
Prism
with compatible bounds to a simple Prism
.S
- the input that might fail to map to its output and the guaranteed output from the other
directionA
- the output that might fail to be produced and the input that guarantees its output in the other
directionprism
- the Prism
simple Prism
static <S,A> Prism.Simple<S,A> adapt(ProtoOptic<? super Cocartesian<?,?,?>,S,S,A,A> protoOptic)
ProtoOptic
with compatible bounds to a simple Prism
.S
- the input that might fail to map to its output and the guaranteed output from the other
directionA
- the output that might fail to be produced and the input that guarantees its output in the
other directionprotoOptic
- the ProtoOptic
simple Prism
static <S,A> Prism.Simple<S,A> adapt(Optic<? super Cocartesian<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Optic
with compatible bounds to a simple Prism
.S
- the input that might fail to map to its output and the guaranteed output from the other
directionA
- the output that might fail to be produced and the input that guarantees its output in the
other directionoptic
- the Optic
simple Prism
static <S,A> Prism.Simple<S,A> fromPartial(Fn1<? super S,? extends A> partialSa, Fn1<? super A,? extends S> as)
simple Prism
from a partial function
S -> A
and a total function A -> T
.S
- the input that might fail to map to its output and the guaranteed output from the other
directionA
- the output that might fail to be produced and the input that guarantees its output in the
other directionpartialSa
- the partial directionas
- the reverse total directionsimple Prism