Copyright | Copyright (c) 2016 the Hakaru team |
---|---|
License | BSD3 |
Maintainer | zsulliva@indiana.edu |
Stability | experimental |
Portability | GHC-only |
Safe Haskell | None |
Language | Haskell2010 |
Provides tools for building C Types from Hakaru types
- buildDeclaration :: CTypeSpec -> Ident -> CDecl
- buildPtrDeclaration :: CTypeSpec -> Ident -> CDecl
- typeDeclaration :: Sing (a :: Hakaru) -> Ident -> CDecl
- typePtrDeclaration :: Sing (a :: Hakaru) -> Ident -> CDecl
- arrayDeclaration :: Sing (a :: Hakaru) -> Ident -> CDecl
- arrayName :: Sing (a :: Hakaru) -> String
- arrayStruct :: Sing (a :: Hakaru) -> CExtDecl
- arraySize :: CExpr -> CExpr
- arrayData :: CExpr -> CExpr
- arrayPtrSize :: CExpr -> CExpr
- arrayPtrData :: CExpr -> CExpr
- mdataDeclaration :: Sing (a :: Hakaru) -> Ident -> CDecl
- mdataPtrDeclaration :: Sing (a :: Hakaru) -> Ident -> CDecl
- mdataName :: Sing (a :: Hakaru) -> String
- mdataStruct :: Sing (a :: Hakaru) -> CExtDecl
- mdataStruct' :: Sing (a :: Hakaru) -> CTypeSpec
- mdataWeight :: CExpr -> CExpr
- mdataSample :: CExpr -> CExpr
- mdataPtrWeight :: CExpr -> CExpr
- mdataPtrSample :: CExpr -> CExpr
- datumDeclaration :: Sing (HData' t) -> Ident -> CDecl
- datumName :: Sing (a :: [[HakaruFun]]) -> String
- datumStruct :: Sing (HData' t) -> CExtDecl
- functionDef :: Sing (a :: Hakaru) -> Ident -> [CDecl] -> [CDecl] -> [CStat] -> CFunDef
- datumSum :: Sing (a :: [[HakaruFun]]) -> Ident -> CDecl
- datumProd :: Sing (a :: [HakaruFun]) -> Ident -> Maybe CDecl
- buildType :: Sing (a :: Hakaru) -> [CTypeSpec]
- mkDecl :: [CTypeSpec] -> CDecl
- mkPtrDecl :: [CTypeSpec] -> CDecl
- buildStruct :: Maybe Ident -> [CDecl] -> CTypeSpec
- buildUnion :: [CDecl] -> CTypeSpec
- intDecl :: CDecl
- natDecl :: CDecl
- doubleDecl :: CDecl
- doublePtr :: CDecl
- intPtr :: CDecl
- natPtr :: CDecl
- boolTyp :: CDecl
- binaryOp :: NaryOp a -> CExpr -> CExpr -> CExpr
Documentation
arrayPtrSize :: CExpr -> CExpr Source #
arrayPtrData :: CExpr -> CExpr Source #
mdataWeight :: CExpr -> CExpr Source #
mdataSample :: CExpr -> CExpr Source #
mdataPtrWeight :: CExpr -> CExpr Source #
mdataPtrSample :: CExpr -> CExpr Source #
datumName :: Sing (a :: [[HakaruFun]]) -> String Source #
datumProd and datumSum use a store of names, which needs to match up with the names used when they are assigned and printed datumDeclaration declares struct internally datumStruct declares struct definitions externally
datumName provides a unique name to identify a struct type
buildType :: Sing (a :: Hakaru) -> [CTypeSpec] Source #
buildType function do the work of describing how the Hakaru type will be stored in memory. Arrays needed their own declaration function for their arity
buildUnion :: [CDecl] -> CTypeSpec Source #
doubleDecl :: CDecl Source #