hermit-0.7.1.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.

Dynamic Loading

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.

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.

occurAnalyseR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m, Walker c u, Injection CoreExpr u) => Rewrite c m u Source

Apply occurAnalyseExprR to all sub-expressions.

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

Build a dictionary for the given