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

Safe HaskellNone

HERMIT.Dictionary.Unfold

Synopsis

Documentation

cleanupUnfoldR :: (AddBindings c, ExtendPath c Crumb, MonadCatch m) => Rewrite c m 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 -> Rewrite c HermitM CoreSource

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

unfoldR :: forall c. (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource

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

unfoldStashR :: ReadBindings c => String -> Rewrite c HermitM CoreExprSource

Stash a binding with a name for later use. Allows us to look at past definitions. rememberR :: String -> Translate c m 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).