haskus-binary-1.4: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.Format.Binary.Layout

Description

Memory layout

Describe a memory region

Synopsis

Documentation

data LPath (path :: [PathElem]) Source #

Path in a layout

Constructors

LPath 
Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathOffset (LPath ([] :: [PathElem])) l = 0
type LPathType (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathType (LPath ([] :: [PathElem])) l = l

data PathElem Source #

Layout path element

Constructors

LIndex Nat

Addressing via a numeric index

LSymbol Symbol

Addressing via a symbol

Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathOffset (LPath ([] :: [PathElem])) l = 0
type LPathType (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathType (LPath ([] :: [PathElem])) l = l

lPath :: forall e. LPath '[e] Source #

Index in the layout path

Helper for ``ptr --> lPath @p`` until

type family LPathType p l :: * Source #

Type obtained when following path p

Instances
type LPathType (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathType (LPath ([] :: [PathElem])) l = l

type family LPathOffset p l :: Nat Source #

Offset obtained when following path p

Instances
type LPathOffset (LPath ([] :: [PathElem])) l Source # 
Instance details

Defined in Haskus.Format.Binary.Layout

type LPathOffset (LPath ([] :: [PathElem])) l = 0

type LRoot = LPath '[] Source #

Layout path root

type family p :-> (s :: Symbol) where ... Source #

Equations

(LPath xs) :-> s = LPath (Snoc xs (LSymbol s)) 

type family p :#> (n :: Nat) where ... Source #

Equations

(LPath xs) :#> n = LPath (Snoc xs (LIndex n))