Safe Haskell | None |
---|---|
Language | Haskell98 |
- 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 #
MonadTrans ModuleBuilderT Source # | |
MonadWriter w m => MonadWriter w (ModuleBuilderT m) Source # | |
MonadState s m => MonadState s (ModuleBuilderT m) Source # | |
MonadReader r m => MonadReader r (ModuleBuilderT m) Source # | |
MonadError e m => MonadError e (ModuleBuilderT m) Source # | |
Monad m => Monad (ModuleBuilderT m) Source # | |
Functor m => Functor (ModuleBuilderT m) Source # | |
MonadFix m => MonadFix (ModuleBuilderT m) Source # | |
MonadFail m => MonadFail (ModuleBuilderT m) Source # | |
Monad m => Applicative (ModuleBuilderT m) Source # | |
MonadPlus m => Alternative (ModuleBuilderT m) Source # | |
MonadPlus m => MonadPlus (ModuleBuilderT m) Source # | |
MonadIO m => MonadIO (ModuleBuilderT m) Source # | |
MonadCont m => MonadCont (ModuleBuilderT m) Source # | |
Monad m => MonadModuleBuilder (ModuleBuilderT m) Source # | |
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 #
MonadModuleBuilder m => MonadModuleBuilder (ListT m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (MaybeT m) Source # | |
Monad m => MonadModuleBuilder (ModuleBuilderT m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (IdentityT * m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (ExceptT e m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (StateT s m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (StateT s m) Source # | |
(Monoid w, MonadModuleBuilder m) => MonadModuleBuilder (WriterT w m) Source # | |
(Monoid w, MonadModuleBuilder m) => MonadModuleBuilder (WriterT w m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (ContT * r m) Source # | |
MonadModuleBuilder m => MonadModuleBuilder (ReaderT * r m) Source # | |
(MonadModuleBuilder m, Monoid w) => MonadModuleBuilder (RWST r w s m) Source # | |
(MonadModuleBuilder m, Monoid w) => MonadModuleBuilder (RWST r w s m) Source # | |
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
Eq ParameterName Source # | |
Data ParameterName Source # | |
Ord ParameterName Source # | |
Read ParameterName Source # | |
Show ParameterName Source # | |
IsString ParameterName Source # | Using |
Generic ParameterName Source # | |
type Rep ParameterName Source # | |
:: 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] | Parametere 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)