HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Moduleheapwords-0.1.0.2Haskell2010

Cardano.HeapWords

  • 1 class
  • 19 values
  • Packageheapwords-0.1.0.2
  • Exports20
  • LanguageHaskell2010
  • LicenceApache-2.0
  • SourceHeapWords.hs
classclass HeapWords a where
#

Size in the heap of values, in words (to get the size in bytes multiply by 4 on a 32-bit machine or 8 on a 64-bit machine)

Methods

Instances30HeapWords, …
valueheapWordsUnpacked :: HeapWords a => a -> Int
#

Calculate the number of heap words used by a field unpacked within another constructor.

This function simply subtracts 2 from the heapWords result of its parameter, since in the case of an unpacked field we _do not_ have to use:

  • a word for the pointer to the inner structure.

  • a word for the constructor that is being unpacked.