hi,
i propose to include the following functions into Data.Either.
mapLeft :: (a->b) -> Either a c -> Either b c
mapLeft f = bimap f id
bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d
bimap f g = either (Left . f) (Right . g)
bimap and mapLeft already exists in edward kmett's either library (and in categories-extras and in gabriel gonzales' errors), but imo they are very useful by itself to warrant an inclusion in base. given bimap, mapLeft might not cross the fairbairn threshold though.
note: i don't propose exporting them from Prelude.
discussion period: 2 weeks
cheers,
tobias florek
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries