| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- decodeAttoparsecText :: Monad f => Decoder f a -> Text -> f (Either (DecodeError, CursorHistory) a)
- decodeAttoparsecByteString :: Monad f => Decoder f a -> ByteString -> f (Either (DecodeError, CursorHistory) a)
- pureDecodeAttoparsecText :: Decoder Identity a -> Text -> Either (DecodeError, CursorHistory) a
- pureDecodeAttoparsecByteString :: Decoder Identity a -> ByteString -> Either (DecodeError, CursorHistory) a
Decoders
decodeAttoparsecText :: Monad f => Decoder f a -> Text -> f (Either (DecodeError, CursorHistory) a) Source #
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.
pureDecodeAttoparsecText :: Decoder Identity a -> Text -> Either (DecodeError, CursorHistory) a Source #
As per decodeAttoparsecText but with f specialised to Identity.
pureDecodeAttoparsecByteString :: Decoder Identity a -> ByteString -> Either (DecodeError, CursorHistory) a Source #
As per decodeAttoparsecByteString but with f specialised to Identity.