functionalscript 0.1.594 → 0.1.596
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/.github/workflows/npm-publish.yml +2 -1
- package/com/cpp/module.f.d.mts +8 -0
- package/com/cpp/test.f.d.mts +2 -0
- package/com/cpp/testlib.f.d.mts +2 -0
- package/com/cs/module.f.d.mts +8 -0
- package/com/cs/test.f.d.mts +2 -0
- package/com/cs/testlib.f.d.mts +2 -0
- package/com/rust/module.f.d.mts +28 -0
- package/com/rust/test.f.d.mts +2 -0
- package/com/rust/testlib.f.d.mts +2 -0
- package/com/test/build.d.mts +1 -0
- package/com/test/build.f.d.mts +26 -0
- package/com/types/module.f.d.mts +28 -0
- package/com/types/testlib.f.d.mts +44 -0
- package/commonjs/build/module.f.d.mts +24 -0
- package/commonjs/build/test.f.d.mts +3 -0
- package/commonjs/module/function/module.f.d.mts +7 -0
- package/commonjs/module/module.f.d.mts +57 -0
- package/commonjs/module.d.mts +7 -0
- package/commonjs/module.f.d.mts +4 -0
- package/commonjs/package/dependencies/module.f.d.mts +10 -0
- package/commonjs/package/dependencies/test.f.d.mts +2 -0
- package/commonjs/package/module.f.d.mts +27 -0
- package/commonjs/package/test.f.d.mts +2 -0
- package/commonjs/path/module.f.d.mts +67 -0
- package/commonjs/path/test.f.d.mts +25 -0
- package/commonjs/test.d.mts +8 -0
- package/dev/index.d.mts +1 -0
- package/dev/module.d.mts +26 -0
- package/dev/module.f.d.mts +4 -0
- package/dev/test/module.f.d.mts +26 -0
- package/dev/test.d.mts +3 -0
- package/dev/test.f.d.mts +9 -0
- package/djs/module.f.d.mts +25 -0
- package/djs/parser/module.f.d.mts +40 -0
- package/djs/parser/test.f.d.mts +8 -0
- package/djs/test.f.d.mts +12 -0
- package/djs/tokenizer/module.f.d.mts +17 -0
- package/djs/tokenizer/test.f.d.mts +6 -0
- package/fsc/module.f.d.mts +12 -0
- package/fsc/test.f.d.mts +4 -0
- package/fsm/module.f.d.mts +21 -0
- package/fsm/test.f.d.mts +5 -0
- package/html/module.f.d.mts +20 -0
- package/html/test.f.d.mts +10 -0
- package/index.f.d.mts +83 -0
- package/js/tokenizer/module.f.d.mts +150 -0
- package/js/tokenizer/test.f.d.mts +8 -0
- package/json/module.f.d.mts +41 -0
- package/json/parser/module.f.d.mts +36 -0
- package/json/parser/test.f.d.mts +5 -0
- package/json/serializer/module.f.d.mts +45 -0
- package/json/serializer/test.f.d.mts +8 -0
- package/json/test.f.d.mts +8 -0
- package/json/tokenizer/module.f.d.mts +17 -0
- package/json/tokenizer/test.f.d.mts +6 -0
- package/jsr.json +1 -1
- package/nodejs/version/main.d.mts +1 -0
- package/nodejs/version/module.f.d.mts +18 -0
- package/nodejs/version/test.f.d.mts +2 -0
- package/package.json +2 -1
- package/prime_field/module.f.d.mts +44 -0
- package/prime_field/test.f.d.mts +12 -0
- package/secp/module.f.d.mts +49 -0
- package/secp/test.f.d.mts +4 -0
- package/sha2/module.f.d.mts +23 -0
- package/sha2/test.f.d.mts +10 -0
- package/text/ascii/module.f.d.mts +73 -0
- package/text/ascii/test.f.d.mts +4 -0
- package/text/module.f.d.mts +18 -0
- package/text/sgr/module.f.d.mts +14 -0
- package/text/test.f.d.mts +2 -0
- package/text/utf16/module.f.d.mts +19 -0
- package/text/utf16/test.f.d.mts +6 -0
- package/text/utf8/module.f.d.mts +15 -0
- package/text/utf8/test.f.d.mts +6 -0
- package/types/array/module.f.d.mts +41 -0
- package/types/array/test.f.d.mts +10 -0
- package/types/bigfloat/module.f.d.mts +11 -0
- package/types/bigfloat/test.f.d.mts +6 -0
- package/types/bigint/module.f.d.mts +77 -0
- package/types/bigint/test.f.d.mts +16 -0
- package/types/btree/find/module.f.d.mts +42 -0
- package/types/btree/find/test.f.d.mts +2 -0
- package/types/btree/module.f.d.mts +9 -0
- package/types/btree/remove/module.f.d.mts +19 -0
- package/types/btree/remove/test.f.d.mts +7 -0
- package/types/btree/set/module.f.d.mts +9 -0
- package/types/btree/set/test.f.d.mts +2 -0
- package/types/btree/test.f.d.mts +13 -0
- package/types/btree/types/module.f.d.mts +16 -0
- package/types/byte_set/module.f.d.mts +38 -0
- package/types/byte_set/test.f.d.mts +13 -0
- package/types/function/compare/module.f.d.mts +29 -0
- package/types/function/compare/test.f.d.mts +2 -0
- package/types/function/module.f.d.mts +36 -0
- package/types/function/operator/module.f.d.mts +75 -0
- package/types/function/test.f.d.mts +2 -0
- package/types/list/module.f.d.mts +117 -0
- package/types/list/test.f.d.mts +38 -0
- package/types/map/module.f.d.mts +30 -0
- package/types/map/test.f.d.mts +5 -0
- package/types/nibble_set/module.f.d.mts +26 -0
- package/types/nibble_set/test.f.d.mts +13 -0
- package/types/nullable/module.f.d.mts +14 -0
- package/types/nullable/test.f.d.mts +2 -0
- package/types/number/module.f.d.mts +13 -0
- package/types/number/test.f.d.mts +11 -0
- package/types/object/module.f.d.mts +29 -0
- package/types/object/test.f.d.mts +5 -0
- package/types/range/module.f.d.mts +11 -0
- package/types/range/test.f.d.mts +2 -0
- package/types/range_map/module.f.d.mts +25 -0
- package/types/range_map/test.f.d.mts +6 -0
- package/types/result/module.d.mts +7 -0
- package/types/result/module.f.d.mts +28 -0
- package/types/sorted_list/module.f.d.mts +59 -0
- package/types/sorted_list/test.f.d.mts +5 -0
- package/types/sorted_set/module.f.d.mts +25 -0
- package/types/sorted_set/test.f.d.mts +6 -0
- package/types/string/module.f.d.mts +15 -0
- package/types/string/test.f.d.mts +15 -0
- package/types/string_set/module.f.d.mts +21 -0
- package/types/string_set/test.f.d.mts +5 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { join };
|
|
3
|
+
export { addition };
|
|
4
|
+
export { increment };
|
|
5
|
+
export { strictEqual };
|
|
6
|
+
export { logicalNot };
|
|
7
|
+
export { min };
|
|
8
|
+
export { max };
|
|
9
|
+
export { stateScanToScan };
|
|
10
|
+
export { foldToScan };
|
|
11
|
+
export { reduceToScan };
|
|
12
|
+
export { counter };
|
|
13
|
+
export { concat };
|
|
14
|
+
}
|
|
15
|
+
export default _default;
|
|
16
|
+
export type Binary<A, B, R> = (a: A) => (b: B) => R;
|
|
17
|
+
export type Fold<I, O> = Binary<I, O, O>;
|
|
18
|
+
export type Unary<T, R> = (value: T) => R;
|
|
19
|
+
export type Equal<T> = Binary<T, T, boolean>;
|
|
20
|
+
export type Scan<I, O> = (input: I) => readonly [O, Scan<I, O>];
|
|
21
|
+
export type StateScan<I, S, O> = (prior: S) => (input: I) => readonly [O, S];
|
|
22
|
+
export type Reduce<T> = Fold<T, T>;
|
|
23
|
+
/**
|
|
24
|
+
* @template A
|
|
25
|
+
* @template B
|
|
26
|
+
* @template R
|
|
27
|
+
* @typedef {(a: A) => (b: B) => R} Binary
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @template I,O
|
|
31
|
+
* @typedef {Binary<I, O, O>} Fold
|
|
32
|
+
*/
|
|
33
|
+
/** @type {(separator: string) => Reduce<string>} */
|
|
34
|
+
declare const join: (separator: string) => Reduce<string>;
|
|
35
|
+
/** @type {Reduce<number>} */
|
|
36
|
+
declare const addition: Reduce<number>;
|
|
37
|
+
declare const increment: (b: number) => number;
|
|
38
|
+
/**
|
|
39
|
+
* @template T
|
|
40
|
+
* @typedef {Binary<T, T, boolean>} Equal
|
|
41
|
+
*/
|
|
42
|
+
/** @type {<T>(a: T) => (b: T) => boolean} */
|
|
43
|
+
declare const strictEqual: <T>(a: T) => (b: T) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @template T
|
|
46
|
+
* @template R
|
|
47
|
+
* @typedef {(value: T) => R} Unary
|
|
48
|
+
*/
|
|
49
|
+
/** @type {Unary<boolean, boolean>} */
|
|
50
|
+
declare const logicalNot: Unary<boolean, boolean>;
|
|
51
|
+
/** @type {Reduce<number>} */
|
|
52
|
+
declare const min: Reduce<number>;
|
|
53
|
+
/** @type {Reduce<number>} */
|
|
54
|
+
declare const max: Reduce<number>;
|
|
55
|
+
/**
|
|
56
|
+
* @template I,O
|
|
57
|
+
* @typedef {(input: I) => readonly[O, Scan<I,O>]} Scan
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* @template I,S,O
|
|
61
|
+
* @typedef {(prior: S) => (input: I) => readonly[O, S]} StateScan
|
|
62
|
+
*/
|
|
63
|
+
/** @type {<I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>} */
|
|
64
|
+
declare const stateScanToScan: <I, S, O>(op: StateScan<I, S, O>) => (prior: S) => Scan<I, O>;
|
|
65
|
+
/** @type {<I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>} */
|
|
66
|
+
declare const foldToScan: <I, O>(fold: Fold<I, O>) => (prior: O) => Scan<I, O>;
|
|
67
|
+
/**
|
|
68
|
+
* @template T
|
|
69
|
+
* @typedef {Fold<T, T>} Reduce
|
|
70
|
+
*/
|
|
71
|
+
/** @type {<T>(fold: Reduce<T>) => Scan<T, T>} */
|
|
72
|
+
declare const reduceToScan: <T>(fold: Reduce<T>) => Scan<T, T>;
|
|
73
|
+
declare function counter(): (b: number) => number;
|
|
74
|
+
/** @type {Reduce<string>} */
|
|
75
|
+
declare const concat: Reduce<string>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let empty: null;
|
|
3
|
+
export { concat };
|
|
4
|
+
export { next };
|
|
5
|
+
export { iterable };
|
|
6
|
+
export { toArray };
|
|
7
|
+
export { flat };
|
|
8
|
+
export { map };
|
|
9
|
+
export { flatMap };
|
|
10
|
+
export { filter };
|
|
11
|
+
export { filterMap };
|
|
12
|
+
export { takeWhile };
|
|
13
|
+
export { take };
|
|
14
|
+
export { dropWhile };
|
|
15
|
+
export { drop };
|
|
16
|
+
export { first };
|
|
17
|
+
export { last };
|
|
18
|
+
export { find };
|
|
19
|
+
export { some };
|
|
20
|
+
export { every };
|
|
21
|
+
export { isEmpty };
|
|
22
|
+
export { includes };
|
|
23
|
+
export { countdown };
|
|
24
|
+
export { repeat };
|
|
25
|
+
export { cycle };
|
|
26
|
+
export { scan };
|
|
27
|
+
export { stateScan };
|
|
28
|
+
export { foldScan };
|
|
29
|
+
export { fold };
|
|
30
|
+
export { reduce };
|
|
31
|
+
export { length };
|
|
32
|
+
export { entries };
|
|
33
|
+
export { reverse };
|
|
34
|
+
export { zip };
|
|
35
|
+
export { equal };
|
|
36
|
+
}
|
|
37
|
+
export default _default;
|
|
38
|
+
export type List<T> = NotLazy<T> | Thunk<T>;
|
|
39
|
+
export type NotLazy<T> = Result<T> | Concat<T> | readonly T[];
|
|
40
|
+
export type Empty = null;
|
|
41
|
+
export type Result<T> = Empty | NonEmpty<T>;
|
|
42
|
+
export type Thunk<T> = () => List<T>;
|
|
43
|
+
export type NonEmpty<T> = {
|
|
44
|
+
readonly first: T;
|
|
45
|
+
readonly tail: List<T>;
|
|
46
|
+
};
|
|
47
|
+
export type Concat<T> = {
|
|
48
|
+
readonly head: List<T>;
|
|
49
|
+
readonly tail: List<T>;
|
|
50
|
+
};
|
|
51
|
+
export type Entry<T> = readonly [number, T];
|
|
52
|
+
/** @type {<T>(head: List<T>) => (tail: List<T>) => List<T>} */
|
|
53
|
+
declare const concat: <T>(head: List<T>) => (tail: List<T>) => List<T>;
|
|
54
|
+
/** @type {<T>(list: List<T>) => Result<T>} */
|
|
55
|
+
declare const next: <T>(list: List<T>) => Result<T>;
|
|
56
|
+
/** @type {<T>(list: List<T>) => Iterable<T>} */
|
|
57
|
+
declare const iterable: <T>(list: List<T>) => Iterable<T>;
|
|
58
|
+
/** @type {<T>(list: List<T>) => readonly T[]} */
|
|
59
|
+
declare const toArray: <T>(list: List<T>) => readonly T[];
|
|
60
|
+
/** @type {<T>(list: List<List<T>>) => Thunk<T>} */
|
|
61
|
+
declare const flat: <T>(list: List<List<T>>) => Thunk<T>;
|
|
62
|
+
/** @type {<I, O>(f: (value: I) => O) => (input: List<I>) => Thunk<O>} */
|
|
63
|
+
declare const map: <I, O>(f: (value: I) => O) => (input: List<I>) => Thunk<O>;
|
|
64
|
+
/** @type {<I, O>(f: (value: I) => List<O>) => (input: List<I>) => Thunk<O>} */
|
|
65
|
+
declare const flatMap: <I, O>(f: (value: I) => List<O>) => (input: List<I>) => Thunk<O>;
|
|
66
|
+
/** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
|
|
67
|
+
declare const filter: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
|
|
68
|
+
/** @type {<I, O>(f: (value: I) => O|null) => (input: List<I>) => Thunk<O>} */
|
|
69
|
+
declare const filterMap: <I, O>(f: (value: I) => O | null) => (input: List<I>) => Thunk<O>;
|
|
70
|
+
/** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
|
|
71
|
+
declare const takeWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
|
|
72
|
+
/** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
|
|
73
|
+
declare const take: (n: number) => <T>(input: List<T>) => Thunk<T>;
|
|
74
|
+
/** @type {<T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>} */
|
|
75
|
+
declare const dropWhile: <T>(f: (value: T) => boolean) => (input: List<T>) => Thunk<T>;
|
|
76
|
+
/** @type {(n: number) => <T>(input: List<T>) => Thunk<T>} */
|
|
77
|
+
declare const drop: (n: number) => <T>(input: List<T>) => Thunk<T>;
|
|
78
|
+
/** @type {<D>(def: D) => <T>(input: List<T>) => D|T} */
|
|
79
|
+
declare const first: <D>(def: D) => <T>(input: List<T>) => D | T;
|
|
80
|
+
/** @type {<D>(first: D) => <T>(tail: List<T>) => D|T} */
|
|
81
|
+
declare const last: <D>(first: D) => <T>(tail: List<T>) => D | T;
|
|
82
|
+
/** @type {<D>(def: D) => <T>(f: (value: T) => boolean) => (input: List<T>) => D|T} */
|
|
83
|
+
declare const find: <D>(def: D) => <T>(f: (value: T) => boolean) => (input: List<T>) => D | T;
|
|
84
|
+
/** @type {(input: List<boolean>) => boolean} */
|
|
85
|
+
declare const some: (input: List<boolean>) => boolean;
|
|
86
|
+
declare const every: import("../function/module.f.mjs").Func<List<boolean>, boolean>;
|
|
87
|
+
/** @type {<T>(input: List<T>) => boolean} */
|
|
88
|
+
declare const isEmpty: <T>(input: List<T>) => boolean;
|
|
89
|
+
/** @type {<T>(value: T) => (sequence: List<T>) => boolean} */
|
|
90
|
+
declare const includes: <T>(value: T) => (sequence: List<T>) => boolean;
|
|
91
|
+
/** @type {(count: number) => Thunk<number>} */
|
|
92
|
+
declare const countdown: (count: number) => Thunk<number>;
|
|
93
|
+
/** @type {<T>(v: T) => (c: number) => Thunk<T>} */
|
|
94
|
+
declare const repeat: <T>(v: T) => (c: number) => Thunk<T>;
|
|
95
|
+
/** @type {<T>(list: List<T>) => List<T>} */
|
|
96
|
+
declare const cycle: <T>(list: List<T>) => List<T>;
|
|
97
|
+
/** @type {<I, O>(op: Operator.Scan<I, O>) => (input: List<I>) => Thunk<O>} */
|
|
98
|
+
declare const scan: <I, O>(op: Operator.Scan<I, O>) => (input: List<I>) => Thunk<O>;
|
|
99
|
+
/** @type {<I, S, O>(op: Operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>} */
|
|
100
|
+
declare const stateScan: <I, S, O>(op: Operator.StateScan<I, S, O>) => (init: S) => (input: List<I>) => Thunk<O>;
|
|
101
|
+
/** @type {<I,O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>} */
|
|
102
|
+
declare const foldScan: <I, O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => Thunk<O>;
|
|
103
|
+
/** @type {<I,O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => O} */
|
|
104
|
+
declare const fold: <I, O>(op: Operator.Fold<I, O>) => (init: O) => (input: List<I>) => O;
|
|
105
|
+
/** @type {<T>(op: Operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D|T} */
|
|
106
|
+
declare const reduce: <T>(op: Operator.Reduce<T>) => <D>(def: D) => (input: List<T>) => D | T;
|
|
107
|
+
/** @type {<T>(input: List<T>) => number} */
|
|
108
|
+
declare const length: <T>(input: List<T>) => number;
|
|
109
|
+
/** @type {<T>(input: List<T>) => Thunk<Entry<T>>} */
|
|
110
|
+
declare const entries: <T>(input: List<T>) => Thunk<Entry<T>>;
|
|
111
|
+
/** @type {<T>(input: List<T>) => List<T>} */
|
|
112
|
+
declare const reverse: <T>(input: List<T>) => List<T>;
|
|
113
|
+
/** @type {<A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly[A, B]>} */
|
|
114
|
+
declare const zip: <A>(a: List<A>) => <B>(b: List<B>) => Thunk<readonly [A, B]>;
|
|
115
|
+
/** @type {<T>(e: Operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean} */
|
|
116
|
+
declare const equal: <T>(e: Operator.Equal<T>) => (a: List<T>) => (b: List<T>) => boolean;
|
|
117
|
+
import * as Operator from '../function/operator/module.f.mjs';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { stringifyTest };
|
|
3
|
+
export { cycle };
|
|
4
|
+
export { countdown };
|
|
5
|
+
export { flat };
|
|
6
|
+
export { concat };
|
|
7
|
+
export { flatMap };
|
|
8
|
+
export { take };
|
|
9
|
+
export { find };
|
|
10
|
+
export { takeWhile };
|
|
11
|
+
export { dropWhile };
|
|
12
|
+
export { drop };
|
|
13
|
+
export { additionTests };
|
|
14
|
+
export { entries };
|
|
15
|
+
export { reverse };
|
|
16
|
+
export { zip };
|
|
17
|
+
export { logic };
|
|
18
|
+
export let strictEqual: (() => void)[];
|
|
19
|
+
export let isEmpty: (() => void)[];
|
|
20
|
+
export function length(): void;
|
|
21
|
+
}
|
|
22
|
+
export default _default;
|
|
23
|
+
declare function stringifyTest(): void;
|
|
24
|
+
declare function cycle(): void;
|
|
25
|
+
declare function countdown(): void;
|
|
26
|
+
declare function flat(): void;
|
|
27
|
+
declare function concat(): void;
|
|
28
|
+
declare function flatMap(): void;
|
|
29
|
+
declare const take: (() => void)[];
|
|
30
|
+
declare const find: (() => void)[];
|
|
31
|
+
declare const takeWhile: (() => void)[];
|
|
32
|
+
declare function dropWhile(): void;
|
|
33
|
+
declare const drop: (() => void)[];
|
|
34
|
+
declare const additionTests: (() => void)[];
|
|
35
|
+
declare const entries: (() => void)[];
|
|
36
|
+
declare const reverse: (() => void)[];
|
|
37
|
+
declare const zip: (() => void)[];
|
|
38
|
+
declare function logic(): (() => void)[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let empty: null;
|
|
3
|
+
export { at };
|
|
4
|
+
export { setReduce };
|
|
5
|
+
export { setReplace };
|
|
6
|
+
export { entries };
|
|
7
|
+
export { fromEntries };
|
|
8
|
+
export { remove };
|
|
9
|
+
}
|
|
10
|
+
export default _default;
|
|
11
|
+
export type Sign = Compare.Sign;
|
|
12
|
+
export type Cmp<T> = Compare.Compare<T>;
|
|
13
|
+
export type Entry<T> = readonly [string, T];
|
|
14
|
+
export type Map<T> = btreeTypes.Tree<Entry<T>>;
|
|
15
|
+
/** @type {(name: string) => <T>(map: Map<T>) => T|null} */
|
|
16
|
+
declare const at: (name: string) => <T>(map: Map<T>) => T | null;
|
|
17
|
+
/** @type {<T>(reduce: Operator.Reduce<T>) => (name: string) => (value: T) => (map: Map<T>) => Map<T>} */
|
|
18
|
+
declare const setReduce: <T>(reduce: Operator.Reduce<T>) => (name: string) => (value: T) => (map: Map<T>) => Map<T>;
|
|
19
|
+
/** @type {(name: string) => <T>(value: T) => (map: Map<T>) => Map<T>} */
|
|
20
|
+
declare const setReplace: (name: string) => <T>(value: T) => (map: Map<T>) => Map<T>;
|
|
21
|
+
/** @type {<T>(map: Map<T>) => List.List<Entry<T>>} */
|
|
22
|
+
declare const entries: <T>(map: Map<T>) => List.List<Entry<T>>;
|
|
23
|
+
/** @type {<T>(entries: List.List<Entry<T>>) => Map<T>} */
|
|
24
|
+
declare const fromEntries: <T>(entries: List.List<Entry<T>>) => Map<T>;
|
|
25
|
+
/** @type {(name: string) => <T>(map: Map<T>) => Map<T>} */
|
|
26
|
+
declare const remove: (name: string) => <T>(map: Map<T>) => Map<T>;
|
|
27
|
+
import * as Compare from '../function/compare/module.f.mjs';
|
|
28
|
+
import * as btreeTypes from '../btree/types/module.f.mjs';
|
|
29
|
+
import * as Operator from '../function/operator/module.f.mjs';
|
|
30
|
+
import * as List from '../list/module.f.mjs';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { empty };
|
|
3
|
+
export { universe };
|
|
4
|
+
export { has };
|
|
5
|
+
export { complement };
|
|
6
|
+
export { set };
|
|
7
|
+
export { unset };
|
|
8
|
+
export { setRange };
|
|
9
|
+
}
|
|
10
|
+
export default _default;
|
|
11
|
+
export type NibbleSet = number;
|
|
12
|
+
export type Nibble = number;
|
|
13
|
+
/** @typedef {number} NibbleSet */
|
|
14
|
+
/** @typedef {number} Nibble */
|
|
15
|
+
declare const empty: 0;
|
|
16
|
+
declare const universe: 65535;
|
|
17
|
+
/** @type {(n: Nibble) => (s: NibbleSet) => boolean} */
|
|
18
|
+
declare const has: (n: Nibble) => (s: NibbleSet) => boolean;
|
|
19
|
+
/** @type {(n: NibbleSet) => NibbleSet} */
|
|
20
|
+
declare const complement: (n: NibbleSet) => NibbleSet;
|
|
21
|
+
/** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
|
|
22
|
+
declare const set: (n: Nibble) => (s: NibbleSet) => NibbleSet;
|
|
23
|
+
/** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
|
|
24
|
+
declare const unset: (n: Nibble) => (s: NibbleSet) => NibbleSet;
|
|
25
|
+
/** @type {(r: readonly[number, number]) => (s: NibbleSet) => NibbleSet} */
|
|
26
|
+
declare const setRange: (r: readonly [number, number]) => (s: NibbleSet) => NibbleSet;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
function has(): void;
|
|
3
|
+
let set: (() => void)[];
|
|
4
|
+
function unset(): (() => void)[];
|
|
5
|
+
function setRange(): void;
|
|
6
|
+
function universe(): void;
|
|
7
|
+
namespace compliment {
|
|
8
|
+
export function empty(): void;
|
|
9
|
+
export function universe_1(): void;
|
|
10
|
+
export { universe_1 as universe };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { map };
|
|
3
|
+
export { match };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export type Nullable<T> = T | null;
|
|
7
|
+
/**
|
|
8
|
+
* @template T
|
|
9
|
+
* @typedef {T|null} Nullable
|
|
10
|
+
*/
|
|
11
|
+
/** @type {<T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>} */
|
|
12
|
+
declare const map: <T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>;
|
|
13
|
+
/** @type {<T, R>(f: (_: T) => R) => (none: () => R) => (_: Nullable<T>) => Nullable<R>} */
|
|
14
|
+
declare const match: <T, R>(f: (_: T) => R) => (none: () => R) => (_: Nullable<T>) => Nullable<R>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { sum };
|
|
3
|
+
export { min };
|
|
4
|
+
export { max };
|
|
5
|
+
export { cmp };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
declare const sum: (input: import("../list/module.f.mjs").List<number>) => number;
|
|
9
|
+
declare const min: (input: import("../list/module.f.mjs").List<number>) => number | null;
|
|
10
|
+
declare const max: (input: import("../list/module.f.mjs").List<number>) => number | null;
|
|
11
|
+
/** @type {(a: number) => (b: number) => Compare.Sign} */
|
|
12
|
+
declare const cmp: (a: number) => (b: number) => Compare.Sign;
|
|
13
|
+
import * as Compare from '../function/compare/module.f.mjs';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { at };
|
|
3
|
+
export { sort };
|
|
4
|
+
export { fromEntries };
|
|
5
|
+
export { fromMap };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export type Map<T> = { readonly [k in string]: T; };
|
|
9
|
+
export type Entry<T> = readonly [string, T];
|
|
10
|
+
/**
|
|
11
|
+
* @template T
|
|
12
|
+
* @typedef {{
|
|
13
|
+
* readonly [k in string]: T
|
|
14
|
+
* }} Map
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @template T
|
|
18
|
+
* @typedef {readonly[string, T]} Entry
|
|
19
|
+
*/
|
|
20
|
+
/** @type {(name: string) => <T>(object: Map<T>) => T|null} */
|
|
21
|
+
declare const at: (name: string) => <T>(object: Map<T>) => T | null;
|
|
22
|
+
/** @type {<T>(e: List.List<Entry<T>>) => List.List<Entry<T>>} */
|
|
23
|
+
declare const sort: <T>(e: List.List<Entry<T>>) => List.List<Entry<T>>;
|
|
24
|
+
/** @type {<T>(e: List.List<Entry<T>>) => Map<T>} */
|
|
25
|
+
declare const fromEntries: <T>(e: List.List<Entry<T>>) => Map<T>;
|
|
26
|
+
/** @type {<T>(m: Map.Map<T>) => Map<T>} */
|
|
27
|
+
declare const fromMap: <T>(m: Map.Map<T>) => Map<T>;
|
|
28
|
+
import * as List from '../list/module.f.mjs';
|
|
29
|
+
import * as Map from '../map/module.f.mjs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { contains };
|
|
3
|
+
export { one };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export type Range = readonly [number, number];
|
|
7
|
+
/** @typedef {readonly[number,number]} Range */
|
|
8
|
+
/** @type {(range: Range) => (i: number) => boolean} */
|
|
9
|
+
declare const contains: (range: Range) => (i: number) => boolean;
|
|
10
|
+
/** @type {(i: number) => Range} */
|
|
11
|
+
declare const one: (i: number) => Range;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { merge };
|
|
3
|
+
export { get };
|
|
4
|
+
export { fromRange };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export type Entry<T> = [T, number];
|
|
8
|
+
export type RangeMap<T> = SL.SortedList<Entry<T>>;
|
|
9
|
+
export type RangeMapArray<T> = readonly Entry<T>[];
|
|
10
|
+
export type Operators<T> = {
|
|
11
|
+
readonly union: O.Reduce<T>;
|
|
12
|
+
readonly equal: O.Equal<T>;
|
|
13
|
+
};
|
|
14
|
+
export type RangeState<T> = Option.Nullable<Entry<T>>;
|
|
15
|
+
export type RangeMerge<T> = O.Reduce<RangeMap<T>>;
|
|
16
|
+
/** @type {<T>(op: Operators<T>) => RangeMerge<T>} */
|
|
17
|
+
declare const merge: <T>(op: Operators<T>) => RangeMerge<T>;
|
|
18
|
+
/** @type {<T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T} */
|
|
19
|
+
declare const get: <T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T;
|
|
20
|
+
/** @type {<T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>} */
|
|
21
|
+
declare const fromRange: <T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>;
|
|
22
|
+
import * as SL from '../sorted_list/module.f.mjs';
|
|
23
|
+
import * as O from '../function/operator/module.f.mjs';
|
|
24
|
+
import * as Option from '../nullable/module.f.mjs';
|
|
25
|
+
import * as Range from '../range/module.f.mjs';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { ok };
|
|
3
|
+
export { error };
|
|
4
|
+
export { unwrap };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export type Ok<T> = readonly ["ok", T];
|
|
8
|
+
export type Error<E> = readonly ["error", E];
|
|
9
|
+
export type Result<T, E> = Ok<T> | Error<E>;
|
|
10
|
+
/**
|
|
11
|
+
* @template T
|
|
12
|
+
* @typedef {readonly['ok', T]} Ok
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @template E
|
|
16
|
+
* @typedef {readonly['error', E]} Error
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @template T
|
|
20
|
+
* @template E
|
|
21
|
+
* @typedef {Ok<T>|Error<E>} Result
|
|
22
|
+
*/
|
|
23
|
+
/** @type {<T>(value: T) => Ok<T>} */
|
|
24
|
+
declare const ok: <T>(value: T) => Ok<T>;
|
|
25
|
+
/** @type {<E>(e: E) => Error<E>} */
|
|
26
|
+
declare const error: <E>(e: E) => Error<E>;
|
|
27
|
+
/** @type {<T, E>(r: Result<T, E>) => T} */
|
|
28
|
+
declare const unwrap: <T, E>(r: Result<T, E>) => T;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { merge };
|
|
3
|
+
export { genericMerge };
|
|
4
|
+
export { find };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export type SortedList<T> = List.List<T>;
|
|
8
|
+
export type SortedArray<T> = readonly T[];
|
|
9
|
+
export type Cmp<T> = (a: T) => (b: T) => compare.Sign;
|
|
10
|
+
export type ReduceOp<T, S> = (state: S) => (a: T) => (b: T) => readonly [option.Nullable<T>, compare.Sign, S];
|
|
11
|
+
export type TailReduce<T, S> = (state: S) => (tail: List.List<T>) => List.List<T>;
|
|
12
|
+
export type MergeReduce<T, S> = {
|
|
13
|
+
readonly reduceOp: ReduceOp<T, S>;
|
|
14
|
+
readonly tailReduce: TailReduce<T, S>;
|
|
15
|
+
};
|
|
16
|
+
export type CmpReduceOp<T> = ReduceOp<T, null>;
|
|
17
|
+
/**
|
|
18
|
+
* @template T
|
|
19
|
+
* @typedef {ReduceOp<T, null>} CmpReduceOp
|
|
20
|
+
*/
|
|
21
|
+
/** @type {<T>(cmp: Cmp<T>) => (a: SortedList<T>) => (b: SortedList<T>) => SortedList<T>} */
|
|
22
|
+
declare const merge: <T>(cmp: Cmp<T>) => (a: SortedList<T>) => (b: SortedList<T>) => SortedList<T>;
|
|
23
|
+
/**
|
|
24
|
+
* @template T
|
|
25
|
+
* @typedef {List.List<T>} SortedList
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @template T
|
|
29
|
+
* @typedef {readonly T[]} SortedArray
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @template T
|
|
33
|
+
* @typedef {(a: T) => (b: T) => compare.Sign} Cmp
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* @template T
|
|
37
|
+
* @template S
|
|
38
|
+
* @typedef {(state: S) => (a: T) => (b: T) => readonly[option.Nullable<T>, compare.Sign, S]} ReduceOp
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @template T
|
|
42
|
+
* @template S
|
|
43
|
+
* @typedef {(state: S) => (tail: List.List<T>) => List.List<T>} TailReduce
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @template T
|
|
47
|
+
* @template S
|
|
48
|
+
* @typedef {{
|
|
49
|
+
* readonly reduceOp: ReduceOp<T,S>
|
|
50
|
+
* readonly tailReduce: TailReduce<T,S>
|
|
51
|
+
* }} MergeReduce
|
|
52
|
+
*/
|
|
53
|
+
/** @type {<T,S>(reduce: MergeReduce<T,S>) => (state: S) => (a: List.List<T>) => (b: List.List<T>) => List.List<T>} */
|
|
54
|
+
declare const genericMerge: <T, S>(reduce: MergeReduce<T, S>) => (state: S) => (a: List.List<T>) => (b: List.List<T>) => List.List<T>;
|
|
55
|
+
/** @type {<T>(cmp: Cmp<T>) => (value: T) => (array: SortedArray<T>) => T|null} */
|
|
56
|
+
declare const find: <T>(cmp: Cmp<T>) => (value: T) => (array: SortedArray<T>) => T | null;
|
|
57
|
+
import * as List from '../list/module.f.mjs';
|
|
58
|
+
import * as compare from '../function/compare/module.f.mjs';
|
|
59
|
+
import * as option from '../nullable/module.f.mjs';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { union };
|
|
3
|
+
export { intersect };
|
|
4
|
+
export { has };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export type SortedSet<T> = readonly T[];
|
|
8
|
+
export type Cmp<T> = (a: T) => (b: T) => Compare.Sign;
|
|
9
|
+
export type Byte = number;
|
|
10
|
+
/**
|
|
11
|
+
* @template T
|
|
12
|
+
* @typedef {readonly T[]} SortedSet
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @template T
|
|
16
|
+
* @typedef {(a: T) => (b: T) => Compare.Sign} Cmp
|
|
17
|
+
*/
|
|
18
|
+
/** @typedef {number} Byte */
|
|
19
|
+
/** @type {<T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>} */
|
|
20
|
+
declare const union: <T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>;
|
|
21
|
+
/** @type {<T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>} */
|
|
22
|
+
declare const intersect: <T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>;
|
|
23
|
+
/** @type {<T>(cmp: Cmp<T>) => (value: T) => (set: SortedSet<T>) => boolean} */
|
|
24
|
+
declare const has: <T>(cmp: Cmp<T>) => (value: T) => (set: SortedSet<T>) => boolean;
|
|
25
|
+
import * as Compare from '../function/compare/module.f.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { join };
|
|
3
|
+
export { concat };
|
|
4
|
+
export { repeat };
|
|
5
|
+
export { cmp };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
declare const join: import("../function/module.f.mjs").Func<string, (input: List.List<string>) => string>;
|
|
9
|
+
declare const concat: (input: List.List<string>) => string;
|
|
10
|
+
/** @type {(n: string) => (v: number) => string} */
|
|
11
|
+
declare const repeat: (n: string) => (v: number) => string;
|
|
12
|
+
/** @type {(a: string) => (b: string) => Compare.Sign} */
|
|
13
|
+
declare const cmp: (a: string) => (b: string) => Compare.Sign;
|
|
14
|
+
import * as List from '../list/module.f.mjs';
|
|
15
|
+
import * as Compare from '../function/compare/module.f.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let join: {
|
|
3
|
+
0: () => void;
|
|
4
|
+
1: () => void;
|
|
5
|
+
3: () => void;
|
|
6
|
+
};
|
|
7
|
+
function concat(): void;
|
|
8
|
+
let repeatList: {
|
|
9
|
+
0: () => void;
|
|
10
|
+
5: () => void;
|
|
11
|
+
};
|
|
12
|
+
function repeat(): void;
|
|
13
|
+
function cmp(): void;
|
|
14
|
+
}
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { empty };
|
|
3
|
+
export { contains };
|
|
4
|
+
export { set };
|
|
5
|
+
export { values };
|
|
6
|
+
export { fromValues };
|
|
7
|
+
export { remove };
|
|
8
|
+
}
|
|
9
|
+
export default _default;
|
|
10
|
+
export type StringSet = BtreeTypes.Tree<string>;
|
|
11
|
+
declare const empty: null;
|
|
12
|
+
/** @typedef {BtreeTypes.Tree<string>} StringSet */
|
|
13
|
+
/** @type {(value: string) => (set: StringSet) => boolean} */
|
|
14
|
+
declare const contains: (value: string) => (set: StringSet) => boolean;
|
|
15
|
+
/** @type {(value: string) => (s: StringSet) => StringSet} */
|
|
16
|
+
declare const set: (value: string) => (s: StringSet) => StringSet;
|
|
17
|
+
declare const values: <T>(tree: BtreeTypes.Tree<T>) => import("../list/module.f.mjs").List<T>;
|
|
18
|
+
declare const fromValues: (input: import("../list/module.f.mjs").List<string>) => StringSet;
|
|
19
|
+
/** @type {(value: string) => (s: StringSet) => StringSet} */
|
|
20
|
+
declare const remove: (value: string) => (s: StringSet) => StringSet;
|
|
21
|
+
import * as BtreeTypes from '../btree/types/module.f.mjs';
|