function op(elop) {
    return function(a, b) {
        var i, n=a.length, m=b.length;
        var c = new Array(n);
        for (i=0; i<n && i<m; i++) {
            c[i] = elop(a[i], b[i]);
        }
        for (; i<n; i++) {
            c[i] = a[i];
        }
        return c;
    };
}

function relation(elrel) {
    return function(a, b) {
        return a
            .map(function(v, i) {return elrel(v, b[i]);})
            .reduce(function(all, bool) {return all && bool;}, true)
            ;
    };
}

function numOp(elop) {
    return function(a, b) {
        var i, n=a.length, m=b.length;
        var c = new Array(n);
        for (i=0; i<n && i<m; i++) {
            if (typeof a[i] === 'number' && typeof b[i] === 'number') {
                c[i] = elop(a[i], b[i]);
            } else {
                c[i] = a[i];
            }
        }
        for (; i<n; i++) {
            c[i] = a[i];
        }
        return c;
    };
}

function numRelation(elrel) {
    return function(a, b) {
        return a
            .map(function(v, i) {
                if (i >= b.length) return true;
                if (typeof v !== 'number') return true;
                return elrel(v, b[i]);
            })
            .reduce(function(all, bool) {return all && bool;}, true)
            ;
    };
}

module.exports.op = op;
module.exports.numOp = numOp;
module.exports.relation = relation;
module.exports.numRelation = numRelation;

@@ -276,32 +276,245 @@
 rn c;%0A    %7D;%0A%7D%0A%0A
+function scalarOp(elop) %7B%0A    return function(s, a) %7B%0A        var i, n=a.length;%0A        var c = new Array(n);%0A        for (i=0; i%3Cn; i++) %7B%0A            c%5Bi%5D = elop(s, a%5Bi%5D);%0A        %7D%0A        return c;%0A    %7D;%0A%7D%0A%0A
 function relatio
@@ -1518,56 +1518,462 @@
 %0A%7D%0A%0A
-module.exports.op = op;%0Amodule.exports.numOp = n
+function scalarNumOp(elop) %7B%0A    return function(s, a) %7B%0A        var i, n=a.length;%0A        var c = new Array(n);%0A        for (i=0; i%3Cn; i++) %7B%0A            if (typeof a%5Bi%5D === 'number') %7B%0A                c%5Bi%5D = elop(s, a%5Bi%5D);%0A            %7D else %7B%0A                c%5Bi%5D = a%5Bi%5D;%0A            %7D%0A        %7D%0A        return c;%0A    %7D;%0A%7D%0A%0Amodule.exports.op = op;%0Amodule.exports.numOp = numOp;%0Amodule.exports.scalarOp = scalarOp;%0Amodule.exports.scalarNumOp = scalarN
 umOp

add scalar ops