[Haskell-cafe] Foldable for (,)
benno.fuenfstueck at gmail.com
Thu May 4 08:05:30 UTC 2017
The relation between Foldable and Traversable is similar to the one between
Applicative and Monad: Traversable does not require Foldable, but every
Traversable has a Foldable instance (given by foldMalDefault). That's why
there is the superclass constraint.
Jonathon Delgado <voldermort at hotmail.com> schrieb am Do., 4. Mai 2017,
> It seems that Traversable is doing two things:
> 1) Changing the shape of a data structure.
> 2) Folding over the contents of a data structure.
> Traversable requires Foldable to enable 2, but Traversable is also applied
> to types such as (,) where only 1 is relevant.
> If this is correct, follow-up questions would be:
> 1) For educational purposes, could these concerns be split without
> substantial drawback?
> 2) For practical purposes, could this be done without breaking a lot of
> existing code?
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe