pipes-aeson-0.4.1.6: Encode and decode JSON streams using Aeson and Pipes.

Safe HaskellNone
LanguageHaskell98

Pipes.Aeson.Unchecked

Contents

Description

This module exports facilities similar to those exported by the Pipes.Aeson module, except they do not restrict the Values that might be encoded or decoded to be just valid top-level values. That is, not only Objects or Arrays, according to to the RFC-4627 JSON standard.

Synopsis

Encoding

encode :: (Monad m, ToJSON a) => a -> Producer' ByteString m () Source

Like encode, except it accepts any ToJSON instance, not just Array or Object.

Decoding

decode Source

Arguments

:: (Monad m, FromJSON a) 
=> Parser ByteString m (Maybe (Either DecodingError a)) 

Like decode, except it will decode any FromJSON instance, not just Array or Object.

decoded Source

Arguments

:: (Monad m, FromJSON a, ToJSON a) 
=> Lens' (Producer ByteString m r) (Producer a m (Either (DecodingError, Producer ByteString m r) r)) 

Like decoded, except it will decode and decode any FromJSON and ToJSON instance, not just Array or Object.

Including lenghts

decodeL Source

Arguments

:: (Monad m, FromJSON a) 
=> Parser ByteString m (Maybe (Either DecodingError (Int, a))) 

Like decode, except it also returns the length of JSON input that was consumed in order to obtain the value, not including the length of whitespace between each parsed JSON input.

decodedL Source

Arguments

:: (Monad m, FromJSON a, ToJSON a) 
=> Lens' (Producer ByteString m r) (Producer (Int, a) m (Either (DecodingError, Producer ByteString m r) r)) 

Like decoded, except it also tags each decoded entity with the length of JSON input that was consumed in order to obtain the value, not including the length of whitespace between each parsed JSON input.