Safe Haskell | None |
---|---|
Language | Haskell2010 |
- externals :: [External]
- fixIntroR :: RewriteH CoreDef
- fixComputationRuleBR :: BiRewriteH CoreExpr
- fixRollingRuleBR :: BiRewriteH CoreExpr
- fixFusionRuleBR :: Maybe (CoreExprEqualityProof HermitC HermitM) -> Maybe (RewriteH CoreExpr) -> CoreExpr -> CoreExpr -> CoreExpr -> BiRewriteH CoreExpr
- mkFixT :: (BoundVars c, MonadCatch m, HasModGuts m, HasDynFlags m, HasHscEnv m, MonadIO m, MonadThings m) => CoreExpr -> Transform c m z CoreExpr
- isFixExprT :: TransformH 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 CoreExpr Source
fix ty f
<==> f (fix ty f)
fixRollingRuleBR :: BiRewriteH CoreExpr Source
fix tyA (\ a -> f (g a))
<==> f (fix tyB (\ b -> g (f b))
fixFusionRuleBR :: Maybe (CoreExprEqualityProof HermitC HermitM) -> Maybe (RewriteH CoreExpr) -> CoreExpr -> CoreExpr -> CoreExpr -> BiRewriteH CoreExpr Source
If f
is strict, then (f (g a)
== h (f a)
) ==> (f (fix g)
== fix h
)
Utilities
mkFixT :: (BoundVars c, MonadCatch m, HasModGuts m, HasDynFlags m, HasHscEnv m, MonadIO m, MonadThings m) => CoreExpr -> Transform c m z CoreExpr Source
f ==> fix f
isFixExprT :: TransformH CoreExpr (Type, CoreExpr) Source
Check that the expression has the form "fix t (f :: t -> t)", returning "t" and "f".