Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- data InlineConfig
- data CaseBinderInlineOption
- getUnfoldingT :: (ReadBindings c, MonadCatch m) => InlineConfig -> Transform c m Id (CoreExpr, BindingDepth -> Bool)
- ensureBoundT :: (Monad m, ReadBindings c) => Transform c m CoreExpr ()
- inlineR :: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb, MonadCatch m) => Rewrite c m CoreExpr
- inlineNameR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => String -> Rewrite c m CoreExpr
- inlineNamesR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => [String] -> Rewrite c m CoreExpr
- inlineMatchingPredR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => (Id -> Bool) -> Rewrite c m CoreExpr
- inlineCaseScrutineeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => Rewrite c m CoreExpr
- inlineCaseAlternativeR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => Rewrite c m CoreExpr
- configurableInlineR :: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb, MonadCatch m) => InlineConfig -> Transform c m Id Bool -> Rewrite c m CoreExpr
- inlineTargetsT :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => Transform c m Core [String]
Inlining
data InlineConfig Source
getUnfoldingT :: (ReadBindings c, MonadCatch m) => InlineConfig -> Transform c m 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 :: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb, MonadCatch m) => Rewrite c m CoreExpr Source
Inline the current variable.
inlineNameR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, ReadBindings c, HasEmptyContext c, MonadCatch m) => String -> Rewrite c m 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, MonadCatch m) => [String] -> Rewrite c m 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, MonadCatch m) => (Id -> Bool) -> Rewrite c m 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, MonadCatch m) => Rewrite c m 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, MonadCatch m) => Rewrite c m CoreExpr Source
Inline the current identifier if is a case binder, using the case-alternative pattern rather than the scrutinee.
:: (AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb, MonadCatch m) | |
=> InlineConfig | |
-> Transform c m Id Bool | Only inline identifiers that satisfy this predicate. |
-> Rewrite c m 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, MonadCatch m) => Transform c m Core [String] Source
Get list of possible inline targets. Used by shell for completion.