Hello! I was just repackaging a little library for OPAM 2 the other day when one of the repository maintainers pointed out that I should probably make mention of it on this forum (given that I never have). The package name is “ocaml-monadic”; it provides ppx extensions for monadic syntax in a way that blends with OCaml’s existing grammar. Here’s a link:
I optimistically anticipate the following questions enough to provide answers:
Q1. Why?
A1. Because switching between monadic and non-monadic syntax shouldn’t require rewriting everything. Also because I wanted to learn PPX extensions in 2015.
Q2. Does the library require or use any specific library when dealing with monads?
A2. No. It just assumes the locally-scoped use of the names “bind” and, in some cases, “zero”.
Q3. How is this different from Jane Street’s ppx_let library?
A3. There are some miscellaneous differences ("%map" in ppx_let vs. “%orzero” in ocaml-monadic), but they’re largely the same idea. Their first versions were released at roughly the same time.