Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type rewriting for Feldspar programs
- rewriteType :: Type -> Q Type
- buildHaskellType :: Type -> Q Type
- buildCType :: Type -> Q Type
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 ()