Haskell Hierarchical Libraries (base package)ContentsIndex
Text.Read.Lex
Portabilitynon-portable (uses Text.ParserCombinators.ReadP)
Stabilityprovisional
Maintainerlibraries@haskell.org
Description
The cut-down Haskell lexer, used by Text.Read
Synopsis
data Lexeme
= Char Char
| String String
| Punc String
| Ident String
| Symbol String
| Int Integer
| Rat Rational
| EOF
lex :: ReadP Lexeme
hsLex :: ReadP String
lexChar :: ReadP Char
readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a
readOctP :: Num a => ReadP a
readDecP :: Num a => ReadP a
readHexP :: Num a => ReadP a
Documentation
data Lexeme
Haskell lexemes.
Constructors
Char CharCharacter literal
String StringString literal, with escapes interpreted
Punc StringPunctuation or reserved symbol, e.g. (, ::
Ident StringHaskell identifier, e.g. foo, Baz
Symbol StringHaskell symbol, e.g. >>, :%
Int IntegerInteger literal
Rat RationalFloating point literal
EOF
show/hide Instances
lex :: ReadP Lexeme
hsLex :: ReadP String
Haskell lexer: returns the lexed string, rather than the lexeme
lexChar :: ReadP Char
readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a
readOctP :: Num a => ReadP a
readDecP :: Num a => ReadP a
readHexP :: Num a => ReadP a
Produced by Haddock version 0.7