Bindings to libbz2

Version on this page:
LTS Haskell 20.25:
Stackage Nightly 2023-06-08:
Latest on Hackage:

See all snapshots bz2 appears in

BSD-3-Clause licensed by Vanessa McHale
Maintained by
This version can be pinned in stack with:bz2-,4029

Module documentation for

Depends on 2 packages(full list with versions):


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