imperative-edsl-0.4.1: Deep embedding of imperative programs with code generation

Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Signature

Contents

Synopsis

Language

data Ann exp a where Source

Signature annotations

Constructors

Empty :: Ann exp a 
Native :: VarPred exp a => exp len -> Ann exp [a] 
Named :: String -> Ann exp a 

data Signature exp a where Source

Signatures

Constructors

Ret :: VarPred exp a => String -> exp a -> Signature exp a 
Ptr :: VarPred exp a => String -> exp a -> Signature exp a 
Lam :: VarPred exp a => Ann exp a -> (exp a -> Signature exp b) -> Signature exp (a -> b) 

Combinators

lam :: VarPred exp a => (exp a -> Signature exp b) -> Signature exp (a -> b) Source

name :: VarPred exp a => String -> (exp a -> Signature exp b) -> Signature exp (a -> b) Source

ret :: VarPred exp a => String -> exp a -> Signature exp a Source

ptr :: VarPred exp a => String -> exp a -> Signature exp a Source

arg :: VarPred exp a => Ann exp a -> (exp a -> exp b) -> (exp b -> Signature exp c) -> Signature exp (a -> c) Source

Compilation

translateFunction :: forall m exp a. (MonadC m, CompExp exp) => Signature exp a -> m () Source

Compile a function Signature to C code