I really enjoy using parser combinators libraries, such as Angstrom. I use it in my Rpmfile library, and it’s very clean and expressive. My love for these started with an Tsoding’s old stream about a dead simple parser combinator library called Parcoom. This streak was the clearest explanation of the topic that I’ve ever seen. Since then, a lot of time has passed, but I decided to rewrite Parcoom’s original OCaml code in a more idiomatic implementation while preserving the original concept.
The result of my work you can find at GitHub - dx3mod/parcoom: Parser combinators library.
# #require "parcoom";;
# let open Parcoom in
parse (char 'h' <*> any_char) "hello";;
- : _ * (char * char, _) result = ("llo", Ok ('h', 'e'))