Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generic components
Synopsis
- loadFunWithConfig :: Config -> [Name] -> Q [Dec]
- loadFunType :: Name -> Q Type
- data Config = Config {}
- defaultConfig :: Config
- defaultBuilder :: Config -> Name -> Q Body
- data CallConv = CallConv {}
- buildType :: CallConv -> Type -> Q Type
- applyTF :: Name -> Type -> Q Type
- expandTF :: Type -> Q Type
- pack :: (Reference (Rep a), Marshal a) => a -> IO (Ref (Rep a))
- unpack :: (Reference (Rep a), Marshal a) => Ref (Rep a) -> IO a
- class Reference a where
- class Marshal a where
Loading
Configuration
Configuration parameters for the function loader
Calling Convention
The Calling Convention specifies how a type should be converted
buildType :: CallConv -> Type -> Q Type Source #
Convert a type using the supplied calling convention
Marshaling
pack :: (Reference (Rep a), Marshal a) => a -> IO (Ref (Rep a)) Source #
Pack a value into its runtime representation
pack a = to a >>= ref
unpack :: (Reference (Rep a), Marshal a) => Ref (Rep a) -> IO a Source #
Unpack a value from its runtime representation
unpack a = deref a >>= from
class Reference a where Source #
Optionally make a refrence of a value
Nothing
ref :: a -> IO (Ref a) Source #
Convert to a referenced value
ref :: a ~ Ref a => a -> IO (Ref a) Source #
Convert to a referenced value
deref :: Ref a -> IO a Source #
Convert from a referenced value
In the IO monad to allow peek
ing through the reference.
deref :: a ~ Ref a => Ref a -> IO a Source #
Convert from a referenced value
In the IO monad to allow peek
ing through the reference.
class Marshal a where Source #
Convert between Haskell and representation types
Nothing
to :: a -> IO (Rep a) Source #
to :: a ~ Rep a => a -> IO (Rep a) Source #