Skip to content

Commit

Permalink
feat(pointfree): add caseq()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 31, 2018
1 parent 0da93da commit 5db90c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/pointfree/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,12 @@ export const cases = (cases: IObjectOf<StackProc>) =>
illegalState(`no matching case for: ${tos}`);
};

export const casesq = (ctx: StackContext) => {
const stack = ctx[0];
$(stack, 2);
return cases(stack.pop())(ctx);
};

//////////////////// Loop constructs ////////////////////

/**
Expand Down

0 comments on commit 5db90c5

Please sign in to comment.