On Tue, Sep 11, 2012 at 9:36 AM, Eric Velten de Melo
<ericvm...@gmail.com> wrote:
> Any thoughts? Hopefully I'm not saying anything really stupid.

You can intersperse decoding errors in the output, e.g. output is
[Either Error DecodedChunk].  Then all the processors have to deal
with it, but if you just want to pass the error through then just 'map
. fmap' instead of 'map'.  This means processors can also inject their
own errors or logs into the output, which may be very useful.

Or you could use runtime exceptions, i.e. the decoder is lazy but can
call error.  This is bad for reliability but if you know you always
want to crash on a bad parse it keeps the return value simple.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to