documentation
documentation copied to clipboard
Documenting the required eta-expansion for using default implementations
Some type classes provide default implementations as functions (since default members are not supported yet). However, to use those, one needs eta-expand them, or the compiler will yell that the instance does not exist yet.
I'm not sure how this restriction comes up, but it would be nice to document this.
I think it might fit in the Haskell differences
part, in the section about the lack of default members.
I'm going to disagree with Phil here - I think it would probably be better to track these inside the libraries which provide the default implementations. I think the most appropriate place for these notices would be the doc-comments for the default implementations such as foldlDefault
, foldrDefault
, etc. I think not only would these notices be more likely to be seen there, they'd also be more likely to be kept up to date; if the relevant code changed in a way that necessitated changes in the docs, you would have some chance of actually noticing this and making said changes in the docs.