functionalscript 0.35.2 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fs/asn.1/module.f.js +1 -1
- package/fs/asserts/proof.f.js +1 -1
- package/fs/base_n/module.f.js +3 -3
- package/fs/base_n/proof.f.js +3 -3
- package/fs/{base128 → basen/base128}/module.f.d.ts +1 -1
- package/fs/{base128 → basen/base128}/module.f.js +1 -1
- package/fs/{base128 → basen/base128}/proof.f.js +3 -3
- package/fs/{base64 → basen/base64}/module.f.d.ts +2 -2
- package/fs/basen/base64/module.f.js +71 -0
- package/fs/{base64 → basen/base64}/proof.f.d.ts +2 -0
- package/fs/{base64 → basen/base64}/proof.f.js +17 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.d.ts +2 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.js +2 -2
- package/fs/{cbase32 → basen/cbase32}/proof.f.js +1 -1
- package/fs/bnf/data/module.f.js +4 -4
- package/fs/bnf/data/proof.f.js +6 -6
- package/fs/bnf/descent/module.f.js +6 -6
- package/fs/bnf/descent/proof.f.js +6 -6
- package/fs/bnf/ll1/module.f.js +9 -9
- package/fs/bnf/ll1/proof.f.js +6 -6
- package/fs/bnf/module.f.js +4 -4
- package/fs/bnf/proof.f.js +2 -2
- package/fs/bnf/testlib.f.js +1 -1
- package/fs/cas/cli/module.f.js +7 -7
- package/fs/cas/cli/proof.f.js +8 -8
- package/fs/cas/mcp/module.f.d.ts +8 -4
- package/fs/cas/mcp/module.f.js +124 -72
- package/fs/cas/mcp/proof.f.d.ts +3 -8
- package/fs/cas/mcp/proof.f.js +122 -186
- package/fs/cas/module.f.js +12 -19
- package/fs/cas/proof.f.d.ts +4 -2
- package/fs/cas/proof.f.js +10 -10
- package/fs/ci/bun/module.f.js +2 -2
- package/fs/ci/common/module.f.d.ts +2 -2
- package/fs/ci/common/module.f.js +4 -4
- package/fs/ci/config/module.f.d.ts +20 -21
- package/fs/ci/config/module.f.js +8 -10
- package/fs/ci/deno/module.f.js +8 -4
- package/fs/ci/module.f.js +9 -9
- package/fs/ci/node/module.f.d.ts +1 -1
- package/fs/ci/node/module.f.js +3 -5
- package/fs/ci/playwright/module.f.js +3 -3
- package/fs/ci/proof.f.js +14 -14
- package/fs/ci/rust/module.f.js +2 -2
- package/fs/cli/module.f.js +3 -3
- package/fs/cli/proof.f.js +3 -3
- package/fs/{types → common}/monoid/module.f.d.ts +1 -1
- package/fs/crypto/hmac/module.f.js +2 -2
- package/fs/crypto/hmac/proof.f.js +5 -5
- package/fs/crypto/pow/module.f.js +3 -3
- package/fs/crypto/pow/proof.f.js +4 -4
- package/fs/crypto/secp/module.f.js +2 -2
- package/fs/crypto/secp/proof.f.js +3 -3
- package/fs/crypto/sha2/module.f.js +2 -2
- package/fs/crypto/sha2/proof.f.js +6 -6
- package/fs/crypto/sign/module.f.js +4 -4
- package/fs/crypto/vdf/module.f.js +1 -1
- package/fs/crypto/vdf/proof.f.js +1 -1
- package/fs/dev/module.f.js +6 -6
- package/fs/dev/package_json/module.f.js +6 -6
- package/fs/dev/package_json/proof.f.js +3 -3
- package/fs/dev/proof.f.js +2 -2
- package/fs/djs/ast/module.f.js +2 -2
- package/fs/djs/ast/proof.f.js +4 -4
- package/fs/djs/examples/m.f.d.ts +1 -1
- package/fs/djs/module.f.d.ts +1 -1
- package/fs/djs/module.f.js +5 -5
- package/fs/djs/parser/module.f.js +4 -4
- package/fs/djs/parser/proof.f.js +19 -7
- package/fs/djs/proof.f.js +3 -3
- package/fs/djs/serializer/module.f.js +6 -6
- package/fs/djs/serializer/proof.f.js +4 -4
- package/fs/djs/tokenizer/module.f.js +3 -3
- package/fs/djs/tokenizer/proof.f.js +5 -5
- package/fs/djs/tokenizer-new/proof.f.js +6 -6
- package/fs/djs/transpiler/module.f.d.ts +5 -0
- package/fs/djs/transpiler/module.f.js +21 -11
- package/fs/djs/transpiler/proof.f.js +5 -5
- package/fs/effects/memory/module.f.js +4 -4
- package/fs/effects/memory/proof.f.js +3 -3
- package/fs/effects/module.f.d.ts +15 -0
- package/fs/effects/module.f.js +15 -1
- package/fs/effects/node/memory/module.js +2 -2
- package/fs/effects/node/memory/proof.js +3 -3
- package/fs/effects/node/module.f.js +10 -20
- package/fs/effects/node/module.js +13 -11
- package/fs/effects/node/proof.f.d.ts +3 -0
- package/fs/effects/node/proof.f.js +19 -1
- package/fs/effects/node/virtual/module.f.js +7 -8
- package/fs/effects/node/virtual/proof.f.d.ts +1 -0
- package/fs/effects/node/virtual/proof.f.js +11 -4
- package/fs/effects/proof.f.d.ts +5 -0
- package/fs/effects/proof.f.js +22 -1
- package/fs/emergent_testing/all.test.js +2 -2
- package/fs/emergent_testing/example.f.d.ts +1 -1
- package/fs/emergent_testing/module.f.js +6 -6
- package/fs/emergent_testing/proof.f.d.ts +19 -17
- package/fs/emergent_testing/proof.f.js +7 -7
- package/fs/emergent_testing/scenarios/all.js +1 -1
- package/fs/fsc/bnf.f.js +2 -2
- package/fs/fsc/json.f.js +1 -1
- package/fs/fsc/module.f.d.ts +1 -0
- package/fs/fsc/module.f.js +11 -7
- package/fs/fsc/proof.f.js +4 -4
- package/fs/fsm/module.f.js +9 -9
- package/fs/fsm/proof.f.js +7 -7
- package/fs/js/tokenizer/module.f.d.ts +1 -1
- package/fs/js/tokenizer/module.f.js +14 -8
- package/fs/js/tokenizer/proof.f.js +64 -5
- package/fs/mcp/module.f.d.ts +13 -13
- package/fs/mcp/module.f.js +8 -8
- package/fs/mcp/proof.f.js +5 -5
- package/fs/mcp/stdio/module.f.d.ts +2 -2
- package/fs/mcp/stdio/module.f.js +10 -10
- package/fs/mcp/stdio/proof.f.js +10 -10
- package/fs/{html → media/html}/module.f.d.ts +3 -3
- package/fs/{html → media/html}/module.f.js +9 -9
- package/fs/media/json/module.f.d.ts +50 -0
- package/fs/{json → media/json}/module.f.js +7 -7
- package/fs/{json → media/json}/parser/module.f.d.ts +2 -2
- package/fs/{json → media/json}/parser/module.f.js +7 -7
- package/fs/{json → media/json}/parser/proof.f.js +24 -6
- package/fs/{json → media/json}/proof.f.js +4 -4
- package/fs/media/json/rpc/module.f.d.ts +114 -0
- package/fs/{json → media/json}/rpc/module.f.js +3 -3
- package/fs/{json → media/json}/rpc/proof.f.js +4 -4
- package/fs/media/json/schema/module.f.d.ts +78 -0
- package/fs/{json → media/json}/schema/module.f.js +2 -2
- package/fs/{json → media/json}/schema/proof.f.js +3 -3
- package/fs/{json → media/json}/serializer/module.f.d.ts +1 -1
- package/fs/{json → media/json}/serializer/module.f.js +2 -2
- package/fs/{json → media/json}/serializer/proof.f.js +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.d.ts +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.js +4 -4
- package/fs/{json → media/json}/tokenizer/proof.f.js +5 -5
- package/fs/media/module.f.d.ts +37 -0
- package/fs/media/module.f.js +24 -0
- package/fs/media/proof.f.d.ts +9 -0
- package/fs/media/proof.f.js +57 -0
- package/fs/media/revision/module.f.d.ts +51 -0
- package/fs/media/revision/module.f.js +110 -0
- package/fs/media/revision/proof.f.d.ts +29 -0
- package/fs/media/revision/proof.f.js +119 -0
- package/fs/{mime → media/type}/module.f.d.ts +6 -6
- package/fs/{mime → media/type}/module.f.js +6 -6
- package/fs/{mime → media/type}/proof.f.js +6 -6
- package/fs/module.f.d.ts +2 -0
- package/fs/{fjs/module.f.js → module.f.js} +8 -8
- package/fs/module.js +4 -0
- package/fs/path/module.f.d.ts +6 -0
- package/fs/path/module.f.js +8 -2
- package/fs/path/proof.f.d.ts +1 -0
- package/fs/path/proof.f.js +40 -2
- package/fs/{fjs/proof.f.d.ts → proof.f.d.ts} +1 -0
- package/fs/{fjs/proof.f.js → proof.f.js} +10 -4
- package/fs/sul/id/module.f.js +9 -9
- package/fs/sul/id/proof.f.js +5 -5
- package/fs/sul/level/hash/module.f.js +3 -3
- package/fs/sul/level/hash/proof.f.js +3 -3
- package/fs/sul/level/literal/module.f.js +5 -5
- package/fs/sul/level/literal/proof.f.js +3 -3
- package/fs/sul/module.f.js +3 -3
- package/fs/sul/proof.f.js +3 -3
- package/fs/text/ascii/proof.f.js +3 -3
- package/fs/text/code_point/module.f.js +2 -2
- package/fs/text/code_point/proof.f.js +1 -1
- package/fs/text/module.f.js +5 -5
- package/fs/text/proof.f.js +4 -4
- package/fs/text/sgr/module.f.js +2 -2
- package/fs/text/sgr/proof.f.js +2 -2
- package/fs/text/utf16/module.f.js +5 -5
- package/fs/text/utf16/proof.f.js +4 -4
- package/fs/text/utf8/module.f.d.ts +6 -0
- package/fs/text/utf8/module.f.js +37 -19
- package/fs/text/utf8/proof.f.js +58 -5
- package/fs/types/array/module.f.js +1 -1
- package/fs/types/array/proof.f.js +3 -3
- package/fs/types/bigfloat/module.f.js +1 -1
- package/fs/types/bigfloat/proof.f.js +1 -1
- package/fs/types/bigint/module.f.js +2 -2
- package/fs/types/bigint/proof.f.js +3 -3
- package/fs/types/bit_vec/module.f.js +8 -8
- package/fs/types/bit_vec/proof.f.js +5 -5
- package/fs/types/btree/find/module.f.js +1 -1
- package/fs/types/btree/find/proof.f.d.ts +3 -1
- package/fs/types/btree/find/proof.f.js +7 -7
- package/fs/types/btree/module.f.js +2 -2
- package/fs/types/btree/proof.f.d.ts +11 -5
- package/fs/types/btree/proof.f.js +7 -7
- package/fs/types/btree/remove/module.f.js +4 -4
- package/fs/types/btree/remove/proof.f.d.ts +5 -2
- package/fs/types/btree/remove/proof.f.js +5 -5
- package/fs/types/btree/set/module.f.js +3 -3
- package/fs/types/btree/set/proof.f.js +4 -4
- package/fs/types/byte_set/module.f.js +2 -2
- package/fs/types/byte_set/proof.f.js +4 -4
- package/fs/types/function/compare/proof.f.js +1 -1
- package/fs/types/function/operator/proof.f.d.ts +21 -10
- package/fs/types/function/operator/proof.f.js +1 -1
- package/fs/types/function/proof.f.js +1 -1
- package/fs/types/list/module.f.js +2 -2
- package/fs/types/list/proof.f.d.ts +15 -7
- package/fs/types/list/proof.f.js +4 -4
- package/fs/types/map/proof.f.js +2 -2
- package/fs/types/nibble_set/proof.f.js +2 -2
- package/fs/types/nullable/module.f.js +2 -2
- package/fs/types/nullable/proof.f.js +1 -1
- package/fs/types/number/module.f.js +5 -5
- package/fs/types/number/proof.f.js +1 -1
- package/fs/types/object/module.f.js +4 -4
- package/fs/types/object/proof.f.js +1 -1
- package/fs/types/ordered_map/module.f.js +6 -6
- package/fs/types/ordered_map/proof.f.js +3 -3
- package/fs/types/patricia_trie/proof.f.d.ts +11 -5
- package/fs/types/patricia_trie/proof.f.js +2 -2
- package/fs/types/prime_field/module.f.js +2 -2
- package/fs/types/prime_field/proof.f.js +2 -2
- package/fs/types/range/proof.f.js +1 -1
- package/fs/types/range_map/module.f.js +4 -4
- package/fs/types/range_map/proof.f.js +7 -7
- package/fs/types/result/module.f.d.ts +4 -0
- package/fs/types/result/module.f.js +4 -0
- package/fs/types/result/module.js +1 -1
- package/fs/types/result/proof.f.d.ts +9 -3
- package/fs/types/result/proof.f.js +12 -2
- package/fs/types/rtti/common/module.f.js +4 -4
- package/fs/types/rtti/module.f.d.ts +2 -2
- package/fs/types/rtti/module.f.js +1 -1
- package/fs/types/rtti/parse/module.f.js +5 -5
- package/fs/types/rtti/parse/proof.f.js +2 -2
- package/fs/types/rtti/ts/module.f.js +1 -1
- package/fs/types/rtti/ts/proof.f.js +2 -2
- package/fs/types/rtti/validate/module.f.js +4 -4
- package/fs/types/rtti/validate/proof.f.js +2 -2
- package/fs/types/sorted_list/module.f.js +3 -3
- package/fs/types/sorted_list/proof.f.js +6 -6
- package/fs/types/sorted_set/module.f.js +1 -1
- package/fs/types/sorted_set/proof.f.js +6 -6
- package/fs/types/string/module.f.js +4 -4
- package/fs/types/string/proof.f.js +2 -2
- package/fs/types/string_set/module.f.js +6 -6
- package/fs/types/string_set/proof.f.js +1 -1
- package/fs/types/ts/proof.f.d.ts +18 -18
- package/fs/types/ts/proof.f.js +1 -1
- package/fs/types/uint8array/module.f.js +4 -4
- package/fs/types/uint8array/proof.f.js +4 -4
- package/fs/website/module.f.js +3 -3
- package/fs/website/proof.f.js +3 -3
- package/package.json +8 -8
- package/fs/base64/module.f.js +0 -60
- package/fs/fjs/module.f.d.ts +0 -2
- package/fs/fjs/module.js +0 -4
- package/fs/json/module.f.d.ts +0 -50
- package/fs/json/rpc/module.f.d.ts +0 -114
- package/fs/json/schema/module.f.d.ts +0 -77
- /package/fs/{base128 → basen/base128}/proof.f.d.ts +0 -0
- /package/fs/{cbase32 → basen/cbase32}/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/module.f.js +0 -0
- /package/fs/{types → common}/monoid/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/proof.f.js +0 -0
- /package/fs/{html → media/html}/proof.f.d.ts +0 -0
- /package/fs/{html → media/html}/proof.f.js +0 -0
- /package/fs/{json → media/json}/parser/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/rpc/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/schema/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/serializer/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/tokenizer/proof.f.d.ts +0 -0
- /package/fs/{mime → media/type}/proof.f.d.ts +0 -0
- /package/fs/{fjs/module.d.ts → module.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { set as setSet } from
|
|
2
|
-
import { cmp } from
|
|
3
|
-
import { stringify } from
|
|
4
|
-
import { sort } from
|
|
1
|
+
import { set as setSet } from './module.f.js';
|
|
2
|
+
import { cmp } from '../../string/module.f.js';
|
|
3
|
+
import { stringify } from '../../../media/json/module.f.js';
|
|
4
|
+
import { sort } from '../../object/module.f.js';
|
|
5
5
|
const set = (node) => (value) => setSet(cmp(value))(() => value)(node);
|
|
6
6
|
const jsonStr = stringify(sort);
|
|
7
7
|
const test = [
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { compose } from
|
|
7
|
-
import { reverse, countdown, flat, map } from
|
|
6
|
+
import { compose } from '../function/module.f.js';
|
|
7
|
+
import { reverse, countdown, flat, map } from '../list/module.f.js';
|
|
8
8
|
export const has = n => s => ((s >> BigInt(n)) & 1n) === 1n;
|
|
9
9
|
// create a set
|
|
10
10
|
export const empty = 0n;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { has, empty, set, setRange, unset, universe, complement, toRangeMap } from
|
|
2
|
-
import { every, countdown, map, toArray } from
|
|
3
|
-
import { stringify as jsonStringify } from
|
|
4
|
-
import { sort } from
|
|
1
|
+
import { has, empty, set, setRange, unset, universe, complement, toRangeMap } from './module.f.js';
|
|
2
|
+
import { every, countdown, map, toArray } from '../list/module.f.js';
|
|
3
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
4
|
+
import { sort } from '../object/module.f.js';
|
|
5
5
|
const stringify = jsonStringify(sort);
|
|
6
6
|
export const proof = {
|
|
7
7
|
has: [
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
declare const joinTest: () => void;
|
|
2
|
+
declare const concatTest: () => void;
|
|
3
|
+
declare const logicalNotTest: () => void;
|
|
4
|
+
declare const strictEqualTest: () => void;
|
|
5
|
+
declare const additionTest: () => void;
|
|
6
|
+
declare const incrementTest: () => void;
|
|
7
|
+
declare const foldToScanTest: () => void;
|
|
8
|
+
declare const reduceToScanTest: () => void;
|
|
9
|
+
declare const counterTest: () => void;
|
|
10
|
+
declare const stateScanToScanTest: () => void;
|
|
1
11
|
export declare const proof: {
|
|
2
|
-
joinTest:
|
|
3
|
-
concatTest:
|
|
4
|
-
logicalNotTest:
|
|
5
|
-
strictEqualTest:
|
|
6
|
-
additionTest:
|
|
7
|
-
incrementTest:
|
|
8
|
-
counterTest:
|
|
9
|
-
stateScanToScanTest:
|
|
10
|
-
foldToScanTest:
|
|
11
|
-
reduceToScanTest:
|
|
12
|
+
joinTest: typeof joinTest;
|
|
13
|
+
concatTest: typeof concatTest;
|
|
14
|
+
logicalNotTest: typeof logicalNotTest;
|
|
15
|
+
strictEqualTest: typeof strictEqualTest;
|
|
16
|
+
additionTest: typeof additionTest;
|
|
17
|
+
incrementTest: typeof incrementTest;
|
|
18
|
+
counterTest: typeof counterTest;
|
|
19
|
+
stateScanToScanTest: typeof stateScanToScanTest;
|
|
20
|
+
foldToScanTest: typeof foldToScanTest;
|
|
21
|
+
reduceToScanTest: typeof reduceToScanTest;
|
|
12
22
|
};
|
|
23
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join, concat, logicalNot, strictEqual, addition, increment, counter, stateScanToScan, foldToScan, reduceToScan, } from
|
|
1
|
+
import { join, concat, logicalNot, strictEqual, addition, increment, counter, stateScanToScan, foldToScan, reduceToScan, } from './module.f.js';
|
|
2
2
|
const joinTest = () => {
|
|
3
3
|
const result = join(', ')('world')('hello');
|
|
4
4
|
if (result !== 'hello, world') {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { identity, fn, compose } from
|
|
7
|
-
import { addition, logicalNot, strictEqual, stateScanToScan, foldToScan, reduceToScan, } from
|
|
6
|
+
import { identity, fn, compose } from '../function/module.f.js';
|
|
7
|
+
import { addition, logicalNot, strictEqual, stateScanToScan, foldToScan, reduceToScan, } from '../function/operator/module.f.js';
|
|
8
8
|
export const fromArrayLike = (array) => {
|
|
9
9
|
const at = (i) => i < array.length ? { first: array[i], tail: () => at(i + 1) } : null;
|
|
10
10
|
return at(0);
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
+
declare const stringifyTest: () => void;
|
|
2
|
+
declare const countdownTest: () => void;
|
|
3
|
+
declare const flatTest: () => void;
|
|
4
|
+
declare const concatTest: () => void;
|
|
5
|
+
declare const flatMapTest: () => void;
|
|
6
|
+
declare const dropWhileTest: () => void;
|
|
7
|
+
declare const logic: () => (() => void)[];
|
|
1
8
|
export declare const proof: {
|
|
2
|
-
stringifyTest:
|
|
9
|
+
stringifyTest: typeof stringifyTest;
|
|
3
10
|
cycle: (() => void)[];
|
|
4
|
-
countdown:
|
|
5
|
-
flat:
|
|
6
|
-
concat:
|
|
7
|
-
flatMap:
|
|
11
|
+
countdown: typeof countdownTest;
|
|
12
|
+
flat: typeof flatTest;
|
|
13
|
+
concat: typeof concatTest;
|
|
14
|
+
flatMap: typeof flatMapTest;
|
|
8
15
|
take: (() => void)[];
|
|
9
16
|
find: (() => void)[];
|
|
10
17
|
takeWhile: (() => void)[];
|
|
11
|
-
dropWhile:
|
|
18
|
+
dropWhile: typeof dropWhileTest;
|
|
12
19
|
drop: (() => void)[];
|
|
13
20
|
additionTests: (() => void)[];
|
|
14
21
|
entries: (() => void)[];
|
|
15
22
|
reverse: (() => void)[];
|
|
16
23
|
zip: (() => void)[];
|
|
17
|
-
logic:
|
|
24
|
+
logic: typeof logic;
|
|
18
25
|
strictEqual: (() => void)[];
|
|
19
26
|
isEmpty: (() => void)[];
|
|
20
27
|
length: () => void;
|
|
21
28
|
filterMap: (() => void)[];
|
|
22
29
|
};
|
|
30
|
+
export {};
|
package/fs/types/list/proof.f.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { length, concat, countdown, cycle, drop, dropWhile, entries, every, filter, find, flat, flatMap, map, next, reduce, reverse, scan, some, take, takeWhile, toArray, zip, first, filterMap, isEmpty, equal } from
|
|
2
|
-
import { stringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { addition, strictEqual, reduceToScan } from
|
|
1
|
+
import { length, concat, countdown, cycle, drop, dropWhile, entries, every, filter, find, flat, flatMap, map, next, reduce, reverse, scan, some, take, takeWhile, toArray, zip, first, filterMap, isEmpty, equal } from './module.f.js';
|
|
2
|
+
import { stringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
|
+
import { addition, strictEqual, reduceToScan } from '../function/operator/module.f.js';
|
|
5
5
|
const str = sequence => stringify(sort)(toArray(sequence));
|
|
6
6
|
const stringifyTest = () => {
|
|
7
7
|
const s = str([1, 2, 3]);
|
package/fs/types/map/proof.f.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mapSet, mapDelete } from
|
|
2
|
-
import { assertEq } from
|
|
1
|
+
import { mapSet, mapDelete } from './module.f.js';
|
|
2
|
+
import { assertEq } from '../../asserts/module.f.js';
|
|
3
3
|
export const proof = {
|
|
4
4
|
set: () => {
|
|
5
5
|
const map = mapSet(new Map(), 'a', 'b');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { every, map, countdown } from
|
|
2
|
-
import { empty, has, set, setRange, unset, universe, complement } from
|
|
1
|
+
import { every, map, countdown } from '../list/module.f.js';
|
|
2
|
+
import { empty, has, set, setRange, unset, universe, complement } from './module.f.js';
|
|
3
3
|
export const proof = {
|
|
4
4
|
has: () => {
|
|
5
5
|
if (has(0)(empty)) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { assert } from
|
|
7
|
-
import { fn } from
|
|
6
|
+
import { assert } from '../../asserts/module.f.js';
|
|
7
|
+
import { fn } from '../function/module.f.js';
|
|
8
8
|
export const map = f => value => value === null ? null : f(value);
|
|
9
9
|
export const match = f => none => value => value === null ? none() : f(value);
|
|
10
10
|
export const toOption = (value) => value === null ? [] : [value];
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { reduce } from
|
|
8
|
-
import { addition } from
|
|
9
|
-
import { cmp as uCmp, min as uMin, max as uMax } from
|
|
7
|
+
import { reduce } from '../list/module.f.js';
|
|
8
|
+
import { addition } from '../function/operator/module.f.js';
|
|
9
|
+
import { cmp as uCmp, min as uMin, max as uMax } from '../function/compare/module.f.js';
|
|
10
10
|
export const sum = reduce(addition)(0);
|
|
11
|
-
export const min = reduce(
|
|
12
|
-
export const max = reduce(
|
|
11
|
+
export const min = reduce(uMin)(null);
|
|
12
|
+
export const max = reduce(uMax)(null);
|
|
13
13
|
export const cmp = uCmp;
|
|
14
14
|
const mo = [
|
|
15
15
|
[0x5555_5555, 1],
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { isArray } from
|
|
9
|
-
import { iterable } from
|
|
10
|
-
import { fromUndefined } from
|
|
11
|
-
import { entries as mapEntries, fromEntries as mapFromEntries } from
|
|
8
|
+
import { isArray } from '../array/module.f.js';
|
|
9
|
+
import { iterable } from '../list/module.f.js';
|
|
10
|
+
import { fromUndefined } from '../nullable/module.f.js';
|
|
11
|
+
import { entries as mapEntries, fromEntries as mapFromEntries } from '../ordered_map/module.f.js';
|
|
12
12
|
const { getOwnPropertyDescriptor, fromEntries: objectFromEntries } = Object;
|
|
13
13
|
export const at = name => object => {
|
|
14
14
|
const d = getOwnPropertyDescriptor(object, name);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { value, find } from
|
|
2
|
-
import { set } from
|
|
3
|
-
import { remove as btreeRemove } from
|
|
4
|
-
import { values } from
|
|
5
|
-
import { cmp } from
|
|
6
|
-
import { fold } from
|
|
1
|
+
import { value, find } from '../btree/find/module.f.js';
|
|
2
|
+
import { set } from '../btree/set/module.f.js';
|
|
3
|
+
import { remove as btreeRemove } from '../btree/remove/module.f.js';
|
|
4
|
+
import { values } from '../btree/module.f.js';
|
|
5
|
+
import { cmp } from '../string/module.f.js';
|
|
6
|
+
import { fold } from '../list/module.f.js';
|
|
7
7
|
const keyCmp = a => ([b]) => cmp(a)(b);
|
|
8
8
|
export const at = (name) => (map) => {
|
|
9
9
|
if (map === null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { at, setReplace, setReduce, empty, entries, remove, fromEntries } from
|
|
2
|
-
import { toArray } from
|
|
3
|
-
import { assertEq } from
|
|
1
|
+
import { at, setReplace, setReduce, empty, entries, remove, fromEntries } from './module.f.js';
|
|
2
|
+
import { toArray } from '../list/module.f.js';
|
|
3
|
+
import { assertEq } from '../../asserts/module.f.js';
|
|
4
4
|
export const proof = {
|
|
5
5
|
main: [
|
|
6
6
|
() => {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
declare const empty: () => void;
|
|
2
|
+
declare const singleLeaf: () => void;
|
|
3
|
+
declare const twoLeaves: () => void;
|
|
4
|
+
declare const descending: () => void;
|
|
5
|
+
declare const ascending: () => void;
|
|
1
6
|
export declare const proof: {
|
|
2
|
-
empty:
|
|
3
|
-
singleLeaf:
|
|
4
|
-
twoLeaves:
|
|
5
|
-
descending:
|
|
6
|
-
ascending:
|
|
7
|
+
empty: typeof empty;
|
|
8
|
+
singleLeaf: typeof singleLeaf;
|
|
9
|
+
twoLeaves: typeof twoLeaves;
|
|
10
|
+
descending: typeof descending;
|
|
11
|
+
ascending: typeof ascending;
|
|
7
12
|
};
|
|
13
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert } from
|
|
2
|
-
import { emptyState, patriciaTrie } from
|
|
1
|
+
import { assert } from '../../asserts/module.f.js';
|
|
2
|
+
import { emptyState, patriciaTrie } from './module.f.js';
|
|
3
3
|
const combine = (a, b) => a * 1000n + b;
|
|
4
4
|
const create = (a, b, s) => {
|
|
5
5
|
const h = combine(a, b);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { repeat } from
|
|
2
|
-
import { assert } from
|
|
1
|
+
import { repeat } from '../../common/monoid/module.f.js';
|
|
2
|
+
import { assert } from '../../asserts/module.f.js';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a prime field with the specified prime modulus and associated operations.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { modSqrt, prime_field, sqrt } from
|
|
2
|
-
import { assert, assertEq } from
|
|
1
|
+
import { modSqrt, prime_field, sqrt } from './module.f.js';
|
|
2
|
+
import { assert, assertEq } from '../../asserts/module.f.js';
|
|
3
3
|
export const proof = {
|
|
4
4
|
throw: {
|
|
5
5
|
reciprocal_zero: () => prime_field(7n).reciprocal(0n),
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
* if (rmOps.get(16)(merged) !== 0) { throw 'error' }
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
import { genericMerge } from
|
|
38
|
-
import { next } from
|
|
39
|
-
import { cmp } from
|
|
40
|
-
import { bsearch } from
|
|
37
|
+
import { genericMerge } from '../sorted_list/module.f.js';
|
|
38
|
+
import { next } from '../list/module.f.js';
|
|
39
|
+
import { cmp } from '../number/module.f.js';
|
|
40
|
+
import { bsearch } from '../function/compare/module.f.js';
|
|
41
41
|
const reduceOp = ({ union, equal }) => state => ([aItem, aMax]) => ([bItem, bMax]) => {
|
|
42
42
|
const sign = cmp(aMax)(bMax);
|
|
43
43
|
const min = sign === 1 ? bMax : aMax;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { get, merge, fromRange, rangeMap } from
|
|
2
|
-
import { stringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { union } from
|
|
5
|
-
import { equal, toArray } from
|
|
6
|
-
import { strictEqual } from
|
|
7
|
-
import { cmp } from
|
|
1
|
+
import { get, merge, fromRange, rangeMap } from './module.f.js';
|
|
2
|
+
import { stringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
|
+
import { union } from '../sorted_set/module.f.js';
|
|
5
|
+
import { equal, toArray } from '../list/module.f.js';
|
|
6
|
+
import { strictEqual } from '../function/operator/module.f.js';
|
|
7
|
+
import { cmp } from '../string/module.f.js';
|
|
8
8
|
const str = stringify(sort);
|
|
9
9
|
const op = {
|
|
10
10
|
union: union(cmp),
|
|
@@ -55,3 +55,7 @@ export declare const unwrap: <T, E>([kind, v]: Result<T, E>) => T;
|
|
|
55
55
|
* Swaps the `ok` and `error` cases of a result.
|
|
56
56
|
*/
|
|
57
57
|
export declare const invert: <T, E>([k, v]: Result<T, E>) => Result<E, T>;
|
|
58
|
+
/**
|
|
59
|
+
* Maps the `ok` case of a result, passing an `error` through unchanged.
|
|
60
|
+
*/
|
|
61
|
+
export declare const mapOk: <T, R>(f: (value: T) => R) => <E>(r: Result<T, E>) => Result<R, E>;
|
|
@@ -48,3 +48,7 @@ export const unwrap = ([kind, v]) => {
|
|
|
48
48
|
* Swaps the `ok` and `error` cases of a result.
|
|
49
49
|
*/
|
|
50
50
|
export const invert = ([k, v]) => k === 'ok' ? error(v) : ok(v);
|
|
51
|
+
/**
|
|
52
|
+
* Maps the `ok` case of a result, passing an `error` through unchanged.
|
|
53
|
+
*/
|
|
54
|
+
export const mapOk = (f) => (r) => r[0] === 'ok' ? ok(f(r[1])) : r;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
declare const example: () => void;
|
|
2
|
+
declare const invertTest: () => void;
|
|
3
|
+
declare const unwrapError: () => void;
|
|
4
|
+
declare const mapOkTest: () => void;
|
|
1
5
|
export declare const proof: {
|
|
2
|
-
example:
|
|
3
|
-
invertTest:
|
|
4
|
-
unwrapError:
|
|
6
|
+
example: typeof example;
|
|
7
|
+
invertTest: typeof invertTest;
|
|
8
|
+
unwrapError: typeof unwrapError;
|
|
9
|
+
mapOkTest: typeof mapOkTest;
|
|
5
10
|
};
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { error, ok, unwrap, invert } from "./module.f.js";
|
|
1
|
+
import { error, ok, unwrap, invert, mapOk } from "./module.f.js";
|
|
2
2
|
const example = () => {
|
|
3
3
|
const success = ok(42);
|
|
4
4
|
const failure = error('Something went wrong');
|
|
@@ -39,4 +39,14 @@ const unwrapError = () => {
|
|
|
39
39
|
throw 'expected throw';
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
const mapOkTest = () => {
|
|
43
|
+
const [k0, v0] = mapOk((n) => n + 1)(ok(41));
|
|
44
|
+
if (k0 !== 'ok' || v0 !== 42) {
|
|
45
|
+
throw [k0, v0];
|
|
46
|
+
}
|
|
47
|
+
const [k1, v1] = mapOk((n) => n + 1)(error('oops'));
|
|
48
|
+
if (k1 !== 'error' || v1 !== 'oops') {
|
|
49
|
+
throw [k1, v1];
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export const proof = { example, invertTest, unwrapError, mapOkTest };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {} from
|
|
2
|
-
import { error, ok } from
|
|
3
|
-
import { isArray as commonIsArray } from
|
|
4
|
-
import { isObject as commonIsObject } from
|
|
1
|
+
import {} from '../module.f.js';
|
|
2
|
+
import { error, ok } from '../../result/module.f.js';
|
|
3
|
+
import { isArray as commonIsArray } from '../../array/module.f.js';
|
|
4
|
+
import { isObject as commonIsObject } from '../../object/module.f.js';
|
|
5
5
|
/** Builds an error result with empty path and the given message. */
|
|
6
6
|
export const verror = (message) => error({ path: [], message });
|
|
7
7
|
/** Prepends `key` to the error's path, used to build the path bottom-up. */
|
|
@@ -9,7 +9,7 @@ export type ConstObject = Struct | Tuple;
|
|
|
9
9
|
export type Struct = StringMap<string, Type>;
|
|
10
10
|
/** A tuple schema: readonly array whose elements are nested `Type`s. */
|
|
11
11
|
export type Tuple = readonly Type[];
|
|
12
|
-
declare const primitive0List: readonly [
|
|
12
|
+
declare const primitive0List: readonly ['bigint', 'boolean', 'number', 'string'];
|
|
13
13
|
export type Primitive0 = typeof primitive0List[number];
|
|
14
14
|
export declare const tag0List: readonly ["bigint", "boolean", "number", "string", "unknown"];
|
|
15
15
|
/** Tags for nullary (zero-parameter) type schemas. */
|
|
@@ -40,7 +40,7 @@ export declare const bigint: Bigint;
|
|
|
40
40
|
export type Unknown = Type0<'unknown'>;
|
|
41
41
|
/** Schema that validates any DJS-compatible value. */
|
|
42
42
|
export declare const unknown: Unknown;
|
|
43
|
-
declare const tag1List: readonly [
|
|
43
|
+
declare const tag1List: readonly ['array', 'record'];
|
|
44
44
|
export declare const isTag1: Includes<string, typeof tag1List>;
|
|
45
45
|
/** Tags for unary (one-parameter) type schemas. */
|
|
46
46
|
export type Tag1 = typeof tag1List[number];
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
*
|
|
27
27
|
* @module
|
|
28
28
|
*/
|
|
29
|
-
import {} from
|
|
30
|
-
import { ok } from
|
|
31
|
-
import { find, map as listMap } from
|
|
32
|
-
import { constPrimitiveValidate, isArray, isObject, prependPath, primitive0Validate, verror, visit, } from
|
|
33
|
-
export {} from
|
|
29
|
+
import {} from '../module.f.js';
|
|
30
|
+
import { ok } from '../../result/module.f.js';
|
|
31
|
+
import { find, map as listMap } from '../../list/module.f.js';
|
|
32
|
+
import { constPrimitiveValidate, isArray, isObject, prependPath, primitive0Validate, verror, visit, } from '../common/module.f.js';
|
|
33
|
+
export {} from '../common/module.f.js';
|
|
34
34
|
const { entries } = Object;
|
|
35
35
|
const keyedFirstError = (results) => {
|
|
36
36
|
const e = results.find(([, r]) => r[0] === 'error');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parse } from
|
|
2
|
-
import { boolean, number, string, bigint, unknown, array, record, or, option } from
|
|
1
|
+
import { parse } from './module.f.js';
|
|
2
|
+
import { boolean, number, string, bigint, unknown, array, record, or, option } from '../module.f.js';
|
|
3
3
|
const assertOk = ([k]) => { if (k !== 'ok') {
|
|
4
4
|
throw 'expected ok';
|
|
5
5
|
} };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* The runtime `toTs` function mirrors `Ts<T>` at value level, returning a TypeScript
|
|
8
8
|
* type expression string for a given RTTI schema.
|
|
9
9
|
*/
|
|
10
|
-
import { primitive, union, printer as tsPrinter } from
|
|
10
|
+
import { primitive, union, printer as tsPrinter } from '../../ts/module.f.js';
|
|
11
11
|
/**
|
|
12
12
|
* Creates a printer that converts an RTTI schema `Type` to its TypeScript type expression as a string.
|
|
13
13
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { printer } from
|
|
2
|
-
import { boolean, number, string, bigint, unknown, array, record, or, option, never } from
|
|
1
|
+
import { printer } from './module.f.js';
|
|
2
|
+
import { boolean, number, string, bigint, unknown, array, record, or, option, never } from '../module.f.js';
|
|
3
3
|
const toTs = printer();
|
|
4
4
|
const toTsMut = printer(true);
|
|
5
5
|
const eqMut = (rtti, expected) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {} from
|
|
2
|
-
import { ok } from
|
|
3
|
-
import { constPrimitiveValidate, isArray, isObject, prependPath, primitive0Validate, verror, visit, } from
|
|
4
|
-
export { constPrimitiveValidate, prependPath, primitive0Validate, verror, } from
|
|
1
|
+
import {} from '../module.f.js';
|
|
2
|
+
import { ok } from '../../result/module.f.js';
|
|
3
|
+
import { constPrimitiveValidate, isArray, isObject, prependPath, primitive0Validate, verror, visit, } from '../common/module.f.js';
|
|
4
|
+
export { constPrimitiveValidate, prependPath, primitive0Validate, verror, } from '../common/module.f.js';
|
|
5
5
|
const { entries } = Object;
|
|
6
6
|
/**
|
|
7
7
|
* Builds a validator for `array` or `record` schemas.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validate } from
|
|
2
|
-
import { boolean, number, string, bigint, unknown, array, record, or, option } from
|
|
1
|
+
import { validate } from './module.f.js';
|
|
2
|
+
import { boolean, number, string, bigint, unknown, array, record, or, option } from '../module.f.js';
|
|
3
3
|
const assertOk = ([k]) => { if (k !== 'ok') {
|
|
4
4
|
throw 'expected ok';
|
|
5
5
|
} };
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { bsearch } from
|
|
7
|
-
import { next } from
|
|
8
|
-
import { identity } from
|
|
6
|
+
import { bsearch } from '../function/compare/module.f.js';
|
|
7
|
+
import { next } from '../list/module.f.js';
|
|
8
|
+
import { identity } from '../function/module.f.js';
|
|
9
9
|
/**
|
|
10
10
|
* Two-way sorted-list merge.
|
|
11
11
|
* `reduceOp` returns `[output, sign, nextState]` where sign `-1` advances `a`, `1` advances `b`, `0` advances both; `null` output skips emission.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { find, merge } from
|
|
2
|
-
import { stringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { toArray, countdown, length } from
|
|
5
|
-
import { flip } from
|
|
6
|
-
import { cmp } from
|
|
1
|
+
import { find, merge } from './module.f.js';
|
|
2
|
+
import { stringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
|
+
import { toArray, countdown, length } from '../list/module.f.js';
|
|
5
|
+
import { flip } from '../function/module.f.js';
|
|
6
|
+
import { cmp } from '../number/module.f.js';
|
|
7
7
|
const str = stringify(sort);
|
|
8
8
|
const reverseCmp = flip(cmp);
|
|
9
9
|
export const proof = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toArray } from "../list/module.f.js";
|
|
2
|
-
import { merge, intersect as listIntersect, find } from
|
|
2
|
+
import { merge, intersect as listIntersect, find } from '../sorted_list/module.f.js';
|
|
3
3
|
export const union = cmp => a => b => toArray(merge(cmp)(a)(b));
|
|
4
4
|
export const intersect = cmp => a => b => toArray(listIntersect(cmp)(a)(b));
|
|
5
5
|
export const has = cmp => value => set => find(cmp)(value)(set) === value;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { has, intersect, union } from
|
|
2
|
-
import { stringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { toArray, countdown, length } from
|
|
5
|
-
import { flip } from
|
|
6
|
-
import { cmp } from
|
|
1
|
+
import { has, intersect, union } from './module.f.js';
|
|
2
|
+
import { stringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
|
+
import { toArray, countdown, length } from '../list/module.f.js';
|
|
5
|
+
import { flip } from '../function/module.f.js';
|
|
6
|
+
import { cmp } from '../number/module.f.js';
|
|
7
7
|
const str = a => stringify(sort)(a);
|
|
8
8
|
const reverseCmp = flip(cmp);
|
|
9
9
|
export const proof = {
|