diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2023-09-21 15:52:22 +0200 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2023-09-21 15:52:22 +0200 |
commit | 574569ee96a01d623baf8efdcd3908eef42b8007 (patch) | |
tree | cffc7d81e32b2b52430ac7da97a2a31102f55c97 /src/Simplify.hs | |
parent | 8d07a43f0b364156433dc453b9d1cc762c032634 (diff) |
Storage policy (accum / merge)
Diffstat (limited to 'src/Simplify.hs')
-rw-r--r-- | src/Simplify.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Simplify.hs b/src/Simplify.hs index acc2392..16a3e1d 100644 --- a/src/Simplify.hs +++ b/src/Simplify.hs @@ -48,6 +48,12 @@ simplify = \case -- eta rule for return+bind EMBind (EMReturn _ a) b -> simplify (ELet ext a b) + -- associativity of bind + EMBind (EMBind a b) c -> simplify (EMBind a (EMBind b (weakenExpr (WCopy WSink) c))) + + -- bind-let commute + EMBind (ELet _ a b) c -> simplify (ELet ext a (EMBind b (weakenExpr (WCopy WSink) c))) + EVar _ t i -> EVar ext t i ELet _ a b -> ELet ext (simplify a) (simplify b) EPair _ a b -> EPair ext (simplify a) (simplify b) |