Interface Lens.Simple<S,A>
- Type Parameters:
S
- the type of both "larger" valuesA
- the type of both "smaller" values
- All Superinterfaces:
Applicative<S,
,Lens<S, ?, A, A>> Contravariant<S,
,Profunctor<?, S, Lens<?, ?, A, A>>> Functor<S,
,Lens<S, ?, A, A>> Lens<S,
,S, A, A> Monad<S,
,Lens<S, ?, A, A>> MonadRec<S,
,Lens<S, ?, A, A>> Optic<Cartesian<?,
,?, ?>, Functor<?, ?>, S, S, A, A> Optic.Simple<Cartesian<?,
,?, ?>, Functor<?, ?>, S, A> Profunctor<S,
S, Lens<?, ?, A, A>>
- All Known Subinterfaces:
Schema<Values>
- 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 Lens.Simple<S,A>
extends Lens<S,S,A,A>, Optic.Simple<Cartesian<?,?,?>,Functor<?,?>,S,A>
A convenience type with a simplified type signature for common lenses with both unified "larger" values and
unified "smaller" values.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Lens
Lens.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
Modifier and TypeMethodDescriptionstatic <S,
A> Lens.Simple <S, A> Adapt aLens
with the right variance to aLens.Simple
.default <B> Lens.Simple
<S, B> andThen
(Optic.Simple<? super Cartesian<?, ?, ?>, ? super Functor<?, ?>, A, B> f) Compose two simple optics from left to right.static <S,
A, B> Lens.Simple <S, Tuple2<A, B>> Specialization ofLens.both(Lens, Lens)
for simple lenses.default <R> Lens.Simple
<R, A> compose
(Optic.Simple<? super Cartesian<?, ?, ?>, ? super Functor<?, ?>, R, S> g) Compose two simple optics from right to left.Methods inherited from interface com.jnape.palatable.lambda.optics.Lens
andThen, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, mapA, mapB, mapS, mapT, pure, toIso, trampolineM, zip
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
apply, monomorphize
-
Method Details
-
andThen
default <B> Lens.Simple<S,B> andThen(Optic.Simple<? super Cartesian<?, ?, ?>, ? super Functor<?, ?>, A, B> f) Compose two simple optics from left to right. -
compose
default <R> Lens.Simple<R,A> compose(Optic.Simple<? super Cartesian<?, ?, ?>, ? super Functor<?, ?>, R, S> g) Compose two simple optics from right to left. -
adapt
static <S,A> Lens.Simple<S,A> adapt(Optic<? super Cartesian<?, ?, ?>, ? super Functor<?, ?>, S, S, A, A> lens) Adapt aLens
with the right variance to aLens.Simple
.- Type Parameters:
S
- S/TA
- A/B- Parameters:
lens
- the lens- Returns:
- the simple lens
-
both
Specialization ofLens.both(Lens, Lens)
for simple lenses.- Type Parameters:
S
- both lens larger valuesA
- lens f smaller valuesB
- lens g smaller values- Parameters:
f
- the first lensg
- the second lens- Returns:
- the dual-focus simple lens
-