Udon = (typeof Udon === 'undefined') ? {} : Udon;

Udon.foldl = function(f, z, xs) {
    var len = xs.length, i;
    for (i = 0; i < len; i++) z = f(z, xs[i]);
    return z;
};

Udon.foldr = function(f, z, xs) {
    var i = xs.length;
    while (i--) z = f(xs[i], z);
    return z;
};

Udon.map = function(f, xs) {
    var i = xs.length, ys = new Array(i);
    while (i--) ys[i] = f(xs[i]);
    return ys;
};

Udon.filter = function(f, xs) {
    var ys = [], len = xs.length, i, e;
    for (i = 0; i < len; i++) {
        e = xs[i];
        if (f(e)) ys.push(e);
    }
    return ys;
};

Udon.partition = function(f, xs) {
    var ts = [], fs = [], len = xs.length, i, e;
    for (i = 0; i < len; i++) {
        e = xs[i];
        (f(e) ? ts : fs).push(e);
    }
    return [ts, fs];
};

Udon.unfoldr = function(step, seed) {
    var output  = [], result;
    while ((result = step(seed))) {
        output.push(result[0]);
        seed = result[1];
    }
    return output;
};

Udon.zip = function(xs, ys) {
    return Udon.zipWith(function(x, y) { return [x, y]; }, xs, ys);
};

Udon.zipWith = function(f, xs, ys) {
    var xsl = xs.length, ysl = ys.length, i = xsl > ysl ? ysl : xsl,
        zs = new Array(i);
    while (i--) zs[i] = f(xs[i], ys[i]);
    return zs;
};

@@ -44,16 +44,549 @@
  Udon;%0A%0A
+Udon.ncurry = function(n) %7B%0A    if (typeof n != 'number' %7C%7C n %3C 2) n = 2;%0A    return function(f) %7B%0A        var a1 = Array.prototype.slice.call(arguments, 1),%0A        curry = function() %7B%0A            var a2 = a1.concat(Array.prototype.slice.call(arguments, 0));%0A            if (a2.length %3C n) %7B%0A                a2.unshift(f);%0A                a1 = a2;%0A                return _curry;%0A            %7D else %7B%0A                return fn.apply(null, a2);%0A            %7D%0A        %7D;%0A        return curry;%0A    %7D;%0A%7D;%0A%0AUdon.curry = Udon.ncurry(2);%0A%0A
 Udon.fol

Add curry and ncurry functions.