Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solo instance heads are printed incorrectly #1423

Open
treeowl opened this issue Sep 3, 2021 · 4 comments
Open

Solo instance heads are printed incorrectly #1423

treeowl opened this issue Sep 3, 2021 · 4 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Sep 3, 2021

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
Copy link
Contributor Author

treeowl commented Sep 3, 2021

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

@treeowl
Copy link
Contributor Author

treeowl commented Sep 3, 2021

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.

@phadej
Copy link
Contributor

phadej commented Feb 8, 2022

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

ppr_mono_ty (HsTupleTy _ con tys) u q _ =
tupleParens con (map (ppLType u q HideEmptyContexts) tys)
(and similar place in PDF backend).

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

@treeowl treeowl changed the title Missing instance documentation Solo instance heads are printed incorrectly May 12, 2022
@treeowl
Copy link
Contributor Author

treeowl commented May 12, 2022

@phadej, renamed. I missed your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants