Fix linter errors
This commit is contained in:
@@ -28,6 +28,7 @@ export default [
|
|||||||
rules: {
|
rules: {
|
||||||
'arrow-body-style': 'error',
|
'arrow-body-style': 'error',
|
||||||
'no-extra-parens': ['error', 'all'],
|
'no-extra-parens': ['error', 'all'],
|
||||||
|
'no-unexpected-multiline': 'off',
|
||||||
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
||||||
'@stylistic/quotes': ['error', 'single'],
|
'@stylistic/quotes': ['error', 'single'],
|
||||||
'@stylistic/semi': ['error', 'always'],
|
'@stylistic/semi': ['error', 'always'],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Num, Zero, ge, ifz, pred, succ } from './num';
|
|||||||
import { x00 } from './byte';
|
import { x00 } from './byte';
|
||||||
import { Char, fromChar as _c, dec as cdec, inc as cinc, eq, ifn } from './char';
|
import { Char, fromChar as _c, dec as cdec, inc as cinc, eq, ifn } from './char';
|
||||||
import { Pair, first, fst, second, snd, uncurry } from './pair';
|
import { Pair, first, fst, second, snd, uncurry } from './pair';
|
||||||
import { List, Nil, cons, head, repeat, set, singleton, tail, update } from './list';
|
import { List, cons, head, repeat, set, singleton, tail, update } from './list';
|
||||||
import { Empty, String, get, len, snoc } from './string';
|
import { Empty, String, get, len, snoc } from './string';
|
||||||
|
|
||||||
type Program = Pair<List<Num>, String>;
|
type Program = Pair<List<Num>, String>;
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
export type L<T extends (v: P) => L<any>> = T & { run: () => T; }
|
export type L<T extends (v: P) => L<any>> = T & { run: () => T };
|
||||||
|
|
||||||
export function ___<T extends (v: P) => L<any>>(run: () => T): L<T> {
|
export function ___<T extends (v: P) => L<any>>(run: () => T): L<T> {
|
||||||
const r: T = ((p: Parameters<T>[0]) => {
|
const r: T = ((p: Parameters<T>[0]) => {
|
||||||
let v: any;
|
let v: any;
|
||||||
return ___(() => run()(
|
return ___(() => run()(
|
||||||
___(() => v ??= p.run())
|
___(() => v ??= p.run()),
|
||||||
).run());
|
).run());
|
||||||
}) as T;
|
}) as T;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ import { Ord } from './ord';
|
|||||||
import { Bool } from './bool';
|
import { Bool } from './bool';
|
||||||
import { fromNumber as _nn } from './num';
|
import { fromNumber as _nn } from './num';
|
||||||
import { toChar as $c, Char, fromChar as _c, cmp as cmpc, eq as eqc } from './char';
|
import { toChar as $c, Char, fromChar as _c, cmp as cmpc, eq as eqc } from './char';
|
||||||
import { Cons, List, Nil, append, cmp as cmpl, concat, cons, eq as eql, ge as gel, gt as gtl, le as lel, lt as ltl } from './list';
|
import { Cons, List, Nil, append, cmp as cmpl, eq as eql, ge as gel, gt as gtl, le as lel, lt as ltl } from './list';
|
||||||
|
|
||||||
export type String = List<Char>;
|
export type String = List<Char>;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from '@jest/globals';
|
import { describe, expect, it } from '@jest/globals';
|
||||||
import { toNative as $$, L, _, fromNative as __, ___, undef } from '../src/core';
|
import { toNative as $$, _, fromNative as __, ___, undef } from '../src/core';
|
||||||
import { toNOrd as $o, NOrd } from '../src/ord';
|
import { toNOrd as $o, NOrd } from '../src/ord';
|
||||||
import { toBoolean as $b, iif } from '../src/bool';
|
import { toBoolean as $b, iif } from '../src/bool';
|
||||||
import { toNumber as $n, toNumber as $nn, Num, Succ, Zero, fromNumber as _n, fromNumber as _nn, cmp as cmpn, eq as eqn, even, gt as ngt, show as nshow, odd, succ, sum } from '../src/num';
|
import { toNumber as $n, toNumber as $nn, Num, Succ, Zero, fromNumber as _n, fromNumber as _nn, cmp as cmpn, eq as eqn, even, gt as ngt, show as nshow, odd, succ, sum } from '../src/num';
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from '@jest/globals';
|
import { describe, expect, it } from '@jest/globals';
|
||||||
import { ___, L, undef } from '../src/core';
|
import { ___, undef } from '../src/core';
|
||||||
import { toNOrd as $o, NOrd } from '../src/ord';
|
import { toNOrd as $o, NOrd } from '../src/ord';
|
||||||
import { toBoolean as $b, fromBoolean as _b } from '../src/bool';
|
import { toBoolean as $b, fromBoolean as _b } from '../src/bool';
|
||||||
import { toNumber as $n, Num, Succ, Zero, fromNumber as _n, cmp, div, eq, ge, gt, ifz, le, lt, mod, mul, pred, show, sub, succ, sum } from '../src/num';
|
import { toNumber as $n, Num, Succ, Zero, fromNumber as _n, cmp, div, eq, ge, gt, ifz, le, lt, mod, mul, pred, show, sub, succ, sum } from '../src/num';
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from '@jest/globals';
|
import { describe, expect, it } from '@jest/globals';
|
||||||
import { L, _, ___, undef } from '../src/core';
|
import { _, ___, undef } from '../src/core';
|
||||||
import { NOrd, toNOrd } from '../src/ord';
|
import { NOrd, toNOrd } from '../src/ord';
|
||||||
import { toBoolean as $b } from '../src/bool';
|
import { toBoolean as $b } from '../src/bool';
|
||||||
import { toNumber as $n, Zero, gt as ngt } from '../src/num';
|
import { toNumber as $n, Zero, gt as ngt } from '../src/num';
|
||||||
@@ -55,7 +55,6 @@ describe('String', () => {
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
describe('empty', () => {
|
describe('empty', () => {
|
||||||
it('empty "" is True', () => {
|
it('empty "" is True', () => {
|
||||||
expect($b(empty(_s('')))).toEqual(true);
|
expect($b(empty(_s('')))).toEqual(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user