Add missing Monad/Traversable instances to tuples

Eric Mertens emertens at gmail.com
Tue Apr 2 16:00:10 UTC 2019


Hi libraries@,

I'm also -1 on these instances. I'd prefer to see that the various tuples
have instances that don't privilege one type variable over another. I find
the existing instances for 2-tuples are already more likely to be used in
error than intentionally, and even when used intentionally turn heads with
their surprising behavior. I'd prefer to have Writer from transformers
used, for example, when the non-symmetric treatment of the type parameters
is intended.

Best regards,
Eric Mertens


On Mon, Apr 1, 2019 at 9:29 PM Fumiaki Kinoshita <fumiexcel at gmail.com>
wrote:

> I submitted https://gitlab.haskell.org/ghc/ghc/merge_requests/644 but it
> might be still controversial. I'd like to get more opinions again.
>
> Here's the list of proposed instances:
>
> Foldable ((,,) a b)
> Foldable ((,,,) a b c)
> Traversable ((,,) a b)
> Traversable ((,,,) a b c)
> Functor ((,,) a b)
> (Monoid a, Monoid b) => Applicative ((,,) a b)
> (Monoid a, Monoid b) => Monad ((,,) a b)
> Functor ((,,,) a b c)
> (Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c)
> (Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c)
>
> The absence of Traversable instances for tuples feels quite inconsistent
> given that there are Bitraversable instances already.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


-- 
Eric Mertens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190402/093c651d/attachment.html>


More information about the Libraries mailing list