Adding binary to the Haskell Platform

Don Stewart dons at
Wed Aug 5 10:38:00 EDT 2009

> The binary package is too lazy and in some cases the decoding dies
> with "stack overflow". At least this was the situation the last time
> when I tried to use it. Since then I am using hacked version which is
> stricter. This should be addressed before to add this package to the
> platform.

The stack overflow with [a] was fixed a few months ago.
I'd be interested to know if there were other issues with instances.
> Another problem that I see is that Int is serialized as 64 bit
> integer. This makes the serialized data too large. The Int type is
> also used internally, for example to store the length of a list, the
> size of a map, etc, so you can't avoid the problem by using custom
> putInt function. In fact the binary representation is so verbose that
> sometimes it is more compact to use textual representation. In my
> hacked version I use serialization for integers which use variable
> number of bytes. If someone wants to store 64 bit integer then he/she
> could always use Int64. I know that the binary package could be
> combined with gzip to make the data more compact but this is
> unnecessary overhead.

For this, we recommend the lazy zlib library to compress as you see fit.

-- Don

More information about the Libraries mailing list