move do-notation links
[lambda.git] / topics / _week8_using_monads.mdwn
index 9acd123..f23ef50 100644 (file)
@@ -30,7 +30,7 @@ let safe_div (x:int) (y:int) =
     | 0 -> None
     | _ -> Some (x / y);;
 
-(*
+(* an Ocaml session could continue with OCaml's response:
 val safe_div : int -> int -> int option = fun
 # safe_div 12 2;;
 - : int option = Some 6
@@ -57,7 +57,7 @@ let safe_div2 (u:int option) (v:int option) =
       | Some 0 -> None
       | Some y -> Some (x / y));;
 
-(*
+(* an Ocaml session could continue with OCaml's response:
 val safe_div2 : int option -> int option -> int option = <fun>
 # safe_div2 (Some 12) (Some 2);;
 - : int option = Some 6
@@ -95,7 +95,7 @@ let safe_add (u:int option) (v:int option) =
     | (_, None) -> None
     | (Some x, Some y) -> Some (x + y);;
 
-(*
+(* an Ocaml session could continue with OCaml's response:
 val safe_add : int option -> int option -> int option = <fun>
 # safe_add (Some 12) (Some 4);;
 - : int option = Some 16
@@ -142,7 +142,7 @@ Haskell has an even more user-friendly notation for defining `safe_div3`, namely
 Let's see our new functions in action:
 
 <pre>
-(*
+(* an Ocaml session could continue with OCaml's response:
 # safe_div3 (safe_div3 (Some 12) (Some 2)) (Some 3);;
 - : int option = Some 2
 #  safe_div3 (safe_div3 (Some 12) (Some 0)) (Some 3);;