Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data HermitM a
- runHM :: (ModGuts, HermitMEnv) -> DefStash -> (DefStash -> a -> CoreM b) -> (String -> CoreM b) -> HermitM a -> CoreM b
- liftCoreM :: CoreM a -> HermitM a
- newGlobalIdH :: String -> Type -> HermitM Id
- newIdH :: String -> Type -> HermitM Id
- newTyVarH :: String -> Kind -> HermitM TyVar
- newCoVarH :: String -> Type -> HermitM TyVar
- newVarH :: String -> KindOrType -> HermitM Var
- cloneVarH :: (String -> String) -> Var -> HermitM Var
- type Label = String
- type DefStash = Map Label CoreDef
- saveDef :: Label -> CoreDef -> HermitM ()
- lookupDef :: Label -> HermitM CoreDef
- getStash :: HermitM DefStash
- class HasHermitMEnv m where
- getHermitMEnv :: m HermitMEnv
- class HasModGuts m where
- getModGuts :: m ModGuts
- class HasHscEnv m where
- newtype HermitMEnv = HermitMEnv {
- hs_debugChan :: DebugMessage -> HermitM ()
- data DebugMessage
- mkHermitMEnv :: (DebugMessage -> HermitM ()) -> HermitMEnv
- sendDebugMessage :: DebugMessage -> HermitM ()
The HERMIT Monad
The HERMIT monad is kept abstract.
runHM :: (ModGuts, HermitMEnv) -> DefStash -> (DefStash -> a -> CoreM b) -> (String -> CoreM b) -> HermitM a -> CoreM b Source
Eliminator for HermitM
.
newGlobalIdH :: String -> Type -> HermitM Id Source
Make a unique global identifier for a specified type, using a provided name.
newIdH :: String -> Type -> HermitM Id Source
Make a unique identifier for a specified type, using a provided name.
newTyVarH :: String -> Kind -> HermitM TyVar Source
Make a unique type variable for a specified kind, using a provided name.
newCoVarH :: String -> Type -> HermitM TyVar Source
Make a unique coercion variable for a specified type, using a provided name.
cloneVarH :: (String -> String) -> Var -> HermitM Var Source
Make a new variable of the same type, with a modified textual name.
Saving Definitions
Reader Information
class HasHermitMEnv m where Source
getHermitMEnv :: m HermitMEnv Source
Get the HermitMEnv
class HasModGuts m where Source
getModGuts :: m ModGuts Source
Get the ModGuts (Note: this is a snapshot of the ModGuts from before the current transformation.)
Messages
newtype HermitMEnv Source
A way of sending messages to top level
HermitMEnv | |
|
mkHermitMEnv :: (DebugMessage -> HermitM ()) -> HermitMEnv Source
sendDebugMessage :: DebugMessage -> HermitM () Source