Data types for large but fixed width signed and unsigned integers


Version on this page:
LTS Haskell 22.29:
Stackage Nightly 2024-07-19:
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-,3013

Module documentation for

Used by 1 package in lts-18.28(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 – 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.