Safe Haskell | None |
---|
- externals :: [External]
- module Language.HERMIT.Primitive.Local.Let
- module Language.HERMIT.Primitive.Local.Case
- abstract :: Name -> RewriteH CoreExpr
- nonrecToRec :: RewriteH CoreBind
- betaReduce :: RewriteH CoreExpr
- betaReducePlus :: RewriteH CoreExpr
- betaExpand :: RewriteH CoreExpr
- etaReduce :: RewriteH CoreExpr
- etaExpand :: Name -> RewriteH CoreExpr
- multiEtaExpand :: [Name] -> RewriteH CoreExpr
- flattenModule :: RewriteH ModGuts
- flattenProgramR :: RewriteH CoreProg
- flattenProgramT :: TranslateH CoreProg CoreBind
Local Structural Manipulations
Externals for local structural manipulations. (Many taken from Chapter 3 of Andre Santos' dissertation.)
Let Expressions
Case Expressions
Miscellaneous
nonrecToRec :: RewriteH CoreBindSource
NonRec v e ==> Rec [Def v e]
betaReduce :: RewriteH CoreExprSource
((\ v -> e1) e2) ==> (let v = e2 in e1) This form of beta-reduction is safe if e2 is an arbitrary expression (won't duplicate work).
betaReducePlus :: RewriteH CoreExprSource
Perform one or more beta-reductions.
betaExpand :: RewriteH CoreExprSource
(let v = e1 in e2) ==> (\ v -> e2) e1
multiEtaExpand :: [Name] -> RewriteH CoreExprSource
Perform multiple eta-expansions.
flattenModule :: RewriteH ModGutsSource
Flatten all the top-level binding groups in the module to a single recursive binding group.
flattenProgramR :: RewriteH CoreProgSource
Flatten all the top-level binding groups in a program to a program containing a single recursive binding group.
flattenProgramT :: TranslateH CoreProg CoreBindSource
Flatten all the top-level binding groups in a program to a single recursive binding group.