aeson-extra-0.4.0.0: Extra goodies for aeson

Copyright | (C) 2015-2016 Oleg Grenrus
License | BSD3
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi>
Safe Haskell | None
Language | Haskell2010

Data.Aeson.Extra.Stream

Description

Synopsis

- streamDecode :: forall a. FromJSON a => ByteString -> ([a], Maybe String)

# Documentation

streamDecode :: forall a. FromJSON a => ByteString -> ([a], Maybe String) Source #

Lazyly parse `ByteString` with top-level JSON array.

Note: inspecting result's second field will force the list!

    let ~(values, err) = streamDecode bs
    traverse_ processValue values
    maybe (pure ()) printError err

Since: 0.3.2.0