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

Safe HaskellNone

HERMIT.Dictionary.Inline

Contents

Synopsis

Inlining

externals :: [External]Source

Externals for inlining variables.

getUnfoldingT :: ReadBindings c => InlineConfig -> Translate c HermitM Id (CoreExpr, BindingDepth -> Bool)Source

Return the unfolding of an identifier, and a predicate over the binding depths of all variables within that unfolding to determine if they have been captured in their new location.

inlineR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource

Inline the current variable.

inlineNameR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Name -> Rewrite c HermitM CoreExprSource

If the current variable matches the given name, then inline it.

inlineNamesR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => [Name] -> Rewrite c HermitM CoreExprSource

If the current variable matches any of the given names, then inline it.

inlineCaseScrutineeR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource

Inline the current identifier if it is a case binder, using the scrutinee rather than the case-alternative pattern.

inlineCaseAlternativeR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource

Inline the current identifier if is a case binder, using the case-alternative pattern rather than the scrutinee.

configurableInlineRSource

Arguments

:: (ExtendPath c Crumb, AddBindings c, ReadBindings c) 
=> InlineConfig 
-> Translate c HermitM Id Bool

Only inline identifiers that satisfy this predicate.

-> Rewrite c HermitM CoreExpr 

The implementation of inline, an important transformation. This *only* works if the current expression has the form Var v (it does not traverse the expression). It can trivially be prompted to more general cases using traversal strategies.

inlineTargetsT :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Translate c HermitM Core [String]Source

Get list of possible inline targets. Used by shell for completion.