dashbitco / nimble_parsec

A simple and fast library for text-based parser combinators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monadic bind

asib opened this issue · comments

Hi, might be boneheaded but can't see any way to do a monadic bind. I'm writing a Bencoding library and e.g. for byte strings, it would be useful to parse the length and then construct a parser that only parses that number of characters.

This is the same as #30. So in other words, it is not yet supported. However, if you are doing byte-level encoding, then you should look into Elixir's binary matching. It is very powerful syntax and performant abstraction. This library focuses mostly on text parsing.

Well, #30 would provide the functionality I described above but is obviously not as powerful as a generalised bind. Do you have plans to eventually support that feature?

Not planned unless someone submits a pull request.