Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data NamedVar = NameVar {}
- data CFunctionTemplate = CFunTempl {
- returnType :: Text
- functionName :: Text
- inputVars :: [NamedVar]
- functionBody :: Text
- data NamedVal a = NameVal {}
- unTemplate :: CFunctionTemplate -> Text
- fetchVar :: NamedVal a -> [NamedVar] -> (Maybe NamedVar, [NamedVar])
- dumifyNamedVar :: NamedVar -> NamedVar
- updateInputVar :: NamedVal a -> CFunctionTemplate -> [(Text, Text)]
- insertAfterNewline :: Text -> Text -> Text
- namedVarDeclaration :: (CShow a, CTypeable a) => NamedVal a -> Text
- declareNamedVar :: (CShow a, CTypeable a) => CFunctionTemplate -> NamedVal a -> Text
- update :: (a -> Maybe a) -> a -> a
- cTypeRep :: Text -> TypeRep
- class Typeable a => CTypeable a where
- toPtrTypeRep :: TypeRep -> TypeRep
- toFunPtrTypeRep :: TypeRep -> TypeRep
- applyTypeRep :: Typeable a => a -> TypeRep -> TypeRep
- typeRepCons :: TyCon -> TypeRep -> TypeRep
- typeConHead :: Typeable a => a -> TyCon
Documentation
data CFunctionTemplate Source
CFunTempl | |
|
dumifyNamedVar :: NamedVar -> NamedVar Source
Converts a NamedVar
to a dummy variable, e.g. int x
to int dummy_x
updateInputVar :: NamedVal a -> CFunctionTemplate -> [(Text, Text)] Source
insertAfterNewline :: Text -> Text -> Text Source
declareNamedVar :: (CShow a, CTypeable a) => CFunctionTemplate -> NamedVal a -> Text Source
toPtrTypeRep :: TypeRep -> TypeRep Source
Pseudocode illustrative example:
toPtrTypeRep Int == Ptr Int
toFunPtrTypeRep :: TypeRep -> TypeRep Source
See toPtrTypeRep
applyTypeRep :: Typeable a => a -> TypeRep -> TypeRep Source
typeRepCons :: TyCon -> TypeRep -> TypeRep Source
typeConHead :: Typeable a => a -> TyCon Source
Get the head
of a type, e.g.
>>>
`typeRepHead (undefined :: IO Int)
IO