Safe Haskell | None |
---|---|
Language | Haskell2010 |
Memory layout
Describe a memory region
Synopsis
- data LPath (path :: [PathElem]) = LPath
- data PathElem
- lPath :: forall e. LPath '[e]
- type family LPathType p l :: Type
- type family LPathOffset p l :: Nat
- type LRoot = LPath '[]
- type family p :-> (s :: Symbol) where ...
- type family p :#> (n :: Nat) where ...
- data CPrimitive (size :: Nat) (align :: Nat) = CPrimitive
- data CArray (n :: Nat) (a :: k) = CArray
- data CUArray (a :: k) = CUArray
- data CStruct (fs :: [Field]) = CStruct
- data CUnion (fs :: [Field]) = CUnion
Documentation
data LPath (path :: [PathElem]) Source #
Path in a layout
Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # | |
Defined in Haskus.Memory.Layout | |
type LPathType (LPath ([] :: [PathElem])) l Source # | |
Defined in Haskus.Memory.Layout |
Layout path element
Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # | |
Defined in Haskus.Memory.Layout | |
type LPathType (LPath ([] :: [PathElem])) l Source # | |
Defined in Haskus.Memory.Layout |
type family LPathOffset p l :: Nat Source #
Offset obtained when following path p
Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # | |
Defined in Haskus.Memory.Layout |
Layouts
data CPrimitive (size :: Nat) (align :: Nat) Source #
Primitives
>>>
:kind! CSizeOf (CPrimitive 8 1)
CSizeOf (CPrimitive 8 1) :: Nat = 8
>>>
:kind! CAlignment (CPrimitive 8 2)
CAlignment (CPrimitive 8 2) :: Nat = 2
data CArray (n :: Nat) (a :: k) Source #
Array
>>>
type S = CArray 10 (CPrimitive 8 8)
>>>
:kind! CSizeOf S
CSizeOf S :: Nat = 80
>>>
:kind! CAlignment S
CAlignment S :: Nat = 8
data CUArray (a :: k) Source #
Unbounded array
>>>
type S = CUArray (CPrimitive 8 8)
>>>
:kind! CSizeOf S
CSizeOf S :: Nat = (TypeError ...)
>>>
:kind! CAlignment S
CAlignment S :: Nat = 8