ivory-0.1.0.0: Safe embedded C programming.

Safe HaskellNone

Ivory.Language.Ref

Synopsis

Documentation

newtype Ref s a Source

A non-null pointer to a memory area.

Constructors

Ref 

Fields

getRef :: Expr
 

Instances

IvoryRef Ref 
IvoryAddrOf MemArea Ref 
IvoryArea area => IvoryExpr (Ref s area) 
IvoryArea area => IvoryVar (Ref s area) 
IvoryArea area => IvoryType (Ref s area) 

constRef :: IvoryArea area => Ref s area -> ConstRef s areaSource

Turn a reference into a constant reference.

newtype ConstRef s a Source

Constructors

ConstRef 

Fields

getConstRef :: Expr
 

class IvoryRef ref whereSource

Methods

unwrapRef :: IvoryVar a => ref s (Stored a) -> ExprSource

deref :: forall eff ref s a. (IvoryVar a, IvoryVar (ref s (Stored a)), IvoryRef ref) => ref s (Stored a) -> Ivory eff aSource

Dereferenceing.

refCopy :: forall eff sTo ref sFrom a. (IvoryRef ref, IvoryVar (Ref sTo a), IvoryVar (ref sFrom a), IvoryArea a) => Ref sTo a -> ref sFrom a -> Ivory eff ()Source

Memory copy. Emits an assertion that the two references are unequal.

store :: forall eff s a. IvoryStore a => Ref s (Stored a) -> a -> Ivory eff ()Source