Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- module HERMIT.Dictionary.Local.Bind
- module HERMIT.Dictionary.Local.Case
- module HERMIT.Dictionary.Local.Cast
- module HERMIT.Dictionary.Local.Let
- abstractR :: ReadBindings c => String -> Rewrite c HermitM CoreExpr
- pushR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c) => Maybe (Rewrite c HermitM CoreExpr) -> (Id -> Bool) -> Rewrite c HermitM CoreExpr
- betaReduceR :: MonadCatch m => Rewrite c m CoreExpr
- betaReducePlusR :: MonadCatch m => Rewrite c m CoreExpr
- betaExpandR :: MonadCatch m => Rewrite c m CoreExpr
- etaReduceR :: MonadCatch m => Rewrite c m CoreExpr
- etaExpandR :: String -> Rewrite c HermitM CoreExpr
- multiEtaExpandR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c) => [String] -> Rewrite c HermitM CoreExpr
- flattenModuleR :: (ExtendPath c Crumb, HasEmptyContext c, Monad m) => Rewrite c m ModGuts
- flattenProgramR :: Monad m => Rewrite c m CoreProg
- flattenProgramT :: Monad m => Transform c m CoreProg CoreBind
Local Structural Manipulations
externals :: [External] Source
Externals for local structural manipulations. (Many taken from Chapter 3 of Andre Santos' dissertation.)
Binding Groups
module HERMIT.Dictionary.Local.Bind
Case Expressions
module HERMIT.Dictionary.Local.Case
Cast Expressions
module HERMIT.Dictionary.Local.Cast
Let Expressions
module HERMIT.Dictionary.Local.Let
Miscellaneous
abstractR :: ReadBindings c => String -> Rewrite c HermitM CoreExpr Source
Abstract over a variable using a lambda. e ==> ( x. e) x
:: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c) | |
=> Maybe (Rewrite c HermitM CoreExpr) | a proof that the function (after being applied to its type arguments) is strict |
-> (Id -> Bool) | a predicate to identify the function |
-> Rewrite c HermitM CoreExpr |
Push a function through a Case or Let expression. Unsafe if the function is not strict.
betaReduceR :: MonadCatch m => Rewrite c m CoreExpr Source
((\ 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).
betaReducePlusR :: MonadCatch m => Rewrite c m CoreExpr Source
Perform one or more beta-reductions.
betaExpandR :: MonadCatch m => Rewrite c m CoreExpr Source
(let v = e1 in e2) ==> (\ v -> e2) e1
etaReduceR :: MonadCatch m => Rewrite c m CoreExpr Source
(\ v -> f v) ==> f
multiEtaExpandR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c) => [String] -> Rewrite c HermitM CoreExpr Source
Perform multiple eta-expansions.
flattenModuleR :: (ExtendPath c Crumb, HasEmptyContext c, Monad m) => Rewrite c m ModGuts Source
Flatten all the top-level binding groups in the module to a single recursive binding group.
flattenProgramR :: Monad m => Rewrite c m CoreProg Source
Flatten all the top-level binding groups in a program to a program containing a single recursive binding group.