Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype ModuleBuilderT m a = ModuleBuilderT {}
- newtype ModuleBuilderState = ModuleBuilderState {}
- emptyModuleBuilder :: ModuleBuilderState
- type ModuleBuilder = ModuleBuilderT Identity
- class Monad m => MonadModuleBuilder m where
- runModuleBuilder :: ModuleBuilderState -> ModuleBuilder a -> (a, [Definition])
- runModuleBuilderT :: Monad m => ModuleBuilderState -> ModuleBuilderT m a -> m (a, [Definition])
- execModuleBuilder :: ModuleBuilderState -> ModuleBuilder a -> [Definition]
- execModuleBuilderT :: Monad m => ModuleBuilderState -> ModuleBuilderT m a -> m [Definition]
- emitDefn :: MonadModuleBuilder m => Definition -> m ()
- data ParameterName
- function :: MonadModuleBuilder m => Name -> [(Type, ParameterName)] -> Type -> ([Operand] -> IRBuilderT m ()) -> m Operand
- extern :: MonadModuleBuilder m => Name -> [Type] -> Type -> m Operand
- typedef :: MonadModuleBuilder m => Name -> Maybe Type -> m ()
- buildModule :: ShortByteString -> ModuleBuilder a -> Module
- buildModuleT :: Monad m => ShortByteString -> ModuleBuilderT m a -> m Module
Documentation
newtype ModuleBuilderT m a Source #
Instances
type ModuleBuilder = ModuleBuilderT Identity Source #
class Monad m => MonadModuleBuilder m where Source #
liftModuleState :: State ModuleBuilderState a -> m a Source #
liftModuleState :: (MonadTrans t, MonadModuleBuilder m1, m ~ t m1) => State ModuleBuilderState a -> m a Source #
Instances
runModuleBuilder :: ModuleBuilderState -> ModuleBuilder a -> (a, [Definition]) Source #
Evaluate ModuleBuilder
to a result and a list of definitions
runModuleBuilderT :: Monad m => ModuleBuilderState -> ModuleBuilderT m a -> m (a, [Definition]) Source #
Evaluate ModuleBuilderT
to a result and a list of definitions
execModuleBuilder :: ModuleBuilderState -> ModuleBuilder a -> [Definition] Source #
Evaluate ModuleBuilder
to a list of definitions
execModuleBuilderT :: Monad m => ModuleBuilderState -> ModuleBuilderT m a -> m [Definition] Source #
Evaluate ModuleBuilderT
to a list of definitions
emitDefn :: MonadModuleBuilder m => Definition -> m () Source #
data ParameterName Source #
A parameter name suggestion
Instances
:: MonadModuleBuilder m | |
=> Name | Function name |
-> [(Type, ParameterName)] | Parameter types and name suggestions |
-> Type | Return type |
-> ([Operand] -> IRBuilderT m ()) | Function body builder |
-> m Operand |
Define and emit a (non-variadic) function definition
:: MonadModuleBuilder m | |
=> Name | Definition name |
-> [Type] | Parameter types |
-> Type | Type |
-> m Operand |
An external function definition
buildModule :: ShortByteString -> ModuleBuilder a -> Module Source #
Convenience function for module construction
buildModuleT :: Monad m => ShortByteString -> ModuleBuilderT m a -> m Module Source #
Convenience function for module construction (transformer version)