get the target of a PPrism or nothing if there is no target
get the target of a PPrism or return the original value while allowing the type to change if it does not match
get the modified source of a PPrism
alias to composeIso
alias to composeIso
alias to composePrism
alias to composePrism
alias to composeLens
alias to composeLens
alias to composeTraversal
alias to composeTraversal
alias to composeOptional
alias to composeOptional
check if there is no target or the target satisfies the predicate
check if there is no target or the target satisfies the predicate
**********************************************************************
view a PPrism as a PTraversal
view a PPrism as a PTraversal
compose a PPrism with a PTraversal
compose a PPrism with a PTraversal
check if there is a target and it satisfies the predicate
check if there is a target and it satisfies the predicate
find if the target satisfies the predicate
find if the target satisfies the predicate
check if there is no target
check if there is no target
modify polymorphically the target of a PPrism with a function
modify polymorphically the target of a PPrism with a function
modify polymorphically the target of a PPrism with an Applicative function
modify polymorphically the target of a PPrism with an Applicative function
modify polymorphically the target of a PPrism with a function.
check if there is a target
check if there is a target
create a Getter from the modified target to the modified source of a PPrism
set polymorphically the target of a PPrism with a value
set polymorphically the target of a PPrism with a value
set polymorphically the target of a PPrism with a value.
A PPrism can be seen as a pair of functions:
getOrModify: S => 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 it is element.
PPrism stands for Polymorphic Prism as it set and modify methods change a type
A
toB
andS
toT
. 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
the source of a PPrism
the modified source of a PPrism
the target of a PPrism
the modified target of a PPrism
monocle.law.PrismLaws