[project @ 2003-08-04 18:07:49 by panne]
authorpanne <unknown>
Mon, 4 Aug 2003 18:07:50 +0000 (18:07 +0000)
committerpanne <unknown>
Mon, 4 Aug 2003 18:07:50 +0000 (18:07 +0000)
Export ReadS from Text.ParserCombinators.ReadP, curing CPP trickery a bit

GHC/Read.lhs
Text/ParserCombinators/ReadP.hs
Text/ParserCombinators/ReadPrec.hs

index bfffb19..b67e83b 100644 (file)
@@ -49,6 +49,7 @@ import qualified Text.ParserCombinators.ReadP as P
 
 import Text.ParserCombinators.ReadP
   ( ReadP
+  , ReadS
   , readP_to_S
   )
 
@@ -89,19 +90,12 @@ readParen b g   =  if b then mandatory else optional
 
 %*********************************************************
 %*                                                     *
-\subsection{The @Read@ class and @ReadS@ type}
+\subsection{The @Read@ class}
 %*                                                     *
 %*********************************************************
 
 \begin{code}
 ------------------------------------------------------------------------
--- ReadS
-
--- | A parser for a type @a@, represented as a function that takes a
--- 'String' and returns a list of possible parses @(a,'String')@ pairs.
-type ReadS a = String -> [(a,String)]
-
-------------------------------------------------------------------------
 -- class Read
 
 class Read a where
index 654eda0..8a9cc80 100644 (file)
@@ -40,6 +40,7 @@ module Text.ParserCombinators.ReadP
   choice,     -- :: [ReadP a] -> ReadP a
   
   -- * Running a parser
+  ReadS,      -- :: *; = String -> [(a,String)]
   readP_to_S, -- :: ReadP a -> ReadS a
   readS_to_P, -- :: ReadS a -> ReadP a
   
@@ -59,8 +60,11 @@ import Data.Char( isSpace )
 infixr 5 +++, <++
 
 #ifdef __GLASGOW_HASKELL__
--- We define a local version of ReadS here,
--- because its "real" definition site is in GHC.Read
+------------------------------------------------------------------------
+-- ReadS
+
+-- | A parser for a type @a@, represented as a function that takes a
+-- 'String' and returns a list of possible parses @(a,'String')@ pairs.
 type ReadS a = String -> [(a,String)]
 #endif
 
index ae4a365..1fbada4 100644 (file)
@@ -47,6 +47,7 @@ module Text.ParserCombinators.ReadPrec
 
 import Text.ParserCombinators.ReadP
   ( ReadP
+  , ReadS
   , readP_to_S
   , readS_to_P
   )
@@ -136,12 +137,6 @@ choice ps = foldr (+++) pfail ps
 -- ---------------------------------------------------------------------------
 -- Converting between ReadPrec and Read
 
-#ifdef __GLASGOW_HASKELL__
--- We define a local version of ReadS here,
--- because its "real" definition site is in GHC.Read
-type ReadS a = String -> [(a,String)]
-#endif
-
 readPrec_to_P :: ReadPrec a -> (Int -> ReadP a)
 readPrec_to_P (P f) = f