HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecborg-0.2.10.0Haskell2010

Codec.CBOR.Magic

An internal module for doing magical, low-level, and unholy things in the name of efficiency.

  • 1 type
  • 33 values
  • Packagecborg-0.2.10.0
  • Exports34
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceMagic.hs

Word utilities

4 declarations

ByteString utilities

4 declarations

Take the tail of a ByteString (i.e. drop the first byte) and read the resulting byte(s) as an 8-bit word value. The input ByteString MUST be at least 2 bytes long: one byte to drop from the front, and one to read as a Word value. This is not checked, and failure to ensure this will result in undefined behavior.

Take the tail of a ByteString (i.e. drop the first byte) and read the resulting byte(s) as a 16-bit word value. The input ByteString MUST be at least 3 bytes long: one byte to drop from the front, and two to read as a 16-bit Word value. This is not checked, and failure to ensure this will result in undefined behavior.

Take the tail of a ByteString (i.e. drop the first byte) and read the resulting byte(s) as a 32-bit word value. The input ByteString MUST be at least 5 bytes long: one byte to drop from the front, and four to read as a 32-bit Word value. This is not checked, and failure to ensure this will result in undefined behavior.

Take the tail of a ByteString (i.e. drop the first byte) and read the resulting byte(s) as a 64-bit word value. The input ByteString MUST be at least 9 bytes long: one byte to drop from the front, and eight to read as a 64-bit Word64 value. This is not checked, and failure to ensure this will result in undefined behavior.

Half-floats

2 declarations

Float/Word conversion

2 declarations

Int and Word explicit conversions

12 declarations

Integer utilities

2 declarations

Simple mutable counters

6 declarations
datadata Counter s
#

An efficient, mutable counter. Designed to be used inside ST or other primitive monads, hence it carries an abstract rank-2 s type parameter.

Array support

2 declarations