snappy- Bindings to the Google Snappy library for fast compression/decompression

MaintainerBryan O'Sullivan <>
Safe HaskellSafe-Infered



This module provides fast, pure zero-copy compression and decompression of lazy ByteString data using the Snappy format.

Although these functions operate on lazy ByteStrings, they consume the data strictly: they do not produce any output until they have consumed all of the input, and they produce the output in a single large chunk.

If your data is already in the form of a lazy ByteString, it is likely more efficient to use these functions than to convert your data to and from strict ByteStrings, as you can avoid the additional allocation and copying that would entail.



compress :: ByteString -> ByteStringSource

Compress data into the Snappy format.

decompress :: ByteString -> ByteStringSource

Decompress data in the Snappy format.

If the input is not compressed or is corrupt, an exception will be thrown.