A PPrism can be seen as a pair of functions:
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
Value members
Abstract methods
Concrete methods
modify polymorphically the target of a PPrism with a function
modify polymorphically the target of a PPrism with a function
- 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
- Source
- Prism.scala
Deprecated methods
alias to composeIso
alias to composeIso
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
alias to composePrism
alias to composePrism
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
alias to composeLens
alias to composeLens
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
alias to composeTraversal
alias to composeTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
alias to composeOptional
alias to composeOptional
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
compose a PPrism with a PTraversal
compose a PPrism with a PTraversal
- Deprecated
[Since version 3.0.0-M1]
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source
- Prism.scala
- Deprecated
[Since version 3.0.0-M4]
- Definition Classes
- Source
- Prism.scala
- 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
- 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 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
view a POptional as a PTraversal
view a POptional as a PTraversal
- Inherited from
- POptional
- 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
- Inherited from
- POptional
- Source
- Optional.scala
find if the target satisfies the predicate
find if the target satisfies the predicate
- Definition Classes
- Inherited from
- POptional
- Source
- Optional.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
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
- 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
- Inherited from
- POptional
- Source
- Optional.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
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
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