Safe Haskell | None |
---|
- externals :: [External]
- data InlineConfig
- data CaseBinderInlineOption
- = Scrutinee
- | Alternative
- getUnfoldingT :: ReadBindings c => InlineConfig -> Translate c HermitM Id (CoreExpr, BindingDepth -> Bool)
- inlineR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- inlineNameR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Name -> Rewrite c HermitM CoreExpr
- inlineNamesR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => [Name] -> Rewrite c HermitM CoreExpr
- inlineCaseScrutineeR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- inlineCaseAlternativeR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- configurableInlineR :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => InlineConfig -> Translate c HermitM Id Bool -> Rewrite c HermitM CoreExpr
- inlineTargetsT :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Translate c HermitM Core [String]
Inlining
data InlineConfig Source
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.
:: (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.