Class View<S,T,A,B>

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

public final class View<S,T,A,B> extends Object implements Fn2<Optic<? super Fn1<?,?>,? super Const<A,?>,S,T,A,B>,S,A>
Given an Optic and a "larger" value S, retrieve a "smaller" value A by lifting the Optic into the Const functor.

More idiomatically, this function can be used to treat a Optic as a "getter" of As from Ss.

See Also:
  • Field Details

    • INSTANCE

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

    • View

      private View()
  • Method Details

    • checkedApply

      public A checkedApply(Optic<? super Fn1<?,?>,? super Const<A,?>,S,T,A,B> optic, S s)
      Specified by:
      checkedApply in interface Fn2<S,T,A>
    • view

      public static <S, T, A, B> View<S,T,A,B> view()
    • view

      public static <S, T, A, B> Fn1<S,A> view(Optic<? super Fn1<?,?>,? super Const<A,?>,S,T,A,B> optic)
    • view

      public static <S, T, A, B> A view(Optic<? super Fn1<?,?>,? super Const<A,?>,S,T,A,B> optic, S s)