<div dir="ltr">For aeson, use the Parser/attoparsec module <a href="https://hackage.haskell.org/package/aeson-0.11.2.0/docs/Data-Aeson-Parser.html">https://hackage.haskell.org/package/aeson-0.11.2.0/docs/Data-Aeson-Parser.html</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 29, 2016 at 8:48 PM, Nikita Volkov <span dir="ltr"><<a href="mailto:nukasu.kanaka@gmail.com" target="_blank">nukasu.kanaka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I know of at least two packages providing the incremental JSON parsing functionality:<div><a href="http://hackage.haskell.org/package/json-stream" target="_blank">http://hackage.haskell.org/package/json-stream</a><br></div><div><a href="http://hackage.haskell.org/package/json-incremental-decoder" target="_blank">http://hackage.haskell.org/package/json-incremental-decoder</a><br></div><div><br></div><div>Being the author of the latter one I recommend checking out both.</div><div><br><div class="gmail_quote"><div dir="ltr">вс, 29 мая 2016 г. в 20:10, Ryan Newton <<a href="mailto:rrnewton@gmail.com" target="_blank">rrnewton@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">As someone who spent many years putting data in S-expression format, it seems natural to me to write multiple S-expressions (or JSON objects) to a file, and expect a reader to be able to read them back one at a time.<div><br></div><div>This seems comparatively uncommon in the JSON world.  Accordingly, it looks like the most popular JSON parsing lib, Aeson, doesn't directly provide this functionality.  Functions like decode just return a "Maybe a", not the left-over input, meaning that you would need to somehow split up your multi-object file before attempting to parse, which is annoying and error prone.</div><div><br></div><div>It looks like maybe you can get Aeson to do what I want by dropping down to the attoparsec layer and messing with IResult.</div><div><br></div><div>But is there a better way to do this?  Would this be a good convenience routine to add to aeson in a PR?  I.e. would anyone else use this?</div><div><br></div><div>Thanks,</div><div>  -Ryan</div><div><br></div><div><br></div></div></div></div><span class="">
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</span></blockquote></div></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>