Bow offers the possibility to create a Prism providing an extract and an embed functions.
For consistency, Prism should allow such functions to be retrieved from a Prism.
It might help people who is not used to the Either formulation of Prisms.
Potential implementation
public extension Prism where S == T, A == B {
var extract: (S) -> A? {
getOrModify >>> \.orNil
}
var embed: (A) -> S {
reverseGet
}
}
Description
Bow offers the possibility to create a Prism providing an
extract
and anembed
functions. For consistency, Prism should allow such functions to be retrieved from a Prism.It might help people who is not used to the Either formulation of Prisms.
Potential implementation
Modules
Optics