HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-internal-10.0.0Haskell2010

GHC.Internal.Bignum.Primitives

  • 1 type
  • 57 values

Bool#

4 declarations

Int#

8 declarations

Word#

19 declarations
valuewordLog2# :: Word# -> Word#
#

Compute base-2 log of Word#

This is internally implemented as count-leading-zeros machine instruction.

Addr import/export

valuewordFromAddr#
  1. :: Word#
  2. -> Addr#
  3. -> Bool#
  4. -> State# s
  5. -> (# State# s, Word# #)
#

Read a Word from addr in base-256 representation.

@n is the number of bytes to read.

The endianness is selected with the Bool# parameter: write most significant byte first (big-endian) if 1# or least significant byte first (little-endian) if 0#.

valuewordToAddr# :: Word# -> Addr# -> Bool# -> State# s -> (# State# s, Word# #)
#

Write a Word to addr in base-256 representation and return the number of bytes written.

The endianness is selected with the Bool# parameter: write most significant byte first (big-endian) if 1# or least significant byte first (little-endian) if 0#.

ByteArray import/export

Read a Word from ByteArray in base-256 representation.

@n is the number of bytes to read.

The endianness is selected with the Bool# parameter: write most significant byte first (big-endian) if 1# or least significant byte first (little-endian) if 0#.

Write a Word to MutableByteArray in base-256 representation and return the number of bytes written.

The endianness is selected with the Bool# parameter: write most significant byte first (big-endian) if 1# or least significant byte first (little-endian) if 0#.

The offset is in bytes.

Exception

7 declarations
valueraiseDivZero :: a
#

Raise GHC.Exception.Type.divZeroException

IO

4 declarations