3 ms·
Combinators make for a very nice Regex API. In OCaml, most people use the re[1] library for regular expressions (example[2]). I wrote a library called tyre[3]
by Drup 8y ago
Combinators make for a very nice Regex API.
In OCaml, most people use the re[1] library for regular expressions (example[2]). I wrote a library called tyre[3] for typed extraction that follows a similar API.
Of course these APIs are much more verbose, but they are also very regular(hah!): Regular operators are normal functions of the language, typechecking and completion works, etc.
[1]: https://github.com/ocaml/ocaml-re https://github.com/ocaml/ocaml-re
[2]: https://github.com/ocaml/ocaml-re/blob/master/benchmarks/benchmark.ml#L4-L48 https://github.com/ocaml/ocaml-re/blob/master/benchmarks/ben...
[3]: https://github.com/Drup/tyre https://github.com/Drup/tyre