Data types for large but fixed width signed and unsigned integers


Version on this page:
LTS Haskell 22.30:
Stackage Nightly 2024-07-21:
Latest on Hackage:

See all snapshots wide-word appears in

BSD-2-Clause licensed by Erik de Castro Lopo
Maintained by [email protected]
This version can be pinned in stack with:wide-word-,3521
Used by 4 packages in nightly-2024-06-18(full list with versions):

A library to provide data types for large (ie > 64 bits) but fixed width signed and unsigned integers with the usual typeclass instances to allow them to be used interchangeably with Word64.

The types and operations are coded to be as fast as possible using strictness annotations, INLINEABLE pragmas and unboxed values and operations where appropriate.


Revision history for wide-word – 2023-10-24

  • Fixes for shifting/rotating by negative values. – 2023-01-14

  • Add Binary instances for Int128, Word128 and Word256. – 2022-12-24

  • Add support for building on 32 bit architectures with ghc-9.2 or later. – 2022-12-01

  • Add Hashable instances for Int128, Word128, and Word256. – 2022-??-??

  • Add Hashable instances for Int128, Word128, and Word256. – 2020-12-26

  • Derive Generic for Int128, Word128 and Word256.
  • Fix Bits.isSigned instance for Int128. – 2020-03-22

  • Make sizeOf and alignment methods of Word256 Prim and Storable instances agree. – 2019-11-22

  • Add Word256. – 2019-02-06

  • Fix Prim instance for Int128 – 2019-01-31

  • Improve implementation of succ/pred.
  • Add tests for typeclass laws.
  • Add Prim instances for Int128 and Word128.
  • Fix/re-instate rewite rules. – 2018-11-16

  • Switch to Hedgehog for testing. – 2017-04-05

  • Make it build with ghc 8.2. – 2017-02-08

  • Add NFData instances for Word128 and Int128. – 2017-01-29

  • Int128: Fix flakey rewrite rules. – 2017-01-06

  • First version. Released on an unsuspecting world.