summaryrefslogtreecommitdiff
path: root/src/Language/PureScript/CoreImp/Optimizer/TCO.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/PureScript/CoreImp/Optimizer/TCO.hs')
-rw-r--r--src/Language/PureScript/CoreImp/Optimizer/TCO.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Language/PureScript/CoreImp/Optimizer/TCO.hs b/src/Language/PureScript/CoreImp/Optimizer/TCO.hs
index 7d8518a..f27a843 100644
--- a/src/Language/PureScript/CoreImp/Optimizer/TCO.hs
+++ b/src/Language/PureScript/CoreImp/Optimizer/TCO.hs
@@ -68,6 +68,14 @@ tco = everywhere convert where
= all allInTailPosition body
allInTailPosition (Throw _ js1)
= countSelfReferences js1 == 0
+ allInTailPosition (ReturnNoResult _)
+ = True
+ allInTailPosition (VariableIntroduction _ _ js1)
+ = all ((== 0) . countSelfReferences) js1
+ allInTailPosition (Assignment _ _ js1)
+ = countSelfReferences js1 == 0
+ allInTailPosition (Comment _ _ js1)
+ = allInTailPosition js1
allInTailPosition _
= False