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

Safe HaskellNone
LanguageHaskell2010

HERMIT.Dictionary.GHC

Contents

Synopsis

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.

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.

substCoreAlt :: Var -> CoreExpr -> CoreAlt -> CoreAlt Source

Substitute all occurrences of a variable with an expression, in a case alternative.

substCoreExpr :: Var -> CoreExpr -> CoreExpr -> CoreExpr Source

Substitute all occurrences of a variable with an expression, in an expression.

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.

occurAnalyseR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m) => Rewrite c m Core Source

Apply occurAnalyseExprR to all sub-expressions.

occurAnalyseChangedR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m) => Rewrite c m Core 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) => Rewrite c m Core 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, HasHscEnv m, MonadIO m) => Id -> m (Id, [CoreBind]) Source

Build a dictionary for the given