Monads
Monads in OCaml are generally used in a slightly different way than in other languages.
Rather than using >>=
for monadic binds, values are generally bound using a ppx
with a syntax such as let%bind x = ...
.
Additionally, as of OCaml 4.08, the langauge itself contains syntax for calling monadic functions. See this blog post and the OCaml manual on this.
Monadic Synax Extensions
- ppx_monad: Monadic syntax extension.
- ppx_let: A monadic syntax extension from Jane Street.
- ocaml-monadic: Another monadic syntax extension.
Classic Monads
- BAP Monads:
BAP (Binary Analysis Platform) has an independent and comprehensive monad library.
Rather than using a
ppx
, BAP makes use of Functors to create expressive monad hierarchies.