ivory- Safe embedded C programming.

Safe HaskellNone




Ivory Monad

data Ivory eff a Source


Monad (Ivory eff) 
Functor (Ivory eff) 
Applicative (Ivory eff) 
FreshName (Ivory eff) 
IvoryType r => IvoryCall_ (:-> * ([] *) r) eff (Ivory eff ()) 
IvoryVar r => IvoryCall (:-> * ([] *) r) eff (Ivory eff r) 

retProxy :: Ivory eff a -> Proxy rSource

Get a Proxy to the return type of an Ivory block.

XXX do not export

Running Functions

runIvory :: Ivory (ProcEffects s r) a -> (a, CodeBlock)Source

Run an Ivory block computation that could require any effect.

XXX do not export

collect :: Ivory eff' a -> Ivory eff (a, CodeBlock)Source

Collect the CodeBlock for an Ivory computation.

XXX do not export


noBreak :: Ivory (ClearBreak eff) a -> Ivory eff aSource

noAlloc :: innerEff ~ ClearAlloc outerEff => Ivory innerEff a -> Ivory outerEff aSource

Code Blocks

emits :: CodeBlock -> Ivory eff ()Source

Add some statements to the collected block.

XXX do not export

emit :: Stmt -> Ivory eff ()Source

Emit a single statement.

XXX do not export

Name Generation

freshVar :: String -> Ivory eff VarSource

Generate a fresh variable name.

XXX do not export

result :: forall eff a. IvoryExpr a => a -> Ivory eff VarSource

Name the result of an expression.

XXX do not export

assign :: forall eff a. IvoryExpr a => a -> Ivory eff aSource

Sub-expression naming.