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

Safe HaskellSafe-Infered

Language.HERMIT.Primitive.Unfold

Synopsis

Documentation

stashDef :: String -> RewriteH CoreSource

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

stashApply :: String -> RewriteH CoreExprSource

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

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

getUnfoldingSource

Arguments

:: Monad m 
=> Bool

Get the scrutinee instead of the patten match (for case binders).

-> Bool

Only succeed if this variable is a case binder.

-> Id 
-> Context 
-> m (CoreExpr, Int)