Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- substR :: MonadCatch m => Var -> CoreExpr -> Rewrite c m Core
- substCoreAlt :: Var -> CoreExpr -> CoreAlt -> CoreAlt
- substCoreExpr :: Var -> CoreExpr -> CoreExpr -> CoreExpr
- 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
- occurAnalyseR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m) => Rewrite c m Core
- occurAnalyseChangedR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m) => Rewrite c m Core
- occurAnalyseExprChangedR :: MonadCatch m => Rewrite c m CoreExpr
- occurAnalyseAndDezombifyR :: (AddBindings c, ExtendPath c Crumb, ReadPath c Crumb, HasEmptyContext c, MonadCatch m) => Rewrite c m Core
- dezombifyR :: (ExtendPath c Crumb, Monad m) => Rewrite c m CoreExpr
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.