HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleunicode-data-0.9.0Haskell2010

Unicode.Internal.Bits

Fast, static bitmap lookup utilities

Contents
  1. Bitmap lookup
  2. CString
Synopsis

Bitmap lookup

valuelookupBit :: Addr# -> Int -> Int -> Bool

lookupBit addr byteIndex bitIndex looks up the bit stored in the byte at index byteIndex at the bit index bitIndex using a bitmap starting at the address addr. The caller must make sure that the byte at address (addr + byteIndex) is legally accessible memory.

valuelookupWord8AsInt
  1. :: Addr#

    Bitmap address

  2. -> Int

    Word index

  3. -> Int

    Resulting word as Int

lookupWord8AsInt addr index looks up for the index-th 8-bits word in the bitmap starting at addr, then convert it to an Int.

The caller must make sure that:

  • ceiling (addr + (n * 8)) is legally accessible Word8#.

valuelookupWord32#
  1. :: Addr#

    Bitmap address

  2. -> Int#

    Word index

  3. -> Word#

    Resulting word

lookupWord32# addr index looks up for the index-th 32-bits word in the bitmap starting at addr, then convert it to a Word#.

The caller must make sure that:

  • ceiling (addr + (n * 32)) is legally accessible Word32#.

CString