Proposal: merge Data.Functor.Coproduct into transformers

Mario Blazevic mblazevic at
Tue Dec 11 13:27:00 CET 2012

On Tue, Dec 11, 2012 at 5:29 AM, Edward Kmett <ekmett at> wrote:
> I'm not wedded to its current behavior of wrapping an Either. It was kind of
> nice that converting to and from Either was a no-op on GHC, but that could
> change.
> I agree that I wouldn't want to add functions named 'left' and 'right', so
> moving to a data type rather than a newtype seems reasonable.
> Perhaps
> data Coproduct f g a = LeftF (f a) | RightF (g a)
> would be a nice color for the bikeshed?

Nah, those constructor names are dumb. I prefer Shaun's

> data Sum f g a = SumLeft (f a) | SumRight (g a)

If we're going with Sum, of course.

More information about the Libraries mailing list