hermit-0.5.0.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone
LanguageHaskell2010

HERMIT.Monad

Contents

Synopsis

The HERMIT Monad

runHM :: (ModGuts, HermitMEnv) -> DefStash -> (DefStash -> a -> CoreM b) -> (String -> CoreM b) -> HermitM a -> CoreM b Source

Eliminator for HermitM.

liftCoreM :: CoreM a -> HermitM a Source

CoreM can be lifted to 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.

newVarH :: String -> KindOrType -> HermitM Var Source

Experimental, use at your own risk.

cloneVarH :: (String -> String) -> Var -> HermitM Var Source

Make a new variable of the same type, with a modified textual name.

Saving Definitions

type Label = String Source

A label for individual definitions.

type DefStash = Map Label CoreDef Source

A store of saved definitions.

saveDef :: Label -> CoreDef -> HermitM () Source

Save a definition for future use.

lookupDef :: Label -> HermitM CoreDef Source

Lookup a previously saved definition.

getStash :: HermitM DefStash Source

Get the stash of saved definitions.

Reader Information

class HasHermitMEnv m where Source

Methods

getHermitMEnv :: m HermitMEnv Source

Get the HermitMEnv

class HasModGuts m where Source

Methods

getModGuts :: m ModGuts Source

Get the ModGuts (Note: this is a snapshot of the ModGuts from before the current transformation.)

Instances

class HasHscEnv m where Source

Methods

getHscEnv :: m HscEnv Source

Messages

newtype HermitMEnv Source

A way of sending messages to top level

Constructors

HermitMEnv 

data DebugMessage Source

A message packet.