Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- compress :: forall m r. MonadIO m => Producer ByteString m r -> Producer ByteString m r
- decompress :: forall m r. (MonadIO m, MonadThrow m) => Producer ByteString m r -> Producer ByteString m (Producer ByteString m r)
- compressWith :: forall m r. MonadIO m => CompressParams -> Producer ByteString m r -> Producer ByteString m r
- defaultCompressParams :: CompressParams
- data CompressParams
- compressLevel :: CompressParams -> CompressionLevel
- data CompressionLevel
- compressLevelExtreme :: CompressParams -> Bool
- data IntegrityCheck
- compressIntegrityCheck :: CompressParams -> IntegrityCheck
- decompressWith :: forall m r. (MonadIO m, MonadThrow m) => DecompressParams -> Producer ByteString m r -> Producer ByteString m (Producer ByteString m r)
- defaultDecompressParams :: DecompressParams
- data DecompressParams
- decompressTellNoCheck :: DecompressParams -> Bool
- decompressTellUnsupportedCheck :: DecompressParams -> Bool
- decompressTellAnyCheck :: DecompressParams -> Bool
- decompressConcatenated :: DecompressParams -> Bool
- decompressAutoDecoder :: DecompressParams -> Bool
- decompressMemLimit :: DecompressParams -> Word64
Simple interface
compress :: forall m r. MonadIO m => Producer ByteString m r -> Producer ByteString m r Source #
Compress a ByteString
.
decompress :: forall m r. (MonadIO m, MonadThrow m) => Producer ByteString m r -> Producer ByteString m (Producer ByteString m r) Source #
Decompress a ByteString
.
Compression
compressWith :: forall m r. MonadIO m => CompressParams -> Producer ByteString m r -> Producer ByteString m r Source #
Compress a ByteString
with a given set of CompressParams
.
Parameters
defaultCompressParams :: CompressParams #
The default set of parameters for compression. This is typically
used with the compressWith
function with specific parameters
overridden.
data CompressParams #
Set of parameters for compression. The defaults are defaultCompressParams
.
Instances
Eq CompressParams | |
Defined in LibLzma (==) :: CompressParams -> CompressParams -> Bool # (/=) :: CompressParams -> CompressParams -> Bool # | |
Show CompressParams | |
Defined in LibLzma showsPrec :: Int -> CompressParams -> ShowS # show :: CompressParams -> String # showList :: [CompressParams] -> ShowS # |
compressLevel :: CompressParams -> CompressionLevel #
CompressParams
field: See documentation of CompressionLevel
data CompressionLevel #
Compression level presets that define the tradeoff between computational complexity and compression ratio
CompressionLevel0
has the lowest compression ratio as well as the
lowest memory requirements, whereas CompressionLevel9
has the
highest compression ratio and can require over 600MiB during
compression (and over 60MiB during decompression). The
man-page for xz(1)
contains more detailed information with tables describing the
properties of all compression level presets.
CompressionLevel6
is the default setting in
defaultCompressParams
as it provides a good trade-off and
matches the default of the xz(1)
tool.
CompressionLevel0 | |
CompressionLevel1 | |
CompressionLevel2 | |
CompressionLevel3 | |
CompressionLevel4 | |
CompressionLevel5 | |
CompressionLevel6 | |
CompressionLevel7 | |
CompressionLevel8 | |
CompressionLevel9 |
Instances
compressLevelExtreme :: CompressParams -> Bool #
CompressParams
field: Enable slower variant of the
lzmaCompLevel
preset, see xz(1)
man-page for details.
data IntegrityCheck #
Integrity check type (only supported when compressing .xz
files)
IntegrityCheckNone | disable integrity check (not recommended) |
IntegrityCheckCrc32 | CRC32 using the polynomial from IEEE-802.3 |
IntegrityCheckCrc64 | CRC64 using the polynomial from ECMA-182 |
IntegrityCheckSha256 | SHA-256 |
Instances
Eq IntegrityCheck | |
Defined in LibLzma (==) :: IntegrityCheck -> IntegrityCheck -> Bool # (/=) :: IntegrityCheck -> IntegrityCheck -> Bool # | |
Ord IntegrityCheck | |
Defined in LibLzma compare :: IntegrityCheck -> IntegrityCheck -> Ordering # (<) :: IntegrityCheck -> IntegrityCheck -> Bool # (<=) :: IntegrityCheck -> IntegrityCheck -> Bool # (>) :: IntegrityCheck -> IntegrityCheck -> Bool # (>=) :: IntegrityCheck -> IntegrityCheck -> Bool # max :: IntegrityCheck -> IntegrityCheck -> IntegrityCheck # min :: IntegrityCheck -> IntegrityCheck -> IntegrityCheck # | |
Read IntegrityCheck | |
Defined in LibLzma readsPrec :: Int -> ReadS IntegrityCheck # readList :: ReadS [IntegrityCheck] # | |
Show IntegrityCheck | |
Defined in LibLzma showsPrec :: Int -> IntegrityCheck -> ShowS # show :: IntegrityCheck -> String # showList :: [IntegrityCheck] -> ShowS # |
compressIntegrityCheck :: CompressParams -> IntegrityCheck #
CompressParams
field: Specify type of integrity check
Decompression
decompressWith :: forall m r. (MonadIO m, MonadThrow m) => DecompressParams -> Producer ByteString m r -> Producer ByteString m (Producer ByteString m r) Source #
Decompress a ByteString
with a given set of DecompressParams
.
Parameters
defaultDecompressParams :: DecompressParams #
The default set of parameters for decompression. This is
typically used with the decompressWith
function with specific
parameters overridden.
data DecompressParams #
Set of parameters for decompression. The defaults are
defaultDecompressParams
.
Instances
Eq DecompressParams | |
Defined in LibLzma (==) :: DecompressParams -> DecompressParams -> Bool # (/=) :: DecompressParams -> DecompressParams -> Bool # | |
Show DecompressParams | |
Defined in LibLzma showsPrec :: Int -> DecompressParams -> ShowS # show :: DecompressParams -> String # showList :: [DecompressParams] -> ShowS # |
decompressTellNoCheck :: DecompressParams -> Bool #
DecompressParams
field: If set, abort if decoded stream has no integrity check.
decompressTellUnsupportedCheck :: DecompressParams -> Bool #
DecompressParams
field: If set, abort (via LzmaRetGetCheck
) if decoded stream integrity check is unsupported.
decompressTellAnyCheck :: DecompressParams -> Bool #
DecompressParams
field: If set, abort (via LzmaRetGetCheck
) as soon as the type of the integrity check has been detected.
decompressConcatenated :: DecompressParams -> Bool #
DecompressParams
field: If set, concatenated files as decoded seamless.
decompressAutoDecoder :: DecompressParams -> Bool #
DecompressParams
field: If set, legacy .lzma
-encoded streams are allowed too.
decompressMemLimit :: DecompressParams -> Word64 #
DecompressParams
field: decompressor memory limit. Set to maxBound
to disable memory limit.