diff --git a/src/libraries/monads/composition.mli b/src/libraries/monads/composition.mli index 37e90317155210f91fa0daf5c09f19f858245041..65ff12e118ed71430017c2201e987c83d1f29928 100644 --- a/src/libraries/monads/composition.mli +++ b/src/libraries/monads/composition.mli @@ -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