Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data JsonState
- slurpText :: ByteString -> Either Text Text
- slurpNumber :: ByteString -> ByteString
Documentation
slurpText :: ByteString -> Either Text Text Source #
Slurp a JSON string
Examples:
>>>
:set -XOverloadedStrings
>>>
slurpText "\"Hello\""
Right "Hello">>>
slurpText "123"
Left "34: Failed reading: satisfy"
slurpNumber :: ByteString -> ByteString Source #
Slurp a JSON number
Examples:
>>>
:set -XOverloadedStrings
>>>
slurpNumber "123, true"
"123">>>
slurpNumber "\"Hello\""
"\"Hello\""