Interface Iso.Simple<S,A>
-
- Type Parameters:
S
- the type of both "larger" valuesA
- the type of both "smaller" values
- All Superinterfaces:
Applicative<S,Iso<S,?,A,A>>
,Contravariant<S,Profunctor<?,S,Iso<?,?,A,A>>>
,Functor<S,Iso<S,?,A,A>>
,Iso<S,S,A,A>
,Monad<S,Iso<S,?,A,A>>
,MonadRec<S,Iso<S,?,A,A>>
,Optic<Profunctor<?,?,?>,Functor<?,?>,S,S,A,A>
,Optic.Simple<Profunctor<?,?,?>,Functor<?,?>,S,A>
,Profunctor<S,S,Iso<?,?,A,A>>
- All Known Subinterfaces:
TypeSafeKey<A,B>
,TypeSafeKey.Simple<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 static interface Iso.Simple<S,A> extends Iso<S,S,A,A>, Optic.Simple<Profunctor<?,?,?>,Functor<?,?>,S,A>
A convenience type with a simplified type signature for common isos with both unified "larger" values and unified "smaller" values.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Iso
Iso.Simple<S,A>
-
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 Static Methods Instance Methods Default Methods Modifier and Type Method Description static <S,A>
Iso.Simple<S,A>adapt(Optic<? super Profunctor<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Adapt anOptic
with the right variance to anIso.Simple
.default <B> Iso.Simple<S,B>
andThen(Iso.Simple<A,B> f)
Compose two simple isos from left to right.default <B> Iso.Simple<S,B>
andThen(Optic.Simple<? super Profunctor<?,?,?>,? super Functor<?,?>,A,B> f)
Compose two simple optics from left to right.default <R> Iso.Simple<R,A>
compose(Iso.Simple<R,S> g)
Compose two simple isos from right to left.default <R> Iso.Simple<R,A>
compose(Optic.Simple<? super Profunctor<?,?,?>,? super Functor<?,?>,R,S> g)
Compose two simple optics from right to left.default <U> Iso.Simple<S,A>
discardR(Applicative<U,Iso<S,?,A,A>> appB)
Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.default Iso.Simple<A,S>
mirror()
Flip thisIso
around.default Lens.Simple<S,A>
toLens()
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Iso
andThen, compose, contraMap, diMap, diMapL, diMapR, discardL, flatMap, fmap, mapA, mapB, mapS, mapT, pure, trampolineM, unIso, zip
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
apply, monomorphize
-
-
-
-
Method Detail
-
compose
default <R> Iso.Simple<R,A> compose(Iso.Simple<R,S> g)
Compose two simple isos from right to left.- Type Parameters:
R
- the other simple iso' larger type- Parameters:
g
- the other simple iso- Returns:
- the composed simple iso
-
andThen
default <B> Iso.Simple<S,B> andThen(Iso.Simple<A,B> f)
Compose two simple isos from left to right.- Type Parameters:
B
- the other simple iso' smaller type- Parameters:
f
- the other simple iso- Returns:
- the composed simple iso
-
mirror
default Iso.Simple<A,S> mirror()
Flip thisIso
around.
-
toLens
default Lens.Simple<S,A> toLens()
-
discardR
default <U> Iso.Simple<S,A> discardR(Applicative<U,Iso<S,?,A,A>> appB)
Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
. This is generally useful for sequentially performing side-effects.- Specified by:
discardR
in interfaceApplicative<S,A>
- Specified by:
discardR
in interfaceIso<S,S,A,A>
- Specified by:
discardR
in interfaceMonad<S,A>
- Specified by:
discardR
in interfaceMonadRec<S,A>
- Type Parameters:
U
- the type of appB's parameter- Parameters:
appB
- the other Applicative- Returns:
- this Applicative
-
andThen
default <B> Iso.Simple<S,B> andThen(Optic.Simple<? super Profunctor<?,?,?>,? super Functor<?,?>,A,B> f)
Compose two simple optics from left to right.- Specified by:
andThen
in interfaceOptic.Simple<Profunctor<?,?,?>,Functor<?,?>,S,A>
- Type Parameters:
B
- the new left side and right side's functor embedding of the input profunctor- Parameters:
f
- the other simple optic- Returns:
- the composed simple optic
-
compose
default <R> Iso.Simple<R,A> compose(Optic.Simple<? super Profunctor<?,?,?>,? super Functor<?,?>,R,S> g)
Compose two simple optics from right to left.- Specified by:
compose
in interfaceOptic.Simple<Profunctor<?,?,?>,Functor<?,?>,S,A>
- Type Parameters:
R
- the new left side and right side's functor embedding of the output profunctor- Parameters:
g
- the other simple optic- Returns:
- the composed simple optic
-
adapt
static <S,A> Iso.Simple<S,A> adapt(Optic<? super Profunctor<?,?,?>,? super Functor<?,?>,S,S,A,A> optic)
Adapt anOptic
with the right variance to anIso.Simple
.- Type Parameters:
S
- S/TA
- A/B- Parameters:
optic
- the optic- Returns:
- the simple iso
-
-