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
modify polymorphically the target of a POptional with a function
modify polymorphically the target of a POptional with an Applicative function
get the modified source of a POptional
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
view a POptional as a PTraversal
view a POptional as a PTraversal
join two POptional with the same target
join two POptional with the same target
compose a POptional with a PTraversal
compose a POptional with a PTraversal
check if a POptional has a target
check if a POptional has a target
modify polymorphically the target of a POptional with a function.
set polymorphically the target of a POptional with a value.
(Since version 1.1.0) use getOption
(Since version 1.1.0) use modifyOption
(Since version 1.1.0) use setOption
(Since version 1.2.0) use choice
A POptional can be seen as a pair of functions:
getOrModify: S => T \/ A
set : (B, S) => T
A POptional could also be defined as a weaker PLens and weaker PPrism
POptional stands for Polymorphic Optional as it set and modify methods change a type
A
toB
andS
toT
. Optional is a type alias for POptional restricted to monomorphic updates:type Optional[S, A] = POptional[S, S, A, A]
the source of a POptional
the modified source of a POptional
the target of a POptional
the modified target of a POptional
monocle.law.OptionalLaws