aeson-extra-0.4.1.3: Extra goodies for aeson

Copyright(C) 2015-2016 Oleg Grenrus
LicenseBSD3
MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Extra.Stream

Description

 
Synopsis

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