<div dir="ltr">It&#39;s not released yet, but persistent 0.2 is going to be using enumerator. I personally don&#39;t mind SomeException as a hard-coded error type, but go ahead and do whatever you think is best for the API.<div>
<br></div><div>Michael<br><br><div class="gmail_quote">On Tue, Aug 24, 2010 at 5:47 AM, John Millikin <span dir="ltr">&lt;<a href="mailto:jmillikin@gmail.com">jmillikin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
After fielding some more questions regarding error handling, it turns<br>
out that my earlier mail was in error (hah) -- error handling is much<br>
more complicated than I thought.<br>
<br>
When I gave each iteratee its own error type, I was expecting that<br>
each pipeline would have only one or two sources of errors -- for<br>
example. a parser, or a file reader. However, in reality, it&#39;s likely<br>
that every single element in a pipeline can produce an error. For<br>
example, in a JSON/XML/etc reformatter (enumFile, parseEvents,<br>
formatEvents, iterFile), errors could be SomeException, ParseError, or<br>
FormatError.<br>
<br>
Futhermore, while it&#39;s easy to change an iteratee&#39;s error type with<br>
just (e1 -&gt; e2), changing an enumerator or enumeratee *also* requires<br>
(e2 -&gt; e1). In other words, to avoid loss of error information, the<br>
two types have to be basically the same thing anyway.<br>
<br>
I would like to avoid hard-coding the error type to SomeException,<br>
because it forces libraries to use unsafe/unportable language features<br>
(dynamic typing and casting). However, given the apparent practical<br>
requirement that all iteratees have the same error type, it seems like<br>
there&#39;s no other choice.<br>
<br>
So, my questions:<br>
<br>
1. Has anybody here successfully created / used / heard of an iteratee<br>
implementation with independent error types?<br>
2. Do alternative Haskell implementations (JHC, UHC, Hugs, etc)<br>
support DeriveDataTypeable? If not, is there any more portable way to<br>
define exceptions?<br>
3. Has anybody actually written any libraries which use the existing<br>
&quot;enumerator&quot; error handling API? I don&#39;t mind rewriting my own<br>
uploads, since this whole mess is my own damn fault, but I don&#39;t want<br>
to inconvenience anybody else.<br>
<div><div></div><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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><br></div></div>