Monadic programming tutorial

When I have started writing the tutorial, I have started with the list monad… and the Base module provides a bind function, not Stdlib (however, concat_map is provided). I note that Stdlib.Option and StdLib.Result provide bind… but not return. (One could argue about the order of the monads… Option is perhaps easier to understand). Base.Option.(>>=) is also available… then it makes Base more directly usabled for monad uses.

(PS: I am perhaps a bit biased after reading Real World OCaml…).

There is some stuff on binding operators here: Operators · OCaml Documentation
But it is missing a link to Monad tutorial.

1 Like