[Haskell-cafe] Data.Binary and error handling

Don Stewart dons at galois.com
Fri Nov 27 15:55:47 EST 2009


alexey.skladnoy:
> В сообщении от 27 ноября 2009 23:09:53 Don Stewart написал:
> > alexey.skladnoy:
> > > Hello
> > >
> > >  Is there any plans to add error handling for binary? When it comes to
> > > binary parsing most awkward part is error handling
> > 
> > It is now available in the 'cereal' package. A strict binary with
> > explicit, checked error handling.
> > 
> It does but it was already noted that cereal uses strict bytestrings which are 
> not really convenient when dealing with huge inputs. One may end up using both 
> binary and cereal which is not really satisfactory.

It is quite hard to do a good job of lazy input, but explicit checked
errors (turning it into an Either Error a makes the whole stream
strict!).

You might want to look at designs that interleave error tokens in the
stream.

-- Don


More information about the Haskell-Cafe mailing list