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

Safe HaskellNone

Pipes.Aeson.Unsafe

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 :: (Monad m, FromJSON b) => StateT (Producer ByteString m r) m (Either DecodingError (Int, b))Source

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

decodeManySource

Arguments

:: (Monad m, FromJSON b) 
=> Producer ByteString m r

Producer from which to draw JSON.

-> Producer (Int, b) m (Either (DecodingError, Producer ByteString m r) r) 

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