hermit-0.1.8.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone

Language.HERMIT.Primitive.Unfold

Synopsis

Documentation

cleanupUnfoldR :: RewriteH CoreExprSource

cleanupUnfoldR cleans a unfold operation (for example, an inline or rule application) It is used at the level of the top-redex. Invariant: will not introduce let bindings

rememberR :: Label -> RewriteH CoreSource

Stash a binding with a name for later use. Allows us to look at past definitions.

unfoldR :: RewriteH CoreExprSource

A more powerful inline. Matches two cases: Var ==> inlines App ==> inlines the head of the function call for the app tree

unfoldStashR :: String -> RewriteH CoreExprSource

Stash a binding with a name for later use. Allows us to look at past definitions. rememberR :: String -> TranslateH Core () rememberR label = contextfreeT $ core -> case core of DefCore def -> saveDef label def BindCore (NonRec i e) -> saveDef label (Def i e) _ -> fail remember: not a binding

Apply a stashed definition (like inline, but looks in stash instead of context).