Open phadej opened 7 years ago
prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b prism setter getter pab = dimap getter (either id setter) (right pab)
Then there won't be unnecessary rmap preprocessing.
rmap
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b lens getter setter pab = dimap (\s -> (getter s, s)) (\(b, s) -> setter s b) (first' pab)
and here we won't apply setter to s before actually needed (making of pair is unavoidable)
setter
s
That sounds like an improvement to me.
Then there won't be unnecessary
rmap
preprocessing.and here we won't apply
setter
tos
before actually needed (making of pair is unavoidable)