The two major competing packages for serializing and deserializing data in Haskell that I am aware of are binary and cereal. When should one choose one of these packages over the other? Or are there other choices that I am neglecting?
They aren't competing, they are complementary. cereal
works on strict bytestrings while binary
works on lazy. Because of its lazy nature, binary
depends on throwing an exception on parse error while cereal
can fail via Either
.
Also, to imply there are "only" two main packages is a misrepresentation. At the very least you should look at blaze-builder too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With