Safe Haskell | None |
---|
- externals :: [External]
- fixIntroR :: RewriteH CoreDef
- fixComputationRuleBR :: BiRewriteH CoreExpr
- fixRollingRuleBR :: BiRewriteH CoreExpr
- fixFusionRuleBR :: Maybe (RewriteH CoreExpr, RewriteH CoreExpr) -> Maybe (RewriteH CoreExpr) -> CoreExpr -> CoreExpr -> CoreExpr -> BiRewriteH CoreExpr
- mkFixT :: (BoundVars c, HasGlobalRdrEnv c, MonadCatch m, HasDynFlags m, MonadThings m) => CoreExpr -> Translate c m z CoreExpr
- isFixExprT :: TranslateH CoreExpr (Type, CoreExpr)
Operations on the Fixed Point Operator (fix)
Note that many of these operations require fix
to be explicitly imported, if it is not used in the source file.
Rewrites and BiRewrites on Fixed Points
fixComputationRuleBR :: BiRewriteH CoreExprSource
fix ty f
<==> f (fix ty f)
fixRollingRuleBR :: BiRewriteH CoreExprSource
fix tyA (\ a -> f (g a))
<==> f (fix tyB (\ b -> g (f b))
fixFusionRuleBR :: Maybe (RewriteH CoreExpr, RewriteH CoreExpr) -> Maybe (RewriteH CoreExpr) -> CoreExpr -> CoreExpr -> CoreExpr -> BiRewriteH CoreExprSource
If f
is strict, then (f (g a)
== h (f a)
) ==> (f (fix g)
== fix h
)
Utilities
mkFixT :: (BoundVars c, HasGlobalRdrEnv c, MonadCatch m, HasDynFlags m, MonadThings m) => CoreExpr -> Translate c m z CoreExprSource
f ==> fix f
isFixExprT :: TranslateH CoreExpr (Type, CoreExpr)Source
Check that the expression has the form fix t (f :: t -> t), returning t and f.