A POptional can be seen as a pair of functions:
getOrModify: S => Either[T, A]
replace : (B, S) => T
A POptional could also be defined as a weaker PLens and weaker PPrism
POptional stands for Polymorphic Optional as it replace and modify methods change a type A
to B
and S
to
T
. Optional is a type alias for POptional restricted to monomorphic updates:
type Optional[S, A] = POptional[S, S, A, A]
Attributes
Members list
Value members
Abstract methods
get the target of a POptional or nothing if there is no target
get the target of a POptional or return the original value while allowing the type to change if it does not match
get the target of a POptional or return the original value while allowing the type to change if it does not match
Attributes
- Source:
- Optional.scala
get the modified source of a POptional
Concrete 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
Attributes
- Definition Classes
- Source:
- Optional.scala
view a POptional as a PTraversal
check if there is a target and it satisfies the predicate
check if there is a target and it satisfies the predicate
Attributes
- Definition Classes
- Source:
- Optional.scala
find if the target satisfies the predicate
Attributes
- Definition Classes
- Source:
- Optional.scala
check if there is no target
modify polymorphically the target of a POptional with a function. return empty if the POptional is not matching
modify polymorphically the target of a POptional with a function. return empty if the POptional is not matching
Attributes
- Source:
- Optional.scala
check if there is a target
fall-back to another POptional in case this one doesn't match
replace polymorphically the target of a POptional with a value. return empty if the POptional is not matching
replace polymorphically the target of a POptional with a value. return empty if the POptional is not matching
Attributes
- Source:
- Optional.scala
Attributes
- Definition Classes
- Source:
- Optional.scala
Deprecated methods
alias to composeIso
alias to composePrism
alias to composeLens
alias to composeTraversal
alias to composeOptional
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Source:
- Optional.scala
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Source:
- Optional.scala
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Source:
- Optional.scala
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Source:
- Optional.scala
compose a POptional with a PTraversal
compose a POptional with a PTraversal
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Source:
- Optional.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Source:
- Optional.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Source:
- Optional.scala
alias to replaceOption
Inherited methods
compose a PTraversal with another PTraversal
compose a PTraversal with another PTraversal
Attributes
- Inherited from:
- PTraversal
- Source:
- Traversal.scala
view a PTraversal as a Fold
view a PTraversal as a PSetter
combine all targets using a target's Monoid
map each target to a Monoid and combine the results
map each target to a Monoid and combine the results
Attributes
- Inherited from:
- PTraversal
- Source:
- Traversal.scala
get all the targets of a Fold
get the first target
Attributes
- Inherited from:
- Fold
- Source:
- Fold.scala
get the last target
calculate the number of targets
modify polymorphically the target of a PTraversal with a function
modify polymorphically the target of a PTraversal with a function
Attributes
- Inherited from:
- PTraversal
- Source:
- Traversal.scala
modify polymorphically the target of a PTraversal with an Applicative function all traversal methods are written in terms of modifyA
modify polymorphically the target of a PTraversal with an Applicative function all traversal methods are written in terms of modifyA
Attributes
- Inherited from:
- PTraversal
- Source:
- Traversal.scala
PTraversal.modifyA for a Parallel
applicative functor.
PTraversal.modifyA for a Parallel
applicative functor.
Attributes
- Inherited from:
- PTraversal
- Source:
- Traversal.scala
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Fold
- Source:
- Fold.scala
Compose with a function lifted into a Getter
Deprecated and Inherited methods
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Inherited from:
- Fold
- Source:
- Fold.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Inherited from:
- Fold
- Source:
- Fold.scala
alias to replace
alias to replace
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Inherited from:
- PSetter
- Source:
- Setter.scala