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

Override default docs for some and many #41

Closed
david-davies opened this issue Oct 9, 2024 · 1 comment · Fixed by #51
Closed

Override default docs for some and many #41

david-davies opened this issue Oct 9, 2024 · 1 comment · Fixed by #51
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@david-davies
Copy link
Collaborator

Text.Gigaparsec re-exports some and many from Control.Applicative, whose documentation for these combinators is crap.

We could either:

  • Define local versions that just inline to the applicative versions: many = Control.Applicative.many {-# inline many #-}, and attach better documentation to these. I don't know if there may be downsides to this. Plus, it seems bad to change the implementation for the sake of documentation, although I know user-friendliness is a specific goal of gigaparsec.
  • Figure out a way to override the documentation of re-exports in haddock.
@david-davies david-davies added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 9, 2024
@j-mie6
Copy link
Owner

j-mie6 commented Oct 9, 2024

Yes, it's frankly infuriatingly bad. See also (<|>).

The original parsec did expose it's own versions of these combinators, allowing for good docs. The downside is that these are treated as specific by GHC, and if you want to use the more generic operations, you'll need to explicitly hide gigaparsecs.

Long term, the right solution would probably be a GHC proposal to allow for haddock to be overwritten by instances, and re-exported. In turn the docs would be picked up for the library, and if the type is monomorphic enough, even when used in the IDE (this is how Scaladoc works, for instance). Perhaps I should have made that a Master's project for this year to implement...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants