Package fj.data.optic

Class Lens<S,​A>


  • public final class Lens<S,​A>
    extends PLens<S,​S,​A,​A>
    PLens with a monomorphic set function
    • Field Detail

    • Constructor Detail

      • Lens

        public Lens​(PLens<S,​S,​A,​A> pLens)
    • Method Detail

      • get

        public A get​(S s)
        Description copied from class: PLens
        get the target of a PLens
        Specified by:
        get in class PLens<S,​S,​A,​A>
      • set

        public F<S,​S> set​(A a)
        Description copied from class: PLens
        set polymorphically the target of a PLens using a function
        Specified by:
        set in class PLens<S,​S,​A,​A>
      • modifyFunctionF

        public <C> F<S,​F<C,​S>> modifyFunctionF​(F<A,​F<C,​A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyFunctionF in class PLens<S,​S,​A,​A>
      • modifyEitherF

        public <L> F<S,​Either<L,​S>> modifyEitherF​(F<A,​Either<L,​A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyEitherF in class PLens<S,​S,​A,​A>
      • modifyIOF

        public F<S,​IO<S>> modifyIOF​(F<A,​IO<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyIOF in class PLens<S,​S,​A,​A>
      • modifyListF

        public F<S,​List<S>> modifyListF​(F<A,​List<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyListF in class PLens<S,​S,​A,​A>
      • modifyOptionF

        public F<S,​Option<S>> modifyOptionF​(F<A,​Option<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyOptionF in class PLens<S,​S,​A,​A>
      • modifyStreamF

        public F<S,​Stream<S>> modifyStreamF​(F<A,​Stream<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyStreamF in class PLens<S,​S,​A,​A>
      • modifyP1F

        public F<S,​P1<S>> modifyP1F​(F<A,​P1<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyP1F in class PLens<S,​S,​A,​A>
      • modifyV2F

        public F<S,​V2<S>> modifyV2F​(F<A,​V2<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyV2F in class PLens<S,​S,​A,​A>
      • modify

        public F<S,​S> modify​(F<A,​A> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens using a function
        Specified by:
        modify in class PLens<S,​S,​A,​A>
      • sum

        public <S1> Lens<Either<S,​S1>,​A> sum​(Lens<S1,​A> other)
        join two Lens with the same target
      • composeLens

        public <C> Lens<S,​C> composeLens​(Lens<A,​C> other)
        compose a Lens with a Lens
      • composeIso

        public <C> Lens<S,​C> composeIso​(Iso<A,​C> other)
        compose a Lens with an Iso
      • id

        public static <S> Lens<S,​S> id()
      • lens

        public static <S,​A> Lens<S,​A> lens​(F<S,​A> get,
                                                       F<A,​F<S,​S>> set)
        create a Lens using a pair of functions: one to get the target, one to set the target.