waargonaut-0.8.0.2: JSON wrangling
Safe HaskellNone
LanguageHaskell2010

Waargonaut.Attoparsec

Contents

Description

Some default decoder implementations using the attoparsec package.

Waargonaut works with any parser that has an instance of the CharParsing typeclass. So you're able to select from a few different parsing libraries, depending on your needs. This module provides some convenient defaults using the attoparsec package.

These functions are implemented using the decodeFromX functions in the Waargonaut.Decode module. They use the parseOnly function, from either the Text or ByteString attoparsec modules.

Synopsis

Decoders

decodeAttoparsecText :: Monad f => Decoder f a -> Text -> f (Either (DecodeError, CursorHistory) a) Source #

Use the parseOnly function as our default parser for decoding Text input.

decodeAttoparsecByteString :: Monad f => Decoder f a -> ByteString -> f (Either (DecodeError, CursorHistory) a) Source #

Use the parseOnly function as our default parser for decoding ByteString input.