Interface Prism.Simple<S,A>
-
- Type Parameters:
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 direction
- All Superinterfaces:
Applicative<S,Prism<S,?,A,A>>
,Contravariant<S,Profunctor<?,S,Prism<?,?,A,A>>>
,Functor<S,Prism<S,?,A,A>>
,Monad<S,Prism<S,?,A,A>>
,MonadRec<S,Prism<S,?,A,A>>
,Optic<Cocartesian<?,?,?>,Identity<?>,S,S,A,A>
,Prism<S,S,A,A>
,Profunctor<S,S,Prism<?,?,A,A>>
,ProtoOptic<Cocartesian<?,?,?>,S,S,A,A>
public static interface Prism.Simple<S,A> extends Prism<S,S,A,A>
A convenience type with a simplified type signature for commonprism
with unifiedS/T
andA/B
types.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Prism
Prism.Simple<S,A>
-
-
Method Summary
Static Methods Modifier and Type Method Description static <S,A>
Prism.Simple<S,A>adapt(Optic<? super Cocartesian<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Adapt anOptic
with compatible bounds to asimple Prism
.static <S,A>
Prism.Simple<S,A>adapt(Prism<S,S,A,A> prism)
Adapt aPrism
with compatible bounds to asimple Prism
.static <S,A>
Prism.Simple<S,A>adapt(ProtoOptic<? super Cocartesian<?,?,?>,S,S,A,A> protoOptic)
Adapt aProtoOptic
with compatible bounds to asimple 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 asimple Prism
from a partial functionS -> A
and a total functionA -> T
.-
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
andThen, compose, monomorphize
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Prism
andThen, apply, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, lazyZip, mapA, mapB, mapS, mapT, pure, trampolineM, unPrism, zip
-
Methods inherited from interface com.jnape.palatable.lambda.optics.ProtoOptic
toOptic
-
-
-
-
Method Detail
-
adapt
static <S,A> Prism.Simple<S,A> adapt(Prism<S,S,A,A> prism)
Adapt aPrism
with compatible bounds to asimple Prism
.- Type Parameters:
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 direction- Parameters:
prism
- thePrism
- Returns:
- the
simple Prism
-
adapt
static <S,A> Prism.Simple<S,A> adapt(ProtoOptic<? super Cocartesian<?,?,?>,S,S,A,A> protoOptic)
Adapt aProtoOptic
with compatible bounds to asimple Prism
.- Type Parameters:
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 direction- Parameters:
protoOptic
- theProtoOptic
- Returns:
- the
simple Prism
-
adapt
static <S,A> Prism.Simple<S,A> adapt(Optic<? super Cocartesian<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Adapt anOptic
with compatible bounds to asimple Prism
.- Type Parameters:
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 direction- Parameters:
optic
- theOptic
- Returns:
- the
simple Prism
-
fromPartial
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 asimple Prism
from a partial functionS -> A
and a total functionA -> T
.- Type Parameters:
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 direction- Parameters:
partialSa
- the partial directionas
- the reverse total direction- Returns:
- the
simple Prism
-
-