P
- the Profunctor
boundF
- the Functor
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@FunctionalInterface public interface Optic<P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,T,A,B>
Precisely stated, for some Profunctor
P
and some Functor
F
, and for the
types S
T
A
B
, an
is a polymorphic function
Optic
<P, F, S, T, A, B>P<A, F<B>> -> P<S, F<T>>
.
Modifier and Type | Interface and Description |
---|---|
static interface |
Optic.Simple<P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,A>
|
Modifier and Type | Method and Description |
---|---|
default <Z,C> Optic<P,F,S,T,Z,C> |
andThen(Optic<? super P,? super F,A,B,Z,C> f)
Left-to-right composition of optics.
|
<CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends F>,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>> |
apply(PAFB pafb)
The polymorphic arrow between profunctors in this optic interface.
|
default <R,U> Optic<P,F,R,U,A,B> |
compose(Optic<? super P,? super F,R,U,S,T> g)
Right-to-Left composition of optics.
|
default <C> Optic<P,F,S,T,C,B> |
mapA(Fn1<? super A,? extends C> fn)
Covariantly map
A to C , yielding a new optic. |
default <Z> Optic<P,F,S,T,A,Z> |
mapB(Fn1<? super Z,? extends B> fn)
Contravariantly map
B to Z , yielding a new optic. |
default <R> Optic<P,F,R,T,A,B> |
mapS(Fn1<? super R,? extends S> fn)
Contravariantly map
S to R , yielding a new optic. |
default <U> Optic<P,F,S,U,A,B> |
mapT(Fn1<? super T,? extends U> fn)
Covariantly map
T to U , yielding a new optic. |
default <CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends F>,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>> |
monomorphize()
|
static <P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,T,A,B,FB extends Functor<B,? extends F>,FT extends Functor<T,? extends F>,PAFB extends Profunctor<A,FB,? extends P>,PSFT extends Profunctor<S,FT,? extends P>> |
optic(Fn1<PAFB,PSFT> fn)
Promote a monomorphic function to a compatible
Optic . |
static <P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,T,A,B> |
reframe(Optic<? super P,? super F,S,T,A,B> optic)
Reframe an
Optic according to covariant bounds. |
<CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends F>,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)
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 typepafb
- the inputdefault <CoP extends Profunctor<?,?,? extends P>,CoF extends Functor<?,? extends F>,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>> Fn1<PAFB,PSFT> monomorphize()
default <Z,C> Optic<P,F,S,T,Z,C> andThen(Optic<? super P,? super F,A,B,Z,C> f)
S
and T
.Z
- the new left side of the input profunctorC
- the new right side's functor embedding of the input profunctorf
- the other opticdefault <R,U> Optic<P,F,R,U,A,B> compose(Optic<? super P,? super F,R,U,S,T> g)
A
and B
.R
- the new left side of the output profunctorU
- the new right side's functor embedding of the output profunctorg
- the other opticdefault <R> Optic<P,F,R,T,A,B> mapS(Fn1<? super R,? extends S> fn)
S
to R
, yielding a new optic.R
- the new left side of the output profunctorfn
- the mapping functiondefault <U> Optic<P,F,S,U,A,B> mapT(Fn1<? super T,? extends U> fn)
T
to U
, yielding a new optic.U
- the new right side's functor embedding of the output profunctorfn
- the mapping functiondefault <C> Optic<P,F,S,T,C,B> mapA(Fn1<? super A,? extends C> fn)
A
to C
, yielding a new optic.C
- the new left side of the input profunctorfn
- the mapping functiondefault <Z> Optic<P,F,S,T,A,Z> mapB(Fn1<? super Z,? extends B> fn)
B
to Z
, yielding a new optic.Z
- the new right side's functor embedding of the input profunctorfn
- the mapping functionstatic <P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,T,A,B,FB extends Functor<B,? extends F>,FT extends Functor<T,? extends F>,PAFB extends Profunctor<A,FB,? extends P>,PSFT extends Profunctor<S,FT,? extends P>> Optic<P,F,S,T,A,B> optic(Fn1<PAFB,PSFT> fn)
Optic
.P
- the Profunctor
boundF
- the Functor
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 profunctorFB
- fixed functor over B for inferenceFT
- fixed functor over T for inferencePAFB
- the inputPSFT
- the outputfn
- the functionOptic
static <P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,T,A,B> Optic<P,F,S,T,A,B> reframe(Optic<? super P,? super F,S,T,A,B> optic)
Optic
according to covariant bounds.P
- the Profunctor
typeF
- the Functor
typeS
- 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 profunctoroptic
- the Optic
Optic