Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- loadLemmaLibraryT :: HermitName -> Maybe LemmaName -> TransformH x String
- type LemmaLibrary = TransformH () Lemmas
- injectDependencyT :: (LiftCoreM m, MonadIO m) => ModuleName -> Transform c m ModGuts ()
- substR :: MonadCatch m => Var -> CoreExpr -> Rewrite c m Core
- dynFlagsT :: HasDynFlags m => Transform c m a DynFlags
- arityOf :: ReadBindings c => c -> Id -> Int
- lintExprT :: (BoundVars c, Monad m, HasDynFlags m) => Transform c m CoreExpr String
- lintModuleT :: TransformH ModGuts String
- lintClauseT :: forall c m. (AddBindings c, BoundVars c, ExtendPath c Crumb, HasEmptyContext c, LemmaContext c, ReadPath c Crumb, HasDynFlags m, MonadCatch m) => Transform c m Clause String
- occurAnalyseR :: (Injection CoreExpr u, Walker c u, MonadCatch m) => Rewrite c m u
- occurAnalyseChangedR :: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, LemmaContext c, ReadPath c Crumb, MonadCatch m) => Rewrite c m LCore
- occurAnalyseExprChangedR :: MonadCatch m => Rewrite c m CoreExpr
- occurAnalyseAndDezombifyR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m, Walker c u, Injection CoreExpr u) => Rewrite c m u
- dezombifyR :: (ExtendPath c Crumb, Monad m) => Rewrite c m CoreExpr
- buildDictionary :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Id -> m (Id, [CoreBind])
- buildDictionaryT :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadCatch m, MonadIO m, MonadUnique m) => Transform c m Type CoreExpr
- buildTypeable :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Type -> m (Id, [CoreBind])
GHC-based Transformations
This module contains transformations that are reflections of GHC functions, or derived from GHC functions.
externals :: [External] Source
Externals that reflect GHC functions, or are derived from GHC functions.
Dynamic Loading
loadLemmaLibraryT :: HermitName -> Maybe LemmaName -> TransformH x String Source
type LemmaLibrary = TransformH () Lemmas Source
A LemmaLibrary is a transformation that produces a set of lemmas, which are then added to the lemma store. It is not allowed to insert its own lemmas directly (if it tries they are throw away), but can certainly read the existing store.
injectDependencyT :: (LiftCoreM m, MonadIO m) => ModuleName -> Transform c m ModGuts () Source
Substitution
substR :: MonadCatch m => Var -> CoreExpr -> Rewrite c m Core Source
Substitute all occurrences of a variable with an expression, in either a program, an expression, or a case alternative.
Utilities
dynFlagsT :: HasDynFlags m => Transform c m a DynFlags Source
Lifted version of getDynFlags
.
arityOf :: ReadBindings c => c -> Id -> Int Source
Try to figure out the arity of an identifier.
Lifted GHC capabilities
lintExprT :: (BoundVars c, Monad m, HasDynFlags m) => Transform c m CoreExpr String Source
Note: this can miss several things that a whole-module core lint will find. For instance, running this on the RHS of a binding, the type of the RHS will not be checked against the type of the binding. Running on the whole let expression will catch that however.
lintModuleT :: TransformH ModGuts String Source
Run the Core Lint typechecker. Fails on errors, with error messages. Succeeds returning warnings.
lintClauseT :: forall c m. (AddBindings c, BoundVars c, ExtendPath c Crumb, HasEmptyContext c, LemmaContext c, ReadPath c Crumb, HasDynFlags m, MonadCatch m) => Transform c m Clause String Source
occurAnalyseR :: (Injection CoreExpr u, Walker c u, MonadCatch m) => Rewrite c m u Source
Apply occurAnalyseExprR
to all sub-expressions.
occurAnalyseChangedR :: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, LemmaContext c, ReadPath c Crumb, MonadCatch m) => Rewrite c m LCore Source
Occurrence analyse all sub-expressions, failing if the result is syntactically equal to the initial expression.
occurAnalyseExprChangedR :: MonadCatch m => Rewrite c m CoreExpr Source
Occurrence analyse an expression, failing if the result is syntactically equal to the initial expression.
occurAnalyseAndDezombifyR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m, Walker c u, Injection CoreExpr u) => Rewrite c m u Source
Run GHC's occurrence analyser, and also eliminate any zombies.
dezombifyR :: (ExtendPath c Crumb, Monad m) => Rewrite c m CoreExpr Source
Zap the OccInfo
in a zombie identifier.
buildDictionary :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Id -> m (Id, [CoreBind]) Source
Build a dictionary for the given
buildDictionaryT :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadCatch m, MonadIO m, MonadUnique m) => Transform c m Type CoreExpr Source
buildTypeable :: (HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadIO m) => Type -> m (Id, [CoreBind]) Source