documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Foldable instance defaults can cause CycleInDeclaration error

Open jmatsushita opened this issue 3 years ago • 1 comments

I just bumped into the problem mentioned here https://stackoverflow.com/a/38490637/3237351 and the solution was also indeed to go from foldl = foldlDefault to fold f = foldlDefault f. It feels like this could be better documented in the Foldable instance. Maybe by simply giving a trivial example like the one in SO.

File this documentation issue on the foldable-traversable repo https://github.com/purescript/purescript-foldable-traversable/issues/139 but thought that it would be also good to have this (probably common) case mentioned in the possible causes, or maybe as a note?

jmatsushita avatar Jul 27 '21 19:07 jmatsushita

I think this is worth having. It's sort of special casing for that situation, but it would be nice to know about this quirky situation sooner.

JordanMartinez avatar Jul 27 '21 20:07 JordanMartinez