2 Shoving away gross stuff into this one module.
6 import Control.Monad.Trans.State
7 import Data.Functor.Identity
9 import LLVM.IRBuilder.Module
10 import LLVM.IRBuilder.Internal.SnocList
12 mostRecentDef :: Monad m => ModuleBuilderT m Definition
13 mostRecentDef = last . getSnocList . builderDefs <$> liftModuleState get
15 hoist :: Monad m => ModuleBuilder a -> ModuleBuilderT m a
16 hoist m = ModuleBuilderT $ StateT $
17 return . runIdentity . runStateT (unModuleBuilderT m)