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

Modulememory-0.18.0Haskell2010

Data.ByteArray.Sized

  • 1 type
  • 1 class
  • 27 values
  • Packagememory-0.18.0
  • Exports29
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSized.hs
classclass (ByteArrayAccess c, KnownNat n) => ByteArrayN (n :: Nat) c | c -> n where
#

Type class to emulate exactly the behaviour of ByteArray but with a known length at compile time

Methods

Instances2ByteArrayN
newtypenewtype SizedByteArray (n :: Nat) ba
#

Wrapper around any collection type with the size as type parameter

Instances6ByteArrayN, Eq, Ord, Show, NormalForm, ByteArrayAccess

ByteArrayN operators

24 declarations
valuealloc :: (ByteArrayN n ba, KnownNat n) => (Ptr p -> IO ()) -> IO ba
#

Allocate a new bytearray of specific size, and run the initializer on this memory

valuecreate :: (ByteArrayN n ba, KnownNat n) => (Ptr p -> IO ()) -> IO ba
#

Allocate a new bytearray of specific size, and run the initializer on this memory