Skip to content
Snippets Groups Projects
Commit d6c8ad8a authored by Maxime Jacquemin's avatar Maxime Jacquemin
Browse files

[Kernel] Correct odoc syntax for code blocks

Credit to Thibault Martin
parent 0df8b7f6
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,12 @@
prove difficult, or use the provided functors of this module. Using
the Option monad as the interior and the State monad as the exterior,
one can trivially provide the following swap function:
```ocaml
let swap (m : 'a State.t Option.t) : 'a Option.t State.t =
match m with
| None -> State.return None
| Some s -> State.map Option.return s
```
{[
let swap (m : 'a State.t Option.t) : 'a Option.t State.t =
match m with
| None -> State.return None
| Some s -> State.map Option.return s
]}
Note here that trying to reverse the order of the Option and State
monads makes the [swap] function way harder to write. Moreover, the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment