Safe Haskell | None |
---|---|
Language | Haskell98 |
- convert :: Text -> BaseCodeGen e Converter -> BaseCodeGen e Text
- genConversion :: Text -> Converter -> CodeGen Text
- unpackCArray :: Text -> Type -> Transfer -> ExcCodeGen Converter
- computeArrayLength :: Text -> Type -> ExcCodeGen Text
- callableHasClosures :: Callable -> Bool
- hToF :: Type -> Transfer -> ExcCodeGen Converter
- fToH :: Type -> Transfer -> ExcCodeGen Converter
- haskellType :: Type -> CodeGen TypeRep
- isoHaskellType :: Type -> CodeGen TypeRep
- foreignType :: Type -> CodeGen TypeRep
- argumentType :: [Char] -> Type -> CodeGen ([Char], Text, [Text])
- elementType :: Type -> Maybe Type
- elementMap :: Type -> Text -> Maybe Text
- elementTypeAndMap :: Type -> Text -> Maybe (Type, Text)
- isManaged :: Type -> CodeGen Bool
- typeIsNullable :: Type -> CodeGen Bool
- typeIsPtr :: Type -> CodeGen Bool
- maybeNullConvert :: Type -> CodeGen (Maybe Text)
- nullPtrForType :: Type -> CodeGen (Maybe Text)
- getIsScalar :: Type -> CodeGen Bool
- typeAllocInfo :: Type -> CodeGen (Maybe TypeAllocInfo)
- data TypeAllocInfo = TypeAllocInfo {}
- apply :: Constructor -> Converter
- mapC :: Constructor -> Converter
- literal :: Constructor -> Converter
- data Constructor
Documentation
convert :: Text -> BaseCodeGen e Converter -> BaseCodeGen e Text Source #
genConversion :: Text -> Converter -> CodeGen Text Source #
unpackCArray :: Text -> Type -> Transfer -> ExcCodeGen Converter Source #
computeArrayLength :: Text -> Type -> ExcCodeGen Text Source #
callableHasClosures :: Callable -> Bool Source #
Whether the callable has closure arguments (i.e. "user_data" style arguments).
isoHaskellType :: Type -> CodeGen TypeRep Source #
Basically like haskellType
, but for types which admit a "isomorphic"
version of the Haskell type distinct from the usual Haskell type.
Generally the Haskell type we expose is isomorphic to the foreign
type, but in some cases, such as callbacks with closure arguments,
this does not hold, as we omit the closure arguments. This function
returns a type which is actually isomorphic.
elementMap :: Type -> Text -> Maybe Text Source #
isManaged :: Type -> CodeGen Bool Source #
Returns whether the given type corresponds to a ManagedPtr
instance (a thin wrapper over a ForeignPtr
).
typeIsNullable :: Type -> CodeGen Bool Source #
Returns whether the given type should be represented by a
Maybe
type on the Haskell side. This applies to all properties
which have a C representation in terms of pointers, except for
G(S)Lists, for which NULL is a valid G(S)List, and raw pointers,
which we just pass through to the Haskell side. Notice that
introspection annotations can override this.
typeIsPtr :: Type -> CodeGen Bool Source #
Returns whether the given type is represented by a pointer on the C side.
maybeNullConvert :: Type -> CodeGen (Maybe Text) Source #
If the passed in type is nullable, return the conversion function
between the FFI pointer type (may be a Ptr
or a FunPtr
) and the
corresponding Maybe
type.
nullPtrForType :: Type -> CodeGen (Maybe Text) Source #
An appropriate NULL value for the given type, for types which are represented by pointers on the C side.
typeAllocInfo :: Type -> CodeGen (Maybe TypeAllocInfo) Source #
Information on how to allocate the given type, if known.
data TypeAllocInfo Source #
Information on how to allocate a type.
TypeAllocInfo | |
|
apply :: Constructor -> Converter Source #
mapC :: Constructor -> Converter Source #
literal :: Constructor -> Converter Source #
data Constructor Source #