ivory-0.1.0.8: Safe embedded C programming.

Safe HaskellNone
LanguageHaskell2010

Ivory.Language.Init

Synopsis

Documentation

data XInit Source #

Intermediate initializer type supporting compound initializers. The IFresh nodes are flattened into multiple I.Init nodes in a FreshName monad when the variable is allocated.

initType :: XInit -> Type Source #

Return the type of the initializer.

newtype Init (area :: Area *) Source #

Constructors

Init 

Fields

class IvoryZero (area :: Area *) where Source #

Zero initializers. The semantics of Ivory is that initializers must be compatible with C semantics of initializing to 0 for globals in .bss.

Minimal complete definition

izero

Methods

izero :: Init area Source #

Instances
IvoryStruct sym => IvoryZero (Struct sym :: Area *) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

izero :: Init (Struct sym) Source #

IvoryZeroVal a => IvoryZero (Stored a) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

izero :: Init (Stored a) Source #

(IvoryZero area, IvoryArea area, ANat len) => IvoryZero (Array len area) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

izero :: Init (Array len area) Source #

refZero :: forall eff s a. (IvoryZero a, IvoryArea a) => Ref s a -> Ivory eff () Source #

Zero the memory pointed to by this reference, as long as it could have been created with a zero initializer.

class Monad m => FreshName m where Source #

Minimal complete definition

freshName

Methods

freshName :: String -> m Var Source #

Instances
FreshName AreaInitM Source # 
Instance details

Defined in Ivory.Language.MemArea

FreshName (Ivory eff) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

freshName :: String -> Ivory eff Var Source #

data Binding Source #

A variable binding (on the stack or in a memory area).

Constructors

Binding 
Instances
Show Binding Source # 
Instance details

Defined in Ivory.Language.Init

runInit :: FreshName m => XInit -> m (Init, [Binding]) Source #

Return the initializer and auxillary bindings for an initializer in a context that can allocate fresh names.

class IvoryVar e => IvoryInit e where Source #

Initializers for Stored things.

Methods

ival :: e -> Init (Stored e) Source #

Instances
IvoryInit IChar Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: IChar -> Init (Stored IChar) Source #

IvoryInit Sint64 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Sint32 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Sint16 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Sint8 Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: Sint8 -> Init (Stored Sint8) Source #

IvoryInit Uint64 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Uint32 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Uint16 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit Uint8 Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: Uint8 -> Init (Stored Uint8) Source #

IvoryInit IBool Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: IBool -> Init (Stored IBool) Source #

IvoryInit IDouble Source # 
Instance details

Defined in Ivory.Language.Init

IvoryInit IFloat Source # 
Instance details

Defined in Ivory.Language.Init

ProcType proc => IvoryInit (ProcPtr proc) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: ProcPtr proc -> Init (Stored (ProcPtr proc)) Source #

ANat len => IvoryInit (Ix len) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: Ix len -> Init (Stored (Ix len)) Source #

IvoryRep (BitRep n) => IvoryInit (Bits n) Source # 
Instance details

Defined in Ivory.Language.BitData.Bits

Methods

ival :: Bits n -> Init (Stored (Bits n)) Source #

IvoryArea area => IvoryInit (Ptr Global area) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

ival :: Ptr Global area -> Init (Stored (Ptr Global area)) Source #

class IvoryVar a => IvoryZeroVal a where Source #

Minimal complete definition

izeroval

Methods

izeroval :: Init (Stored a) Source #

Instances
IvoryZeroVal IChar Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Sint64 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Sint32 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Sint16 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Sint8 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Uint64 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Uint32 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Uint16 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal Uint8 Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal IBool Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal IDouble Source # 
Instance details

Defined in Ivory.Language.Init

IvoryZeroVal IFloat Source # 
Instance details

Defined in Ivory.Language.Init

ANat n => IvoryZeroVal (Ix n) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

izeroval :: Init (Stored (Ix n)) Source #

IvoryRep (BitRep n) => IvoryZeroVal (Bits n) Source # 
Instance details

Defined in Ivory.Language.BitData.Bits

Methods

izeroval :: Init (Stored (Bits n)) Source #

IvoryArea area => IvoryZeroVal (Ptr Global area) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

izeroval :: Init (Stored (Ptr Global area)) Source #

iarray :: forall len area. (IvoryArea area, ANat len) => [Init area] -> Init (Array len area) Source #

newtype InitStruct (sym :: Symbol) Source #

Constructors

InitStruct 

Fields

Instances
IvoryStruct sym => Semigroup (InitStruct sym) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

(<>) :: InitStruct sym -> InitStruct sym -> InitStruct sym #

sconcat :: NonEmpty (InitStruct sym) -> InitStruct sym #

stimes :: Integral b => b -> InitStruct sym -> InitStruct sym #

IvoryStruct sym => Monoid (InitStruct sym) Source # 
Instance details

Defined in Ivory.Language.Init

Methods

mempty :: InitStruct sym #

mappend :: InitStruct sym -> InitStruct sym -> InitStruct sym #

mconcat :: [InitStruct sym] -> InitStruct sym #

istruct :: forall sym. IvoryStruct sym => [InitStruct sym] -> Init (Struct sym) Source #

(.=) :: Label sym area -> Init area -> InitStruct sym Source #

local :: forall eff s area. (IvoryArea area, GetAlloc eff ~ Scope s) => Init area -> Ivory eff (Ref (Stack s) area) Source #

Stack allocation