-
Notifications
You must be signed in to change notification settings - Fork 0
Currying
Bill Hails edited this page Jun 8, 2024
·
5 revisions
Functions can be curried, For example:
let
link "listutils.fn" as list;
fn mul(x, y) {
x * y
}
in
list.map(mul(2), [1, 2, 3, 4]); // [2, 4, 6, 8]
Note that mul
is defined with two arguments but called with only one, resulting
an a closure that accepts the second argument and performs the computation.
Next: Pattern Matching
CEKF(s) a.k.a. F Natural a.k.a F♮