PLens
A Lens (or Functional Reference) is an optic that can focus into a structure for getting, setting or modifying the focus (target).
A (polymorphic) PLens is useful when setting or modifying a value for a constructed type i.e. PLens, Pair, Double, String>
A PLens can be seen as a pair of functions:
get: (S) -> Ameaning we can focus into anSand extract anAset: (B) -> (S) -> Tmeaning we can focus into anSand set a valueBfor a targetAand obtain a modified sourceT
Parameters
Types
Functions
Join two Fold with the same target
Join two Getter with the same focus
Join two POptionalGetter with the same focus
Join two PSetter with the same target
Compose a POptionalGetter with a POptionalGetter
Compose a PTraversal with a PTraversal
Find the first element matching the predicate, if one exists.
Get the first target or null
Get the focus of an OptionalGetter or null if the is not there
Check if there is at least one target
Get the last target or null
Set the focus of a POptional with a value.
Properties
Inheritors
Extensions
DSL to compose a Optional with focus Either with a Prism with a focus of Either.Right<R>
DSL to compose a Traversal with focus Either with a Prism with a focus of Either.Right<R>
DSL to compose a Prism with focus arrow.core.Some with a Lens with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Fold with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Optional with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Setter with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Traversal with a focus of Option<S>