base-4.12.0.0: Basic libraries

Copyright(c) The University of Glasgow 2002
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilitynon-portable (uses Text.ParserCombinators.ReadP)
Safe HaskellTrustworthy
LanguageHaskell2010

Text.Read.Lex

Description

The cut-down Haskell lexer, used by Text.Read

Synopsis

Documentation

data Lexeme #

Constructors

Char Char

Character literal

String String

String literal, with escapes interpreted

Punc String

Punctuation or reserved symbol, e.g. (, ::

Ident String

Haskell identifier, e.g. foo, Baz

Symbol String

Haskell symbol, e.g. >>, :%

Number Number

Since: base-4.6.0.0

EOF 
Instances
Eq Lexeme #

Since: base-2.1

Instance details

Defined in Text.Read.Lex

Read Lexeme #

Since: base-2.1

Instance details

Defined in GHC.Read

Show Lexeme #

Since: base-2.1

Instance details

Defined in Text.Read.Lex

data Number #

Since: base-4.6.0.0

Instances
Eq Number #

Since: base-4.6.0.0

Instance details

Defined in Text.Read.Lex

Show Number #

Since: base-4.6.0.0

Instance details

Defined in Text.Read.Lex

numberToInteger :: Number -> Maybe Integer #

Since: base-4.5.1.0

numberToFixed :: Integer -> Number -> Maybe (Integer, Integer) #

Since: base-4.7.0.0

numberToRational :: Number -> Rational #

Since: base-4.6.0.0

numberToRangedRational :: (Int, Int) -> Number -> Maybe Rational #

Since: base-4.5.1.0

expect :: Lexeme -> ReadP () #

Since: base-4.7.0.0

hsLex :: ReadP String #

Haskell lexer: returns the lexed string, rather than the lexeme

readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a #

readOctP :: (Eq a, Num a) => ReadP a #

readDecP :: (Eq a, Num a) => ReadP a #

readHexP :: (Eq a, Num a) => ReadP a #