Portability | portable |
---|---|
Stability | experimental |
Maintainer | as@hacks.yi.org |
This module provides a high level ByteString
interface to
the QuickLZ library. More info about quicklz can be found here:
http://quicklz.com
QuickLZ is fast and compresses well. The library that is bundled with this version is QuickLZ v1.5.0, with the compression level set to 1.
Truthfully, the only laws that hold with this library are the following:
(decompress . compress) == id
(decompress xs) == (decompress xs)
Note that:
(compress xs) == (compress xs)
Does not hold.
QuickLZ uses random data to seed part of the compression, so the lengths
and compressed results can differ. But they will always decompress back
to the same string, e.g., compress
is not referentially transparent, but
decompress
is (so don't go and insert compressed data as keys into any Data.Map
s.)
Arguably this is an abomination; nonetheless, this pure interface is a nice abstraction.
- compress :: ByteString -> ByteString
- decompress :: ByteString -> ByteString
Compressing and decompressing strict ByteString
s
compress :: ByteString -> ByteStringSource
Compresses the input ByteString
.
decompress :: ByteString -> ByteStringSource
Decompress the input ByteString
.