X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FGenerics%2FText.hs;h=5a81cc15d0e492827de1187e24e2d73d281a1b95;hb=c1a7d1856f1af6450ae3e04072b9d36960bc2257;hp=881fd5482d5743758dff33b8da438ce86d79a7c7;hpb=5b272091fa9c22196f0c887d34f6a94d590a1398;p=haskell-directory.git diff --git a/Data/Generics/Text.hs b/Data/Generics/Text.hs index 881fd54..5a81cc1 100644 --- a/Data/Generics/Text.hs +++ b/Data/Generics/Text.hs @@ -6,7 +6,7 @@ -- -- Maintainer : libraries@haskell.org -- Stability : experimental --- Portability : non-portable +-- Portability : non-portable (uses Data.Generics.Basics) -- -- \"Scrap your boilerplate\" --- Generic programming in Haskell -- See . The present module provides @@ -57,8 +57,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 gunfoldR to "parse" the input. To be -precise, gunfoldR is used for all types except String. The +and precedence as well.) We use fromConstrM to "parse" the input. To be +precise, fromConstrM is used for all types except String. The type-specific case for String uses basic String read. -} @@ -68,7 +68,7 @@ gread = readP_to_S gread' where -- Helper for recursive read - gread' :: Data a => ReadP a + gread' :: Data a' => ReadP a' gread' = allButString `extR` stringCase where @@ -80,7 +80,7 @@ gread = readP_to_S gread' -- Determine result type myDataType = dataTypeOf (getArg allButString) where - getArg :: ReadP a -> a + getArg :: ReadP a'' -> a'' getArg = undefined -- The generic default for gread @@ -92,9 +92,9 @@ gread = readP_to_S gread' skipSpaces -- Discard following space -- Do the real work - str <- parseConstr -- Get a lexeme for the constructor - con <- str2con str -- Convert it to a Constr (may fail) - x <- gunfoldR con gread' -- Read the children + str <- parseConstr -- Get a lexeme for the constructor + con <- str2con str -- Convert it to a Constr (may fail) + x <- fromConstrM gread' con -- Read the children -- Drop " ) " skipSpaces -- Discard leading space