llvm-hs-pure-6.0.0: Pure Haskell LLVM functionality (no FFI).

Safe HaskellNone
LanguageHaskell98

LLVM.IRBuilder.Module

Synopsis

Documentation

newtype ModuleBuilderT m a Source #

Instances

MonadTrans ModuleBuilderT Source # 

Methods

lift :: Monad m => m a -> ModuleBuilderT m a #

MonadWriter w m => MonadWriter w (ModuleBuilderT m) Source # 

Methods

writer :: (a, w) -> ModuleBuilderT m a #

tell :: w -> ModuleBuilderT m () #

listen :: ModuleBuilderT m a -> ModuleBuilderT m (a, w) #

pass :: ModuleBuilderT m (a, w -> w) -> ModuleBuilderT m a #

MonadState s m => MonadState s (ModuleBuilderT m) Source # 

Methods

get :: ModuleBuilderT m s #

put :: s -> ModuleBuilderT m () #

state :: (s -> (a, s)) -> ModuleBuilderT m a #

MonadReader r m => MonadReader r (ModuleBuilderT m) Source # 

Methods

ask :: ModuleBuilderT m r #

local :: (r -> r) -> ModuleBuilderT m a -> ModuleBuilderT m a #

reader :: (r -> a) -> ModuleBuilderT m a #

MonadError e m => MonadError e (ModuleBuilderT m) Source # 

Methods

throwError :: e -> ModuleBuilderT m a #

catchError :: ModuleBuilderT m a -> (e -> ModuleBuilderT m a) -> ModuleBuilderT m a #

Monad m => Monad (ModuleBuilderT m) Source # 
Functor m => Functor (ModuleBuilderT m) Source # 

Methods

fmap :: (a -> b) -> ModuleBuilderT m a -> ModuleBuilderT m b #

(<$) :: a -> ModuleBuilderT m b -> ModuleBuilderT m a #

MonadFix m => MonadFix (ModuleBuilderT m) Source # 

Methods

mfix :: (a -> ModuleBuilderT m a) -> ModuleBuilderT m a #

MonadFail m => MonadFail (ModuleBuilderT m) Source # 

Methods

fail :: String -> ModuleBuilderT m a #

Monad m => Applicative (ModuleBuilderT m) Source # 

Methods

pure :: a -> ModuleBuilderT m a #

(<*>) :: ModuleBuilderT m (a -> b) -> ModuleBuilderT m a -> ModuleBuilderT m b #

liftA2 :: (a -> b -> c) -> ModuleBuilderT m a -> ModuleBuilderT m b -> ModuleBuilderT m c #

(*>) :: ModuleBuilderT m a -> ModuleBuilderT m b -> ModuleBuilderT m b #

(<*) :: ModuleBuilderT m a -> ModuleBuilderT m b -> ModuleBuilderT m a #

MonadPlus m => Alternative (ModuleBuilderT m) Source # 
MonadPlus m => MonadPlus (ModuleBuilderT m) Source # 
MonadIO m => MonadIO (ModuleBuilderT m) Source # 

Methods

liftIO :: IO a -> ModuleBuilderT m a #

MonadCont m => MonadCont (ModuleBuilderT m) Source # 

Methods

callCC :: ((a -> ModuleBuilderT m b) -> ModuleBuilderT m a) -> ModuleBuilderT m a #

Monad m => MonadModuleBuilder (ModuleBuilderT m) Source # 

class Monad m => MonadModuleBuilder m where Source #

Instances

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

data ParameterName Source #

A parameter name suggestion

Instances

Eq ParameterName Source # 
Data ParameterName Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParameterName -> c ParameterName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ParameterName #

toConstr :: ParameterName -> Constr #

dataTypeOf :: ParameterName -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ParameterName) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ParameterName) #

gmapT :: (forall b. Data b => b -> b) -> ParameterName -> ParameterName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParameterName -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParameterName -> r #

gmapQ :: (forall d. Data d => d -> u) -> ParameterName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ParameterName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParameterName -> m ParameterName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParameterName -> m ParameterName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParameterName -> m ParameterName #

Ord ParameterName Source # 
Read ParameterName Source # 
Show ParameterName Source # 
IsString ParameterName Source #

Using fromString on non-ASCII strings will throw an error.

Generic ParameterName Source # 

Associated Types

type Rep ParameterName :: * -> * #

type Rep ParameterName Source # 
type Rep ParameterName = D1 * (MetaData "ParameterName" "LLVM.IRBuilder.Module" "llvm-hs-pure-6.0.0-AdKIl6KhlcO5ZIYucKCvA1" False) ((:+:) * (C1 * (MetaCons "NoParameterName" PrefixI False) (U1 *)) (C1 * (MetaCons "ParameterName" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ShortByteString))))

function Source #

Arguments

:: 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

extern Source #

Arguments

:: MonadModuleBuilder m 
=> Name

Definition name

-> [Type]

Parametere types

-> Type

Type

-> m Operand 

An external function definition

typedef :: MonadModuleBuilder m => Name -> Maybe Type -> m () Source #

A named type 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)