1 {-# OPTIONS_GHC -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 -- Converting strings to values.
14 -- The "Text.Read" library is the canonical library to import for
15 -- 'Read'-class facilities. For GHC only, it offers an extended and much
16 -- improved 'Read' class, which constitutes a proposed alternative to the
17 -- Haskell 98 'Read'. In particular, writing parsers is easier, and
18 -- the parsers are much more efficient.
20 -----------------------------------------------------------------------------
24 Read(..), -- The Read class
25 ReadS, -- String -> Maybe (a,String)
27 -- * Haskell 98 functions
28 reads, -- :: (Read a) => ReadS a
29 read, -- :: (Read a) => String -> a
30 readParen, -- :: Bool -> ReadS a -> ReadS a
31 lex, -- :: ReadS String
33 #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
34 -- * New parsing functions
35 module Text.ParserCombinators.ReadPrec,
37 lexP, -- :: ReadPrec Lexeme
39 #ifdef __GLASGOW_HASKELL__
40 readListDefault, -- :: Read a => ReadS [a]
41 readListPrecDefault, -- :: Read a => ReadPrec [a]
46 #ifdef __GLASGOW_HASKELL__
49 #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
50 import Text.ParserCombinators.ReadPrec
51 import qualified Text.Read.Lex as L
55 -- copied from GHC.Read
57 lexP :: ReadPrec L.Lexeme