functionalscript 0.1.596 → 0.1.598

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.
Files changed (61) hide show
  1. package/README.md +0 -2
  2. package/com/cpp/module.f.d.mts +4 -4
  3. package/com/cpp/module.f.mjs +18 -18
  4. package/com/cs/module.f.mjs +1 -1
  5. package/com/rust/module.f.d.mts +7 -7
  6. package/com/rust/module.f.mjs +30 -30
  7. package/com/test/build.mjs +2 -2
  8. package/com/types/module.f.mjs +1 -1
  9. package/commonjs/module/module.f.mjs +1 -1
  10. package/commonjs/package/dependencies/module.f.d.mts +3 -3
  11. package/commonjs/package/dependencies/module.f.mjs +3 -3
  12. package/commonjs/package/module.f.d.mts +6 -6
  13. package/commonjs/package/module.f.mjs +4 -4
  14. package/commonjs/path/module.f.d.mts +7 -7
  15. package/commonjs/path/module.f.mjs +5 -5
  16. package/commonjs/path/test.f.mjs +7 -7
  17. package/commonjs/test.mjs +2 -2
  18. package/djs/module.f.mjs +1 -1
  19. package/djs/tokenizer/module.f.mjs +1 -1
  20. package/djs/tokenizer/test.f.mjs +1 -1
  21. package/html/module.f.mjs +1 -1
  22. package/js/tokenizer/test.f.mjs +3 -3
  23. package/json/parser/module.f.d.mts +3 -3
  24. package/json/parser/module.f.mjs +12 -12
  25. package/json/parser/test.f.mjs +2 -2
  26. package/json/serializer/module.f.mjs +2 -2
  27. package/json/tokenizer/module.f.d.mts +3 -3
  28. package/json/tokenizer/module.f.mjs +7 -7
  29. package/json/tokenizer/test.f.mjs +3 -3
  30. package/jsr.json +1 -1
  31. package/package.json +1 -1
  32. package/secp/module.f.d.mts +8 -8
  33. package/secp/module.f.mjs +6 -6
  34. package/secp/test.f.mjs +5 -5
  35. package/sha2/module.f.mjs +1 -1
  36. package/sha2/test.f.mjs +0 -1
  37. package/text/utf16/test.f.mjs +2 -2
  38. package/text/utf8/module.f.d.mts +2 -2
  39. package/text/utf8/module.f.mjs +2 -2
  40. package/types/bigint/module.f.d.mts +8 -8
  41. package/types/bigint/module.f.mjs +5 -5
  42. package/types/btree/find/module.f.mjs +4 -4
  43. package/types/btree/find/test.f.mjs +2 -2
  44. package/types/btree/remove/module.f.d.mts +7 -7
  45. package/types/btree/remove/module.f.mjs +12 -12
  46. package/types/btree/remove/test.f.mjs +5 -5
  47. package/types/btree/set/module.f.d.mts +3 -3
  48. package/types/btree/set/module.f.mjs +6 -6
  49. package/types/btree/set/test.f.mjs +32 -32
  50. package/types/btree/test.f.mjs +7 -11
  51. package/types/byte_set/module.f.mjs +2 -2
  52. package/types/byte_set/test.f.mjs +3 -3
  53. package/types/function/compare/module.f.d.mts +7 -7
  54. package/types/function/compare/module.f.mjs +4 -4
  55. package/types/map/module.f.d.mts +2 -2
  56. package/types/map/module.f.mjs +4 -4
  57. package/types/range_map/module.f.d.mts +2 -2
  58. package/types/range_map/module.f.mjs +5 -5
  59. package/types/range_map/test.f.mjs +2 -2
  60. package/types/sorted_list/test.f.mjs +2 -2
  61. package/types/sorted_set/test.f.mjs +1 -1
package/html/module.f.mjs CHANGED
@@ -2,7 +2,7 @@ import list, * as List from '../types/list/module.f.mjs'
2
2
  const { map, flatMap, flat, concat: listConcat } = list
3
3
  import s from '../types/string/module.f.mjs'
4
4
  const { concat: stringConcat } = s
5
- import object, * as O from '../types/object/module.f.mjs'
5
+ import * as O from '../types/object/module.f.mjs'
6
6
  import f from '../types/function/module.f.mjs'
7
7
  const { compose } = f
8
8
  import utf16 from '../text/utf16/module.f.mjs'
@@ -1,12 +1,12 @@
1
- import tokenizer, * as tokenizerT from './module.f.mjs'
1
+ import tokenizer, * as Tokenizer from './module.f.mjs'
2
2
  import list from '../../types/list/module.f.mjs'
3
- const { toArray, countdown } = list
3
+ const { toArray } = list
4
4
  import djs from '../../djs/module.f.mjs'
5
5
  import o from '../../types/object/module.f.mjs'
6
6
  const { sort } = o
7
7
  import encoding from '../../text/utf16/module.f.mjs'
8
8
 
9
- /** @type {(s: string) => readonly tokenizerT.JsToken[]} */
9
+ /** @type {(s: string) => readonly Tokenizer.JsToken[]} */
10
10
  const tokenizeString = s => toArray(tokenizer.tokenize(encoding.stringToList(s)))
11
11
 
12
12
  const stringify = djs.stringify(sort)
@@ -27,10 +27,10 @@ export type StateError = {
27
27
  readonly message: string;
28
28
  };
29
29
  export type JsonState = StateParse | StateResult | StateError;
30
- /** @type {(tokenList: List.List<tokenizerT.JsonToken>) => Result.Result<Json.Unknown, string>} */
31
- declare const parse: (tokenList: List.List<tokenizerT.JsonToken>) => Result.Result<Json.Unknown, string>;
30
+ /** @type {(tokenList: List.List<Tokenizer.JsonToken>) => Result.Result<Json.Unknown, string>} */
31
+ declare const parse: (tokenList: List.List<Tokenizer.JsonToken>) => Result.Result<Json.Unknown, string>;
32
32
  import * as Map from '../../types/map/module.f.mjs';
33
33
  import * as Json from '../module.f.mjs';
34
34
  import * as List from '../../types/list/module.f.mjs';
35
- import * as tokenizerT from '../tokenizer/module.f.mjs';
35
+ import * as Tokenizer from '../tokenizer/module.f.mjs';
36
36
  import * as Result from '../../types/result/module.f.mjs';
@@ -2,7 +2,7 @@ import result, * as Result from '../../types/result/module.f.mjs'
2
2
  import list, * as List from '../../types/list/module.f.mjs'
3
3
  const { fold, first, drop, toArray } = list
4
4
  import * as Operator from '../../types/function/operator/module.f.mjs'
5
- import * as tokenizerT from '../tokenizer/module.f.mjs'
5
+ import * as Tokenizer from '../tokenizer/module.f.mjs'
6
6
  import map, * as Map from '../../types/map/module.f.mjs'
7
7
  const { setReplace } = map
8
8
  import * as Json from '../module.f.mjs'
@@ -114,7 +114,7 @@ const endObject = state => {
114
114
  return pushValue(newState)(obj)
115
115
  }
116
116
 
117
- /** @type {(token: tokenizerT.JsonToken) => Json.Unknown} */
117
+ /** @type {(token: Tokenizer.JsonToken) => Json.Unknown} */
118
118
  const tokenToValue = token => {
119
119
  switch (token.kind) {
120
120
  case 'null': return null
@@ -126,7 +126,7 @@ const tokenToValue = token => {
126
126
  }
127
127
  }
128
128
 
129
- /** @type {(token: tokenizerT.JsonToken) => boolean} */
129
+ /** @type {(token: Tokenizer.JsonToken) => boolean} */
130
130
  const isValueToken = token => {
131
131
  switch (token.kind) {
132
132
  case 'null':
@@ -138,7 +138,7 @@ const isValueToken = token => {
138
138
  }
139
139
  }
140
140
 
141
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
141
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
142
142
  const parseValueOp = token => state => {
143
143
  if (isValueToken(token)) { return pushValue(state)(tokenToValue(token)) }
144
144
  if (token.kind === '[') { return startArray(state) }
@@ -146,7 +146,7 @@ const parseValueOp = token => state => {
146
146
  return { status: 'error', message: 'unexpected token' }
147
147
  }
148
148
 
149
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
149
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
150
150
  const parseArrayStartOp = token => state => {
151
151
  if (isValueToken(token)) { return pushValue(state)(tokenToValue(token)) }
152
152
  if (token.kind === '[') { return startArray(state) }
@@ -155,40 +155,40 @@ const parseArrayStartOp = token => state => {
155
155
  return { status: 'error', message: 'unexpected token' }
156
156
  }
157
157
 
158
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
158
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
159
159
  const parseArrayValueOp = token => state => {
160
160
  if (token.kind === ']') { return endArray(state) }
161
161
  if (token.kind === ',') { return { status: '[,', top: state.top, stack: state.stack } }
162
162
  return { status: 'error', message: 'unexpected token' }
163
163
  }
164
164
 
165
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
165
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
166
166
  const parseObjectStartOp = token => state => {
167
167
  if (token.kind === 'string') { return pushKey(state)(token.value) }
168
168
  if (token.kind === '}') { return endObject(state) }
169
169
  return { status: 'error', message: 'unexpected token' }
170
170
  }
171
171
 
172
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
172
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
173
173
  const parseObjectKeyOp = token => state => {
174
174
  if (token.kind === ':') { return { status: '{:', top: state.top, stack: state.stack } }
175
175
  return { status: 'error', message: 'unexpected token' }
176
176
  }
177
177
 
178
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
178
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
179
179
  const parseObjectNextOp = token => state => {
180
180
  if (token.kind === '}') { return endObject(state) }
181
181
  if (token.kind === ',') { return { status: '{,', top: state.top, stack: state.stack } }
182
182
  return { status: 'error', message: 'unexpected token' }
183
183
  }
184
184
 
185
- /** @type {(token: tokenizerT.JsonToken) => (state: StateParse) => JsonState}} */
185
+ /** @type {(token: Tokenizer.JsonToken) => (state: StateParse) => JsonState}} */
186
186
  const parseObjectCommaOp = token => state => {
187
187
  if (token.kind === 'string') { return pushKey(state)(token.value) }
188
188
  return { status: 'error', message: 'unexpected token' }
189
189
  }
190
190
 
191
- /** @type {Operator.Fold<tokenizerT.JsonToken, JsonState>} */
191
+ /** @type {Operator.Fold<Tokenizer.JsonToken, JsonState>} */
192
192
  const foldOp = token => state => {
193
193
  switch (state.status) {
194
194
  case 'result': return { status: 'error', message: 'unexpected token' }
@@ -205,7 +205,7 @@ const foldOp = token => state => {
205
205
  }
206
206
  }
207
207
 
208
- /** @type {(tokenList: List.List<tokenizerT.JsonToken>) => Result.Result<Json.Unknown, string>} */
208
+ /** @type {(tokenList: List.List<Tokenizer.JsonToken>) => Result.Result<Json.Unknown, string>} */
209
209
  const parse = tokenList => {
210
210
  const state = fold(foldOp)({ status: '', top: null, stack: null })(tokenList)
211
211
  switch (state.status) {
@@ -1,5 +1,5 @@
1
1
  import parser from './module.f.mjs'
2
- import tokenizer, * as tokenizerT from '../tokenizer/module.f.mjs'
2
+ import tokenizer, * as Tokenizer from '../tokenizer/module.f.mjs'
3
3
  import list from '../../types/list/module.f.mjs'
4
4
  const { toArray } = list
5
5
  import json from '../module.f.mjs'
@@ -7,7 +7,7 @@ import o from '../../types/object/module.f.mjs'
7
7
  const { sort } = o
8
8
  import encoding from '../../text/utf16/module.f.mjs'
9
9
 
10
- /** @type {(s: string) => readonly tokenizerT.JsonToken[]} */
10
+ /** @type {(s: string) => readonly Tokenizer.JsonToken[]} */
11
11
  const tokenizeString = s => toArray(tokenizer.tokenize(encoding.stringToList(s)))
12
12
 
13
13
  const stringify = json.stringify(sort)
@@ -1,7 +1,7 @@
1
1
  import list, * as List from '../../types/list/module.f.mjs'
2
2
  const { flat, reduce, empty } = list
3
- import object, * as O from '../../types/object/module.f.mjs'
4
- import operator, * as Operator from '../../types/function/operator/module.f.mjs'
3
+ import * as O from '../../types/object/module.f.mjs'
4
+ import * as Operator from '../../types/function/operator/module.f.mjs'
5
5
 
6
6
  /**
7
7
  * @template T
@@ -6,12 +6,12 @@ export type JsonToken = {
6
6
  readonly kind: "true" | "false" | "null";
7
7
  } | {
8
8
  readonly kind: "{" | "}" | ":" | "," | "[" | "]";
9
- } | jsTokenizerT.StringToken | jsTokenizerT.NumberToken | jsTokenizerT.ErrorToken;
9
+ } | JsTokenizer.StringToken | JsTokenizer.NumberToken | JsTokenizer.ErrorToken;
10
10
  export type ScanState = {
11
11
  readonly kind: "def" | "-";
12
12
  };
13
- export type ScanInput = jsTokenizerT.JsToken | null;
13
+ export type ScanInput = JsTokenizer.JsToken | null;
14
14
  /** @type {(input: List.List<number>) => List.List<JsonToken>} */
15
15
  declare const tokenize: (input: List.List<number>) => List.List<JsonToken>;
16
- import * as jsTokenizerT from '../../js/tokenizer/module.f.mjs';
16
+ import * as JsTokenizer from '../../js/tokenizer/module.f.mjs';
17
17
  import * as List from '../../types/list/module.f.mjs';
@@ -1,17 +1,17 @@
1
- import operator, * as Operator from '../../types/function/operator/module.f.mjs'
1
+ import * as Operator from '../../types/function/operator/module.f.mjs'
2
2
  import list, * as List from '../../types/list/module.f.mjs'
3
3
  const { empty, flat, stateScan } = list
4
4
  import bf from '../../types/bigfloat/module.f.mjs'
5
5
  const { multiply } = bf
6
- import jsTokenizer, * as jsTokenizerT from '../../js/tokenizer/module.f.mjs'
6
+ import jsTokenizer, * as JsTokenizer from '../../js/tokenizer/module.f.mjs'
7
7
 
8
8
  /**
9
9
  * @typedef {|
10
10
  * {readonly kind: 'true' | 'false' | 'null' } |
11
11
  * {readonly kind: '{' | '}' | ':' | ',' | '[' | ']' } |
12
- * jsTokenizerT.StringToken |
13
- * jsTokenizerT.NumberToken |
14
- * jsTokenizerT.ErrorToken
12
+ * JsTokenizer.StringToken |
13
+ * JsTokenizer.NumberToken |
14
+ * JsTokenizer.ErrorToken
15
15
  * } JsonToken
16
16
  */
17
17
 
@@ -23,11 +23,11 @@ import jsTokenizer, * as jsTokenizerT from '../../js/tokenizer/module.f.mjs'
23
23
 
24
24
  /**
25
25
  * @typedef {|
26
- * jsTokenizerT.JsToken | null
26
+ * JsTokenizer.JsToken | null
27
27
  * } ScanInput
28
28
  */
29
29
 
30
- /** @type {(input: jsTokenizerT.JsToken) => List.List<JsonToken>} */
30
+ /** @type {(input: JsTokenizer.JsToken) => List.List<JsonToken>} */
31
31
  const mapToken = input =>
32
32
  {
33
33
  switch(input.kind)
@@ -1,12 +1,12 @@
1
- import tokenizer, * as tokenizerT from './module.f.mjs'
1
+ import tokenizer, * as Tokenizer from './module.f.mjs'
2
2
  import list from '../../types/list/module.f.mjs'
3
- const { toArray, countdown } = list
3
+ const { toArray } = list
4
4
  import djs from '../../djs/module.f.mjs'
5
5
  import o from '../../types/object/module.f.mjs'
6
6
  const { sort } = o
7
7
  import encoding from '../../text/utf16/module.f.mjs'
8
8
 
9
- /** @type {(s: string) => readonly tokenizerT.JsonToken[]} */
9
+ /** @type {(s: string) => readonly Tokenizer.JsonToken[]} */
10
10
  const tokenizeString = s => toArray(tokenizer.tokenize(encoding.stringToList(s)))
11
11
 
12
12
  const stringify = djs.stringify(sort)
package/jsr.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@functionalscript/functionalscript",
3
- "version": "0.1.596",
3
+ "version": "0.1.598",
4
4
  "exports": "./index.f.mjs"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.1.596",
3
+ "version": "0.1.598",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "index.f.mjs",
6
6
  "scripts": {
@@ -14,12 +14,12 @@ export type Init = {
14
14
  readonly n: bigint;
15
15
  };
16
16
  export type Curve = {
17
- readonly pf: pfT.PrimeField;
18
- readonly nf: pfT.PrimeField;
17
+ readonly pf: Pf.PrimeField;
18
+ readonly nf: Pf.PrimeField;
19
19
  readonly y2: (x: bigint) => bigint;
20
20
  readonly y: (x: bigint) => bigint | null;
21
21
  readonly neg: (a: Point) => Point;
22
- readonly add: op.Reduce<Point>;
22
+ readonly add: Operator.Reduce<Point>;
23
23
  readonly mul: (a: Point) => (n: bigint) => Point;
24
24
  };
25
25
  /** @typedef {readonly[bigint, bigint]} Point2D */
@@ -34,16 +34,16 @@ export type Curve = {
34
34
  */
35
35
  /**
36
36
  * @typedef {{
37
- * readonly pf: pfT.PrimeField
38
- * readonly nf: pfT.PrimeField
37
+ * readonly pf: Pf.PrimeField
38
+ * readonly nf: Pf.PrimeField
39
39
  * readonly y2: (x: bigint) => bigint
40
40
  * readonly y: (x: bigint) => bigint|null
41
41
  * readonly neg: (a: Point) => Point
42
- * readonly add: op.Reduce<Point>
42
+ * readonly add: Operator.Reduce<Point>
43
43
  * readonly mul: (a: Point) => (n: bigint) => Point
44
44
  * }} Curve
45
45
  */
46
46
  /** @type {(i: Init) => Curve} */
47
47
  declare const curve: (i: Init) => Curve;
48
- import * as pfT from '../prime_field/module.f.mjs';
49
- import * as op from '../types/function/operator/module.f.mjs';
48
+ import * as Pf from '../prime_field/module.f.mjs';
49
+ import * as Operator from '../types/function/operator/module.f.mjs';
package/secp/module.f.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import * as op from '../types/function/operator/module.f.mjs'
2
- import pf, * as pfT from '../prime_field/module.f.mjs'
1
+ import * as Operator from '../types/function/operator/module.f.mjs'
2
+ import pf, * as Pf from '../prime_field/module.f.mjs'
3
3
  import bi from '../types/bigint/module.f.mjs'
4
4
  const { scalar_mul } = bi
5
5
  const { prime_field, sqrt } = pf
@@ -19,12 +19,12 @@ const { prime_field, sqrt } = pf
19
19
 
20
20
  /**
21
21
  * @typedef {{
22
- * readonly pf: pfT.PrimeField
23
- * readonly nf: pfT.PrimeField
22
+ * readonly pf: Pf.PrimeField
23
+ * readonly nf: Pf.PrimeField
24
24
  * readonly y2: (x: bigint) => bigint
25
25
  * readonly y: (x: bigint) => bigint|null
26
26
  * readonly neg: (a: Point) => Point
27
- * readonly add: op.Reduce<Point>
27
+ * readonly add: Operator.Reduce<Point>
28
28
  * readonly mul: (a: Point) => (n: bigint) => Point
29
29
  * }} Curve
30
30
  */
@@ -41,7 +41,7 @@ const curve = ({ p, a: [a0, a1], n }) => {
41
41
  // y**2 = a1*x**3 + a0
42
42
  /** @type {(x: bigint) => bigint} */
43
43
  const y2 = x => addA0(add(pow3(x))(mulA1(x)))
44
- /** @type {op.Reduce<Point>} */
44
+ /** @type {Operator.Reduce<Point>} */
45
45
  const addPoint = p => q => {
46
46
  if (p === null) {
47
47
  return q
package/secp/test.f.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import mt, * as mT from './module.f.mjs'
2
- const { curve, secp256k1, secp192r1, eq } = mt
1
+ import _, * as T from './module.f.mjs'
2
+ const { curve, secp256k1, secp192r1, eq } = _
3
3
 
4
4
  export default {
5
5
  test: () => {
6
- /** @type {(c: mT.Init) => void} */
6
+ /** @type {(c: T.Init) => void} */
7
7
  const test_curve = c => {
8
8
  const { g } = c
9
9
  const { mul, neg, pf: { abs }, y: yf, nf: { p: n } } = curve(c)
10
- /** @type {(p: mT.Point) => void} */
10
+ /** @type {(p: T.Point) => void} */
11
11
  const point_check = p => {
12
12
  if (p === null) { throw 'null' }
13
13
  const [x, y] = p
@@ -17,7 +17,7 @@ export default {
17
17
  }
18
18
  point_check(g)
19
19
  point_check(neg(g))
20
- /** @type {(p: mT.Point) => void} */
20
+ /** @type {(p: T.Point) => void} */
21
21
  const test_mul = p => {
22
22
  if (mul(p)(0n) !== null) { throw 'O' }
23
23
  if (mul(p)(1n) !== p) { throw 'p' }
package/sha2/module.f.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import array, * as arrayT from '../types/array/module.f.mjs'
1
+ import * as arrayT from '../types/array/module.f.mjs'
2
2
 
3
3
  /**
4
4
  * @typedef {{
package/sha2/test.f.mjs CHANGED
@@ -2,7 +2,6 @@ import _ from './module.f.mjs'
2
2
  import json, * as jsonT from '../json/module.f.mjs'
3
3
  import o from '../types/object/module.f.mjs'
4
4
  const { sort } = o
5
- import list from '../types/list/module.f.mjs'
6
5
 
7
6
  /** @type {(a: number) => number} */
8
7
  const toU32 = x => (x + 0x1_0000_0000) % 0x1_0000_0000
@@ -1,10 +1,10 @@
1
1
  import encoding from './module.f.mjs'
2
- import json, * as jsonT from '../../json/module.f.mjs'
2
+ import json, * as Json from '../../json/module.f.mjs'
3
3
  import o from '../../types/object/module.f.mjs'
4
4
  const { sort } = o
5
5
  import list from '../../types/list/module.f.mjs'
6
6
 
7
- /** @type {(a: readonly jsonT.Unknown[]) => string} */
7
+ /** @type {(a: readonly Json.Unknown[]) => string} */
8
8
  const stringify = a => json.stringify(sort)(a)
9
9
 
10
10
  export default {
@@ -4,12 +4,12 @@ declare namespace _default {
4
4
  }
5
5
  export default _default;
6
6
  export type ByteOrEof = u8 | null;
7
- export type Utf8NonEmptyState = arrayT.Array1<number> | arrayT.Array2<number> | arrayT.Array3<number>;
7
+ export type Utf8NonEmptyState = Array.Array1<number> | Array.Array2<number> | Array.Array3<number>;
8
8
  export type Utf8State = null | Utf8NonEmptyState;
9
9
  export type u8 = number;
10
10
  export type i32 = number;
11
11
  declare const fromCodePointList: (input: List.List<number>) => List.Thunk<number>;
12
12
  /** @type {(input: List.List<u8>) => List.List<i32>} */
13
13
  declare const toCodePointList: (input: List.List<u8>) => List.List<i32>;
14
- import * as arrayT from '../../types/array/module.f.mjs';
14
+ import * as Array from '../../types/array/module.f.mjs';
15
15
  import * as List from '../../types/list/module.f.mjs';
@@ -1,11 +1,11 @@
1
1
  import list, * as List from '../../types/list/module.f.mjs'
2
2
  import * as operator from '../../types/function/operator/module.f.mjs'
3
- import * as arrayT from '../../types/array/module.f.mjs'
3
+ import * as Array from '../../types/array/module.f.mjs'
4
4
  const { flatMap, flat, stateScan } = list
5
5
 
6
6
  /** @typedef {u8|null} ByteOrEof */
7
7
 
8
- /** @typedef {arrayT.Array1<number>|arrayT.Array2<number>|arrayT.Array3<number>} Utf8NonEmptyState */
8
+ /** @typedef {Array.Array1<number>|Array.Array2<number>|Array.Array3<number>} Utf8NonEmptyState */
9
9
 
10
10
  /** @typedef {null|Utf8NonEmptyState} Utf8State */
11
11
 
@@ -9,26 +9,26 @@ declare namespace _default {
9
9
  export { bitLength };
10
10
  }
11
11
  export default _default;
12
- export type Unary = Op.Unary<bigint, bigint>;
12
+ export type Unary = Operator.Unary<bigint, bigint>;
13
13
  export type Additive<T> = {
14
14
  readonly 0: T;
15
- readonly add: Op.Reduce<T>;
15
+ readonly add: Operator.Reduce<T>;
16
16
  };
17
- /** @typedef {Op.Unary<bigint, bigint>} Unary*/
17
+ /** @typedef {Operator.Unary<bigint, bigint>} Unary*/
18
18
  /** @type {(a: bigint) => (b: bigint) => bigint} */
19
19
  declare const addition: (a: bigint) => (b: bigint) => bigint;
20
20
  declare const sum: (input: import("../list/module.f.mjs").List<bigint>) => bigint;
21
21
  /** @type {(a: bigint) => bigint} */
22
22
  declare const abs: (a: bigint) => bigint;
23
- /** @type {(a: bigint) => compareT.Sign} */
24
- declare const sign: (a: bigint) => compareT.Sign;
23
+ /** @type {(a: bigint) => Compare.Sign} */
24
+ declare const sign: (a: bigint) => Compare.Sign;
25
25
  /** @type {(a: bigint) => string} */
26
26
  declare const serialize: (a: bigint) => string;
27
27
  /**
28
28
  * @template T
29
29
  * @typedef {{
30
30
  * readonly 0: T
31
- * readonly add: Op.Reduce<T>
31
+ * readonly add: Operator.Reduce<T>
32
32
  * }} Additive
33
33
  */
34
34
  /** @type {<T>(a: Additive<T>) => (a: T) => (n: bigint) => T} */
@@ -73,5 +73,5 @@ declare function log2(v: bigint): bigint;
73
73
  * and adds `1n` to account for the MSB itself.For negative numbers, the absolute value is used.
74
74
  */
75
75
  declare function bitLength(v: bigint): bigint;
76
- import * as Op from '../function/operator/module.f.mjs';
77
- import * as compareT from '../function/compare/module.f.mjs';
76
+ import * as Operator from '../function/operator/module.f.mjs';
77
+ import * as Compare from '../function/compare/module.f.mjs';
@@ -1,10 +1,10 @@
1
- import compare, * as compareT from '../function/compare/module.f.mjs'
2
- import op, * as Op from '../function/operator/module.f.mjs'
1
+ import compare, * as Compare from '../function/compare/module.f.mjs'
2
+ import * as Operator from '../function/operator/module.f.mjs'
3
3
  const { unsafeCmp } = compare
4
4
  import list from '../list/module.f.mjs'
5
5
  const { reduce } = list
6
6
 
7
- /** @typedef {Op.Unary<bigint, bigint>} Unary*/
7
+ /** @typedef {Operator.Unary<bigint, bigint>} Unary*/
8
8
 
9
9
  /** @type {(a: bigint) => (b: bigint) => bigint} */
10
10
  const addition = a => b => a + b
@@ -14,7 +14,7 @@ const sum = reduce(addition)(0n)
14
14
  /** @type {(a: bigint) => bigint} */
15
15
  const abs = a => a >= 0 ? a : -a
16
16
 
17
- /** @type {(a: bigint) => compareT.Sign} */
17
+ /** @type {(a: bigint) => Compare.Sign} */
18
18
  const sign = a => unsafeCmp(a)(0n)
19
19
 
20
20
  /** @type {(a: bigint) => string} */
@@ -24,7 +24,7 @@ const serialize = a => `${a}n`
24
24
  * @template T
25
25
  * @typedef {{
26
26
  * readonly 0: T
27
- * readonly add: Op.Reduce<T>
27
+ * readonly add: Operator.Reduce<T>
28
28
  * }} Additive
29
29
  */
30
30
 
@@ -1,8 +1,8 @@
1
1
  import * as _ from '../types/module.f.mjs'
2
- import list, * as List from '../../list/module.f.mjs'
2
+ import * as List from '../../list/module.f.mjs'
3
3
  import cmp, * as cmpT from '../../function/compare/module.f.mjs'
4
4
  const { index3, index5 } = cmp
5
- import array, * as arrayT from '../../array/module.f.mjs'
5
+ import * as Array from '../../array/module.f.mjs'
6
6
 
7
7
  /**
8
8
  * @template T
@@ -68,12 +68,12 @@ const find = c => {
68
68
  /** @typedef {typeof c extends cmpT.Compare<infer T> ? T : never} T */
69
69
  /** @type {(prior: Path<T>) => (node: _.Node<T>) => Result<T>} */
70
70
  const f = tail => node => {
71
- /** @type {(index: arrayT.KeyOf<typeof node>) => Result<T>} */
71
+ /** @type {(index: Array.KeyOf<typeof node>) => Result<T>} */
72
72
  const append = index => {
73
73
  const first = /** @type {PathItem<T>} */([index, node])
74
74
  return f({ first, tail })(child(first))
75
75
  }
76
- /** @type {(index: arrayT.KeyOf<typeof node>) => Result<T>} */
76
+ /** @type {(index: Array.KeyOf<typeof node>) => Result<T>} */
77
77
  const done = index => ({ first: /** @type {First<T>} */([index, node]), tail })
78
78
  switch (node.length) {
79
79
  case 1: { return done(i3(node[0])) }
@@ -1,6 +1,6 @@
1
1
  import _, * as T from './module.f.mjs'
2
2
  import list from '../../list/module.f.mjs'
3
- import json, * as jsonT from '../../../json/module.f.mjs'
3
+ import json, * as Json from '../../../json/module.f.mjs'
4
4
  import o from '../../object/module.f.mjs'
5
5
  const { sort } = o
6
6
  import * as btree from '../types/module.f.mjs'
@@ -13,7 +13,7 @@ const jsonStr = json.stringify(sort)
13
13
  /** @type {(node: btree.Node<string>) => (value: string) => btree.Node<string>} */
14
14
  const set = node => value => s.set(cmp(value))(() => value)(node)
15
15
 
16
- /** @type {(r: T.Result<jsonT.Unknown>) => string} */
16
+ /** @type {(r: T.Result<Json.Unknown>) => string} */
17
17
  const str = r => jsonStr(list.toArray(list.map(x => x[0])(r)))
18
18
 
19
19
  /** @type {(i: string) => (m: btree.Node<string>) => string} */
@@ -6,14 +6,14 @@ export default _default;
6
6
  export type Leaf01<T> = null | _.Leaf1<T>;
7
7
  export type RemovePath<T> = {
8
8
  readonly first: Leaf01<T>;
9
- readonly tail: findT.Path<T>;
9
+ readonly tail: Find.Path<T>;
10
10
  };
11
11
  export type Branch<T> = _.Branch1<T> | _.Branch3<T> | _.Branch5<T>;
12
12
  export type Merge<A, T> = (a: A) => (n: _.Branch3<T>) => _.Branch1<T> | _.Branch3<T>;
13
- /** @type {<T>(c: cmpT.Compare<T>) => (node: _.Node<T>) => _.Tree<T>} */
14
- declare const nodeRemove: <T>(c: cmpT.Compare<T>) => (node: _.Node<T>) => _.Tree<T>;
15
- /** @type {<T>(c: cmpT.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>} */
16
- declare const remove: <T>(c: cmpT.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>;
13
+ /** @type {<T>(c: Cmp.Compare<T>) => (node: _.Node<T>) => _.Tree<T>} */
14
+ declare const nodeRemove: <T>(c: Cmp.Compare<T>) => (node: _.Node<T>) => _.Tree<T>;
15
+ /** @type {<T>(c: Cmp.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>} */
16
+ declare const remove: <T>(c: Cmp.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>;
17
17
  import * as _ from '../types/module.f.mjs';
18
- import * as findT from '../find/module.f.mjs';
19
- import * as cmpT from '../../function/compare/module.f.mjs';
18
+ import * as Find from '../find/module.f.mjs';
19
+ import * as Cmp from '../../function/compare/module.f.mjs';
@@ -1,9 +1,9 @@
1
1
  import * as _ from '../types/module.f.mjs'
2
- import cmp, * as cmpT from '../../function/compare/module.f.mjs'
3
- import find, * as findT from '../find/module.f.mjs'
2
+ import * as Cmp from '../../function/compare/module.f.mjs'
3
+ import find, * as Find from '../find/module.f.mjs'
4
4
  import list from '../../list/module.f.mjs'
5
5
  const { fold, concat, next } = list
6
- import array, * as arrayT from '../../array/module.f.mjs'
6
+ import * as Array from '../../array/module.f.mjs'
7
7
  import n from '../../nullable/module.f.mjs'
8
8
  const { map } = n
9
9
 
@@ -16,11 +16,11 @@ const { map } = n
16
16
  * @template T
17
17
  * @typedef {{
18
18
  * readonly first: Leaf01<T>,
19
- * readonly tail: findT.Path<T>
19
+ * readonly tail: Find.Path<T>
20
20
  * }} RemovePath
21
21
  */
22
22
 
23
- /** @type {<T>(tail: findT.Path<T>) => (n: _.Node<T>) => readonly[T, RemovePath<T>]} */
23
+ /** @type {<T>(tail: Find.Path<T>) => (n: _.Node<T>) => readonly[T, RemovePath<T>]} */
24
24
  const path = tail => n => {
25
25
  switch (n.length) {
26
26
  case 1: { return [n[0], { first: null, tail }] }
@@ -94,10 +94,10 @@ const initValue1 = a => n => {
94
94
  * @typedef {(a: A) => (n: _.Branch3<T>) => _.Branch1<T> | _.Branch3<T>} Merge
95
95
  */
96
96
 
97
- /** @type {<A, T>(ms: arrayT.Array2<Merge<A, T>>) => (i: findT.PathItem<T>) => (a: A) => Branch<T>} */
97
+ /** @type {<A, T>(ms: Array.Array2<Merge<A, T>>) => (i: Find.PathItem<T>) => (a: A) => Branch<T>} */
98
98
  const reduceX = ms => ([i, n]) => a => {
99
99
  const [m0, m2] = ms
100
- /** @typedef {typeof ms extends arrayT.Array2<Merge<infer A, infer T>> ? [A,T] : never} AT */
100
+ /** @typedef {typeof ms extends Array.Array2<Merge<infer A, infer T>> ? [A,T] : never} AT */
101
101
  /** @typedef {AT[0]} A */
102
102
  /** @typedef {AT[1]} T */
103
103
  /** @type {(m: Merge<A, T>) => Branch<T>} */
@@ -116,15 +116,15 @@ const reduce = fold(reduceX([reduceValue0, reduceValue2]))
116
116
 
117
117
  const initReduce = reduceX([initValue0, initValue1])
118
118
 
119
- /** @type {<T>(c: cmpT.Compare<T>) => (node: _.Node<T>) => _.Tree<T>} */
119
+ /** @type {<T>(c: Cmp.Compare<T>) => (node: _.Node<T>) => _.Tree<T>} */
120
120
  const nodeRemove = c => node => {
121
- /** @typedef {typeof c extends cmpT.Compare<infer T> ? T : never} T */
121
+ /** @typedef {typeof c extends Cmp.Compare<infer T> ? T : never} T */
122
122
  /** @type {() => null | RemovePath<T>} */
123
123
  const f = () => {
124
124
  const { first, tail } = find.find(c)(node)
125
- /** @type {(n: _.Node<T>) => (f: (v: T) => findT.PathItem<T>) => RemovePath<T>} */
125
+ /** @type {(n: _.Node<T>) => (f: (v: T) => Find.PathItem<T>) => RemovePath<T>} */
126
126
  const branch = n => f => {
127
- const [v, p] = path(/** @type {findT.Path<T>} */(null))(n)
127
+ const [v, p] = path(/** @type {Find.Path<T>} */(null))(n)
128
128
  return { first: p.first, tail: concat(p.tail)({ first: f(v), tail }) }
129
129
  }
130
130
  const [i, n] = first
@@ -156,7 +156,7 @@ const nodeRemove = c => node => {
156
156
  return result.length === 1 ? result[0] : result
157
157
  }
158
158
 
159
- /** @type {<T>(c: cmpT.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>} */
159
+ /** @type {<T>(c: Cmp.Compare<T>) => (tree: _.Tree<T>) => _.Tree<T>} */
160
160
  const remove = c => map(nodeRemove(c))
161
161
 
162
162
  export default {