Text package:aeson

Parser from strict Text to Tokens.
Most frequently, you'll probably want to encode straight to UTF-8 (the standard JSON encoding) using encode. You can use the conversions to Builders when embedding JSON messages as parts of a protocol.
Lex (and parse) strict ByteString into Tokens stream.
key is encoded to string, produces object
Efficiently deserialize a JSON value from a strict Text. If this fails due to incomplete or invalid input, Nothing is returned.
Like decodeStrictText but returns an error message when decoding fails.
Like decodeStrictText but throws an AesonException when decoding fails.
withText name f value applies f to the Text when value is a String and fails otherwise.

Error message example

withText "MyType" f Null
-- Error: "parsing MyType failed, expected String, but encountered Null"
Unescape JSON text literal. This function is exporeted mostly for testing and benchmarking purposes.
>>> doubleText 42
"\"42.0\""
>>> doubleText (0/0)
"\"NaN\""
>>> doubleText (1/0)
"\"+inf\""
>>> doubleText (-23/0)
"\"-inf\""