haddock icon indicating copy to clipboard operation
haddock copied to clipboard

Solo instance heads are printed incorrectly

Open treeowl opened this issue 4 years ago • 4 comments

The documentation of GHC.Generics shows the instance for Generic1 Solo, but not the instance for Generic (Solo a). The instance is definitely there; indeed, if you click through to the source, you'll see it derived.

treeowl avatar Sep 03 '21 05:09 treeowl

Interestingly, the documentation for that module also has a mysterious extra instance: instance Generic (a).

treeowl avatar Sep 03 '21 05:09 treeowl

Aha! These are connected! For some reason, Haddock displays fully-applied Solo in instances as parentheses. So instance Generic (Solo a) is displayed as Generic (a) even though a function f :: Solo a -> Solo a will have its type displayed correctly.

treeowl avatar Sep 03 '21 05:09 treeowl

This is even "worse": Solo a is systematically printed as (a) e.g. in Solo instance list: Screenshot from 2022-02-08 05-45-32

It might be the https://github.com/haskell/haddock/blob/4cf2f4d8f6bd5588c2659e343573c5d30b329d37/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs#L1255-L1256 (and similar place in PDF backend).

EDIT: I'd rename this issue to Solo instance heads are printed incorrectly

phadej avatar Feb 08 '22 03:02 phadej

@phadej, renamed. I missed your request.

treeowl avatar May 12 '22 04:05 treeowl