Just parse the human-readable string with another parser, to get the machine-readable error description ;) and don&#39;t forget to parse the error your error string parser produces too.<div><br></div><div>+0.7 for proposal, but +1 if we have a nice error ADT :)<br>
<div><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 10:24 AM, Ben Millwood <span dir="ltr">&lt;<a href="mailto:haskell@benmachine.co.uk">haskell@benmachine.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Dec 8, 2011 at 10:39 PM, Iavor Diatchki<br>
&lt;<a href="mailto:iavor.diatchki@gmail.com">iavor.diatchki@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; when writing simple String parsers, I find implementing this function<br>
&gt; over and over:<br>
&gt;<br>
&gt; readEither :: Read a =&gt; String -&gt; Either String a<br>
<br>
</div>The only thing that bothers me about this is the fact that the error<br>
is a String; I don&#39;t think that&#39;s a very good type for errors, because<br>
only humans can really effectively interpret it. I don&#39;t know whether<br>
it&#39;s worth introducing a new sum type just for the different kinds of<br>
read error.<br>
<br>
Regardless, readMaybe is definitely a good idea, so +1 for that.<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div>