[project @ 2002-07-24 09:57:21 by simonmar]
[ghc-base.git] / Text / Read.hs
1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
3 -- |
4 -- Module      :  Text.Read
5 -- Copyright   :  (c) The University of Glasgow 2001
6 -- License     :  BSD-style (see the file libraries/base/LICENSE)
7 -- 
8 -- Maintainer  :  libraries@haskell.org
9 -- Stability   :  provisional
10 -- Portability :  portable
11 --
12 -- The "Text.Read" library is the canonical library to import for
13 -- 'Read'-class facilities.  It offers an extended and much improved
14 -- 'Read' class, which constitutes a proposed alternative to the 
15 -- Haskell98 'Read'.  In particular, writing parsers is easier, and
16 -- the parsers are much more efficient.
17 --
18 -----------------------------------------------------------------------------
19
20 module Text.Read (
21    -- * The 'Read' class
22    Read(..),            -- The Read class
23    ReadS,               -- String -> Maybe (a,String)
24
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
30
31 #ifdef __GLASGOW_HASKELL__
32    -- * New parsing functions
33    module Text.ParserCombinators.ReadPrec,
34    L.Lexeme(..),        
35    lexP,                -- :: ReadPrec Lexeme
36    readListDefault,     -- :: Read a => ReadS [a]
37    readListPrecDefault, -- :: Read a => ReadPrec [a]
38 #endif
39
40  ) where
41
42 #ifdef __GLASGOW_HASKELL__
43 import GHC.Read
44 import Text.ParserCombinators.ReadPrec
45 import qualified Text.Read.Lex as L
46 #endif