rfc: include bimap into Data.Either
Herbert Valerio Riedel
hvr at gnu.org
Sat Apr 19 10:21:42 UTC 2014
On 2014-04-18 at 22:54:18 +0200, Tobias Florek wrote:
> 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)
as these are just specialized versions of existing functions, i.e.
mapLeft = Control.Arrow.left
bimap = Control.Arrow.(+++)
I'm not convinced we should add these
More information about the Libraries
mailing list