Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- isInteger :: JSString -> Bool
- isNatural :: JSString -> Bool
- readInt :: JSString -> Int
- readIntMaybe :: JSString -> Maybe Int
- lenientReadInt :: JSString -> Int
- readInt64 :: JSString -> Int64
- readInt64Maybe :: JSString -> Maybe Int64
- readWord64 :: JSString -> Word64
- readWord64Maybe :: JSString -> Maybe Word64
- readDouble :: JSString -> Double
- readDoubleMaybe :: JSString -> Maybe Double
- readInteger :: JSString -> Integer
- readIntegerMaybe :: JSString -> Maybe Integer
Documentation
isNatural :: JSString -> Bool Source #
Returns whether the JSString represents a natural number at base 10 (including 0)
readInt :: JSString -> Int Source #
Convert a JSString to an Int, throwing an exception if it cannot be converted. Leading spaces and trailing non-digit characters are not allowed.
readIntMaybe :: JSString -> Maybe Int Source #
Convert a JSString to an Int, returning Nothing if it cannot be converted. Leading spaces and trailing non-digit characters are not allowed.
lenientReadInt :: JSString -> Int Source #
Convert a JSString to an Int, throwing an exception if it cannot be converted. Leading spaces are allowed. The function ignores trailing non-digit characters.
readInt64Maybe :: JSString -> Maybe Int64 Source #
readWord64 :: JSString -> Word64 Source #
readWord64Maybe :: JSString -> Maybe Word64 Source #
readDouble :: JSString -> Double Source #
Convert a JSString to an Int, throwing an exception if it cannot be converted. Leading spaces are allowed. The function ignores trailing non-digit characters.
readDoubleMaybe :: JSString -> Maybe Double Source #
Convert a JSString to a Double, returning Nothing if it cannot be converted. Leading spaces are allowed. The function ignores trailing non-digit characters.
readInteger :: JSString -> Integer Source #