X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek8_safe_division_with_monads.mdwn;h=933ded83b60f6eb2f0e367184775645e7bf265a1;hp=3e3e14c0a4375682987788bf6631abc5ec08e361;hb=a0eb18e702862266fdc8a7d935d6cc33821fdf4a;hpb=29fb3ed9c63e37aeaeef765c1c11986bd1f84f41 diff --git a/topics/week8_safe_division_with_monads.mdwn b/topics/week8_safe_division_with_monads.mdwn index 3e3e14c0..933ded83 100644 --- a/topics/week8_safe_division_with_monads.mdwn +++ b/topics/week8_safe_division_with_monads.mdwn @@ -217,7 +217,7 @@ Wherever we have a well-defined monad, we can define the `mapN` operations for t of their `>>=` and `⇧`/`mid`. The general pattern is: mapN (g : 'a1 -> ... 'an -> 'result) (u1 : 'a1 option) ... (un : 'an option) : 'result option = - u1 >>= (fun x1 -> ... un >>= (fun xn -> ⇧ (g x1 ... xn)) ...) + u1 >>= (fun x1 -> ... un >>= (fun xn -> ⇧(g x1 ... xn)) ...) Our above definitions of `map` and `mapN` were of this form, except we just explicitly supplied the definition of `⇧` for the Option/Maybe monad (namely, in OCamlese, the constructor `Some`).