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 java.util.function.Function<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> java.util.function.Function<S,​java.util.function.Function<C,​S>> modifyFunctionF​(java.util.function.Function<A,​java.util.function.Function<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> java.util.function.Function<S,​Either<L,​S>> modifyEitherF​(java.util.function.Function<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>
      • modifyOptionF

        public java.util.function.Function<S,​Option<S>> modifyOptionF​(java.util.function.Function<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>
      • modifyIterableF

        public java.util.function.Function<S,​java.lang.Iterable<S>> modifyIterableF​(java.util.function.Function<A,​java.lang.Iterable<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyIterableF in class PLens<S,​S,​A,​A>
      • modifySupplierF

        public java.util.function.Function<S,​java.util.function.Supplier<S>> modifySupplierF​(java.util.function.Function<A,​java.util.function.Supplier<A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifySupplierF in class PLens<S,​S,​A,​A>
      • modifyPairF

        public java.util.function.Function<S,​Pair<S,​S>> modifyPairF​(java.util.function.Function<A,​Pair<A,​A>> f)
        Description copied from class: PLens
        modify polymorphically the target of a PLens with an Applicative function
        Specified by:
        modifyPairF in class PLens<S,​S,​A,​A>
      • modify

        public java.util.function.Function<S,​S> modify​(java.util.function.Function<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 final <S1> Lens<Either<S,​S1>,​A> sum​(Lens<S1,​A> other)
        join two Lens with the same target
      • composeLens

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

        public final <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​(java.util.function.Function<S,​A> get,
                                                       java.util.function.Function<A,​java.util.function.Function<S,​S>> set)
        create a Lens using a pair of functions: one to get the target, one to set the target.