[Haskell-cafe] Data.Binary and error handling

Svein Ove Aas svein.ove at aas.no
Fri Nov 27 10:31:51 EST 2009


On Fri, Nov 27, 2009 at 12:00 PM, Alexey Khudyakov
<alexey.skladnoy at gmail.com> wrote:
> Hello
>
>  Is there any plans to add error handling for binary? When it comes to
> binary parsing most awkward part is error handling
>
> I presume answer will be like "there are some vague plans but no one
> to implement them" so the second question how could it be done?
>
> Naive implementation of error handliing which converts Get monad into
> hybrid of state monad and error monad (Either like) gives about 5
> times slowdown.
>
There is a Cereal package on Hackage that does exactly that, which may
have better performance characteristics than what you've tried. I
haven't personally benchmarked it.

However, it insists on strict bytestrings everywhere, including as the
return type of encode. This has made it mostly a no-go for me.

-- 
Svein Ove Aas


More information about the Haskell-Cafe mailing list