Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- data InlineConfig
- data CaseBinderInlineOption
- getUnfoldingT :: ReadBindings c => InlineConfig -> Transform c HermitM Id (CoreExpr, BindingDepth -> Bool)
- ensureBoundT :: (Monad m, ReadBindings c) => Transform c m CoreExpr ()
- inlineR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr
- inlineNameR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => String -> Rewrite c HermitM CoreExpr
- inlineNamesR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => [String] -> Rewrite c HermitM CoreExpr
- inlineMatchingPredR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => (Id -> Bool) -> Rewrite c HermitM CoreExpr
- inlineCaseScrutineeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr
- inlineCaseAlternativeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr
- configurableInlineR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => InlineConfig -> Transform c HermitM Id Bool -> Rewrite c HermitM CoreExpr
- inlineTargetsT :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Transform c HermitM Core [String]
Inlining
data InlineConfig Source
getUnfoldingT :: ReadBindings c => InlineConfig -> Transform 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.
ensureBoundT :: (Monad m, ReadBindings c) => Transform c m CoreExpr () Source
Check that all free variables in an expression are bound. Fails, listing unbound variables if not.
inlineR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr Source
Inline the current variable.
inlineNameR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => String -> Rewrite c HermitM CoreExpr Source
If the current variable matches the given name, then inline it.
inlineNamesR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => [String] -> Rewrite c HermitM CoreExpr Source
If the current variable matches any of the given names, then inline it.
inlineMatchingPredR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => (Id -> Bool) -> Rewrite c HermitM CoreExpr Source
If the current variable satisifies the predicate, then inline it.
inlineCaseScrutineeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr Source
Inline the current identifier if it is a case binder, using the scrutinee rather than the case-alternative pattern.
inlineCaseAlternativeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Rewrite c HermitM CoreExpr Source
Inline the current identifier if is a case binder, using the case-alternative pattern rather than the scrutinee.
:: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) | |
=> InlineConfig | |
-> Transform 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, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c) => Transform c HermitM Core [String] Source
Get list of possible inline targets. Used by shell for completion.