documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Documenting the required eta-expansion for using default implementations

Open Ptival opened this issue 7 years ago • 1 comments

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.

Ptival avatar Jun 14 '17 01:06 Ptival

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.

hdgarrood avatar Oct 13 '19 01:10 hdgarrood