[Haskell-cafe] Textbook example of instance Foldable ((,) a)

Henning Thielemann lemming at henning-thielemann.de
Mon Nov 23 23:23:17 UTC 2020


On Mon, 23 Nov 2020, Tom Ellis wrote:

> On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote:
>> Il 23 novembre 2020 alle 14:40 Zemyla ha scritto:
>> > So what should maximum (2, "potato") be?
>> 
>> For people who did not agree with `instance Foldable (,) a`, a
>> type error!
>
> Which of the following would they give up?
>
> A. Foldable as superclass of Traversable
>
> B. (a,) as Traversable
>
> Personally I think in retrospect I think I'd give up both

You cannot really give up A, because Foldable methods can be implemented 
in terms of traverse.


More information about the Haskell-Cafe mailing list