imperative-edsl-0.8.2: Deep embedding of imperative programs with code generation
Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Signature

Synopsis

Language

data Ann exp a where Source #

Signature annotations

Constructors

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

data Signature exp pred a where Source #

Signatures

Constructors

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

Combinators

lam :: (pred a, FreeExp exp, FreePred exp a) => (exp a -> Signature exp pred b) -> Signature exp pred (a -> b) Source #

name :: (pred a, FreeExp exp, FreePred exp a) => String -> (exp a -> Signature exp pred b) -> Signature exp pred (a -> b) Source #

ret :: pred a => String -> exp a -> Signature exp pred a Source #

ptr :: pred a => String -> exp a -> Signature exp pred a Source #

arg :: (pred a, FreeExp exp, FreePred exp a) => Ann exp a -> (exp a -> exp b) -> (exp b -> Signature exp pred c) -> Signature exp pred (a -> c) Source #

Compilation

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

Compile a function Signature to C code

argProxy :: Signature exp pred (b -> c) -> Proxy b Source #