Proposal: merge Data.Functor.Coproduct into transformers

Henning Thielemann lemming at henning-thielemann.de
Fri Dec 14 20:47:13 CET 2012


On Fri, 14 Dec 2012, Mario Blažević wrote:

> 	So far we have a consensus on the proposal (yay!), but no firm 
> agreement on the naming. Of the two alternatives I've suggested, Sum 
> appears to have edged ahead of Coproduct. Let me know if I 
> misrepresented anybody's position:
>
> Edward  Coproduct  (LeftF | RightF)
> Erik    Sum
> Wren    Coproduct  (InL | InR)
> Gábor   ?          (LeftF | RightF)
> Andreas Either1    (Left1 | Right1)
> Sean    Sum        (InL | InR)
> Henning Sum        no prefixes
>
>
> 	Unfortunately, there seems to be a preference for a new data type 
> instead of a newtype wrapping for Either, which gives us three bike 
> sheds to paint instead of one. I'm going to list some of the suggested 
> alternatives here:
>
> > data Coproduct f g a = LeftF (f a) | RightF (g a)
> > data Sum f g a       = InL   (f a) | InR    (g a)
> > data Either1 f g a   = Left1 (f a) | Right1 (g a)
> > data Either  f g a   = Left  (f a) | Right  (g a) -- use qualification


Oh, I missed the optio "newtype wrapper around Either". A newtype wrapper 
would simplify the naming discussion I think and it would simplify 
remembering names and simplifies the qualification issue. I think I prefer 
that.


More information about the Libraries mailing list