From 5db90c538ffd8ae46517f822b14c08b226309463 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Sat, 31 Mar 2018 04:46:45 +0100 Subject: [PATCH] feat(pointfree): add caseq() --- packages/pointfree/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/pointfree/src/index.ts b/packages/pointfree/src/index.ts index 7fd58ed1c0..9b33514217 100644 --- a/packages/pointfree/src/index.ts +++ b/packages/pointfree/src/index.ts @@ -1135,6 +1135,12 @@ export const cases = (cases: IObjectOf) => illegalState(`no matching case for: ${tos}`); }; +export const casesq = (ctx: StackContext) => { + const stack = ctx[0]; + $(stack, 2); + return cases(stack.pop())(ctx); +}; + //////////////////// Loop constructs //////////////////// /**