decimal
Read a decimal integer. The input must begin with at least one decimal
digit, and is consumed until a non-digit or end of string is reached.
This function does not handle leading sign characters. If you need to
handle signed input, use
signed decimal.
Note: For fixed-width integer types, this function does not
attempt to detect overflow, so a sufficiently long input may give
incorrect results. If you are worried about overflow, use
Integer for your result type.
Parses a non-negative whole number in the decimal system. Returns the
value of the number.
Parse and decode an unsigned decimal number.
Parse an integer in the decimal representation according to the format
of integer literals described in the Haskell report.
If you need to parse signed integers, see the
signed
combinator.
Warning: this function does not perform range checks.
Parse an integer in the decimal representation according to the format
of integer literals described in the Haskell report.
If you need to parse signed integers, see the
signed
combinator.
Note: before the version
6.0.0 the function returned
Integer, i.e. it wasn't polymorphic in its return type.
Warning: this function does not perform range checks.
Parses a decimal numeral and returns (Decimal, number).
Parses a non-negative whole number in the decimal system. Returns the
value of the number.
This parser does NOT swallow trailing whitespace
Match an unsigned decimal number
>>> match decimal "123"
[123]
>>> match decimal "-123"
[]
Parse decimal number without sign.
Signed decimal representation of an integer.
>>> decimal 123456
"123456"
>>> decimal (-123456)
"-123456"
>>> decimal 0
"0"
>>> decimal (-2 :: Int8)
"-2"
>>> decimal (-128 :: Int8)
"-128"
Parse and decode an unsigned integral decimal number.
Recognize a decimal number.
>>> decimal
(re.+ (re.range "0" "9"))
>>> prove $ \s -> (s::SString) `match` decimal .=> sNot (s `match` KStar asciiLetter)
Q.E.D.
Create a literal as a real from the given integer.
Parse and decode an unsigned decimal number.
Parse a non-negative decimal number in ASCII
Print a number in the decimal numeral system. Negative values are
prefixed with a minus sign.
parse plain non-negative decimal numbers given by a non-empty sequence
of digits