Bindings to libbz2

Version on this page:
LTS Haskell 16.16:
Stackage Nightly 2020-09-29:
Latest on Hackage:

See all snapshots bz2 appears in

BSD-3-Clause licensed by Vanessa McHale
Maintained by

Module documentation for

This version can be pinned in stack with:bz2-,4029


High-level bindings to bzip2.


Compared to bzlib:

  • Bundles bzip2 1.0.8.
  • Compatible with GHC 8.8.2
  • Uses c2hs rather than hsc2hs and thus has a larger dependency footprint

Backpack Integration

bz2 implements bzip-signature, which makes it interchangeable with bzlib.



  • Remove Codec.Compression.BZip.Foreign
  • Use ForeignPtr under the hood
  • Lazier streaming; memory use should be sensible

  • Use ForeignPtrs under the hood in various places (over bracket)

  • Haddock improvements

  • Change type signature of bZ2BzlibVersion
  • Add Codec.Compression.BZip module

  • Fix distribution

Initial release

Depends on 2 packages(full list with versions):
Used by 2 packages in lts-16.14(full list with versions):