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. This means that it is pretty fast! However, you also get basically *zero* error reporting, which is generally not what you want.
Synopsis
- attoparsecParserFor :: (forall parser. JSONParser parser => parser a) -> Parser a
- parseViaAttoparsecWith :: (forall parser. JSONParser parser => parser a) -> ByteString -> Either String a
- parseViaAttoparsec :: forall val. FromJSON val => ByteString -> Either String val
- attoparsecParser :: FromJSON val => Parser val
Documentation
attoparsecParserFor :: (forall parser. JSONParser parser => parser a) -> Parser a Source #
Convert an abstract JSON parser to an Attoparsec Parser. This function will skip leading whitespace.
parseViaAttoparsecWith :: (forall parser. JSONParser parser => parser a) -> ByteString -> Either String a Source #
parseViaAttoparsec :: forall val. 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.