Safe Haskell | None |
---|---|
Language | Haskell2010 |
Implementation of FromJSON parsers via Attoparsec.
This module does not construct intermediate data structures like maps or key-value lists, and instead uses permutation parsers in order to parse your data structure directly.
Synopsis
- convertParserToAttoparsecParser :: (forall parser. JSONParser parser => parser a) -> Parser a
- runParserViaAttoparsec :: (forall parser. JSONParser parser => parser a) -> ByteString -> Either String a
- parseViaAttoparsec :: FromJSON val => ByteString -> Either String val
- attoparsecParser :: FromJSON val => Parser val
Documentation
convertParserToAttoparsecParser :: (forall parser. JSONParser parser => parser a) -> Parser a Source #
Convert an abstract JSON parser to an Attoparsec Parser. This function will skip leading whitespace.
runParserViaAttoparsec :: (forall parser. JSONParser parser => parser a) -> ByteString -> Either String a Source #
parseViaAttoparsec :: FromJSON val => ByteString -> Either String val Source #
Parse a ByteString via an Attoparsec Parser.
attoparsecParser :: FromJSON val => Parser val Source #
Get an Attoparsec parser for a particular JSON-parsable value.