Class Set<S,T,A,B>

java.lang.Object
com.jnape.palatable.lambda.optics.functions.Set<S,T,A,B>
Type Parameters:
S - the type of the larger value
T - the type of the larger updated value
A - the type of the smaller retrieving value (unused, but necessary for composition)
B - the type of the smaller setting value
All Implemented Interfaces:
Fn1<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, Fn1<B,Fn1<S,T>>>, Fn2<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, B, Fn1<S,T>>, Fn3<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, B, S, T>, Applicative<Fn1<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<B,Fn1<S,T>>, Fn1<?,?>>, Cocartesian<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, Fn1<B,Fn1<S,T>>, Fn1<?,?>>, Contravariant<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, Profunctor<?, Fn1<B,Fn1<S,T>>, Fn1<?,?>>>, Functor<Fn1<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<B,Fn1<S,T>>, Fn1<?,?>>, Monad<Fn1<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<B,Fn1<S,T>>, Fn1<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, ?>>, MonadRec<Fn1<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<B,Fn1<S,T>>, Fn1<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, ?>>

public final class Set<S,T,A,B> extends Object implements Fn3<Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B>, B, S, T>
Given an Optic, a "smaller" value B, and a "larger" value S, produce a T by lifting the Optic into the Identity functor.

More idiomatically, this function can be used to treat an Optic as a "setter" of Bs on Ss, potentially producing a different "larger" value, T.

See Also:
  • Field Details

    • INSTANCE

      private static final Set<?,?,?,?> INSTANCE
  • Constructor Details

    • Set

      private Set()
  • Method Details

    • checkedApply

      public T checkedApply(Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B> optic, B b, S s)
      Specified by:
      checkedApply in interface Fn3<S,T,A,B>
    • set

      public static <S,T,A,B> Set<S,T,A,B> set()
    • set

      public static <S,T,A,B> Fn2<B,S,T> set(Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B> optic)
    • set

      public static <S,T,A,B> Fn1<S,T> set(Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B> optic, B b)
    • set

      public static <S,T,A,B> T set(Optic<? super Fn1<?,?>, ? super Identity<?>, S, T, A, B> optic, B b, S s)