Proposal: merge Data.Functor.Coproduct into transformers

wren ng thornton wren at freegeek.org
Tue Dec 11 13:36:06 CET 2012


On 12/10/12 11:54 PM, Mario Blazevic wrote:
> At the instigation of Edward Kmett, I hereby propose to merge
> Data.Functor.Coproduct module from comonad-transformers into
> transformers.
>
> The module defines the Coproduct data type, together with several
> class instances. All non-base instances would have to be left out,
> leaving the following instances to be merged in:
>
>    instance (Functor f, Functor g) => Functor (Coproduct f g)
>    instance (Foldable f, Foldable g) => Foldable (Coproduct f g)
>    instance (Traversable f, Traversable g) => Traversable (Coproduct f g)

+1.

> An alternative naming for the module (and the type) would be
> Data.Functor.Sum. This name would be shorter and less frightening to
> newcomers, but it clashes with its namesake type from Data.Monoid. On
> the other hand, so does Data.Functor.Product. I'm ambivalent on the
> naming, but I'm throwing this out because I don't expect it to become
> a bikeshed issue. If you have any name preference, state it together
> with your vote; if the proposal succeeds we can use whichever name is
> preferred.

+1 for Coproduct. -1 for Sum.

-- 
Live well,
~wren



More information about the Libraries mailing list