
7 Aug
2013
7 Aug
'13
1:13 p.m.
Ivan Lazar Miljenovic wrote:
If we're starting to add functions to Data.Either, I've often used something like this:
mapEither :: (l -> l') -> (r -> r') -> Either l r -> Either l' r' mapEither fl fr = either (Left . fl) (Right . fr)
This function is hidden in Control.Arrow as (+++). There are more useful functions in there, but it's sometimes hard to find them, especially now that we can no longer use type operators for type variables. Erik