From cac48f5674124963f2f176be8562054c380ab538 Mon Sep 17 00:00:00 2001 From: Tim Whiting Date: Fri, 20 Oct 2023 13:06:30 -0600 Subject: [PATCH] update --- src/Core/OpenResolve.hs | 6 +++--- test/algeff/open-clauses.kk | 27 --------------------------- 2 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 test/algeff/open-clauses.kk diff --git a/src/Core/OpenResolve.hs b/src/Core/OpenResolve.hs index 16d2f9c2f..8440900f1 100644 --- a/src/Core/OpenResolve.hs +++ b/src/Core/OpenResolve.hs @@ -177,21 +177,21 @@ resOpen (Env penv gamma) eopen effFrom effTo tpFrom tpTo@(TFun targs _ tres) exp if (isHandlerFree expr) then trace ("*** remove open-none") $ -- fully total with using any operations that need evidence; just leave it as is expr - else if (n <= 6) + else if (n <= 2) then wrapper (resolve (nameOpenNone n)) [] -- fails in perf1c with exceeded stack size if --optmaxdup < 500 (since it prevents a tailcall) -- expr -- fails in nim as it evidence is not cleared else wrapperThunk (resolve (nameOpenNone 0)) [] [l] -> -- just one: used open-atN for efficiency trace (" one handled effect; use at: " ++ show (ppType penv l)) $ - if (n <= 6) + if (n <= 2) then wrapper (resolve (nameOpenAt n)) [evIndexOf l] else wrapperThunk (resolve (nameOpenAt 0)) [evIndexOf l] _ -> --failure $ "Core.OpenResolve.resOpen: todo: from: " ++ show (ppType penv effFrom) ++ ", to " ++ show (ppType penv effTo) -- ++ " with handled: " ++ show (map (ppType penv) lsFrom, map (ppType penv) lsTo) let indices = makeVector typeEvIndex (map evIndexOf lsFrom) - in if (n <= 6) + in if (n <= 2) then wrapper (resolve (nameOpen n)) [indices] else wrapperThunk (resolve (nameOpen 0)) [indices] diff --git a/test/algeff/open-clauses.kk b/test/algeff/open-clauses.kk deleted file mode 100644 index a960aa0e8..000000000 --- a/test/algeff/open-clauses.kk +++ /dev/null @@ -1,27 +0,0 @@ -effect xeff - fun doA(a: int, b: int, c: int, d: int, e: int, f: int): string - fun doB(a: int, b: int, c: int, d: int, e: int): string - fun doC(a: int, b: int, c: int, d: int): string - fun doD(a: int, b: int, c: int): string - fun doE(a: int, b: int): string - fun doF(a: int): string - fun doG(): string - -fun main() - with handler - fun doA(a, b, c, d, e, f) - [a, b, c, d, e, f].show - fun doB(a, b, c, d, e) - [a, b, c, d, e].show - fun doC(a, b, c, d) - [a, b, c, d].show - fun doD(a, b, c) - [a, b, c].show - fun doE(a, b) - "(" ++ show(a) ++ ", " ++ show(b) ++ ")" - fun doF(a) - a.show - fun doG() - "G" - val result = doA(1, 2, 3, 4, 5, 6) ++ doB(7, 8, 9, 10, 11) ++ doC(12, 13, 14, 15) ++ doD(16, 17, 18) ++ doE(19, 20) ++ doF(21) ++ doG() - result.println \ No newline at end of file