<div dir="ltr">Thanks!<div><br></div><div style>That looks perfect and that is exactly what my googling failed to turn up.</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Tue, Oct 15, 2013 at 11:49 AM, malcolm.wallace <span dir="ltr"><<a href="mailto:malcolm.wallace@me.com" target="_blank">malcolm.wallace@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>The polyparse package has a complete drop-in replacement for Read, called Text.Parse.  Its lexer is derived closely from Haskell Prelude lex.  It already has instances for all of the standard datatypes, and you can use DrIFT to generate instances for any datatypes outside the usual Prelude types.  The parser is fast, lazy, and space-efficient.  It gives good error messages.</div>

<div><pre style="font-family:HelveticaNeue,Helvetica,sans-serif;font-size:13px;white-space:pre-wrap">Regards,
    Malcolm</pre></div><div><div class="h5"><div><br>On 15 Oct, 2013,at 04:01 PM, Ryan Newton <<a href="mailto:rrnewton@gmail.com" target="_blank">rrnewton@gmail.com</a>> wrote:<br><br></div></div></div><div><blockquote type="cite">

<div><div><div class="h5"><div dir="ltr">We have great tools for [de]serializing both to binary and to JSON (binary, cereal, json, aeson, etc).  But we have rather weak support for [de]serializing to human readable Haskell-ish external formats.<div>

<br></div><div>Read instances are both (1) slow, because they take Strings, and (2) they don't allow sensible error messages!  (Historical decision choosing Maybe rather than Either.)</div><div><br></div><div>Right now I'm working on a project with a Racketeer who is trying to read a 6000 line file as a single list data structure.  The derived Read instance is just telling him it won't parse, with NO error information, line number etc.  To someone used to Scheme readers, that's rather poor.</div>

<div><br></div><div>I wish I had something better to tell him!  I am not aware of a library to recommend other than switching to JSON format on disk.  OR manually kludging together a parsing hack that, for example, puts one element of the list on each line and makes much smaller calls to "read".</div>

<div><br></div><div>Argh!,</div><div>  -Ryan</div><div><br></div></div></div></div><div>_______________________________________________<br> Haskell-Cafe mailing list<br> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>

 <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></div></blockquote></div></div></blockquote></div><br></div>