rfc: Additions to Data.Either (take 2)

Herbert Valerio Riedel hvr at gnu.org
Tue Apr 22 07:23:23 UTC 2014


On 2014-04-21 at 22:01:34 +0200, João Cristóvão wrote:
> Proposal 1:
> ----------------
> Add no new code, but document Data.Either to mention how to use `left` and
> (+++) from Control.Arrow

+1

> Proposal 2:
> ----------------
> Document Control.Arrow to exemplify the (->) instance usage.

+1

> Proposal 3:
> ----------------
>
> Implement mapLeft in Data.Either
>
> 3a) ... as (a -> b) -> Either a c -> Either b c (so that is easy to follow)
> 3b) ... as Control.Arrow.left
> 3c) ... and also redefine the -> instance of Control.Arrow.left as mapLeft

-1

> Proposal 4:
> ----------------
>
> Implement mapBoth in Data.Either
>
> 4a) ... as (a -> b) -> (c -> d) -> Either a c -> Either b d (so that is
> easy to follow)
> 4b) ... as Control.Arrow.(+++)
> 4c) ... and also redefine the -> instance of Control.Arrow.(+++) as mapBoth

-1

> Proposal 5:
> ----------------
>
> == Proposal 4, using the mapEither name instead.

-1

> Proposal 6:
> ----------------
>
> Implement mapRight in Data.Either
>
> 6a) ... as (b -> c) -> Either a b -> Either a c
> 6b) ... as fmap

-1

> Proposal 7:
> ----------------
>
> Don't implement mapRight, but include documentation in Data.Either stating
> that it is just fmap.

+1

> Proposal 8:
> ----------------
>
> Bring bifunctors to base.

+1    (btw, afaik the idea is to bring only the core parts of bifunctors into base)


More information about the Libraries mailing list