[project @ 2004-01-10 12:53:42 by panne]
[ghc-base.git] / Data / Generics / Text.hs
index c705e07..ccef471 100644 (file)
@@ -9,13 +9,13 @@
 -- Portability :  non-portable
 --
 -- \"Scrap your boilerplate\" --- Generic programming in Haskell 
--- See <http://www.cs.vu.nl/boilerplate/>.
+-- See <http://www.cs.vu.nl/boilerplate/>. The present module provides
+-- generic operations for text serialisation of terms.
 --
 -----------------------------------------------------------------------------
 
 module Data.Generics.Text ( 
 
-       -- * Generic operations for string representations of terms
        gshow,
        gread
 
@@ -23,7 +23,9 @@ module Data.Generics.Text (
 
 ------------------------------------------------------------------------------
 
-
+#ifdef __HADDOCK__
+import Prelude
+#endif
 import Control.Monad
 import Data.Maybe
 import Data.Typeable
@@ -31,7 +33,6 @@ import Data.Generics.Basics
 import Data.Generics.Aliases
 import Text.ParserCombinators.ReadP
 
-
 ------------------------------------------------------------------------------
 
 
@@ -57,8 +58,8 @@ gread :: Data a => ReadS a
 
 This is a read operation which insists on prefix notation.  (The
 Haskell 98 read deals with infix operators subject to associativity
-and precedence as well.) We use gunfoldM to "parse" the input. To be
-precise, gunfoldM is used for all types except String. The
+and precedence as well.) We use gunfoldR to "parse" the input. To be
+precise, gunfoldR is used for all types except String. The
 type-specific case for String uses basic String read.
 
 -}
@@ -68,7 +69,7 @@ gread = readP_to_S gread'
  where
 
   gread' :: Data a => ReadP a
-  gread' = gdefault `extB` scase
+  gread' = gdefault `extR` scase
 
 
    where
@@ -90,7 +91,7 @@ gread = readP_to_S gread'
                -- Do the real work
         str   <- parseConstr           -- Get a lexeme for the constructor
          con   <- str2con str          -- Convert it to a Constr (may fail)
-         x     <- gunfoldM con gread'  -- Read the children
+         x     <- gunfoldR con gread'  -- Read the children
 
                -- Drop "  )  "
          skipSpaces                    -- Discard leading space