parent
d7a91ad6fd
commit
084399c6b4
@ -1,7 +1,7 @@ |
||||
import { g, l, n } from './core'; |
||||
import { _l, g, n } from './core'; |
||||
import { iif } from './bool'; |
||||
import { fromString as _s } from './string'; |
||||
|
||||
n('bool.show'); |
||||
|
||||
export const show = g('show', l('b', iif._('b')._(_s('True'))._(_s('False')))); |
||||
export const show = g('show', _l(b => iif._(b)._(_s('True'))._(_s('False')))); |
||||
|
||||
@ -1,7 +1,7 @@ |
||||
import { g, l, n, pipe } from './core'; |
||||
import { _l, g, n, pipe } from './core'; |
||||
import { singleton } from './list'; |
||||
import { fromString as _s, wrap } from './string'; |
||||
|
||||
n('char.show'); |
||||
|
||||
export const show = g('show', l('c', pipe._(wrap._(_s('\'')))._(singleton)._('c'))); |
||||
export const show = g('show', _l(c => pipe._(wrap._(_s('\'')))._(singleton)._(c))); |
||||
|
||||
@ -1,7 +1,7 @@ |
||||
import { _, g, l, n } from './core'; |
||||
import { _, _l, g, n } from './core'; |
||||
import { concat, intersperse, map } from './list'; |
||||
import { fromString as _s, cons, snoc } from './string'; |
||||
|
||||
n('list.show'); |
||||
|
||||
export const show = g('show', l('eshow', l('xs', concat._(snoc._(cons._(_s('['))._(intersperse._(_s(', '))._(map._('eshow')._('xs'))))._(_s(']')))))); |
||||
export const show = g('show', _l(eshow => _l(xs => concat._(snoc._(cons._(_s('['))._(intersperse._(_s(', '))._(map._(eshow)._(xs))))._(_s(']')))))); |
||||
|
||||
@ -1,72 +1,72 @@ |
||||
import { $, Term, _, cnst, g, id, l, n, pipe, r, undef } from './core'; |
||||
import { $, Term, _, _l, cnst, g, id, n, pipe, _r as ref, undef } from './core'; |
||||
import { EQ, GT, LT, eq as eqc } from './ord'; |
||||
import { False, True, and, iif, or } from './bool'; |
||||
import { Zero, succ } from './num'; |
||||
|
||||
n('list'); |
||||
|
||||
export const Nil = g('Nil', l('z', l('_', 'z'))); |
||||
export const Nil = g('Nil', _l(z => _l(_ => z))); |
||||
|
||||
export const Cons = g('Cons', l('x', l('xs', l('_', l('f', r('f')._('x')._('xs')))))); |
||||
export const Cons = g('Cons', _l(x => _l(xs => _l(_ => _l(f => f._(x)._(xs)))))); |
||||
|
||||
export const cons = g('cons', Cons); |
||||
|
||||
export const snoc = g('snoc', l('xs', l('x', r('xs')._(cons._('x')._(Nil))._(l('y', l('ys', cons._('y')._(r('list', 'snoc')._('ys')._('x')))))))); |
||||
export const snoc = g('snoc', _l(xs => _l(x => xs._(cons._(x)._(Nil))._(_l(y => _l(ys => cons._(y)._(ref('list', 'snoc')._(ys)._(x)))))))); |
||||
|
||||
export const nul = g('nul', l('xs', r('xs')._(True)._(cnst._(cnst._(False))))); |
||||
export const nul = g('nul', _l(xs => xs._(True)._(cnst._(cnst._(False))))); |
||||
|
||||
export const len = g('len', l('xs', r('xs')._(Zero)._(cnst._(pipe._(succ)._(r('list', 'len')))))); |
||||
export const len = g('len', _l(xs => xs._(Zero)._(cnst._(pipe._(succ)._(ref('list', 'len')))))); |
||||
|
||||
export const singleton = g('singleton', l('x', cons._('x')._(Nil))); |
||||
export const singleton = g('singleton', _l(x => cons._(x)._(Nil))); |
||||
|
||||
export const append = g('append', l('l', l('r', r('l')._('r')._(l('x', l('xs', cons._('x')._(r('list', 'append')._('xs')._('r')))))))); |
||||
export const append = g('append', _l(l => _l(r => l._(r)._(_l(x => _l(xs => cons._(x)._(ref('list', 'append')._(xs)._(r)))))))); |
||||
|
||||
export const concat = g('concat', l('ls', r('ls')._(Nil)._(l('x', pipe._(append._('x'))._(r('list', 'concat')))))); |
||||
export const concat = g('concat', _l(ls => ls._(Nil)._(_l(x => pipe._(append._(x))._(ref('list', 'concat')))))); |
||||
|
||||
export const repeat = g('repeat', l('x', cons._('x')._(r('list', 'repeat')._('x')))); |
||||
export const repeat = g('repeat', _l(x => cons._(x)._(ref('list', 'repeat')._(x)))); |
||||
|
||||
export const iterate = g('iterate', l('f', l('x', cons._('x')._(r('list', 'iterate')._('f')._(r('f')._('x')))))); |
||||
export const iterate = g('iterate', _l(f => _l(x => cons._(x)._(ref('list', 'iterate')._(f)._(f._(x)))))); |
||||
|
||||
export const head = g('head', l('xs', r('xs')._(undef)._(cnst))); |
||||
export const head = g('head', _l(xs => xs._(undef)._(cnst))); |
||||
|
||||
export const tail = g('tail', l('xs', r('xs')._(undef)._(cnst._(id)))); |
||||
export const tail = g('tail', _l(xs => xs._(undef)._(cnst._(id)))); |
||||
|
||||
export const foldl = g('foldl', l('f', l('z', l('xs', r('xs')._('z')._(pipe._(r('list', 'foldl')._('f'))._(r('f')._('z'))))))); |
||||
export const foldl = g('foldl', _l(f => _l(z => _l(xs => xs._(z)._(pipe._(ref('list', 'foldl')._(f))._(f._(z))))))); |
||||
|
||||
export const foldlz = g('foldlz', l('f', l('xs', r('xs')._(undef)._(foldl._('f'))))); |
||||
export const foldlz = g('foldlz', _l(f => _l(xs => xs._(undef)._(foldl._(f))))); |
||||
|
||||
export const foldr = g('foldr', l('f', l('z', l('xs', r('xs')._('z')._(l('x', pipe._(r('f')._('x'))._(r('list', 'foldr')._('f')._('z')))))))); |
||||
export const foldr = g('foldr', _l(f => _l(z => _l(xs => xs._(z)._(_l(x => pipe._(f._(x))._(ref('list', 'foldr')._(f)._(z)))))))); |
||||
|
||||
export const foldrz = g('foldrz', undef); |
||||
|
||||
export const cmp = g('cmp', l('ecmp', l('l', l('r', r('l')._(r('r')._(EQ)._(cnst._(cnst._(LT))))._(l('lx', l('lxs', r('r')._(GT)._(l('rx', l('rxs', iif._(eqc._(EQ)._(r('ecmp')._('lx')._('rx')))._(r('list', 'cmp')._('ecmp')._('lxs')._('rxs'))._(r('ecmp')._('lx')._('rx')))))))))))); |
||||
export const cmp = g('cmp', _l(ecmp => _l(l => _l(r => l._(r._(EQ)._(cnst._(cnst._(LT))))._(_l(lx => _l(lxs => r._(GT)._(_l(rx => _l(rxs => iif._(eqc._(EQ)._(ecmp._(lx)._(rx)))._(ref('list', 'cmp')._(ecmp)._(lxs)._(rxs))._(ecmp._(lx)._(rx)))))))))))); |
||||
|
||||
export const lt = g('lt', l('ecmp', l('l', l('r', r('r')._(False)._(l('rx', l('rxs', r('l')._(True)._(l('lx', l('lxs', r('ecmp')._('lx')._('rx')._(True)._(r('list', 'lt')._('ecmp')._('lxs')._('rxs'))._(False))))))))))); |
||||
export const lt = g('lt', _l(ecmp => _l(l => _l(r => r._(False)._(_l(rx => _l(rxs => l._(True)._(_l(lx => _l(lxs => ecmp._(lx)._(rx)._(True)._(ref('list', 'lt')._(ecmp)._(lxs)._(rxs))._(False))))))))))); |
||||
|
||||
export const le = g('le', l('ecmp', l('l', l('r', r('l')._(True)._(l('lx', l('lxs', r('r')._(False)._(l('rx', l('rxs', r('ecmp')._('lx')._('rx')._(True)._(r('list', 'le')._('ecmp')._('lxs')._('rxs'))._(False))))))))))); |
||||
export const le = g('le', _l(ecmp => _l(l => _l(r => l._(True)._(_l(lx => _l(lxs => r._(False)._(_l(rx => _l(rxs => ecmp._(lx)._(rx)._(True)._(ref('list', 'le')._(ecmp)._(lxs)._(rxs))._(False))))))))))); |
||||
|
||||
export const eq = g('eq', l('eeq', l('l', l('r', r('l')._(r('r')._(True)._(cnst._(cnst._(False))))._(l('lx', l('lxs', r('r')._(False)._(l('rx', l('rxs', and._(r('eeq')._('lx')._('rx'))._(r('list', 'eq')._('eeq')._('lxs')._('rxs')))))))))))); |
||||
export const eq = g('eq', _l(eeq => _l(l => _l(r => l._(r._(True)._(cnst._(cnst._(False))))._(_l(lx => _l(lxs => r._(False)._(_l(rx => _l(rxs => and._(eeq._(lx)._(rx))._(ref('list', 'eq')._(eeq)._(lxs)._(rxs)))))))))))); |
||||
|
||||
export const ge = g('ge', l('ecmp', l('l', l('r', r('r')._(True)._(l('rx', l('rxs', r('l')._(False)._(l('lx', l('lxs', r('ecmp')._('lx')._('rx')._(False)._(r('list', 'ge')._('ecmp')._('lxs')._('rxs'))._(True))))))))))); |
||||
export const ge = g('ge', _l(ecmp => _l(l => _l(r => r._(True)._(_l(rx => _l(rxs => l._(False)._(_l(lx => _l(lxs => ecmp._(lx)._(rx)._(False)._(ref('list', 'ge')._(ecmp)._(lxs)._(rxs))._(True))))))))))); |
||||
|
||||
export const gt = g('gt', l('ecmp', l('l', l('r', r('l')._(False)._(l('lx', l('lxs', r('r')._(True)._(l('rx', l('rxs', r('ecmp')._('lx')._('rx')._(False)._(r('list', 'gt')._('ecmp')._('lxs')._('rxs'))._(True))))))))))); |
||||
export const gt = g('gt', _l(ecmp => _l(l => _l(r => l._(False)._(_l(lx => _l(lxs => r._(True)._(_l(rx => _l(rxs => ecmp._(lx)._(rx)._(False)._(ref('list', 'gt')._(ecmp)._(lxs)._(rxs))._(True))))))))))); |
||||
|
||||
export const map = g('map', l('f', l('xs', r('xs')._(Nil)._(l('x', pipe._(cons._(r('f')._('x')))._(r('list', 'map')._('f'))))))); |
||||
export const map = g('map', _l(f => _l(xs => xs._(Nil)._(_l(x => pipe._(cons._(f._(x)))._(ref('list', 'map')._(f))))))); |
||||
|
||||
export const filter = g('filter', l('f', l('xs', r('xs')._(Nil)._(l('x', pipe._(iif._(r('f')._('x'))._(cons._('x'))._(id))._(r('list', 'filter')._('f'))))))); |
||||
export const filter = g('filter', _l(f => _l(xs => xs._(Nil)._(_l(x => pipe._(iif._(f._(x))._(cons._(x))._(id))._(ref('list', 'filter')._(f))))))); |
||||
|
||||
export const any = g('any', l('f', l('xs', r('xs')._(False)._(l('x', pipe._(or._(r('f')._('x')))._(r('list', 'any')._('f'))))))); |
||||
export const any = g('any', _l(f => _l(xs => xs._(False)._(_l(x => pipe._(or._(f._(x)))._(ref('list', 'any')._(f))))))); |
||||
|
||||
export const all = g('all', l('f', l('xs', r('xs')._(True)._(l('x', pipe._(and._(r('f')._('x')))._(r('list', 'all')._('f'))))))); |
||||
export const all = g('all', _l(f => _l(xs => xs._(True)._(_l(x => pipe._(and._(f._(x)))._(ref('list', 'all')._(f))))))); |
||||
|
||||
export const get = g('get', l('i', l('xs', r('xs')._(undef)._(l('x', r('i')._(cnst._('x'))._('list', 'get')))))); |
||||
export const get = g('get', _l(i => _l(xs => xs._(undef)._(_l(x => i._(cnst._(x))._(ref('list', 'get'))))))); |
||||
|
||||
export const update = g('update', l('f', l('i', l('xs', r('xs')._(undef)._(l('x', l('xs', r('i')._(cons._(r('f')._('x'))._('xs'))._(l('pi', cons._('x')._(r('list', 'update')._('f')._('pi')._('xs'))))))))))); |
||||
export const update = g('update', _l(f => _l(i => _l(xs => xs._(undef)._(_l(x => _l(xs => i._(cons._(f._(x))._(xs))._(_l(pi => cons._(x)._(ref('list', 'update')._(f)._(pi)._(xs))))))))))); |
||||
|
||||
export const set = g('set', pipe._(update)._(cnst)); |
||||
|
||||
export const intersperse = g('intersperse', l('v', l('xs', r('xs')._('xs')._(l('x', l('rxs', r('rxs')._('xs')._(cnst._(cnst._(cons._('x')._(cons._('v')._(r('list', 'intersperse')._('v')._('rxs')))))))))))); |
||||
export const intersperse = g('intersperse', _l(v => _l(xs => xs._(xs)._(_l(x => _l(rxs => rxs._(xs)._(cnst._(cnst._(cons._(x)._(cons._(v)._(ref('list', 'intersperse')._(v)._(rxs)))))))))))); |
||||
|
||||
export const fromArray: (xs: Term[]) => Term = xs => !xs.length ? Nil : Cons._(xs[0])._(_(() => fromArray(xs.slice(1)))); |
||||
|
||||
export const toArray: (xs: Term) => Term[] = xs => $(xs._(_([]))._(l('x', l('xs', _(({ x, xs }) => _([x, ...toArray(xs)])))))); |
||||
export const toArray: (xs: Term) => Term[] = xs => $(xs._(_([]))._(_l(x => _l(xs => _(({ x, xs }) => _([x, ...toArray(xs)])))))); |
||||
|
||||
@ -1,7 +1,7 @@ |
||||
import { _, l } from './core'; |
||||
import { _, _l } from './core'; |
||||
import { toString } from './string'; |
||||
|
||||
export const log = l('s', l('p', _(({ s, p }) => { |
||||
export const log = _l(s => _l(p => _(({ s, p }) => { |
||||
console.log(toString(s)); |
||||
return p; |
||||
}))); |
||||
|
||||
@ -1,8 +1,8 @@ |
||||
import { _, g, l, n, r } from './core'; |
||||
import { _, _l, g, n, _r } from './core'; |
||||
import { iif } from './bool'; |
||||
import { fromNumber as _n, div, lt, mod, sum } from './num'; |
||||
import { Empty, append, cons } from './string'; |
||||
|
||||
n('num.show'); |
||||
|
||||
export const show = g('show', l('n', iif._(lt._('n')._(_n(10)))._(cons._(sum._('n')._(_n(48)))._(Empty))._(append._(r('num.show', 'show')._(div._('n')._(_n(10))))._(r('num.show', 'show')._(mod._('n')._(_n(10))))))); |
||||
export const show = g('show', _l(n => iif._(lt._(n)._(_n(10)))._(cons._(sum._(n)._(_n(48)))._(Empty))._(append._(_r('num.show', 'show')._(div._(n)._(_n(10))))._(_r('num.show', 'show')._(mod._(n)._(_n(10))))))); |
||||
|
||||
@ -1,45 +1,45 @@ |
||||
import { $, Term, _, cnst, g, id, l, n, pipe, r } from './core'; |
||||
import { $, Term, _, _l, cnst, g, id, n, pipe, _r as ref } from './core'; |
||||
import { EQ, GT, LT } from './ord'; |
||||
import { False, True, iif } from './bool'; |
||||
|
||||
n('num'); |
||||
|
||||
export const Zero = g('Zero', l('z', l('_n', 'z'))); |
||||
export const Zero = g('Zero', _l(z => _l(_n => z))); |
||||
|
||||
export const Succ = g('Succ', l('p', l('_z', l('n', r('n')._('p'))))); |
||||
export const Succ = g('Succ', _l(p => _l(_z => _l(n => n._(p))))); |
||||
|
||||
export const ifz = g('ifz', l('n', l('t', l('f', r('n')._('t')._(cnst._('f')))))); |
||||
export const ifz = g('ifz', _l(n => _l(t => _l(f => n._(t)._(cnst._(f)))))); |
||||
|
||||
export const succ = g('succ', Succ); |
||||
|
||||
export const pred = g('pred', l('n', r('n')._(Zero)._(id))); |
||||
export const pred = g('pred', _l(n => n._(Zero)._(id))); |
||||
|
||||
export const cmp = g('cmp', l('l', l('r', r('l')._(r('r')._(EQ)._(cnst._(LT)))._(pipe._(r('r')._(GT))._('num', 'cmp'))))); |
||||
export const cmp = g('cmp', _l(l => _l(r => l._(r._(EQ)._(cnst._(LT)))._(pipe._(r._(GT))._(ref('num', 'cmp')))))); |
||||
|
||||
export const lt = g('lt', l('l', l('r', r('r')._(False)._(r('l')._(cnst._(True))._('num', 'lt'))))); |
||||
export const lt = g('lt', _l(l => _l(r => r._(False)._(l._(cnst._(True))._(ref('num', 'lt')))))); |
||||
|
||||
export const le = g('le', l('l', l('r', r('l')._(True)._(r('r')._(cnst._(False))._('num', 'ge'))))); |
||||
export const le = g('le', _l(l => _l(r => l._(True)._(r._(cnst._(False))._(ref('num', 'ge')))))); |
||||
|
||||
export const eq = g('eq', l('l', l('r', r('l')._(r('r')._(True)._(cnst._(False)))._(r('r')._(cnst._(False))._('num', 'eq'))))); |
||||
export const eq = g('eq', _l(l => _l(r => l._(r._(True)._(cnst._(False)))._(r._(cnst._(False))._(ref('num', 'eq')))))); |
||||
|
||||
export const ge = g('ge', l('l', l('r', r('r')._(True)._(r('l')._(cnst._(False))._('num', 'ge'))))); |
||||
export const ge = g('ge', _l(l => _l(r => r._(True)._(l._(cnst._(False))._(ref('num', 'ge')))))); |
||||
|
||||
export const gt = g('gt', l('l', l('r', r('l')._(False)._(r('r')._(cnst._(True))._(lt))))); |
||||
export const gt = g('gt', _l(l => _l(r => l._(False)._(r._(cnst._(True))._(lt))))); |
||||
|
||||
export const even = g('even', l('n', r('n')._(True)._('num', 'odd'))); |
||||
export const even = g('even', _l(n => n._(True)._(ref('num', 'odd')))); |
||||
|
||||
export const odd = g('odd', l('n', r('n')._(False)._('num', 'even'))); |
||||
export const odd = g('odd', _l(n => n._(False)._(ref('num', 'even')))); |
||||
|
||||
export const sum = g('sum', l('l', l('r', r('r')._('l')._(r('num', 'sum')._(Succ._('l')))))); |
||||
export const sum = g('sum', _l(l => _l(r => r._(l)._(ref('num', 'sum')._(Succ._(l)))))); |
||||
|
||||
export const sub = g('sub', l('l', l('r', r('r')._('l')._(r('l')._(cnst._(Zero))._('num', 'sub'))))); |
||||
export const sub = g('sub', _l(l => _l(r => r._(l)._(l._(cnst._(Zero))._(ref('num', 'sub')))))); |
||||
|
||||
export const mul = g('mul', l('l', l('r', r('l')._(Zero)._(l('pl', sum._('r')._(r('num', 'mul')._('pl')._('r'))))))); |
||||
export const mul = g('mul', _l(l => _l(r => l._(Zero)._(_l(pl => sum._(r)._(ref('num', 'mul')._(pl)._(r))))))); |
||||
|
||||
export const div = g('div', l('l', l('r', iif._(lt._('l')._('r'))._(Zero)._(succ._(r('num', 'div')._(sub._('l')._('r'))._('r')))))); |
||||
export const div = g('div', _l(l => _l(r => iif._(lt._(l)._(r))._(Zero)._(succ._(ref('num', 'div')._(sub._(l)._(r))._(r)))))); |
||||
|
||||
export const mod = g('mod', l('l', l('r', iif._(lt._('l')._('r'))._('l')._(r('num', 'mod')._(sub._('l')._('r'))._('r'))))); |
||||
export const mod = g('mod', _l(l => _l(r => iif._(lt._(l)._(r))._(l)._(ref('num', 'mod')._(sub._(l)._(r))._(r))))); |
||||
|
||||
export const fromNumber: (n: number) => Term = n => !n ? Zero : Succ._(_(() => fromNumber(n - 1))); |
||||
|
||||
export const toNumber: (n: Term) => number = n => $(n._(_(0))._(l('p', _(({ p }) => _(1 + toNumber(p)))))); |
||||
export const toNumber: (n: Term) => number = n => $(n._(_(0))._(_l(p => _(({ p }) => _(1 + toNumber(p)))))); |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
import { _, g, l, n, r } from './core'; |
||||
import { _, _l, g, n } from './core'; |
||||
import { fromString as _s } from './string'; |
||||
|
||||
n('ord.show'); |
||||
|
||||
export const show = g('show', l('o', r('o')._(_s('LT'))._(_s('EQ'))._(_s('GT')))); |
||||
export const show = g('show', _l(o => o._(_s('LT'))._(_s('EQ'))._(_s('GT')))); |
||||
|
||||
@ -1,8 +1,8 @@ |
||||
import { _, g, l, n, r } from './core'; |
||||
import { _, _l, g, n } from './core'; |
||||
import { uncurry } from './pair'; |
||||
import { Nil, concat, cons } from './list'; |
||||
import { fromString as _s } from './string'; |
||||
|
||||
n('pair.show'); |
||||
|
||||
export const show = g('show', l('fshow', l('sshow', uncurry._(l('f', l('s', concat._(cons._(_s('('))._(cons._(r('fshow')._('f'))._(cons._(_s(', '))._(cons._(r('sshow')._('s'))._(cons._(_s(')'))._(Nil)))))))))))); |
||||
export const show = g('show', _l(fshow => _l(sshow => uncurry._(_l(f => _l(s => concat._(cons._(_s('('))._(cons._(fshow._(f))._(cons._(_s(', '))._(cons._(sshow._(s))._(cons._(_s(')'))._(Nil)))))))))))); |
||||
|
||||
@ -1,32 +1,32 @@ |
||||
import { _, g, l, n, r } from './core'; |
||||
import { _, _l, g, n } from './core'; |
||||
import { GT, LT } from './ord'; |
||||
import { False, True, and } from './bool'; |
||||
import { fromString as _s } from './string'; |
||||
|
||||
n('pair'); |
||||
|
||||
export const Pair = g('Pair', l('f', l('s', l('p', r('p')._('f')._('s'))))); |
||||
export const Pair = g('Pair', _l(f => _l(s => _l(p => p._(f)._(s))))); |
||||
|
||||
export const fst = g('fst', l('p', r('p')._(l('f', l('_', 'f'))))); |
||||
export const fst = g('fst', _l(p => p._(_l(f => _l(_ => f))))); |
||||
|
||||
export const snd = g('snd', l('p', r('p')._(l('_', l('s', 's'))))); |
||||
export const snd = g('snd', _l(p => p._(_l(_ => _l(s => s))))); |
||||
|
||||
export const first = g('first', l('t', l('p', r('p')._(l('f', l('s', Pair._(r('t')._('f'))._('s'))))))); |
||||
export const first = g('first', _l(t => _l(p => p._(_l(f => _l(s => Pair._(t._(f))._(s))))))); |
||||
|
||||
export const second = g('second', l('t', l('p', r('p')._(l('f', l('s', Pair._('f')._(r('t')._('s')))))))); |
||||
export const second = g('second', _l(t => _l(p => p._(_l(f => _l(s => Pair._(f)._(t._(s)))))))); |
||||
|
||||
export const both = g('both', l('tf', l('ts', l('p', r('p')._(l('f', l('s', Pair._(r('tf')._('f'))._(r('ts')._('s'))))))))); |
||||
export const both = g('both', _l(tf => _l(ts => _l(p => p._(_l(f => _l(s => Pair._(tf._(f))._(ts._(s))))))))); |
||||
|
||||
export const uncurry = g('uncurry', l('t', l('p', r('p')._('t')))); |
||||
export const uncurry = g('uncurry', _l(t => _l(p => p._(t)))); |
||||
|
||||
export const cmp = g('cmp', l('fcmp', l('scmp', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', r('fcmp')._('lf')._('rf')._(LT)._(r('scmp')._('ls')._('rs'))._(GT)))))))))); |
||||
export const cmp = g('cmp', _l(fcmp => _l(scmp => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => fcmp._(lf)._(rf)._(LT)._(scmp._(ls)._(rs))._(GT)))))))))); |
||||
|
||||
export const lt = g('lt', l('fcmp', l('scmp', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', r('fcmp')._('lf')._('rf')._(True)._(r('scmp')._('ls')._('rs')._(True)._(False)._(False))._(False)))))))))); |
||||
export const lt = g('lt', _l(fcmp => _l(scmp => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => fcmp._(lf)._(rf)._(True)._(scmp._(ls)._(rs)._(True)._(False)._(False))._(False)))))))))); |
||||
|
||||
export const le = g('le', l('fcmp', l('scmp', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', r('fcmp')._('lf')._('rf')._(True)._(r('scmp')._('ls')._('rs')._(True)._(True)._(False))._(False)))))))))); |
||||
export const le = g('le', _l(fcmp => _l(scmp => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => fcmp._(lf)._(rf)._(True)._(scmp._(ls)._(rs)._(True)._(True)._(False))._(False)))))))))); |
||||
|
||||
export const eq = g('eq', l('feq', l('seq', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', and._(r('feq')._('lf')._('rf'))._(r('seq')._('ls')._('rs'))))))))))); |
||||
export const eq = g('eq', _l(feq => _l(seq => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => and._(feq._(lf)._(rf))._(seq._(ls)._(rs))))))))))); |
||||
|
||||
export const ge = g('ge', l('fcmp', l('scmp', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', r('fcmp')._('lf')._('rf')._(False)._(r('scmp')._('ls')._('rs')._(False)._(True)._(True))._(True)))))))))); |
||||
export const ge = g('ge', _l(fcmp => _l(scmp => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => fcmp._(lf)._(rf)._(False)._(scmp._(ls)._(rs)._(False)._(True)._(True))._(True)))))))))); |
||||
|
||||
export const gt = g('gt', l('fcmp', l('scmp', uncurry._(l('lf', l('ls', uncurry._(l('rf', l('rs', r('fcmp')._('lf')._('rf')._(False)._(r('scmp')._('ls')._('rs')._(False)._(False)._(True))._(True)))))))))); |
||||
export const gt = g('gt', _l(fcmp => _l(scmp => uncurry._(_l(lf => _l(ls => uncurry._(_l(rf => _l(rs => fcmp._(lf)._(rf)._(False)._(scmp._(ls)._(rs)._(False)._(False)._(True))._(True)))))))))); |
||||
|
||||
Loading…
Reference in new issue