Class PLens<S,T,A,B>

java.lang.Object
io.atlassian.fugue.optic.PLens<S,T,A,B>
Type Parameters:
S - the source of a PLens
T - the modified source of a PLens
A - the target of a PLens
B - the modified target of a PLens
Direct Known Subclasses:
Lens

public abstract class PLens<S,T,A,B> extends Object
A PLens can be seen as a pair of functions: - `get: S => A` i.e. from an `S`, we can extract an `A` - `set: (B, S) => T` i.e. if we replace an `A` by a `B` in an `S`, we obtain a `T`

A PLens could also be defined as a weaker PIso where set requires an additional parameter than reverseGet.

PLens stands for Polymorphic Lens as it set and modify methods change a type `A` to `B` and `S` to `T`. Lens is a PLens restricted to monomorphic updates.

A PLens is also a valid Getter, Fold, POptional, PTraversal and PSetter

Typically a PLens or Lens can be defined between a Product (e.g. case class, tuple, HList) and one of it is component.