Safe Haskell | None |
---|
- externals :: [External]
- module Language.HERMIT.Primitive.Local.Case
- module Language.HERMIT.Primitive.Local.Cast
- module Language.HERMIT.Primitive.Local.Let
- abstract :: (ReadBindings c, MonadCatch m) => Name -> Rewrite c m CoreExpr
- nonrecToRec :: MonadCatch m => Rewrite c m CoreBind
- betaReduce :: MonadCatch m => Rewrite c m CoreExpr
- betaReducePlus :: MonadCatch m => Rewrite c m CoreExpr
- betaExpand :: MonadCatch m => Rewrite c m CoreExpr
- etaReduce :: MonadCatch m => Rewrite c m CoreExpr
- etaExpand :: String -> Rewrite c HermitM CoreExpr
- multiEtaExpand :: (ExtendPath c Crumb, AddBindings c) => [String] -> Rewrite c HermitM CoreExpr
- flattenModule :: (ExtendPath c Crumb, Monad m) => Rewrite c m ModGuts
- flattenProgramR :: Monad m => Rewrite c m CoreProg
- flattenProgramT :: Monad m => Translate c m CoreProg CoreBind
Local Structural Manipulations
Externals for local structural manipulations. (Many taken from Chapter 3 of Andre Santos' dissertation.)
Case Expressions
Cast Expressions
Let Expressions
Miscellaneous
abstract :: (ReadBindings c, MonadCatch m) => Name -> Rewrite c m CoreExprSource
Abstract over a variable using a lambda. e ==> ( x. e) x
nonrecToRec :: MonadCatch m => Rewrite c m CoreBindSource
NonRec v e ==> Rec [Def v e]
betaReduce :: MonadCatch m => Rewrite c m 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 :: MonadCatch m => Rewrite c m CoreExprSource
Perform one or more beta-reductions.
betaExpand :: MonadCatch m => Rewrite c m CoreExprSource
(let v = e1 in e2) ==> (\ v -> e2) e1
etaReduce :: MonadCatch m => Rewrite c m CoreExprSource
(\ v -> e1 v) ==> e1
multiEtaExpand :: (ExtendPath c Crumb, AddBindings c) => [String] -> Rewrite c HermitM CoreExprSource
Perform multiple eta-expansions.
flattenModule :: (ExtendPath c Crumb, Monad m) => Rewrite c m ModGutsSource
Flatten all the top-level binding groups in the module to a single recursive binding group.
flattenProgramR :: Monad m => Rewrite c m CoreProgSource
Flatten all the top-level binding groups in a program to a program containing a single recursive binding group.