winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
572 stars 44 forks source link

docs(examples): generic parse combinator in arithmetic #583

Closed guissalustiano closed 2 months ago

guissalustiano commented 3 months ago

Hi, thanks for the work here!

I'm just learning about the library having used nom before, and one thing I had trouble with was learning how to create simple generic combinators, I think an example of that is in order.

The drawback I can see would be to make this example more complex.

Thanks!

epage commented 3 months ago

We try to keep the API in such a condition that all of it can serve as examples. However, that might not always be obvious and some of those examples still might be slightly more general than the user needs.

However, I don't think this is the most discoverable place as we are putting it in one example among a bunch and the likelihood of the user finding it is low. Finding an appropriate place within the tutorial would likely be the best approach. The question is where. If you want to move forward with that path, I'd recommend we talk further on an Issue about your fundamental concern with the documentation (helping users know how to create combinators)

guissalustiano commented 2 months ago

closed for https://github.com/winnow-rs/winnow/issues/588