decimal -package:megaparsec

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.
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 :: SString) -> s `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
Format in decimal style, and maybe round to n significant figures.
>>> decimal Nothing 1.2345e-2
"0.012345"

>>> decimal (Just 2) 0.012345
"0.012"

>>> decimal (Just 2) 12345
"12000"