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

Improve documentation: copy over from Parsley #48

Merged
merged 46 commits into from
Oct 28, 2024

Conversation

david-davies
Copy link
Collaborator

Closes #39

I've copied over the docs from parsley.
I've tried to make sure to adapt it to Haskell properly.
I haven't copied over examples because my HLS was getting upset if I tried to run examples in comments.

Some modules used to re-export the entire module; I have documented using explicit exports to make it look nicer, but also re-exported the module to avoid breaking API -- this will produce warnings for duplicate exports.

@david-davies david-davies requested a review from j-mie6 October 23, 2024 16:35
@david-davies david-davies added the documentation Improvements or additions to documentation label Oct 23, 2024
@david-davies
Copy link
Collaborator Author

Fails due to a parsing error in GHC 8.10 only.
Error message says this is due to the curly brace,

data Lexeme =
-- | The parsers do consume whitespace
Lexeme
-- | This turns a non-lexeme parser into a lexeme one by ensuring whitespace is consumed after the parser.
{ apply :: !(forall a. Parsec a -> Parsec a) -- this is tricky...
-- | Parse the given string.
, sym :: !(String -> Parsec ())

I'm assuming it's upset at the newline before the brace, and that:

data Lexeme =  
   -- | The parsers do consume whitespace 
   Lexeme {
       -- | This turns a non-lexeme parser into a lexeme one by ensuring whitespace is consumed after the parser. 
         apply :: !(forall a. Parsec a -> Parsec a) -- this is tricky... 
       -- | Parse the given string. 
       , sym :: !(String -> Parsec ())

would fix this?

@david-davies david-davies self-assigned this Oct 23, 2024
@j-mie6 j-mie6 merged commit 6ab86b1 into j-mie6:main Oct 28, 2024
8 checks passed
@david-davies david-davies deleted the improve-docs branch November 11, 2024 03:02
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation Missing
2 participants