Reorganise pattern.mjs with a 'toplevel first' regime (#286)
'toplevel first' regime * loopAt has its optional cps parameter removed, with loopAtCps added for supporting that usage. * rename bitlevel operations e.g. _and -> band Co-authored-by: Felix Roos <flix91@gmail.com>
This commit is contained in:
parent
98e9780819
commit
4340f024d3
7 changed files with 865 additions and 874 deletions
|
|
@ -116,9 +116,9 @@ export const constant = (a, b) => a;
|
|||
|
||||
export const listRange = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => i + min);
|
||||
|
||||
export function curry(func, overload) {
|
||||
export function curry(func, overload, arity = func.length) {
|
||||
const fn = function curried(...args) {
|
||||
if (args.length >= func.length) {
|
||||
if (args.length >= arity) {
|
||||
return func.apply(this, args);
|
||||
} else {
|
||||
const partial = function (...args2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue