# Monadic programming tutorial

**URL:** <https://discuss.ocaml.org/t/monadic-programming-tutorial/14034>\
**Category:** Learning\
**Created:** [February 8, 2024, 2:51pm UTC](https://discuss.ocaml.org/t/monadic-programming-tutorial/14034 "2024-02-08T14:51:54Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![Frederic\_Loyer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/frederic_loyer/32/3472_2.png) [@Frederic\_Loyer](https://discuss.ocaml.org/u/Frederic_Loyer)\
**Post date:** [February 12, 2024, 6:02pm UTC](https://discuss.ocaml.org/t/monadic-programming-tutorial/14034/21 "2024-02-12T18:02:00Z")

</div>

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…).

---

<div class="post-metadata">

**Author:** ![cuihtlauac](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/cuihtlauac/32/3638_2.png) [@cuihtlauac](https://discuss.ocaml.org/u/cuihtlauac)\
**Post date:** [February 13, 2024, 1:20pm UTC](https://discuss.ocaml.org/t/monadic-programming-tutorial/14034/22 "2024-02-13T13:20:46Z")

</div>

> [@Frederic\_Loyer](#):
>
> Since the added value of my tutorial is mainly about the reuse of available notations, a second page about “Monads complements: convenient notation” could be adequate (no need to patch the Monads page which is tagged C3110 which bring some attribution issue). However, the operators page does introduce `(let*)` and `bind` without a link to the monad page.

There is some stuff on binding operators here: [Operators · OCaml Documentation](https://ocaml.org/docs/operators)  
But it is missing a link to Monad tutorial.

[Previous page](https://discuss.ocaml.org/t/monadic-programming-tutorial/14034.md?page=1)
