Class Over<S,T,A,B>
- java.lang.Object
-
- com.jnape.palatable.lambda.optics.functions.Over<S,T,A,B>
-
- Type Parameters:
S
- the type of the larger valueT
- the type of the larger updated valueA
- the type of the smaller retrieving valueB
- the type of the smaller setting value
- All Implemented Interfaces:
Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>>
,Fn2<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<? super A,? extends B>,Fn1<S,T>>
,Fn3<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<? super A,? extends B>,S,T>
,Applicative<Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
,Cartesian<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<?,?>>
,Cocartesian<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<?,?>>
,Contravariant<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Profunctor<?,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<?,?>>>
,Functor<Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
,Profunctor<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<?,?>>
,Monad<Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
,MonadReader<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
,MonadRec<Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
,MonadWriter<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<Fn1<? super A,? extends B>,Fn1<S,T>>,Fn1<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,?>>
public final class Over<S,T,A,B> extends java.lang.Object implements Fn3<Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B>,Fn1<? super A,? extends B>,S,T>
Given anOptic
, a function fromA
toB
, and a "larger" valueS
, produce aT
by retrieving theA
from theS
, applying the function, and updating theS
with theB
resulting from the function.This function is similar to
Set
, except that it allows the setting valueB
to be derived fromS
via function application, rather than provided.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Over()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
checkedApply(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic, Fn1<? super A,? extends B> fn, S s)
static <S,T,A,B>
Over<S,T,A,B>over()
static <S,T,A,B>
Fn2<Fn1<? super A,? extends B>,S,T>over(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic)
static <S,T,A,B>
Fn1<S,T>over(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic, Fn1<? super A,? extends B> fn)
static <S,T,A,B>
Tover(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic, Fn1<? super A,? extends B> fn, S s)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
checkedApply, toBiFunction
-
-
-
-
Field Detail
-
INSTANCE
private static final Over<?,?,?,?> INSTANCE
-
-
Method Detail
-
checkedApply
public T checkedApply(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic, Fn1<? super A,? extends B> fn, S s)
-
over
public static <S,T,A,B> Over<S,T,A,B> over()
-
over
public static <S,T,A,B> Fn2<Fn1<? super A,? extends B>,S,T> over(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic)
-
over
public static <S,T,A,B> Fn1<S,T> over(Optic<? super Fn1<?,?>,? super Identity<?>,S,T,A,B> optic, Fn1<? super A,? extends B> fn)
-
-