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
Modifier and TypeMethodDescriptiondefault <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> Covariantly mapA
toC
, yielding a new optic.default <Z> ProtoOptic
<P, S, T, A, Z> Contravariantly mapB
toZ
, yielding a new optic.default <R> ProtoOptic
<P, R, T, A, B> Contravariantly mapS
toR
, yielding a new optic.default <U> ProtoOptic
<P, S, U, A, B> Covariantly mapT
toU
, yielding a new optic.Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
andThen, compose, monomorphize
-
Method Details
-
toOptic
-
apply
default <CoP extends Profunctor<?,?, PSFT apply? 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>> (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
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
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
Contravariantly mapS
toR
, yielding a new optic. -
mapT
Covariantly mapT
toU
, yielding a new optic. -
mapA
Covariantly mapA
toC
, yielding a new optic. -
mapB
Contravariantly mapB
toZ
, yielding a new optic.
-