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>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Prism
Prism.Simple<S,A> -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <S,A> Prism.Simple <S, A> adapt(Optic<? super Cocartesian<?, ?, ?>, ? super Functor<?, ?>, S, S, A, A> optic) Adapt anOpticwith compatible bounds to asimple Prism.static <S,A> Prism.Simple <S, A> Adapt aPrismwith compatible bounds to asimple Prism.static <S,A> Prism.Simple <S, A> adapt(ProtoOptic<? super Cocartesian<?, ?, ?>, S, S, A, A> protoOptic) Adapt aProtoOpticwith 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 Prismfrom a partial functionS -> Aand a total functionA -> T.Methods inherited from interface Optic
andThen, compose, monomorphizeMethods inherited from interface Prism
andThen, apply, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, lazyZip, mapA, mapB, mapS, mapT, pure, trampolineM, unPrism, zipMethods inherited from interface ProtoOptic
toOptic
-
Method Details
-
adapt
Adapt aPrismwith 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
Adapt aProtoOpticwith 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 anOpticwith 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 Prismfrom a partial functionS -> Aand 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
-