rfc: Additions to Data.Either (take 2)

João Cristóvão jmacristovao at gmail.com
Mon Apr 21 20:01:34 UTC 2014


Hello,

So following Carter Schonwald suggestion of creating a new thread, but not
literally, since the amount of combinations would be huge, here is my own
humble attempt to gather all hypothesis discussed into separate proposals,
for your voting pleasure.
(Some are mutually exclusive, some are not)

Proposal 0:
----------------

Do nothing

Proposal 1:
----------------
Add no new code, but document Data.Either to mention how to use `left` and
(+++) from Control.Arrow

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

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

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

Proposal 5:
----------------

== Proposal 4, using the mapEither name instead.

Proposal 6:
----------------

Implement mapRight in Data.Either

6a) ... as (b -> c) -> Either a b -> Either a c
6b) ... as fmap

Proposal 7:
----------------

Don't implement mapRight, but include documentation in Data.Either stating
that it is just fmap.

Proposal 8:
----------------

Bring bifunctors to base.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140421/dd3f19a5/attachment-0001.html>


More information about the Libraries mailing list