Remove Foldable from Traversable (was Haskell Foldable Wats)

Index Int vlad.z.4096 at
Thu Feb 25 08:43:56 UTC 2016

This is getting ridiculous. The main problem with the `Foldable` instance
for tuples seems to be that it's asymmetric (takes only the second element
into account). Yet tuples are already asymmetric given their `Functor`
instance! No one seems to complain about that although for a beginner it's
a total WAT (judging from my own experience and people that I explained
Haskell to). Why does `succ <$> (1, 2)` evaluate to `(1, 3)` and not `(2,
3)`? Current definitions are entirely consistent, and consistency is the
most valuable property.

And given that `Traversable` gives a rise to a `Foldable` similarly to how
a `Monad` gives a rise to an `Applicative`, it is the same stupid mistake
not to reflect this relation in the type system.

The ship has sailed, but not when the `Foldable` instance defined. It has
sailed when the `Functor` instance was defined, everything else is a
follow-up. Just get over it already.

On Thu, Feb 25, 2016 at 11:28 AM, Jeremy <voldermort at> wrote:

> Several suggestions have been made in this thread. The one with the highest
> cost-to-benefit ratio would seem to be removing the Foldable constraint
> from
> Traversable, as it is simply not required by the Traversable definition.
> Lennart actually tried recompiling base with this "and it hardly needed any
> changes".
> I suggest that we consider this change first, as it brings the benefit of
> allowing Traversable types without having to define possibly nonsensical
> Foldable instances, and according to Lennart's experiment, has trivial
> impact.
> Lennart, what changes did you have to make? Anybody care to recompile their
> pet project with this change and see if there's any significant impact?
> --
> View this message in context:
> Sent from the Haskell - Libraries mailing list archive at
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list