typelevel / cats-parse

A parsing library for the cats ecosystem
https://typelevel.org/cats-parse/
MIT License
233 stars 53 forks source link

Add an example on how to implement a parser for interspersed input #468

Open daddykotex opened 1 year ago

daddykotex commented 1 year ago

While looking at the documentation I found some things that I could be improved so here is a PR for that.

I was specifically looking to see how I could implement something to parse "a,b,c" and extract a, b and c. I found that soft could be used for that and because I think it's a common pattern in parsers, I figured it could be useful to have an example in the documentation.

On top of that, I get feedback from experts to tell me if that solution is bad and what would be a better alternative, win-win!


One annoying thing about the docs/index.md is that yes, it's compiled but it's not the actual output of mdoc and so the result in there are hard coded. I found it annoying to go into site/target/mdoc/index.md and retrieve the output and format it to fit with the rest of the document. Is there a better way?

armanbilge commented 1 year ago

t's compiled but it's not the actual output of mdoc and so the result in there are hard coded ... Is there a better way?

mdoc already renders expressions automatically (but not statements like val declarations).

In fact I think in some places there is duplicate output. https://typelevel.org/cats-parse/