rfc: Additions to Data.Either (take 2)
Andreas Abel
andreas.abel at ifi.lmu.de
Tue Apr 22 08:20:20 UTC 2014
My votes:
On 21.04.14 10:01 PM, João Cristóvão wrote:
> Proposal 0:
> ----------------
>
> Do nothing
-1
> Proposal 1:
> ----------------
> Add no new code, but document Data.Either to mention how to use `left`
> and (+++) from Control.Arrow
-1 That would not show up "first class", e.g. not in synopsis...
> 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 Unfortunately, that is too close to
mapMaybe :: (a -> Maybe b) -> [a] -> [b]
which is a misnomer, should have been called filterMaybe.
> 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.
Where is the radio button?
> Proposal 8:
> ----------------
>
> Bring bifunctors to base.
+1
--
Andreas Abel <>< Du bist der geliebte Mensch.
Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY
andreas.abel at ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/
More information about the Libraries
mailing list