1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
5 -- Copyright : (c) The University of Glasgow 2001
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : provisional
10 -- Portability : non-portable (uses Text.ParserCombinators.ReadP)
12 -- The "Text.Read" library is the canonical library to import for
13 -- 'Read'-class facilities. For GHC only, it offers an extended and much
14 -- improved 'Read' class, which constitutes a proposed alternative to the
15 -- Haskell 98 'Read'. In particular, writing parsers is easier, and
16 -- the parsers are much more efficient.
18 -----------------------------------------------------------------------------
22 Read(..), -- The Read class
23 ReadS, -- String -> Maybe (a,String)
25 -- * Haskell 98 functions
26 reads, -- :: (Read a) => ReadS a
27 read, -- :: (Read a) => String -> a
28 readParen, -- :: Bool -> ReadS a -> ReadS a
29 lex, -- :: ReadS String
31 #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
32 -- * New parsing functions
33 module Text.ParserCombinators.ReadPrec,
35 lexP, -- :: ReadPrec Lexeme
37 #ifdef __GLASGOW_HASKELL__
38 readListDefault, -- :: Read a => ReadS [a]
39 readListPrecDefault, -- :: Read a => ReadPrec [a]
44 #ifdef __GLASGOW_HASKELL__
47 #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
48 import Text.ParserCombinators.ReadPrec
49 import qualified Text.Read.Lex as L
53 -- copied from GHC.Read
55 lexP :: ReadPrec L.Lexeme