W3cubDocs

/Haskell 8

Text.Read.Lex

Copyright (c) The University of Glasgow 2002
License BSD-style (see the file libraries/base/LICENSE)
Maintainer [email protected]
Stability provisional
Portability non-portable (uses Text.ParserCombinators.ReadP)
Safe Haskell Trustworthy
Language Haskell2010

Description

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

data Lexeme Source

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
Instances details
Eq Lexeme

Since: base-2.1

Instance details

Defined in Text.Read.Lex

Methods

(==) :: Lexeme -> Lexeme -> Bool Source

(/=) :: Lexeme -> Lexeme -> Bool Source

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 Source

Since: base-4.6.0.0

Instances
Instances details
Eq Number

Since: base-4.6.0.0

Instance details

Defined in Text.Read.Lex

Methods

(==) :: Number -> Number -> Bool Source

(/=) :: Number -> Number -> Bool Source

Show Number

Since: base-4.6.0.0

Instance details

Defined in Text.Read.Lex

numberToInteger :: Number -> Maybe Integer Source

Since: base-4.5.1.0

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

Since: base-4.7.0.0

numberToRational :: Number -> Rational Source

Since: base-4.6.0.0

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

Since: base-4.5.1.0

lex :: ReadP Lexeme Source

expect :: Lexeme -> ReadP () Source

Since: base-4.7.0.0

hsLex :: ReadP String Source

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

lexChar :: ReadP Char Source

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

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

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

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

isSymbolChar :: Char -> Bool Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/base-4.13.0.0/Text-Read-Lex.html