Safe Haskell | None |
---|---|
Language | Haskell2010 |
Foundation.String.Read
- readInteger :: String -> Maybe Integer
- readNatural :: String -> Maybe Natural
- readDouble :: String -> Maybe Double
- readFloatingExact :: String -> ReadFloatingCallback a -> Maybe a
Documentation
readInteger :: String -> Maybe Integer #
Read an Integer from a String
Consume an optional minus sign and many digits until end of string.
readNatural :: String -> Maybe Natural #
Read a Natural from a String
Consume many digits until end of string.
readDouble :: String -> Maybe Double #
Try to read a Double
readFloatingExact :: String -> ReadFloatingCallback a -> Maybe a #
Read an Floating like number of the form:
Call a function with:
- A boolean representing if the number is negative
- The leading integral part
- The floating part (number of digits after fractional part, and number) if any
- The exponant if any
The code is structured as a simple state machine that: