
11 Dec
2012
11 Dec
'12
7:27 a.m.
On Tue, Dec 11, 2012 at 5:29 AM, Edward Kmett
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.