Skip to content

Instantly share code, notes, and snippets.

@Oderjunkie
Last active February 8, 2022 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oderjunkie/8395e40575fb38301241ea337ee6f748 to your computer and use it in GitHub Desktop.
Save Oderjunkie/8395e40575fb38301241ea337ee6f748 to your computer and use it in GitHub Desktop.
just a simple add function!
// === types ===
let __ = {
any: inp => inp,
nat: inp => {
if (typeof inp === 'function')
return inp(x=>x+1)(0);
if (typeof inp === 'string')
return __.nat(Number(inp))
if (typeof inp === 'number' &&
Number.isSafeInteger(inp) &&
inp >= 0)
return inp === 0 ?
f => x => x :
f => x => f(__.nat(inp-1)(f)(x));
return __.nat(0);
},
sur: inp => {
if (typeof inp === 'function') {
let [left, right] = __.tuple(__.array(__.sur), __.array(__.sur))(inp);
if (left.length == 0 && right.length == 0) return 0;
if (left.length == 0) return Math.min(...right) - 1;
if (right.length == 0) return Math.max(...left) + 1;
return (Math.max(...left) + Math.min(...right)) / 2;
}
if (typeof inp === 'number' && Number.isFinite(inp)) {
let left = [];
let right = [];
let tmp = 0;
let div = 0;
for (let _ = 0; _ < 20; _++) {
if (tmp == inp) break;
if (tmp < inp) {
left = [[left.map(_=>_), right.map(_=>_)]];
if (div != 0 || tmp < 0) div--;
tmp += 2 ** div;
continue;
}
if (tmp > inp) {
right = [[left.map(_=>_), right.map(_=>_)]];
if (div != 0 || tmp > 0) div--;
tmp -= 2 ** div;
continue;
}
}
function convback(arg) {
return __.tuple(__.array(convback), __.array(convback))(arg);
}
return convback([left, right]);
}
return __.sur(0);
},
bool: inp => {
if (typeof inp === 'function')
return inp(true)(false);
if (typeof inp === 'boolean')
return inp?
x => y => x:
x => y => y;
return __.bool(false);
},
array: type => inp => {
if (typeof inp === 'function')
return __.bool(inp(x => y => x))?
[]:
[
type(inp(x => y => y)(x => y => x)),
...__.array(type)(inp(x => y => y)(x => y => y))
];
if (typeof inp === 'object' && Array.isArray(inp))
return inp.length === 0?
__.tuple(__.bool, __.bool)([true, true]):
__.tuple(__.bool, __.tuple(type, __.array(type)))([false, [inp[0], inp.slice(1)]]);
return __.array([]);
},
tuple: (...types) => inp => {
if (typeof inp === 'function')
return __.fn(__.any, __.callback(__.any, ...types))(inp)((...els) => els);
if (typeof inp === 'object' && Array.isArray(inp))
return f => __.fn(__.any, ...types)(f)(...inp);
},
fn: (rettype, ...argtypes) => inp => (..._args) => {
if (typeof inp === 'function') {
let args = _args.slice(0, argtypes.length);
while (args.length < argtypes.length)
args.push(undefined);
for (i in args)
args[i] = argtypes[i](args[i]);
let ret = inp;
for (arg of args)
ret = ret(arg);
return rettype(ret);
}
},
callback: (rettype, ...argtypes) => inp => {
function internal(args_) {
return function(arg) {
let args = [...args_, argtypes[args_.length](arg)];
if (args.length < argtypes.length)
return internal(args);
return rettype(inp(...args));
}
}
return internal([]);
},
}
// === original ===
//
// let Z = f => (x => f(v => x(x)(v)))(x => f(v => x(x)(v)));
//
// let map_ = Z(m=>f=>l=>l(x=>y=>x)(l)((s=>s(x=>y=>y)(s=>s(f(l(x=>y=>y)(x=>y=>x)))(m(f)(l(x=>y=>y)(x=>y=>y)))))));
//
// let concat_ = Z(c=>a=>b=>a(x=>y=>x)(b)(s=>s(x=>y=>y)(s=>s(a(x=>y=>y)(x=>y=>x))(c(a(x=>y=>y)(x=>y=>y))(b)))));
//
// let neg_ = Z(neg => x => s => s(
// map_(neg)(x(l=>r=>r))
// )(
// map_(neg)(x(l=>r=>l))
// ));
//
// let add_ = Z(add => x => y => s => s(
// concat_
// (map_(xl => add(xl)(y))(x(l => r => l)))
// (map_(yl => add(x)(yl))(y(l => r => l)))
// )(
// concat_
// (map_(xr => add(xr)(y))(x(l => r => r)))
// (map_(yr => add(x)(yr))(y(l => r => r)))
// ));
//
// let map = __.fn(__.array(__.any), __.callback(__.any, __.any), __.array(__.any))(map_);
// let concat = __.fn(__.array(__.any), __.array(__.any), __.array(__.any))(concat_);
// let neg = __.fn(__.sur, __.sur)(neg_);
// let add = __.fn(__.sur, __.sur, __.sur)(add_);
// === compressed ===
//
// let add_ = (f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(a=>x=>y=>s=>s((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(c=>a=>b=>a(x=>y=>x)(b)(s=>s(x=>y=>y)(s=>s(a(x=>y=>y)(x=>y=>x))(c(a(x=>y=>y)(x=>y=>y))(b)))))((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(m=>f=>l=>l(x=>y=>x)(l)((s=>s(x=>y=>y)(s=>s(f(l(x=>y=>y)(x=>y=>x)))(m(f)(l(x=>y=>y)(x=>y=>y)))))))(l=>a(l)(y))(x(l=>r=>l)))((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(m=>f=>l=>l(x=>y=>x)(l)((s=>s(x=>y=>y)(s=>s(f(l(x=>y=>y)(x=>y=>x)))(m(f)(l(x=>y=>y)(x=>y=>y)))))))(a(x))(y(l=>r=>l))))((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(c=>a=>b=>a(x=>y=>x)(b)(s=>s(x=>y=>y)(s=>s(a(x=>y=>y)(x=>y=>x))(c(a(x=>y=>y)(x=>y=>y))(b)))))((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(m=>f=>l=>l(x=>y=>x)(l)((s=>s(x=>y=>y)(s=>s(f(l(x=>y=>y)(x=>y=>x)))(m(f)(l(x=>y=>y)(x=>y=>y)))))))(r=>a(r)(y))(x(l=>r=>r)))((f=>(x=>f(v=>x(x)(v)))(x=>f(v=>x(x)(v))))(m=>f=>l=>l(x=>y=>x)(l)((s=>s(x=>y=>y)(s=>s(f(l(x=>y=>y)(x=>y=>x)))(m(f)(l(x=>y=>y)(x=>y=>y)))))))(a(x))(y(l=>r=>r)))));
//
// let add = __.fn(__.sur, __.sur, __.sur)(add_);
// === iota'd ===
let _ = _=>_(_=>__=>___=>_(___)(__(___)))(_=>__=>_);
// just a simple add function!
let add_ = _(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))))(_(_(_(_)))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_))))))))))(_(_(_(_)))(_(_(_(_)))(_(_))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_)))))))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_))))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))))(_(_(_(_)))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_))))))))))(_(_(_(_)))(_(_(_(_)))(_(_))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_)))))))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_))))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))));
let add = __.fn(__.sur, __.sur, __.sur)(add_);
console.log(add(0.125, 10.75));
let neg_ = _(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))(_(_)))))(_(_(_(_)))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_(_(_(_))))(_(_))(_(_)))))(_(_(_(_)))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))(_(_)))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_))))))))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))))(_(_(_(_(_))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_(_))))))(_(_(_(_(_))))(_(_(_(_)))(_(_(_(_)))))(_(_))))(_(_(_(_)))(_(_)))))))(_(_(_(_)))(_(_(_(_)))(_(_(_(_(_))))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_)))(_(_)))))(_(_(_(_)))(_(_(_(_)))(_(_)))))))))))))))(_(_)))))(_(_(_(_)))(_(_(_(_(_))))(_(_))(_(_(_(_)))(_(_(_(_))))))))));
let neg = __.fn(__.sur, __.sur)(neg_);
console.log(neg(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment