functionalscript 0.3.6 → 0.3.8
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/com/cpp/module.f.js +0 -1
- package/com/cs/module.f.js +5 -6
- package/com/rust/module.f.d.ts +3 -3
- package/com/rust/module.f.js +24 -29
- package/com/test/build.f.js +2 -2
- package/com/types/module.f.d.ts +1 -1
- package/com/types/module.f.js +1 -2
- package/com/types/testlib.f.js +0 -1
- package/commonjs/build/module.f.d.ts +2 -2
- package/commonjs/build/module.f.js +3 -6
- package/commonjs/build/test.f.js +0 -4
- package/commonjs/module/function/module.f.d.ts +1 -1
- package/commonjs/module/function/module.f.js +1 -1
- package/commonjs/module/module.f.d.ts +1 -1
- package/commonjs/module/module.f.js +2 -3
- package/commonjs/path/module.f.d.ts +5 -5
- package/commonjs/path/module.f.js +6 -8
- package/commonjs/path/test.f.js +1 -2
- package/crypto/prime_field/module.f.d.ts +2 -2
- package/crypto/prime_field/module.f.js +3 -4
- package/crypto/secp/module.f.d.ts +2 -2
- package/crypto/secp/module.f.js +4 -5
- package/crypto/sha2/module.f.d.ts +75 -12
- package/crypto/sha2/module.f.js +246 -139
- package/crypto/sha2/test.f.d.ts +22 -3
- package/crypto/sha2/test.f.js +120 -67
- package/dev/test/module.f.d.ts +1 -1
- package/dev/test/module.f.js +4 -5
- package/dev/test.f.js +0 -4
- package/djs/module.f.d.ts +1 -1
- package/djs/module.f.js +0 -1
- package/djs/parser/module.f.d.ts +1 -1
- package/djs/parser/module.f.js +0 -2
- package/djs/serializer/module.f.d.ts +2 -2
- package/djs/serializer/module.f.js +0 -2
- package/djs/tokenizer/module.f.js +0 -1
- package/fsc/test.f.js +0 -1
- package/html/module.f.d.ts +1 -1
- package/html/module.f.js +15 -11
- package/html/test.f.js +7 -7
- package/js/tokenizer/module.f.d.ts +2 -2
- package/js/tokenizer/module.f.js +1 -2
- package/json/parser/module.f.d.ts +2 -2
- package/json/parser/module.f.js +0 -3
- package/json/serializer/module.f.js +0 -2
- package/json/tokenizer/module.f.js +0 -1
- package/nanvm-lib/tests/test.f.d.ts +28 -0
- package/nanvm-lib/tests/test.f.js +45 -0
- package/package.json +1 -1
- package/text/ascii/module.f.d.ts +1 -1
- package/text/ascii/module.f.js +2 -3
- package/text/ascii/test.f.js +2 -4
- package/text/module.f.d.ts +18 -3
- package/text/module.f.js +22 -6
- package/text/sgr/module.f.js +1 -1
- package/text/test.f.d.ts +4 -1
- package/text/test.f.js +24 -16
- package/text/utf16/module.f.d.ts +5 -6
- package/text/utf16/module.f.js +9 -10
- package/text/utf16/test.f.js +29 -30
- package/text/utf8/module.f.d.ts +8 -5
- package/text/utf8/module.f.js +3 -5
- package/text/utf8/test.f.js +34 -35
- package/types/array/module.f.d.ts +12 -9
- package/types/array/module.f.js +10 -11
- package/types/array/test.f.d.ts +1 -0
- package/types/array/test.f.js +18 -17
- package/types/bigfloat/module.f.d.ts +1 -1
- package/types/bigfloat/module.f.js +7 -8
- package/types/bigfloat/test.f.js +1 -2
- package/types/bigint/module.f.d.ts +20 -11
- package/types/bigint/module.f.js +19 -20
- package/types/bigint/test.f.d.ts +1 -0
- package/types/bigint/test.f.js +7 -2
- package/types/bit_vec/module.f.d.ts +103 -83
- package/types/bit_vec/module.f.js +68 -110
- package/types/bit_vec/test.f.d.ts +20 -8
- package/types/bit_vec/test.f.js +110 -117
- package/types/btree/find/test.f.js +3 -4
- package/types/btree/module.f.d.ts +3 -3
- package/types/btree/module.f.js +2 -5
- package/types/btree/remove/test.f.js +2 -3
- package/types/btree/set/test.f.js +3 -6
- package/types/btree/test.f.js +0 -1
- package/types/btree/types/module.f.d.ts +3 -3
- package/types/byte_set/module.f.d.ts +2 -2
- package/types/byte_set/module.f.js +0 -2
- package/types/function/compare/module.f.d.ts +1 -1
- package/types/function/compare/module.f.js +0 -1
- package/types/function/compare/test.f.js +1 -2
- package/types/function/module.f.d.ts +1 -1
- package/types/function/module.f.js +1 -1
- package/types/function/operator/module.f.d.ts +2 -3
- package/types/function/operator/module.f.js +5 -5
- package/types/function/test.f.js +1 -2
- package/types/list/module.f.d.ts +1 -1
- package/types/list/module.f.js +9 -9
- package/types/list/test.f.js +2 -4
- package/types/map/module.f.d.ts +6 -6
- package/types/map/module.f.js +6 -15
- package/types/map/test.f.js +1 -2
- package/types/monoid/module.f.d.ts +73 -0
- package/types/monoid/module.f.js +42 -0
- package/types/monoid/test.f.d.ts +5 -0
- package/types/monoid/test.f.js +27 -0
- package/types/nibble_set/module.f.d.ts +2 -3
- package/types/nibble_set/test.f.js +1 -2
- package/types/number/test.f.js +1 -2
- package/types/object/module.f.d.ts +5 -5
- package/types/object/module.f.js +2 -4
- package/types/range_map/module.f.d.ts +4 -4
- package/types/range_map/module.f.js +3 -9
- package/types/result/module.f.d.ts +2 -3
- package/types/sorted_list/module.f.d.ts +6 -6
- package/types/sorted_list/module.f.js +2 -6
- package/types/sorted_list/test.f.js +4 -9
- package/types/sorted_set/module.f.d.ts +1 -1
- package/types/sorted_set/module.f.js +2 -5
- package/types/sorted_set/test.f.js +4 -9
- package/types/string/module.f.d.ts +3 -3
- package/types/string/module.f.js +1 -2
- package/types/string/test.f.js +2 -4
- package/types/string_set/module.f.d.ts +1 -1
- package/types/string_set/module.f.js +5 -11
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Reduce } from "../function/operator/module.f.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a monoid, an algebraic structure with a binary operation
|
|
4
|
+
* and an identity (neutral) element.
|
|
5
|
+
*
|
|
6
|
+
* A monoid satisfies the following properties:
|
|
7
|
+
* 1. **Associativity**: The operation must be associative.
|
|
8
|
+
* For all `a`, `b`, and `c` in the set, `(a operation b) operation c = a operation (b operation c)`.
|
|
9
|
+
* {@link https://en.wikipedia.org/wiki/Associative_property Learn more about associativity}.
|
|
10
|
+
* 2. **Identity Element**: There exists an element (called the identity) such that,
|
|
11
|
+
* when combined with any other element under the operation, it leaves the other element unchanged.
|
|
12
|
+
* {@link https://en.wikipedia.org/wiki/Identity_element Learn more about identity elements}.
|
|
13
|
+
*
|
|
14
|
+
* Learn more about monoids: {@link https://en.wikipedia.org/wiki/Monoid}.
|
|
15
|
+
*
|
|
16
|
+
* @template T The type of the elements in the monoid.
|
|
17
|
+
*/
|
|
18
|
+
export type Monoid<T> = {
|
|
19
|
+
/**
|
|
20
|
+
* The identity (neutral) element for the monoid.
|
|
21
|
+
* When combined with any value under the `operation`, it leaves the other value unchanged.
|
|
22
|
+
*
|
|
23
|
+
* Examples:
|
|
24
|
+
* - `0` for addition
|
|
25
|
+
* - `1` for multiplication
|
|
26
|
+
* - `""` for string concatenation
|
|
27
|
+
* - `[]` for array concatenation
|
|
28
|
+
*
|
|
29
|
+
* Learn more: {@link https://en.wikipedia.org/wiki/Identity_element}
|
|
30
|
+
*/
|
|
31
|
+
readonly identity: T;
|
|
32
|
+
/**
|
|
33
|
+
* The associative binary operation of the monoid.
|
|
34
|
+
* Takes one value of type `T` and returns a function that takes another value of type `T`,
|
|
35
|
+
* producing a result of type `T`.
|
|
36
|
+
*
|
|
37
|
+
* Examples:
|
|
38
|
+
* - `(a, b) => a + b` for addition
|
|
39
|
+
* - `(a, b) => a * b` for multiplication
|
|
40
|
+
* - `(a, b) => a.concat(b)` for arrays or strings
|
|
41
|
+
*
|
|
42
|
+
* Learn more: {@link https://en.wikipedia.org/wiki/Binary_operation}
|
|
43
|
+
*/
|
|
44
|
+
readonly operation: Reduce<T>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Repeats a monoid operation `n` times on the given element `a`.
|
|
48
|
+
* This function efficiently performs the operation using exponentiation by squaring.
|
|
49
|
+
*
|
|
50
|
+
* @template T The type of the elements in the monoid.
|
|
51
|
+
* @param monoid The monoid structure, including the identity and binary operation.
|
|
52
|
+
* @returns A function that takes an element `a` and a repetition count `n`,
|
|
53
|
+
* and returns the result of applying the operation `n` times.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* const add: Monoid<number> = {
|
|
59
|
+
* identity: 0,
|
|
60
|
+
* operation: a => b => a + b,
|
|
61
|
+
* };
|
|
62
|
+
*
|
|
63
|
+
* const resultAdd = repeat(add)(2)(10n) // 20
|
|
64
|
+
*
|
|
65
|
+
* const concat: Monoid<string> = {
|
|
66
|
+
* identity: '',
|
|
67
|
+
* operation: a => b => a + b,
|
|
68
|
+
* };
|
|
69
|
+
*
|
|
70
|
+
* const resultConcat = repeat(concat)('ha')(3n) // 'hahaha'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare const repeat: <T>({ identity, operation }: Monoid<T>) => (a: T) => (n: bigint) => T;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeats a monoid operation `n` times on the given element `a`.
|
|
3
|
+
* This function efficiently performs the operation using exponentiation by squaring.
|
|
4
|
+
*
|
|
5
|
+
* @template T The type of the elements in the monoid.
|
|
6
|
+
* @param monoid The monoid structure, including the identity and binary operation.
|
|
7
|
+
* @returns A function that takes an element `a` and a repetition count `n`,
|
|
8
|
+
* and returns the result of applying the operation `n` times.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* const add: Monoid<number> = {
|
|
14
|
+
* identity: 0,
|
|
15
|
+
* operation: a => b => a + b,
|
|
16
|
+
* };
|
|
17
|
+
*
|
|
18
|
+
* const resultAdd = repeat(add)(2)(10n) // 20
|
|
19
|
+
*
|
|
20
|
+
* const concat: Monoid<string> = {
|
|
21
|
+
* identity: '',
|
|
22
|
+
* operation: a => b => a + b,
|
|
23
|
+
* };
|
|
24
|
+
*
|
|
25
|
+
* const resultConcat = repeat(concat)('ha')(3n) // 'hahaha'
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export const repeat = ({ identity, operation }) => (a) => (n) => {
|
|
29
|
+
let ai = a;
|
|
30
|
+
let ni = n;
|
|
31
|
+
let result = identity;
|
|
32
|
+
while (true) {
|
|
33
|
+
if ((ni & 1n) !== 0n) {
|
|
34
|
+
result = operation(result)(ai);
|
|
35
|
+
}
|
|
36
|
+
ni >>= 1n;
|
|
37
|
+
if (ni === 0n) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
ai = operation(ai)(ai);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { repeat } from "./module.f.js";
|
|
2
|
+
export default {
|
|
3
|
+
numberAdd: () => {
|
|
4
|
+
const add = {
|
|
5
|
+
identity: 0,
|
|
6
|
+
operation: a => b => a + b,
|
|
7
|
+
};
|
|
8
|
+
const resultAdd = repeat(add)(2)(10n); // 20
|
|
9
|
+
if (resultAdd !== 20) {
|
|
10
|
+
throw resultAdd;
|
|
11
|
+
}
|
|
12
|
+
const id = repeat(add)(42)(0n);
|
|
13
|
+
if (id !== 0) {
|
|
14
|
+
throw id;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
stringConcat: () => {
|
|
18
|
+
const concat = {
|
|
19
|
+
identity: '',
|
|
20
|
+
operation: a => b => a + b,
|
|
21
|
+
};
|
|
22
|
+
const resultConcat = repeat(concat)('ha')(3n); // 'hahaha'
|
|
23
|
+
if (resultConcat !== 'hahaha') {
|
|
24
|
+
throw resultConcat;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type NibbleSet = number;
|
|
2
|
-
type Nibble = number;
|
|
1
|
+
export type NibbleSet = number;
|
|
2
|
+
export type Nibble = number;
|
|
3
3
|
export declare const empty = 0;
|
|
4
4
|
export declare const universe = 65535;
|
|
5
5
|
export declare const has: (n: Nibble) => (s: NibbleSet) => boolean;
|
|
@@ -7,4 +7,3 @@ export declare const set: (n: Nibble) => (s: NibbleSet) => NibbleSet;
|
|
|
7
7
|
export declare const complement: (n: NibbleSet) => NibbleSet;
|
|
8
8
|
export declare const unset: (n: Nibble) => (s: NibbleSet) => NibbleSet;
|
|
9
9
|
export declare const setRange: (r: readonly [number, number]) => (s: NibbleSet) => NibbleSet;
|
|
10
|
-
export {};
|
package/types/number/test.f.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { type List } from '../list/module.f.ts';
|
|
2
|
+
import { type Map as BtMap } from '../map/module.f.ts';
|
|
3
3
|
export type Map<T> = {
|
|
4
4
|
readonly [k in string]: T;
|
|
5
5
|
};
|
|
6
6
|
export type Entry<T> = readonly [string, T];
|
|
7
7
|
export declare const at: (name: string) => <T>(object: Map<T>) => T | null;
|
|
8
|
-
export declare const sort: <T>(e:
|
|
9
|
-
export declare const fromEntries: <T>(e:
|
|
10
|
-
export declare const fromMap: <T>(m:
|
|
8
|
+
export declare const sort: <T>(e: List<Entry<T>>) => List<Entry<T>>;
|
|
9
|
+
export declare const fromEntries: <T>(e: List<Entry<T>>) => Map<T>;
|
|
10
|
+
export declare const fromMap: <T>(m: BtMap<T>) => Map<T>;
|
package/types/object/module.f.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import * as btMap from "../map/module.f.js";
|
|
4
|
-
const { entries: mapEntries, fromEntries: mapFromEntries } = btMap;
|
|
1
|
+
import { iterable } from "../list/module.f.js";
|
|
2
|
+
import { entries as mapEntries, fromEntries as mapFromEntries } from "../map/module.f.js";
|
|
5
3
|
const { getOwnPropertyDescriptor, fromEntries: objectFromEntries } = Object;
|
|
6
4
|
export const at = name => object => {
|
|
7
5
|
const r = getOwnPropertyDescriptor(object, name);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as O from '../function/operator/module.f.ts';
|
|
3
|
-
import * as Range from '../range/module.f.ts';
|
|
1
|
+
import { type SortedList } from '../sorted_list/module.f.ts';
|
|
2
|
+
import type * as O from '../function/operator/module.f.ts';
|
|
3
|
+
import type * as Range from '../range/module.f.ts';
|
|
4
4
|
export type Entry<T> = [T, number];
|
|
5
|
-
export type RangeMap<T> =
|
|
5
|
+
export type RangeMap<T> = SortedList<Entry<T>>;
|
|
6
6
|
export type RangeMapArray<T> = readonly Entry<T>[];
|
|
7
7
|
export type Operators<T> = {
|
|
8
8
|
readonly union: O.Reduce<T>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const { next } = list;
|
|
5
|
-
import * as Option from "../nullable/module.f.js";
|
|
6
|
-
import * as number from "../number/module.f.js";
|
|
7
|
-
const { cmp } = number;
|
|
8
|
-
import * as O from "../function/operator/module.f.js";
|
|
9
|
-
import * as Range from "../range/module.f.js";
|
|
1
|
+
import { genericMerge } from "../sorted_list/module.f.js";
|
|
2
|
+
import { next } from "../list/module.f.js";
|
|
3
|
+
import { cmp } from "../number/module.f.js";
|
|
10
4
|
const reduceOp = union => equal => state => ([aItem, aMax]) => ([bItem, bMax]) => {
|
|
11
5
|
const sign = cmp(aMax)(bMax);
|
|
12
6
|
const min = sign === 1 ? bMax : aMax;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
type Ok<T> = readonly ['ok', T];
|
|
2
|
-
type Error<E> = readonly ['error', E];
|
|
1
|
+
export type Ok<T> = readonly ['ok', T];
|
|
2
|
+
export type Error<E> = readonly ['error', E];
|
|
3
3
|
export type Result<T, E> = Ok<T> | Error<E>;
|
|
4
4
|
export declare const ok: <T>(value: T) => Ok<T>;
|
|
5
5
|
export declare const error: <E>(e: E) => Error<E>;
|
|
6
6
|
export declare const unwrap: <T, E>(r: Result<T, E>) => T;
|
|
7
|
-
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as compare from '../function/compare/module.f.ts';
|
|
2
|
-
import
|
|
3
|
-
import * as option from '../nullable/module.f.ts';
|
|
4
|
-
export type SortedList<T> =
|
|
1
|
+
import type * as compare from '../function/compare/module.f.ts';
|
|
2
|
+
import { type List } from '../list/module.f.ts';
|
|
3
|
+
import type * as option from '../nullable/module.f.ts';
|
|
4
|
+
export type SortedList<T> = List<T>;
|
|
5
5
|
type SortedArray<T> = readonly T[];
|
|
6
6
|
type Cmp<T> = (a: T) => (b: T) => compare.Sign;
|
|
7
7
|
export type ReduceOp<T, S> = (state: S) => (a: T) => (b: T) => readonly [option.Nullable<T>, compare.Sign, S];
|
|
8
|
-
export type TailReduce<T, S> = (state: S) => (tail:
|
|
8
|
+
export type TailReduce<T, S> = (state: S) => (tail: List<T>) => List<T>;
|
|
9
9
|
type MergeReduce<T, S> = {
|
|
10
10
|
readonly reduceOp: ReduceOp<T, S>;
|
|
11
11
|
readonly tailReduce: TailReduce<T, S>;
|
|
12
12
|
};
|
|
13
|
-
export declare const genericMerge: <T, S>({ reduceOp, tailReduce }: MergeReduce<T, S>) => (state: S) => (a:
|
|
13
|
+
export declare const genericMerge: <T, S>({ reduceOp, tailReduce }: MergeReduce<T, S>) => (state: S) => (a: List<T>) => (b: List<T>) => List<T>;
|
|
14
14
|
export declare const merge: <T>(cmp: Cmp<T>) => (a: SortedList<T>) => (b: SortedList<T>) => SortedList<T>;
|
|
15
15
|
export declare const find: <T>(cmp: Cmp<T>) => (value: T) => (array: SortedArray<T>) => T | null;
|
|
16
16
|
export {};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import * as option from "../nullable/module.f.js";
|
|
4
|
-
const { next } = list;
|
|
5
|
-
import * as f from "../function/module.f.js";
|
|
6
|
-
const { identity } = f;
|
|
1
|
+
import { next } from "../list/module.f.js";
|
|
2
|
+
import { identity } from "../function/module.f.js";
|
|
7
3
|
export const genericMerge = ({ reduceOp, tailReduce }) => {
|
|
8
4
|
const f = state => a => b => () => {
|
|
9
5
|
const aResult = next(a);
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import * as _ from "./module.f.js";
|
|
2
|
-
import
|
|
3
|
-
const { unsafeCmp } = compare;
|
|
2
|
+
import { unsafeCmp } from "../function/compare/module.f.js";
|
|
4
3
|
import * as json from "../../json/module.f.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
const { toArray, countdown, length } = list;
|
|
9
|
-
import * as Map from "../map/module.f.js";
|
|
10
|
-
import * as f from "../function/module.f.js";
|
|
11
|
-
const { flip } = f;
|
|
4
|
+
import { sort } from "../object/module.f.js";
|
|
5
|
+
import { toArray, countdown, length } from "../list/module.f.js";
|
|
6
|
+
import { flip } from "../function/module.f.js";
|
|
12
7
|
const stringify = json.stringify(sort);
|
|
13
8
|
const reverseCmp = flip(unsafeCmp);
|
|
14
9
|
export default {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Compare from '../function/compare/module.f.ts';
|
|
1
|
+
import type * as Compare from '../function/compare/module.f.ts';
|
|
2
2
|
export type SortedSet<T> = readonly T[];
|
|
3
3
|
type Cmp<T> = (a: T) => (b: T) => Compare.Sign;
|
|
4
4
|
export declare const union: <T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const { toArray } = list;
|
|
4
|
-
import * as sortedList from "../sorted_list/module.f.js";
|
|
5
|
-
const { merge, genericMerge, find } = sortedList;
|
|
1
|
+
import { toArray } from "../list/module.f.js";
|
|
2
|
+
import { merge, genericMerge, find } from "../sorted_list/module.f.js";
|
|
6
3
|
export const union = cmp => a => b => toArray(merge(cmp)(a)(b));
|
|
7
4
|
export const intersect = cmp => a => b => toArray(intersectMerge(cmp)(a)(b));
|
|
8
5
|
const tailReduce = () => () => null;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import * as _ from "./module.f.js";
|
|
2
|
-
import
|
|
3
|
-
const { unsafeCmp } = compare;
|
|
2
|
+
import { unsafeCmp } from "../function/compare/module.f.js";
|
|
4
3
|
import * as json from "../../json/module.f.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
const { toArray, countdown, length } = list;
|
|
9
|
-
import * as Map from "../map/module.f.js";
|
|
10
|
-
import * as f from "../function/module.f.js";
|
|
11
|
-
const { flip } = f;
|
|
4
|
+
import { sort } from "../object/module.f.js";
|
|
5
|
+
import { toArray, countdown, length } from "../list/module.f.js";
|
|
6
|
+
import { flip } from "../function/module.f.js";
|
|
12
7
|
const stringify = a => json.stringify(sort)(a);
|
|
13
8
|
const reverseCmp = flip(unsafeCmp);
|
|
14
9
|
export default {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type List } from '../list/module.f.ts';
|
|
2
2
|
import * as compare from '../function/compare/module.f.ts';
|
|
3
|
-
export declare const join: (_: string) => (input:
|
|
4
|
-
export declare const concat: (input:
|
|
3
|
+
export declare const join: (_: string) => (input: List<string>) => string;
|
|
4
|
+
export declare const concat: (input: List<string>) => string;
|
|
5
5
|
export declare const repeat: (n: string) => (v: number) => string;
|
|
6
6
|
export declare const cmp: (a: string) => (b: string) => compare.Sign;
|
package/types/string/module.f.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const { reduce: listReduce, repeat: listRepeat } = list;
|
|
1
|
+
import { reduce as listReduce, repeat as listRepeat } from "../list/module.f.js";
|
|
3
2
|
import { compose } from "../function/module.f.js";
|
|
4
3
|
import * as compare from "../function/compare/module.f.js";
|
|
5
4
|
const { unsafeCmp } = compare;
|
package/types/string/test.f.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import * as list from "../list/module.f.js";
|
|
4
|
-
const { repeat: repeatList } = list;
|
|
1
|
+
import { join, concat, repeat, cmp } from "./module.f.js";
|
|
2
|
+
import { repeat as repeatList } from "../list/module.f.js";
|
|
5
3
|
export default {
|
|
6
4
|
join: {
|
|
7
5
|
0: () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as BtreeTypes from '../btree/types/module.f.ts';
|
|
1
|
+
import type * as BtreeTypes from '../btree/types/module.f.ts';
|
|
2
2
|
import { type List } from '../list/module.f.ts';
|
|
3
3
|
export declare const values: (s: StringSet) => List<string>;
|
|
4
4
|
export declare const empty: null;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import * as BtreeTypes from "../btree/types/module.f.js";
|
|
2
1
|
import * as btree from "../btree/module.f.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import * as bts from "../btree/set/module.f.js";
|
|
8
|
-
const { set: btreeSet } = bts;
|
|
9
|
-
import * as string from "../string/module.f.js";
|
|
10
|
-
const { cmp } = string;
|
|
2
|
+
import { find, isFound } from "../btree/find/module.f.js";
|
|
3
|
+
import { remove as btreeRemove } from "../btree/remove/module.f.js";
|
|
4
|
+
import { set as btreeSet } from "../btree/set/module.f.js";
|
|
5
|
+
import { cmp } from "../string/module.f.js";
|
|
11
6
|
import { fold } from "../list/module.f.js";
|
|
12
|
-
import
|
|
13
|
-
const { compose } = f;
|
|
7
|
+
import { compose } from "../function/module.f.js";
|
|
14
8
|
export const values = btree.values;
|
|
15
9
|
export const empty = btree.empty;
|
|
16
10
|
export const contains = value => {
|