Safe Haskell | None |
---|---|
Language | Haskell98 |
Common simplifier recipes that combine multiple transforms.
- idsimp :: Simplifier s a n
- anonymize :: Simplifier s a n
- beta :: Simplifier s a n
- betaLets :: Simplifier s a n
- bubble :: Simplifier s a n
- elaborate :: Simplifier s a n
- flatten :: Simplifier s a n
- forward :: Simplifier s a n
- lambdas :: Simplifier s a n
- snip :: Simplifier s a n
- snipOver :: Simplifier s a n
- prune :: Simplifier s a n
- anormalize :: (KindEnv n -> Namifier s n) -> (TypeEnv n -> Namifier s n) -> Simplifier s a n
- rewriteSimp :: Int -> NamedRewriteRules a n -> Simplifier s a n
Atomic recipies
idsimp :: Simplifier s a n Source
The identity simplifier returns the code unharmed.
anonymize :: Simplifier s a n Source
Rewrite named binders to anonymous debruijn binders.
beta :: Simplifier s a n Source
Perform beta reduction
betaLets :: Simplifier s a n Source
Perform beta reduction, introducing let-expressions for compound arguments.
bubble :: Simplifier s a n Source
Float casts outwards.
elaborate :: Simplifier s a n Source
Elaborate possible Const and Distinct witnesses that aren't otherwise in the program.
flatten :: Simplifier s a n Source
Flatten nested let and case expressions.
forward :: Simplifier s a n Source
Float single-use bindings forward into their use sites.
lambdas :: Simplifier s a n Source
Lift out nested lambda expressions to top-level.
snip :: Simplifier s a n Source
Introduce let-bindings for nested applications.
snipOver :: Simplifier s a n Source
Introduce let-bindings for nested applications.
prune :: Simplifier s a n Source
Remove unused, pure let bindings.
Compound recipies
:: (KindEnv n -> Namifier s n) | Make a namifier to create fresh level-1 names. |
-> (TypeEnv n -> Namifier s n) | Make a namifier to create fresh level-0 names. |
-> Simplifier s a n |
Conversion to administrative normal-form.
:: Int | Maximum number of iterations. |
-> NamedRewriteRules a n | Rewrite rules to apply. |
-> Simplifier s a n |
Intersperse rewrites and beta reduction