A POptional can be seen as a pair of functions:
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]
Value members
Abstract methods
get the target of a POptional or nothing if there is no target
get the target of a POptional or nothing if there is no target
- Source
- Optional.scala
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
- Source
- Optional.scala
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
- Definition Classes
- Source
- Optional.scala
check if there is a target and it satisfies the predicate
check if there is a target and it satisfies the predicate
- Definition Classes
- Source
- Optional.scala
find if the target satisfies the predicate
find if the target satisfies the predicate
- Definition Classes
- Source
- Optional.scala
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
- 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
- Source
- Optional.scala
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
- Source
- Optional.scala
Deprecated methods
alias to composeIso
alias to composeIso
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
alias to composePrism
alias to composePrism
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
alias to composeLens
alias to composeLens
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
alias to composeTraversal
alias to composeTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
alias to composeOptional
alias to composeOptional
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
compose a POptional with a PTraversal
compose a POptional with a PTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M4]
- Source
- Optional.scala
- Deprecated
[Since version 3.0.0-M4]
- Source
- Optional.scala
alias to replaceOption
alias to replaceOption
- Deprecated
[Since version 3.0.0-M1]
- Source
- Optional.scala
Inherited methods
compose a PTraversal with another PTraversal
compose a PTraversal with another PTraversal
- Inherited from
- PTraversal
- Source
- Traversal.scala
view a PTraversal as a Fold
view a PTraversal as a Fold
- Inherited from
- PTraversal
- Source
- Traversal.scala
view a PTraversal as a PSetter
view a PTraversal as a PSetter
- Inherited from
- PTraversal
- Source
- Traversal.scala
combine all targets using a target's Monoid
combine all targets using a target's Monoid
- Inherited from
- Fold
- Source
- Fold.scala
map each target to a Monoid and combine the results
map each target to a Monoid and combine the results
- Inherited from
- PTraversal
- Source
- Traversal.scala
modify polymorphically the target of a PTraversal with a function
modify polymorphically the target of a PTraversal with a function
- 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
- Inherited from
- PTraversal
- Source
- Traversal.scala
PTraversal.modifyA for a Parallel
applicative functor.
PTraversal.modifyA for a Parallel
applicative functor.
- Inherited from
- PTraversal
- Source
- Traversal.scala
Compose with a function lifted into a Getter
Compose with a function lifted into a Getter
- Inherited from
- Fold
- Source
- Fold.scala
Deprecated and Inherited methods
- Deprecated
[Since version 3.0.0-M4]
- Inherited from
- Fold
- Source
- Fold.scala
- Deprecated
[Since version 3.0.0-M4]
- Inherited from
- Fold
- Source
- Fold.scala
alias to replace
alias to replace
- Deprecated
[Since version 3.0.0-M1]
- Inherited from
- PSetter
- Source
- Setter.scala