From d9236c265896d65ae4f1d4f4a240d8c0ffbce6f3 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Wed, 29 Aug 2007 08:33:49 +0000 Subject: [PATCH] Further documentation about mdo, suggested by Benjamin Franksen --- docs/users_guide/glasgow_exts.xml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 2857858..4d9a977 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -769,7 +769,7 @@ Furthermore, the Control.Monad.ST and Control.Monad.ST.Lazy modules provide the for Haskell's internal state monad (strict and lazy, respectively). -There are three important points in using the recursive-do notation: +Here are some important points in using the recursive-do notation: The recursive version of the do-notation uses the keyword mdo (rather @@ -777,7 +777,21 @@ than do). -As with other extensions, ghc should be given the flag -fglasgow-exts +It is enabled with the flag -XRecursiveDo, which is in turn implied by +-fglasgow-exts. + + + +Unlike ordinary do-notation, but like let and where bindings, +name shadowing is not allowed; that is, all the names bound in a single mdo must +be distinct (Section 3.3 of the paper). + + + +Variables bound by a let statement in an mdo +are monomorphic in the mdo (Section 3.1 of the paper). However +GHC breaks the mdo into segments to enhance polymorphism, +and improve termination (Section 3.2 of the paper). -- 1.7.10.4