Safe Haskell | None |
---|
- data Proc k = [k] :-> k
- class ProcType sig where
- newtype ProcPtr sig = ProcPtr {
- getProcPtr :: Name
- procPtr :: ProcType sig => Def sig -> ProcPtr sig
- data Def proc
- defSymbol :: Def proc -> Name
- proc :: forall proc impl. IvoryProcDef proc impl => Sym -> impl -> Def proc
- newtype Body r = Body {
- runBody :: forall s. Ivory (ProcEffects s r) ()
- body :: IvoryType r => (forall s. Ivory (ProcEffects s r) ()) -> Body r
- class ProcType proc => IvoryProcDef proc impl | impl -> proc where
- data Closure = Closure {
- closSupply :: [Var]
- closEnv :: [Var]
- initialClosure :: Closure
- genVar :: Closure -> (Var, Closure)
- getEnv :: Closure -> [Var]
- externProc :: forall proc. ProcType proc => Sym -> Def proc
- importProc :: forall proc. ProcType proc => Sym -> String -> Def proc
- call :: forall proc eff impl. IvoryCall proc eff impl => Def proc -> impl
- indirect :: forall proc eff impl. IvoryCall proc eff impl => ProcPtr proc -> impl
- class IvoryCall proc eff impl | proc eff -> impl, impl -> eff where
- call_ :: forall proc eff impl. IvoryCall_ proc eff impl => Def proc -> impl
- indirect_ :: forall proc eff impl. IvoryCall_ proc eff impl => ProcPtr proc -> impl
- class IvoryCall_ proc eff impl | proc eff -> impl, impl -> eff where
Documentation
Procedure pointers
Procedure definitions.
proc :: forall proc impl. IvoryProcDef proc impl => Sym -> impl -> Def procSource
Procedure definition.
Body | |
|
IvoryType ret => IvoryProcDef (:-> * ([] *) ret) (Body ret) |
class ProcType proc => IvoryProcDef proc impl | impl -> proc whereSource
IvoryType ret => IvoryProcDef (:-> * ([] *) ret) (Body ret) | |
(IvoryVar a, IvoryProcDef (:-> * args ret) k) => IvoryProcDef (:-> * (: * a args) ret) (a -> k) |
A variable name supply, and the typed values that have been generated.
Closure | |
|
initialClosure :: ClosureSource
Initial closure, with no environment and a large supply of names.
genVar :: Closure -> (Var, Closure)Source
Given a type and a closure, generate a typed variable, and a new closure with that typed variable in it's environment.
externProc :: forall proc. ProcType proc => Sym -> Def procSource
External function reference.
importProc :: forall proc. ProcType proc => Sym -> String -> Def procSource
Import a function from a C header.
indirect :: forall proc eff impl. IvoryCall proc eff impl => ProcPtr proc -> implSource
Indirect calls.
call_ :: forall proc eff impl. IvoryCall_ proc eff impl => Def proc -> implSource
Direct calls, ignoring the result.
indirect_ :: forall proc eff impl. IvoryCall_ proc eff impl => ProcPtr proc -> implSource
Indirect calls, ignoring the result.
class IvoryCall_ proc eff impl | proc eff -> impl, impl -> eff whereSource
(IvoryVar a, IvoryType r, IvoryCall_ (:-> * args r) eff impl) => IvoryCall_ (:-> * (: * a args) r) eff (a -> impl) | |
IvoryType r => IvoryCall_ (:-> * ([] *) r) eff (Ivory eff ()) |