haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
362 stars 242 forks source link

`MINIMAL` complete definitions should not take `DefaultSignatures` into account #1515

Open andreasabel opened 2 years ago

andreasabel commented 2 years ago

A default signature in general does not alleviate the user from implementing the corresponding method in instances. They only apply to special situations. Thus, they should not be taken into account when computing the MINIMAL complete definition.

E.g., in https://hackage.haskell.org/package/equivalence-0.4.0.1/docs/Data-Equivalence-Monad.html#t:MonadEquiv the "Minimal complete definition" is stated to be Nothing because every method has a default signature or a conventional default implementation. However, this statement is wrong in the sense that a naked instance will lead to broken code in all cases.

If I think about it, it is probably best to never try to compute the minimal complete definition automatically, but only verbalize the contents of the MINIMAL pragma when it is given.

Screenshot 2022-07-26 at 14 45 37