A PLens can be seen as a pair of functions:
A PLens can be seen as a pair of functions:
get: S => A
i.e. from anS
, we can extract anA
set: (B, S) => T
i.e. if we replace anA
by aB
in anS
, we obtain aT
A PLens could also be defined as a weaker PIso where replace requires an additional parameter than reverseGet.
PLens stands for Polymorphic Lens as it replace and modify methods change
a type A
to B
and S
to T
.
Lens is a type alias for PLens restricted to monomorphic updates:
type Lens[S, A] = PLens[S, S, A, A]
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 its component.
Value members
Abstract methods
modify polymorphically the target of a PLens using a function
modify polymorphically the target of a PLens using a function
- Source
- Lens.scala
modify polymorphically the target of a PLens using Functor function
modify polymorphically the target of a PLens using Functor function
- Source
- Lens.scala
replace polymorphically the target of a PLens using a function
replace polymorphically the target of a PLens using a function
- Source
- Lens.scala
Concrete methods
check if the target satisfies the predicate
check if the target satisfies the predicate
- Definition Classes
- Source
- Lens.scala
find if the target satisfies the predicate
find if the target satisfies the predicate
- Definition Classes
- Source
- Lens.scala
Compose with a function lifted into a Getter
Compose with a function lifted into a Getter
- Definition Classes
- Source
- Lens.scala
Deprecated methods
alias to composeIso
alias to composeIso
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
alias to composePrism
alias to composePrism
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
alias to composeLens
alias to composeLens
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
alias to composeTraversal
alias to composeTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
alias to composeOptional
alias to composeOptional
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
compose a PLens with a PTraversal
compose a PLens with a PTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source
- Lens.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source
- Lens.scala
Inherited methods
check if there is no target or the target satisfies the predicate
check if there is no target or the target satisfies the predicate
- Definition Classes
- Inherited from
- POptional
- Source
- Optional.scala
compose a PTraversal with another PTraversal
compose a PTraversal with another PTraversal
- Inherited from
- PTraversal
- Source
- Traversal.scala
view a PTraversal as a PSetter
view a PTraversal as a PSetter
- Inherited from
- PTraversal
- Source
- Traversal.scala
view a POptional as a PTraversal
view a POptional as a PTraversal
- Inherited from
- POptional
- Source
- Optional.scala
join two Getter with the same target
join two Getter with the same target
- Inherited from
- Getter
- Source
- Getter.scala
combine all targets using a target's Monoid
combine all targets using a target's Monoid
- Inherited from
- Fold
- Source
- Fold.scala
check if there is no target
check if there is no target
- Definition Classes
- Inherited from
- POptional
- Source
- Optional.scala
check if there is a target
check if there is a target
- Definition Classes
- Inherited from
- POptional
- Source
- Optional.scala
fall-back to another POptional in case this one doesn't match
fall-back to another POptional in case this one doesn't match
- Inherited from
- POptional
- Source
- Optional.scala
PTraversal.modifyA for a Parallel
applicative functor.
PTraversal.modifyA for a Parallel
applicative functor.
- Inherited from
- PTraversal
- Source
- Traversal.scala
Deprecated and Inherited methods
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Inherited from
- Getter
- Source
- Getter.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Inherited from
- Getter
- Source
- Getter.scala
alias to replace
alias to replace
- Deprecated
[Since version 3.0.0-M1]
- Inherited from
- PSetter
- Source
- Setter.scala
alias to replaceOption
alias to replaceOption
- Deprecated
[Since version 3.0.0-M1]
- Inherited from
- POptional
- Source
- Optional.scala