Cheddar
Cheddar copied to clipboard
Feature request: Functional operators
There should be an operator that curries a function. Perhaps ~:
?
let add = ~: (x, y, z) -> x + y * z;
print(add(3)(4)(5)); // 23
A memoizing function/operator. E.g.:
let fib = memo(n -> n < 2 ? n : fib(n - 1) + fib(n - 2))
fib(1000); // takes however long
fib(1000); // takes virtually no time
Dynamic programing FTW!
I wonder if any more should be considered.