Closed treeowl closed 2 months ago
For context: Haskell libraries mailing list discussion: https://mail.haskell.org/pipermail/libraries/2016-July/027164.html
This should carry a huge warning that it is normally not a sensible definition for Foldable
instances where f a
contains fields of types other than a
, such as a pair.
It has such a warning, specifically mentioning Either a
and (,) a
. Is
the warning insufficient?
On Jul 27, 2016 5:03 PM, "Reid Barton" notifications@github.com wrote:
This should carry a huge warning that it is normally not a sensible definition for Foldable instances where f a contains fields of types other than a, such as a pair.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haskell/deepseq/pull/18#issuecomment-235720235, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzi_djQZ4CsXZJuz8q7fJP_0C8XJgpyks5qZ8esgaJpZM4JOIet .
Oh, so it does. There is such a lot of noise in the diff that I missed it.
This seems useful, can this be worked in to the modern deepseq?
Perhaps I’m overlooking something obvious : but can’t we tease out assoxiativity of a structure from its foldmap?
On Fri, May 3, 2019 at 6:56 PM chessai notifications@github.com wrote:
This seems useful, can this be worked in to the modern deepseq?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell/deepseq/pull/18#issuecomment-489264650, or mute the thread https://github.com/notifications/unsubscribe-auth/AAABBQXQJ6QXWWMAR4BP2TDPTS7JJANCNFSM4CJYQ6WQ .
Are we worried at all about the loss of Safe
?
foldMap
can be more efficient than either foldl
or foldr
, so Unit
was added by #106 (same as UnitLTR).
If a type has a
Foldable
instance, then we can force it from left to right or from right to left.Fixes #17