Safe Haskell | None |
---|
- externals :: [External]
- letElim :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExpr
- letIntro :: Name -> Rewrite c HermitM CoreExpr
- letFloatApp :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatArg :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatLet :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatLam :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatCase :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatCast :: MonadCatch m => Rewrite c m CoreExpr
- letFloatExpr :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letFloatLetTop :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreProg
- letNonRecElim :: MonadCatch m => Rewrite c m CoreExpr
- letRecElim :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExpr
- letToCase :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExpr
- letUnfloat :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExpr
- letUnfloatApp :: MonadCatch m => Rewrite c m CoreExpr
- letUnfloatCase :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExpr
- letUnfloatLam :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExpr
- reorderNonRecLets :: MonadCatch m => [Name] -> Rewrite c m CoreExpr
Rewrites on Let Expressions
letElim :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExprSource
letFloatApp :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
(let v = ev in e) x
==> let v = ev in e x
letFloatArg :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
f (let v = ev in e)
==> let v = ev in f e
letFloatLet :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
let v = (let w = ew in ev) in e
==> let w = ew in let v = ev in e
letFloatLam :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
( v1 -> let v2 = e1 in e2)
==> let v2 = e1 in ( v1 -> e2)
Fails if v1
occurs in e1
.
If v1
= v2
then v1
will be alpha-renamed.
letFloatCase :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
case (let bnds in e) of wild alts
==> let bnds in (case e of wild alts)
Fails if any variables bound in bnds
occurs in alts
.
letFloatCast :: MonadCatch m => Rewrite c m CoreExprSource
cast (let bnds in e) co
==> let bnds in cast e co
letFloatExpr :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
Float a Let
through an expression, whatever the context.
letFloatLetTop :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreProgSource
ProgCons (NonRec v (Let (NonRec w ew) ev)) p
==> ProgCons (NonRec w ew) (ProgCons (NonRec v ev) p)
letNonRecElim :: MonadCatch m => Rewrite c m CoreExprSource
Remove an unused non-recursive let binding.
let v = E1 in E2
==> E2
, if v
is not free in E2
letRecElim :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExprSource
Remove all unused recursive let bindings in the current group.
letToCase :: (ExtendPath c Crumb, AddBindings c, ReadBindings c) => Rewrite c HermitM CoreExprSource
let v = ev in e
==> case ev of v -> e
letUnfloat :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExprSource
Unfloat a Let
if possible.
letUnfloatApp :: MonadCatch m => Rewrite c m CoreExprSource
let v = ev in f a
==> (let v = ev in f) (let v = ev in a)
letUnfloatCase :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExprSource
let v = ev in case s of p -> e
==> case (let v = ev in s) of p -> let v = ev in e
,
if v
does not shadow a pattern binder in p
letUnfloatLam :: (ExtendPath c Crumb, AddBindings c, MonadCatch m) => Rewrite c m CoreExprSource
let v = ev in x -> e
==> x -> let v = ev in e
if v
does not shadow x
reorderNonRecLets :: MonadCatch m => [Name] -> Rewrite c m CoreExprSource
Re-order a sequence of nested non-recursive let bindings. The argument list should contain the let-bound variables, in the desired order.