A PPrism can be seen as a pair of functions:
getOrModify: S => Either[T, A]
reverseGet : B => T
A PPrism could also be defined as a weaker PIso where get can fail.
Typically a PPrism or Prism encodes the relation between a Sum or CoProduct type (e.g. sealed trait) and one of its element.
PPrism stands for Polymorphic Prism as it replace and modify methods change a type A
to B
and S
to T
.
Prism is a type alias for PPrism where the type of target cannot be modified:
type Prism[S, A] = PPrism[S, S, A, A]
A PPrism is also a valid Fold, POptional, PTraversal and PSetter
Attributes
Members list
Value members
Abstract methods
get the modified source of a PPrism
Concrete methods
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Attributes
- Definition Classes
- Source:
- Prism.scala
modify polymorphically the target of a PPrism with a function
modify polymorphically the target of a PPrism with a function
Attributes
- Definition Classes
- Source:
- Prism.scala
modify polymorphically the target of a PPrism with an Applicative function
modify polymorphically the target of a PPrism with an Applicative function
Attributes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
get the modified source of a POptional
Attributes
- Definition Classes
- Source:
- Prism.scala
Attributes
- Source:
- Prism.scala
Deprecated methods
alias to composeIso
alias to composePrism
alias to composeLens
alias to composeTraversal
alias to composeOptional
compose a PPrism with a PTraversal
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source:
- Prism.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source:
- Prism.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source:
- Prism.scala
Attributes
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source:
- Prism.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
Attributes
- Definition Classes
- Inherited from:
- POptional
- Source:
- Optional.scala
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
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
- Inherited from:
- POptional
- Source:
- Optional.scala
find if the target satisfies the predicate
find if the target satisfies the predicate
Attributes
- Definition Classes
- Inherited from:
- POptional
- Source:
- Optional.scala
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 target of a POptional or nothing if there is no target
get the target of a POptional or nothing if there is no target
Attributes
- Inherited from:
- POptional
- 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
Attributes
- Inherited from:
- POptional
- Source:
- Optional.scala
get the first target
Attributes
- Inherited from:
- Fold
- Source:
- Fold.scala
check if there is no target
check if there is no target
Attributes
- Definition Classes
- Inherited from:
- POptional
- Source:
- Optional.scala
get the last target
calculate the number of targets
check if there is a target
check if there is a target
Attributes
- 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
Attributes
- Inherited from:
- POptional
- Source:
- Optional.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
alias to replace
alias to replace
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Inherited from:
- PSetter
- Source:
- Setter.scala
alias to replaceOption
alias to replaceOption
Attributes
- Deprecated
[Since version 3.0.0-M1]
- Inherited from:
- POptional
- Source:
- Optional.scala