functionalscript 0.9.3 → 0.10.1
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/bnf/module.f.d.ts +2 -1
- package/bnf/module.f.js +2 -1
- package/cas/module.f.d.ts +5 -0
- package/cas/module.f.js +5 -0
- package/ci/module.f.js +45 -33
- package/ci/module.js +3 -3
- package/crypto/sign/module.f.d.ts +5 -0
- package/dev/index/module.js +2 -2
- package/dev/module.f.d.ts +5 -0
- package/dev/module.f.js +5 -0
- package/dev/tf/module.f.js +5 -0
- package/dev/version/module.f.js +5 -0
- package/djs/ast/module.f.d.ts +5 -0
- package/djs/module.f.d.ts +5 -0
- package/djs/parser/module.f.d.ts +5 -0
- package/djs/parser/module.f.js +5 -0
- package/djs/parser-new/module.f.js +5 -0
- package/djs/serializer/module.f.d.ts +5 -0
- package/djs/transpiler/module.f.d.ts +5 -0
- package/djs/transpiler/module.f.js +5 -0
- package/fjs/module.f.d.ts +5 -0
- package/fjs/module.f.js +13 -2
- package/fjs/module.js +2 -2
- package/fsc/module.f.js +5 -0
- package/fsm/module.f.d.ts +5 -0
- package/fsm/module.f.js +5 -0
- package/io/module.d.ts +3 -3
- package/io/module.js +8 -7
- package/io/virtual/module.f.d.ts +5 -0
- package/json/parser/module.f.d.ts +5 -0
- package/json/parser/module.f.js +5 -0
- package/json/serializer/module.f.d.ts +5 -0
- package/json/serializer/module.f.js +5 -0
- package/json/tokenizer/module.f.js +5 -0
- package/package.json +1 -1
- package/path/module.f.d.ts +5 -0
- package/types/base128/module.f.d.ts +5 -0
- package/types/base128/module.f.js +5 -0
- package/types/bigfloat/module.f.js +5 -0
- package/types/btree/find/module.f.d.ts +5 -0
- package/types/btree/module.f.d.ts +5 -0
- package/types/btree/module.f.js +5 -0
- package/types/btree/remove/module.f.d.ts +5 -0
- package/types/btree/set/module.f.d.ts +5 -0
- package/types/btree/types/module.f.d.ts +5 -0
- package/types/byte_set/module.f.js +5 -0
- package/types/cbase32/module.f.d.ts +5 -0
- package/types/cbase32/module.f.js +5 -0
- package/types/effect/mock/module.f.d.ts +5 -0
- package/types/effect/module.f.d.ts +5 -0
- package/types/effect/node/virtual/module.f.js +5 -0
- package/types/function/compare/module.f.d.ts +5 -0
- package/types/function/operator/module.f.d.ts +5 -0
- package/types/list/module.f.js +5 -0
- package/types/map/module.f.js +5 -0
- package/types/nibble_set/module.f.d.ts +5 -0
- package/types/nominal/module.f.d.ts +5 -0
- package/types/nullable/module.f.d.ts +5 -0
- package/types/ordered_map/module.f.d.ts +5 -0
- package/types/range/module.f.d.ts +5 -0
- package/types/sorted_list/module.f.d.ts +5 -0
- package/website/module.f.js +5 -0
- package/website/module.js +3 -3
package/bnf/module.f.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { type Array2 } from '../types/array/module.f.ts';
|
|
|
9
9
|
export type TerminalRange = number;
|
|
10
10
|
export declare const fullRange: TerminalRange;
|
|
11
11
|
export declare const unicodeRange: TerminalRange;
|
|
12
|
+
export declare const max: string;
|
|
13
|
+
export declare const unicodeMax: string;
|
|
12
14
|
/** A sequence of rules. */
|
|
13
15
|
export type Sequence = readonly Rule[];
|
|
14
16
|
/** A variant */
|
|
@@ -18,7 +20,6 @@ export type Variant = {
|
|
|
18
20
|
export type DataRule = Variant | Sequence | TerminalRange | string;
|
|
19
21
|
export type LazyRule = () => DataRule;
|
|
20
22
|
export type Rule = DataRule | LazyRule;
|
|
21
|
-
export declare const max: string;
|
|
22
23
|
export declare const rangeEncode: (a: number, b: number) => TerminalRange;
|
|
23
24
|
export declare const oneEncode: (a: number) => TerminalRange;
|
|
24
25
|
export declare const eof: TerminalRange;
|
package/bnf/module.f.js
CHANGED
|
@@ -3,6 +3,8 @@ import { isArray2 } from "../types/array/module.f.js";
|
|
|
3
3
|
import { map, toArray, repeat as listRepeat } from "../types/list/module.f.js";
|
|
4
4
|
export const fullRange = 0x000000_FFFFFF;
|
|
5
5
|
export const unicodeRange = 0x000000_10FFFF;
|
|
6
|
+
export const max = codePointListToString([0xFFFFFF]);
|
|
7
|
+
export const unicodeMax = codePointListToString([0x10FFFF]);
|
|
6
8
|
// Internals:
|
|
7
9
|
const { fromEntries, values } = Object;
|
|
8
10
|
const { fromCodePoint } = String;
|
|
@@ -12,7 +14,6 @@ const { fromCodePoint } = String;
|
|
|
12
14
|
const offset = 24;
|
|
13
15
|
const mask = (1 << offset) - 1;
|
|
14
16
|
const isValid = (r) => r >= 0 && r <= mask;
|
|
15
|
-
export const max = codePointListToString([0x10FFFF]);
|
|
16
17
|
export const rangeEncode = (a, b) => {
|
|
17
18
|
if (!isValid(a) || !isValid(b) || a > b) {
|
|
18
19
|
throw `Invalid range ${a} ${b}.`;
|
package/cas/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-addressable storage utilities for hashing, addressing, and path parsing.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type Sha2 } from "../crypto/sha2/module.f.ts";
|
|
2
7
|
import type { Vec } from "../types/bit_vec/module.f.ts";
|
|
3
8
|
import { type Effect, type Operations } from "../types/effect/module.f.ts";
|
package/cas/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-addressable storage utilities for hashing, addressing, and path parsing.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { computeSync, sha256 } from "../crypto/sha2/module.f.js";
|
|
2
7
|
import { parse } from "../path/module.f.js";
|
|
3
8
|
import { cBase32ToVec, vecToCBase32 } from "../types/cbase32/module.f.js";
|
package/ci/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuous integration helper commands for repository automation tasks.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { utf8 } from "../text/module.f.js";
|
|
2
7
|
import { writeFile } from "../types/effect/node/module.f.js";
|
|
3
8
|
const os = ['ubuntu', 'macos', 'windows'];
|
|
@@ -5,15 +10,15 @@ const architecture = ['intel', 'arm'];
|
|
|
5
10
|
// https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
|
|
6
11
|
const images = {
|
|
7
12
|
ubuntu: {
|
|
8
|
-
intel: 'ubuntu-
|
|
13
|
+
intel: 'ubuntu-24.04',
|
|
9
14
|
arm: 'ubuntu-24.04-arm'
|
|
10
15
|
},
|
|
11
16
|
macos: {
|
|
12
|
-
intel: 'macos-
|
|
13
|
-
arm: 'macos-
|
|
17
|
+
intel: 'macos-26-intel',
|
|
18
|
+
arm: 'macos-26'
|
|
14
19
|
},
|
|
15
20
|
windows: {
|
|
16
|
-
intel: 'windows-
|
|
21
|
+
intel: 'windows-2025',
|
|
17
22
|
arm: 'windows-11-arm',
|
|
18
23
|
}
|
|
19
24
|
};
|
|
@@ -27,11 +32,7 @@ const installBun = installOnWindowsArm({
|
|
|
27
32
|
name: 'bun',
|
|
28
33
|
path: 'bun.sh'
|
|
29
34
|
});
|
|
30
|
-
const installDeno =
|
|
31
|
-
def: { uses: 'denoland/setup-deno@v2', with: { 'deno-version': '2' } },
|
|
32
|
-
name: 'deno',
|
|
33
|
-
path: 'deno.land'
|
|
34
|
-
});
|
|
35
|
+
const installDeno = install({ uses: 'denoland/setup-deno@v2', with: { 'deno-version': '2' } });
|
|
35
36
|
const cargoTest = (target, config) => {
|
|
36
37
|
const to = target ? ` --target ${target}` : '';
|
|
37
38
|
const co = config ? ` --config ${config}` : '';
|
|
@@ -65,6 +66,9 @@ const node = (version) => (extra) => basicNode(version)([
|
|
|
65
66
|
...extra,
|
|
66
67
|
]);
|
|
67
68
|
const findTgz = (v) => v === 'windows' ? '(Get-ChildItem *.tgz).FullName' : './*.tgz';
|
|
69
|
+
const playwrightVersion = '1.58.2';
|
|
70
|
+
const playwrightAndVersion = `playwright@${playwrightVersion}`;
|
|
71
|
+
const rustToolchain = '1.93.1';
|
|
68
72
|
const toSteps = (m) => {
|
|
69
73
|
const filter = (st) => m.flatMap((mt) => mt.type === st ? [mt.step] : []);
|
|
70
74
|
const aptGet = m.flatMap(v => v.type === 'apt-get' ? [v.package] : []).join(' ');
|
|
@@ -73,7 +77,7 @@ const toSteps = (m) => {
|
|
|
73
77
|
return [
|
|
74
78
|
...(aptGet !== '' ? [{ run: `sudo apt-get update && sudo apt-get install -y ${aptGet}` }] : []),
|
|
75
79
|
...(rust ? [{
|
|
76
|
-
uses:
|
|
80
|
+
uses: `dtolnay/rust-toolchain@${rustToolchain}`,
|
|
77
81
|
with: {
|
|
78
82
|
components: 'rustfmt,clippy',
|
|
79
83
|
targets
|
|
@@ -92,11 +96,34 @@ const nodeSteps = (v) => [
|
|
|
92
96
|
test({ run: `npm ${nodeTest(v)}` }),
|
|
93
97
|
];
|
|
94
98
|
const ubuntu = (ms) => ({
|
|
95
|
-
'runs-on': 'ubuntu-
|
|
99
|
+
'runs-on': 'ubuntu-24.04',
|
|
96
100
|
steps: toSteps(ms)
|
|
97
101
|
});
|
|
98
102
|
const nodeVersions = Object.fromEntries(nodes.map(v => [`node${v}`, ubuntu(nodeSteps(v))]));
|
|
99
|
-
const
|
|
103
|
+
const defaultNodeVersion = '24';
|
|
104
|
+
const playwright = ubuntu(basicNode(defaultNodeVersion)([
|
|
105
|
+
//install({ uses: 'actions/cache@v4', with: { path: '~/.cache/ms-playwright', key: `${images.ubuntu.intel}-${playwrightAndVersion}` } }),
|
|
106
|
+
install({ run: `npm install -g ${playwrightAndVersion}` }),
|
|
107
|
+
install({ run: 'playwright install --with-deps' }),
|
|
108
|
+
// we have to use `npx` to make sure that we respect `@playwright/test` version from
|
|
109
|
+
// the `package.json`.
|
|
110
|
+
...['chromium', 'firefox', 'webkit'].map(browser => test({ run: `npx playwright test --browser=${browser}` })),
|
|
111
|
+
]));
|
|
112
|
+
const i686 = (a, v) => {
|
|
113
|
+
if (a === 'intel') {
|
|
114
|
+
switch (v) {
|
|
115
|
+
case 'windows': return customTarget('i686-pc-windows-msvc');
|
|
116
|
+
case 'ubuntu': return [
|
|
117
|
+
{ type: 'apt-get', package: 'libc6-dev-i386' },
|
|
118
|
+
...customTarget('i686-unknown-linux-gnu'),
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return [];
|
|
123
|
+
};
|
|
124
|
+
const job = (v) => (a) => {
|
|
125
|
+
const id = `${v}-${a}`;
|
|
126
|
+
const image = images[v][a];
|
|
100
127
|
const result = [
|
|
101
128
|
// Rust
|
|
102
129
|
test({ run: 'cargo fmt -- --check' }),
|
|
@@ -108,23 +135,12 @@ const steps = (v) => (a) => {
|
|
|
108
135
|
...wasmTarget('wasm32-wasip2'),
|
|
109
136
|
...wasmTarget('wasm32-unknown-unknown'),
|
|
110
137
|
...wasmTarget('wasm32-wasip1-threads'),
|
|
111
|
-
...(a
|
|
112
|
-
v === 'windows' ?
|
|
113
|
-
customTarget('i686-pc-windows-msvc') :
|
|
114
|
-
v === 'ubuntu' ? [
|
|
115
|
-
{ type: 'apt-get', package: 'libc6-dev-i386' },
|
|
116
|
-
...customTarget('i686-unknown-linux-gnu'),
|
|
117
|
-
] :
|
|
118
|
-
[]),
|
|
138
|
+
...i686(a, v),
|
|
119
139
|
// Node.js
|
|
120
|
-
...node(
|
|
140
|
+
...node(defaultNodeVersion)([
|
|
121
141
|
// TypeScript Preview
|
|
122
142
|
install({ run: 'npm install -g @typescript/native-preview' }),
|
|
123
143
|
test({ run: 'tsgo' }),
|
|
124
|
-
// Playwright
|
|
125
|
-
install({ run: 'npm install -g playwright' }),
|
|
126
|
-
install({ run: 'playwright install --with-deps' }),
|
|
127
|
-
...['chromium', 'firefox', 'webkit'].map(browser => (test({ run: `npx playwright test --browser=${browser}` }))),
|
|
128
144
|
// publishing
|
|
129
145
|
test({ run: 'npm pack' }),
|
|
130
146
|
test({ run: `npm install -g ${findTgz(v)}` }),
|
|
@@ -134,7 +150,7 @@ const steps = (v) => (a) => {
|
|
|
134
150
|
]),
|
|
135
151
|
// Deno
|
|
136
152
|
...clean([
|
|
137
|
-
installDeno
|
|
153
|
+
installDeno,
|
|
138
154
|
test({ run: 'deno install' }),
|
|
139
155
|
test({ run: 'deno task test' }),
|
|
140
156
|
test({ run: 'deno task fjs compile issues/demo/data/tree.json _tree.f.js' }),
|
|
@@ -148,16 +164,12 @@ const steps = (v) => (a) => {
|
|
|
148
164
|
test({ run: 'bun ./fjs/module.ts t' }),
|
|
149
165
|
]),
|
|
150
166
|
];
|
|
151
|
-
return toSteps(result);
|
|
167
|
+
return [id, { 'runs-on': image, steps: toSteps(result) }];
|
|
152
168
|
};
|
|
153
169
|
const jobs = {
|
|
154
|
-
...Object.fromEntries(
|
|
155
|
-
...os.flatMap(v => architecture.map(a => [`${v}-${a}`, {
|
|
156
|
-
'runs-on': images[v][a],
|
|
157
|
-
steps: steps(v)(a),
|
|
158
|
-
}]))
|
|
159
|
-
]),
|
|
170
|
+
...Object.fromEntries(os.flatMap(v => architecture.map(job(v)))),
|
|
160
171
|
...nodeVersions,
|
|
172
|
+
playwright,
|
|
161
173
|
};
|
|
162
174
|
const gha = {
|
|
163
175
|
name: 'CI',
|
package/ci/module.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import run from "../io/module.js";
|
|
2
|
+
import app from "./module.f.js";
|
|
3
|
+
run(app);
|
package/dev/index/module.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { index } from "../module.f.js";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { legacyRun } from "../../io/module.js";
|
|
3
|
+
legacyRun(index);
|
package/dev/module.f.d.ts
CHANGED
package/dev/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development utilities for indexing modules and loading FunctionalScript files.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { fromIo } from "../io/module.f.js";
|
|
2
7
|
import { updateVersion } from "./version/module.f.js";
|
|
3
8
|
import { decodeUtf8, encodeUtf8 } from "../types/uint8array/module.f.js";
|
package/dev/tf/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-framework helpers for running and reporting FunctionalScript tests.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { fold } from "../../types/list/module.f.js";
|
|
2
7
|
import { reset, fgGreen, fgRed, bold, stdio, stderr } from "../../text/sgr/module.f.js";
|
|
3
8
|
import { env, loadModuleMap } from "../module.f.js";
|
package/dev/version/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version management helpers for updating project package versions.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { utf8, utf8ToString } from "../../text/module.f.js";
|
|
2
7
|
import { all } from "../../types/effect/module.f.js";
|
|
3
8
|
import { readFile, writeFile } from "../../types/effect/node/module.f.js";
|
package/djs/ast/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST types and helpers for the DJS representation.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Primitive, Array, Unknown } from '../module.f.ts';
|
|
2
7
|
export type AstModule = [readonly string[], AstBody];
|
|
3
8
|
export type AstConst = Primitive | AstModuleRef | AstArray | AstObject;
|
package/djs/module.f.d.ts
CHANGED
package/djs/parser/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJS parser that builds structured trees from DJS tokens.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type Result } from '../../types/result/module.f.ts';
|
|
2
7
|
import { type List } from '../../types/list/module.f.ts';
|
|
3
8
|
import type { DjsTokenWithMetadata } from '../tokenizer/module.f.ts';
|
package/djs/parser/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJS parser that builds structured trees from DJS tokens.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { error, ok } from "../../types/result/module.f.js";
|
|
2
7
|
import { fold, first, drop, toArray, length, concat } from "../../types/list/module.f.js";
|
|
3
8
|
import { setReplace, at } from "../../types/ordered_map/module.f.js";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Experimental DJS parser implementation.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { descentParser } from "../../bnf/data/module.f.js";
|
|
2
7
|
import { eof, join0Plus, max, none, not, notSet, oneEncode, option, range, remove, repeat, repeat0Plus, repeat1Plus, set, unicodeRange } from "../../bnf/module.f.js";
|
|
3
8
|
import { todo } from "../../dev/module.f.js";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJS serializer for formatting AST values back to source text.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Unknown } from '../module.f.ts';
|
|
2
7
|
import type { Entry as ObjectEntry } from '../../types/object/module.f.ts';
|
|
3
8
|
import { type List } from '../../types/list/module.f.ts';
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJS transpiler for transforming parsed trees into JavaScript output.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type Unknown } from '../module.f.ts';
|
|
2
7
|
import { type Result } from '../../types/result/module.f.ts';
|
|
3
8
|
import { type List } from '../../types/list/module.f.ts';
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJS transpiler for transforming parsed trees into JavaScript output.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import {} from "../module.f.js";
|
|
2
7
|
import { error, ok } from "../../types/result/module.f.js";
|
|
3
8
|
import { fold, drop, map as listMap, toArray, includes } from "../../types/list/module.f.js";
|
package/fjs/module.f.d.ts
CHANGED
package/fjs/module.f.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FunctionalScript compiler entry points and command handlers.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { fromIo } from "../io/module.f.js";
|
|
2
7
|
import { compile } from "../djs/module.f.js";
|
|
3
8
|
import { main as testMain } from "../dev/tf/module.f.js";
|
|
4
9
|
import { main as casMain } from "../cas/module.f.js";
|
|
5
|
-
export const main = (io) => {
|
|
10
|
+
export const main = async (io) => {
|
|
6
11
|
const { error } = io.console;
|
|
7
12
|
const [command, ...rest] = io.process.argv.slice(2);
|
|
13
|
+
const eRun = fromIo(io);
|
|
8
14
|
switch (command) {
|
|
9
15
|
case 'test':
|
|
10
16
|
case 't':
|
|
@@ -14,7 +20,12 @@ export const main = (io) => {
|
|
|
14
20
|
return compile(io)(rest);
|
|
15
21
|
case 'cas':
|
|
16
22
|
case 's':
|
|
17
|
-
return
|
|
23
|
+
return eRun(casMain(rest));
|
|
24
|
+
case 'run':
|
|
25
|
+
case 'r':
|
|
26
|
+
const [file, ...args] = rest;
|
|
27
|
+
const m = await io.asyncImport(file);
|
|
28
|
+
return eRun(m.default(args));
|
|
18
29
|
case undefined:
|
|
19
30
|
error('Error: command is required');
|
|
20
31
|
return Promise.resolve(1);
|
package/fjs/module.js
CHANGED
package/fsc/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FunctionalScript command utilities for compile workflows.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { strictEqual } from "../types/function/operator/module.f.js";
|
|
2
7
|
import { merge as rangeMapMerge, fromRange, get, } from "../types/range_map/module.f.js";
|
|
3
8
|
import { reduce as listReduce, toArray, map } from "../types/list/module.f.js";
|
package/fsm/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finite state machine helpers used by parser and tokenizer logic.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type List } from '../types/list/module.f.ts';
|
|
2
7
|
import { type ByteSet } from '../types/byte_set/module.f.ts';
|
|
3
8
|
import { type RangeMapArray } from '../types/range_map/module.f.ts';
|
package/fsm/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finite state machine helpers used by parser and tokenizer logic.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { equal, isEmpty, fold, toArray, scan, foldScan, empty as emptyList } from "../types/list/module.f.js";
|
|
2
7
|
import { toRangeMap, union as byteSetUnion, one, empty, range } from "../types/byte_set/module.f.js";
|
|
3
8
|
import { intersect, union as sortedSetUnion } from "../types/sorted_set/module.f.js";
|
package/io/module.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Io, type Run } from './module.f.ts';
|
|
2
2
|
import type { NodeProgram } from '../types/effect/node/module.f.ts';
|
|
3
3
|
export declare const io: Io;
|
|
4
|
-
declare const
|
|
5
|
-
export default runDefault;
|
|
4
|
+
export declare const legacyRun: Run;
|
|
6
5
|
export type NodeRun = (p: NodeProgram) => Promise<number>;
|
|
7
6
|
export declare const ioRun: (io: Io) => NodeRun;
|
|
8
|
-
|
|
7
|
+
declare const effectRun: NodeRun;
|
|
8
|
+
export default effectRun;
|
package/io/module.js
CHANGED
|
@@ -10,6 +10,7 @@ import { fromIo, run } from "./module.f.js";
|
|
|
10
10
|
import fs from 'node:fs';
|
|
11
11
|
import process from "node:process";
|
|
12
12
|
import { concat } from "../path/module.f.js";
|
|
13
|
+
import { error, ok } from "../types/result/module.f.js";
|
|
13
14
|
const prefix = 'file:///';
|
|
14
15
|
export const io = {
|
|
15
16
|
console,
|
|
@@ -24,26 +25,26 @@ export const io = {
|
|
|
24
25
|
fetch,
|
|
25
26
|
tryCatch: f => {
|
|
26
27
|
try {
|
|
27
|
-
return
|
|
28
|
+
return ok(f());
|
|
28
29
|
}
|
|
29
30
|
catch (e) {
|
|
30
|
-
return
|
|
31
|
+
return error(e);
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
asyncTryCatch: async (f) => {
|
|
34
35
|
try {
|
|
35
|
-
return
|
|
36
|
+
return ok(await f());
|
|
36
37
|
}
|
|
37
38
|
catch (e) {
|
|
38
|
-
return
|
|
39
|
+
return error(e);
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
};
|
|
42
|
-
const
|
|
43
|
-
export default runDefault;
|
|
43
|
+
export const legacyRun = run(io);
|
|
44
44
|
export const ioRun = (io) => {
|
|
45
45
|
const r = fromIo(io);
|
|
46
46
|
const { argv } = io.process;
|
|
47
47
|
return p => r(p(argv));
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
const effectRun = ioRun(io);
|
|
50
|
+
export default effectRun;
|
package/io/virtual/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual I/O adapter implementations for deterministic testing.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Io } from '../module.f.ts';
|
|
2
7
|
import { type OrderedMap } from '../../types/ordered_map/module.f.ts';
|
|
3
8
|
export declare const createVirtualIo: (files: OrderedMap<Uint8Array>) => Io;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON parser that consumes tokenizer output into JSON values.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type Result } from '../../types/result/module.f.ts';
|
|
2
7
|
import { type List } from '../../types/list/module.f.ts';
|
|
3
8
|
import { type JsonToken } from '../tokenizer/module.f.ts';
|
package/json/parser/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON parser that consumes tokenizer output into JSON values.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { error, ok } from "../../types/result/module.f.js";
|
|
2
7
|
import { fold, first, drop, toArray, concat } from "../../types/list/module.f.js";
|
|
3
8
|
import {} from "../../types/function/operator/module.f.js";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON serializer for deterministic string output.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type List } from '../../types/list/module.f.ts';
|
|
2
7
|
export declare const stringSerialize: (_: string) => List<string>;
|
|
3
8
|
export declare const numberSerialize: (_: number) => List<string>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokenizer for JSON lexical analysis.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import {} from "../../types/function/operator/module.f.js";
|
|
2
7
|
import { concat, empty, flat, stateScan } from "../../types/list/module.f.js";
|
|
3
8
|
import { multiply } from "../../types/bigfloat/module.f.js";
|
package/package.json
CHANGED
package/path/module.f.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path parsing and normalization helpers for portable module paths.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Reduce, Unary } from "../types/function/operator/module.f.ts";
|
|
2
7
|
export declare const parse: (path: string) => readonly string[];
|
|
3
8
|
export declare const normalize: Unary<string, string>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lookup operations for persistent B-tree structures.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Leaf1, Leaf2, Branch3, Branch5, TNode } from '../types/module.f.ts';
|
|
2
7
|
import type { List } from '../../list/module.f.ts';
|
|
3
8
|
import { type Compare } from '../../function/compare/module.f.ts';
|
package/types/btree/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removal operations for persistent B-tree structures.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { TNode, Tree } from '../types/module.f.ts';
|
|
2
7
|
import type { Compare } from '../../function/compare/module.f.ts';
|
|
3
8
|
export declare const nodeRemove: <T>(c: Compare<T>) => (node: TNode<T>) => Tree<T>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insertion and update operations for persistent B-tree structures.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { TNode, Tree } from '../types/module.f.ts';
|
|
2
7
|
import type { Compare } from '../../function/compare/module.f.ts';
|
|
3
8
|
export declare const set: <T>(c: Compare<T>) => (f: (value: T | null) => T) => (tree: Tree<T>) => TNode<T>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock effect runtimes for testing effectful programs.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Effect, Operations } from "../module.f.ts";
|
|
2
7
|
export type MemOperationMap<O extends Operations, S> = {
|
|
3
8
|
readonly [K in keyof O]: (state: S, payload: O[K][0]) => readonly [S, O[K][1]];
|
package/types/list/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable list data structure utilities and combinators.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { identity, fn, compose } from "../function/module.f.js";
|
|
2
7
|
import { addition, logicalNot, strictEqual, stateScanToScan, foldToScan, reduceToScan, } from "../function/operator/module.f.js";
|
|
3
8
|
export const fromArrayLike = (array) => {
|
package/types/map/module.f.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for nullable (`null`/`undefined`) value handling.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import type { Option } from '../option/module.f.ts';
|
|
2
7
|
export type Nullable<T> = T | null;
|
|
3
8
|
export declare const map: <T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>;
|
package/website/module.f.js
CHANGED
package/website/module.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import run from "../io/module.js";
|
|
2
|
+
import app from "./module.f.js";
|
|
3
|
+
run(app);
|