Interface ProtoOptic<P extends Profunctor<?,?,? extends P>,S,T,A,B>
-
- Type Parameters:
P
- theProfunctor
boundS
- the left side of the output profunctorT
- the right side's functor embedding of the output profunctorA
- the left side of the input profunctorB
- the right side's functor embedding of the input profunctor
- All Known Subinterfaces:
Prism<S,T,A,B>
,Prism.Simple<S,A>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ProtoOptic<P extends Profunctor<?,?,? extends P>,S,T,A,B> extends Optic<P,Identity<?>,S,T,A,B>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Optic
Optic.Simple<P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,A>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <Z,C>
ProtoOptic<P,S,T,Z,C>andThen(ProtoOptic<? super P,A,B,Z,C> f)
Left-to-right composition of proto-optics.default <CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends Identity<?>>,FB extends Functor<B,? extends CoF>,FT extends Functor<T,? extends CoF>,PAFB extends Profunctor<A,FB,? extends CoP>,PSFT extends Profunctor<S,FT,? extends CoP>>
PSFTapply(PAFB pafb)
The polymorphic arrow between profunctors in this optic interface.default <R,U>
ProtoOptic<P,R,U,A,B>compose(ProtoOptic<? super P,R,U,S,T> g)
Right-to-Left composition of proto-optics.default <C> ProtoOptic<P,S,T,C,B>
mapA(Fn1<? super A,? extends C> fn)
Covariantly mapA
toC
, yielding a new optic.default <Z> ProtoOptic<P,S,T,A,Z>
mapB(Fn1<? super Z,? extends B> fn)
Contravariantly mapB
toZ
, yielding a new optic.default <R> ProtoOptic<P,R,T,A,B>
mapS(Fn1<? super R,? extends S> fn)
Contravariantly mapS
toR
, yielding a new optic.default <U> ProtoOptic<P,S,U,A,B>
mapT(Fn1<? super T,? extends U> fn)
Covariantly mapT
toU
, yielding a new optic.<F extends Applicative<?,F>>
Optic<P,F,S,T,A,B>toOptic(Pure<F> pure)
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
andThen, compose, monomorphize
-
-
-
-
Method Detail
-
apply
default <CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends Identity<?>>,FB extends Functor<B,? extends CoF>,FT extends Functor<T,? extends CoF>,PAFB extends Profunctor<A,FB,? extends CoP>,PSFT extends Profunctor<S,FT,? extends CoP>> PSFT apply(PAFB pafb)
The polymorphic arrow between profunctors in this optic interface.- Specified by:
apply
in interfaceOptic<P extends Profunctor<?,?,? extends P>,Identity<?>,S,T,A,B>
- Type Parameters:
CoP
- the profunctor type constraint witnessed by the application of this opticCoF
- the functor type constraint witnessed by the application of this opticFB
- the covariant parameter type of the input profunctorFT
- the covariant parameter type of the output profunctorPAFB
- the full input typePSFT
- the full output type- Parameters:
pafb
- the input- Returns:
- the output profunctor
-
andThen
default <Z,C> ProtoOptic<P,S,T,Z,C> andThen(ProtoOptic<? super P,A,B,Z,C> f)
Left-to-right composition of proto-optics. Requires compatibility betweenS
andT
.- Type Parameters:
Z
- the new left side of the input profunctorC
- the new right side's functor embedding of the input profunctor- Parameters:
f
- the other proto-optic- Returns:
- the composed proto-optic
-
compose
default <R,U> ProtoOptic<P,R,U,A,B> compose(ProtoOptic<? super P,R,U,S,T> g)
Right-to-Left composition of proto-optics. Requires compatibility betweenA
andB
.- Type Parameters:
R
- the new left side of the output profunctorU
- the new right side's functor embedding of the output profunctor- Parameters:
g
- the other proto-optic- Returns:
- the composed proto-optic
-
mapS
default <R> ProtoOptic<P,R,T,A,B> mapS(Fn1<? super R,? extends S> fn)
Contravariantly mapS
toR
, yielding a new optic.
-
mapT
default <U> ProtoOptic<P,S,U,A,B> mapT(Fn1<? super T,? extends U> fn)
Covariantly mapT
toU
, yielding a new optic.
-
mapA
default <C> ProtoOptic<P,S,T,C,B> mapA(Fn1<? super A,? extends C> fn)
Covariantly mapA
toC
, yielding a new optic.
-
-