feldspar-compiler-0.7: Compiler for the Feldspar language

Safe HaskellNone
LanguageHaskell2010

Feldspar.Compiler.CallConv

Description

Type rewriting for Feldspar programs

Synopsis

Documentation

rewriteType :: Type -> Q Type Source

Normalize the type (expand type synonyms and type families)

buildHaskellType :: Type -> Q Type Source

Construct the corresponding Haskell type of a foreign Feldspar function

prog1 :: Data Index -> Vector1 Index

sigD (mkName "h_prog1") $ loadFunType 'prog1 >>= rewriteType >>= buildHaskellType

becomes

h_prog1 :: Index -> IO [Index]

buildCType :: Type -> Q Type Source

Construct the corresponding C type of a compiled Feldspar function

 sigD (mkName "c_prog1_fun") $ loadFunType 'prog1 >>= rewriteType
>= buildCType

becomes

c_prog1_fun :: Word32 -> Ptr (SA Word32) -> IO ()