|
Text.Read | Portability | portable | Stability | provisional | Maintainer | libraries@haskell.org |
|
|
|
|
Contents |
- The Read class
- Haskell 98 functions
- New parsing functions
|
|
Description |
The Text.Read library is the canonical library to import for
Read-class facilities. It offers an extended and much improved
Read class, which constitutes a proposed alternative to the
Haskell98 Read. In particular, writing parsers is easier, and
the parsers are much more efficient.
|
|
Synopsis |
|
|
|
|
The Read class |
|
class Read a where |
| Methods | | | Instances | Read CChar | Read CSChar | Read CUChar | Read CShort | Read CUShort | Read CInt | Read CUInt | Read CLong | Read CULong | Read CLLong | Read CULLong | Read CFloat | Read CDouble | Read CLDouble | Read CPtrdiff | Read CSize | Read CWchar | Read CSigAtomic | Read CClock | Read CTime | Read Int8 | Read Int16 | Read Int32 | Read Int64 | Read Char | Read Bool | Read Ordering | (Read a) => Read (Maybe a) | (Read a, Read b) => Read (Either a b) | (Read a) => Read [a] | (Ix a, Read a, Read b) => Read (Array a b) | Read Lexeme | Read Int | Read Integer | Read Float | Read Double | (Integral a, Read a) => Read (Ratio a) | Read () | (Read a, Read b) => Read (a, b) | (Read a, Read b, Read c) => Read (a, b, c) | (Read a, Read b, Read c, Read d) => Read (a, b, c, d) | (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) | Read Word | Read Word8 | Read Word16 | Read Word32 | Read Word64 | Read StdGen |
|
|
|
type ReadS a = String -> [(a, String)] |
A parser for a type a, represented as a function that takes a
String and returns a list of possible parses (a,String) pairs. |
|
Haskell 98 functions |
|
reads :: (Read a) => ReadS a |
|
read :: (Read a) => String -> a |
|
readParen :: Bool -> ReadS a -> ReadS a |
|
lex :: ReadS String |
|
New parsing functions |
|
module Text.ParserCombinators.ReadPrec |
|
data Lexeme |
|
|
lexP :: ReadPrec Lexeme |
Parse a single lexeme |
|
readListDefault :: (Read a) => ReadS [a] |
Use this to define the readList method, if you
don't want a special case |
|
readListPrecDefault :: (Read a) => ReadPrec [a] |
Use this to define the readListPrec method, if you
don't want a special case |
|
Produced by Haddock version 0.4 |