@mark1russell7/coeval 0.4.0 → 0.4.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/README.md +3 -3
- package/build/index.d.ts +281 -222
- package/build/index.d.ts.map +1 -1
- package/build/index.js +100 -17
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/evaluate.ts +72 -3
- package/src/index.ts +3 -0
- package/src/static.ts +39 -7
- package/src/stdlib.ts +6 -2
- package/src/world.ts +24 -0
package/README.md
CHANGED
|
@@ -25,13 +25,13 @@ A plan evaluates many times without a trace. `evaluate(machine, doc)` gives the
|
|
|
25
25
|
| Part | Exports | What it does |
|
|
26
26
|
| --- | --- | --- |
|
|
27
27
|
| Documents | `isEnvelope`, `stored`, `typePath`, `docEquals` | The envelope, the keys of a store beside it, and the equality of documents |
|
|
28
|
-
| World | `lookupKind`, `Kind`, `Namespace`, `PartShape`, `ScopeRule` | The kinds, with their contracts: the shape of the parts, the type of the data, the kinds that a position permits, the names that a kind binds, and its effects. A namespace can have a fallback kind |
|
|
28
|
+
| World | `lookupKind`, `Kind`, `Namespace`, `PartShape`, `ScopeRule`, `CapsRule` | The kinds, with their contracts: the shape of the parts, the type of the data, the kinds that a position permits, the names that a kind binds, the capabilities that it gives its parts, and its effects. A namespace can have a fallback kind |
|
|
29
29
|
| Ladder | `ask` | The evaluator of a verb: the own entry, then the kind, then the default |
|
|
30
30
|
| References | `resolve`, `HostThing`, `Navigator` | A path from a root of the context: `self`, `names`, `world`, `event` or `caps`. A step document can have computed parts, and a walker can give the code of its failure |
|
|
31
31
|
| Plans | `prepare`, `planner`, `evaluate`, `run` | A document compiles one time into code. An evaluator is a function or a compiler |
|
|
32
|
-
| The run side | `run`, `Runner`, `permits`, `narrow` | Effects in order, parts at the same time, capabilities that only narrow, and an abort |
|
|
32
|
+
| The run side | `run`, `Runner`, `permits`, `narrow`, `partCaps` | Effects in order, parts at the same time, capabilities that only narrow, and an abort. The kernel narrows the capabilities of each part by the contract of its kind |
|
|
33
33
|
| Errors | `Result`, `EvalError`, `Failure`, `failures` | An error value has a code, a reason, a place and a cause. An evaluation does not throw |
|
|
34
|
-
| The static kit | `walk`, `refsOf`, `mapRefs`, `check` | The documents of a document in linear time, its free references, and its problems before a run, each with its place and its JSON path |
|
|
34
|
+
| The static kit | `walk`, `refsOf`, `mapRefs`, `check` | The documents of a document in linear time, its free references, and its problems before a run, each with its place and its JSON path. A check narrows the capabilities as a run does |
|
|
35
35
|
| The formula kit | `formulaMachine`, `FormulaProfile` | The shared constructs `lit`, `ref`, `record`, `list`, `let`, `fn`, `call`, `if`, `and`, `or`, and the namespaces `ops` and `ext`. A profile gives the rules of a language, for example how the errors of two parts combine. An address gives a thing, not its value |
|
|
36
36
|
|
|
37
37
|
Each rule has an ID in [`docs/SPEC.md`](https://github.com/mark1russell7/coeval/blob/main/docs/SPEC.md), and each ID has a test. [The site](https://mark1russell7.github.io/coeval/) explains each idea with a live diagram.
|
package/build/index.d.ts
CHANGED
|
@@ -247,6 +247,223 @@ export declare function thrown(error: unknown, who: string): Failed;
|
|
|
247
247
|
*/
|
|
248
248
|
export declare function describe(value: unknown): string;
|
|
249
249
|
//#endregion
|
|
250
|
+
//#region src/deref.d.ts
|
|
251
|
+
/**
|
|
252
|
+
* The brand of a host thing: an object of the host that answers the steps of a path itself. The brand is a
|
|
253
|
+
* global symbol, thus two copies of the kernel in one program know the things of each other.
|
|
254
|
+
*/
|
|
255
|
+
export declare const THING: unique symbol;
|
|
256
|
+
/**
|
|
257
|
+
* A host thing: an object that answers the steps of a path itself, for example a node of a live tree. It is the
|
|
258
|
+
* own entry of the ladder for the verb `deref`.
|
|
259
|
+
*/
|
|
260
|
+
interface HostThing {
|
|
261
|
+
readonly [THING]: true;
|
|
262
|
+
/** A short text for a reader, for example `node card`. */
|
|
263
|
+
readonly label: string;
|
|
264
|
+
/**
|
|
265
|
+
* This function answers one step.
|
|
266
|
+
*
|
|
267
|
+
* @param key - The key of the step.
|
|
268
|
+
* @returns What the step reaches, or `undefined` when it reaches nothing.
|
|
269
|
+
*/
|
|
270
|
+
deref(key: Key): Thing | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* This function gives the thing as a value, when a reference ends on it.
|
|
273
|
+
*
|
|
274
|
+
* @returns The value.
|
|
275
|
+
*/
|
|
276
|
+
toJson(): unknown;
|
|
277
|
+
/**
|
|
278
|
+
* This optional function answers all the steps of a path that are keys, in one call. A store uses it to read a
|
|
279
|
+
* path without one call for each step.
|
|
280
|
+
*
|
|
281
|
+
* @param keys - The keys.
|
|
282
|
+
* @returns What the keys reach, or `undefined` when they reach nothing.
|
|
283
|
+
*/
|
|
284
|
+
resolve?(keys: readonly Key[]): {
|
|
285
|
+
readonly thing: Thing;
|
|
286
|
+
} | undefined;
|
|
287
|
+
}
|
|
288
|
+
/** Something that a path can reach: any value of the host, or a host thing. */
|
|
289
|
+
type Thing = unknown;
|
|
290
|
+
/**
|
|
291
|
+
* This function tells if a thing is a host thing.
|
|
292
|
+
*
|
|
293
|
+
* @param thing - The thing.
|
|
294
|
+
* @returns `true` for a host thing.
|
|
295
|
+
*/
|
|
296
|
+
export declare function isHostThing(thing: unknown): thing is HostThing;
|
|
297
|
+
/** The roots of a context. Each path starts with one of them. */
|
|
298
|
+
export declare const ROOTS: readonly ["self", "names", "world", "event", "caps"];
|
|
299
|
+
/** One root of a context. */
|
|
300
|
+
type Root = (typeof ROOTS)[number];
|
|
301
|
+
/**
|
|
302
|
+
* A capability: the name of a kind of effect, or its keys. A capability permits its kind and each kind under it.
|
|
303
|
+
* Keys are necessary when a key has a dot in it.
|
|
304
|
+
*/
|
|
305
|
+
type Cap = string | readonly Key[];
|
|
306
|
+
/**
|
|
307
|
+
* The context of a term: a record with five roots. A reference reaches outside its term only through them.
|
|
308
|
+
*
|
|
309
|
+
* - `self`: the node that the term is part of.
|
|
310
|
+
* - `names`: the values that the evaluators around the term bound.
|
|
311
|
+
* - `world`: the registry of kinds.
|
|
312
|
+
* - `event`: the event that started a run.
|
|
313
|
+
* - `caps`: the effects that the term can cause.
|
|
314
|
+
*/
|
|
315
|
+
interface Context {
|
|
316
|
+
readonly self: Thing;
|
|
317
|
+
readonly names: Readonly<Record<string, unknown>>;
|
|
318
|
+
readonly world: Thing;
|
|
319
|
+
readonly event: Thing;
|
|
320
|
+
readonly caps: readonly Cap[];
|
|
321
|
+
}
|
|
322
|
+
/** The code of a `deref` evaluator: it answers one step of a path on a document of its kind. */
|
|
323
|
+
type DerefCode = (doc: Envelope, key: Key) => Thing | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* The result of a step document: what it reached, or the reason of a failure. A failure can give its code, for
|
|
326
|
+
* example `#REF!` for a position outside a space. The default code is `#N/A`.
|
|
327
|
+
*/
|
|
328
|
+
type WalkResult = {
|
|
329
|
+
readonly ok: true;
|
|
330
|
+
readonly thing: Thing;
|
|
331
|
+
} | {
|
|
332
|
+
readonly ok: false;
|
|
333
|
+
readonly reason: string;
|
|
334
|
+
readonly code?: ErrorCode;
|
|
335
|
+
};
|
|
336
|
+
/** The input of a walker: the code of a step document, for example `nearest`. */
|
|
337
|
+
interface WalkInput {
|
|
338
|
+
/** The value of the step document. */
|
|
339
|
+
readonly data: Json;
|
|
340
|
+
/** The thing that the path reached before this step. */
|
|
341
|
+
readonly here: Thing;
|
|
342
|
+
readonly context: Context;
|
|
343
|
+
/**
|
|
344
|
+
* This function answers one step on a thing, through the ladder.
|
|
345
|
+
*
|
|
346
|
+
* @param thing - The thing.
|
|
347
|
+
* @param key - The key.
|
|
348
|
+
* @returns What the step reaches, or `undefined`.
|
|
349
|
+
*/
|
|
350
|
+
deref(thing: Thing, key: Key): Thing | undefined;
|
|
351
|
+
}
|
|
352
|
+
/** A walker: the code of the verb `step` of a kind of step documents. */
|
|
353
|
+
type Walker = (input: WalkInput) => WalkResult;
|
|
354
|
+
/**
|
|
355
|
+
* What a resolution needs: the world, and the code of the `deref` evaluators and of the walkers.
|
|
356
|
+
*
|
|
357
|
+
* - `plain`: `true` when the values are data. Then a step does not ask the kind of an envelope, and a reference
|
|
358
|
+
* that a step reaches stays a value (no collapse).
|
|
359
|
+
* - `roots`: the roots that a path can start at. The default is each root.
|
|
360
|
+
* - `adopt`: the thing of each value that a path reaches. A host gives its own values a host thing with this
|
|
361
|
+
* function, for example a value whose fields read through signals. A host thing is not followed as a reference.
|
|
362
|
+
*/
|
|
363
|
+
interface Navigator {
|
|
364
|
+
readonly world: World;
|
|
365
|
+
readonly derefs?: Readonly<Record<string, DerefCode>>;
|
|
366
|
+
readonly walkers?: Readonly<Record<string, Walker>>;
|
|
367
|
+
readonly plain?: boolean;
|
|
368
|
+
readonly roots?: readonly Root[];
|
|
369
|
+
readonly adopt?: (value: unknown) => Thing;
|
|
370
|
+
}
|
|
371
|
+
/** The way that one hop of a path was answered. */
|
|
372
|
+
type HopBy = "root" | "own" | "kind" | "default" | "step" | "collapse";
|
|
373
|
+
/** One hop of a path: the step, what it reached, and who answered it. */
|
|
374
|
+
interface Hop {
|
|
375
|
+
readonly step: Json;
|
|
376
|
+
readonly thing: Thing;
|
|
377
|
+
readonly by: HopBy;
|
|
378
|
+
}
|
|
379
|
+
/** The codes that a resolution gives itself. A walker can give another code for its failure. */
|
|
380
|
+
type ResolveCode = "#REF!" | "#NAME?" | "#N/A" | "#CYCLE!" | "#STEP?";
|
|
381
|
+
/** The result of a resolution: what the path reached, with each hop, or an error with the hops before it. */
|
|
382
|
+
type Resolution = {
|
|
383
|
+
readonly ok: true;
|
|
384
|
+
readonly thing: Thing;
|
|
385
|
+
readonly hops: readonly Hop[];
|
|
386
|
+
} | {
|
|
387
|
+
readonly ok: false;
|
|
388
|
+
readonly code: ResolveCode | ErrorCode;
|
|
389
|
+
readonly reason: string;
|
|
390
|
+
readonly hops: readonly Hop[];
|
|
391
|
+
};
|
|
392
|
+
/** The options of a resolution. */
|
|
393
|
+
interface ResolveOptions {
|
|
394
|
+
/** `false`: do not record the hops. The default is `true`. */
|
|
395
|
+
readonly hops?: boolean;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* This function answers one step of a path on a thing, through the ladder of the verb `deref`. A host thing
|
|
399
|
+
* answers for itself (own). A document asks its own entry, then its kind. The default goes into the value: an own
|
|
400
|
+
* field of an object, or an item of a list.
|
|
401
|
+
*
|
|
402
|
+
* @param nav - The world and the code of the evaluators.
|
|
403
|
+
* @param thing - The thing that the path reached.
|
|
404
|
+
* @param key - The key of the step.
|
|
405
|
+
* @returns What the step reaches and the rung that answered, or `undefined` when it reaches nothing.
|
|
406
|
+
*/
|
|
407
|
+
export declare function derefStep(nav: Navigator, thing: Thing, key: Key): {
|
|
408
|
+
readonly thing: Thing;
|
|
409
|
+
readonly by: HopBy;
|
|
410
|
+
} | undefined;
|
|
411
|
+
/**
|
|
412
|
+
* This function tells if a thing is a reference document: an envelope of the type `ref` with a list for its path.
|
|
413
|
+
*
|
|
414
|
+
* @param thing - The thing.
|
|
415
|
+
* @returns `true` for a reference document.
|
|
416
|
+
*/
|
|
417
|
+
export declare function isRef(thing: unknown): thing is Envelope & {
|
|
418
|
+
readonly value: readonly Json[];
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* This function makes the thing of the root `world`: the entries of the world as JSON. An alias is a reference
|
|
422
|
+
* document in it, thus a walk through the world follows each alias (collapse). The thing of a world is made one
|
|
423
|
+
* time.
|
|
424
|
+
*
|
|
425
|
+
* @param world - The world.
|
|
426
|
+
* @returns The thing.
|
|
427
|
+
*/
|
|
428
|
+
export declare function worldThing(world: World): Json;
|
|
429
|
+
/**
|
|
430
|
+
* This function makes a context. The world comes from the navigator when the call gives none.
|
|
431
|
+
*
|
|
432
|
+
* @param parts - The roots to set.
|
|
433
|
+
* @returns The context.
|
|
434
|
+
*/
|
|
435
|
+
export declare function context(parts?: Partial<Context>): Context;
|
|
436
|
+
/**
|
|
437
|
+
* This function resolves a path from a context, and records each hop.
|
|
438
|
+
*
|
|
439
|
+
* The first step is a root of the context. Each later step is a key or a step document. A key goes up the ladder
|
|
440
|
+
* of the verb `deref` on the thing that the path reached. A step document is evaluated by the walker of its kind,
|
|
441
|
+
* with the thing that the path reached. After each hop, a reference document is followed until the path reaches
|
|
442
|
+
* something else (collapse), except in a plain navigation.
|
|
443
|
+
*
|
|
444
|
+
* The codes of a failure:
|
|
445
|
+
*
|
|
446
|
+
* - `#REF!`: the path has no root, or a root that is not open here.
|
|
447
|
+
* - `#NAME?`: the root `names` has no such name.
|
|
448
|
+
* - `#N/A`: a step reaches nothing.
|
|
449
|
+
* - `#STEP?`: a step is not a key and not a step document.
|
|
450
|
+
* - `#CYCLE!`: the references form a cycle.
|
|
451
|
+
*
|
|
452
|
+
* @param nav - The world and the code of the evaluators.
|
|
453
|
+
* @param ctx - The context.
|
|
454
|
+
* @param path - The steps.
|
|
455
|
+
* @param options - `hops: false` does not record the hops.
|
|
456
|
+
* @returns What the path reached and each hop, or an error.
|
|
457
|
+
*/
|
|
458
|
+
export declare function resolve(nav: Navigator, ctx: Context, path: readonly unknown[], options?: ResolveOptions): Resolution;
|
|
459
|
+
/**
|
|
460
|
+
* This function gives the value of a thing: the value that a host thing gives, or else the thing itself.
|
|
461
|
+
*
|
|
462
|
+
* @param thing - The thing.
|
|
463
|
+
* @returns The value.
|
|
464
|
+
*/
|
|
465
|
+
export declare function valueOfThing(thing: Thing): unknown;
|
|
466
|
+
//#endregion
|
|
250
467
|
//#region src/world.d.ts
|
|
251
468
|
/** The two sides of evaluation. `derive` is pure. `run` causes effects in order. */
|
|
252
469
|
type Side = "derive" | "run";
|
|
@@ -338,6 +555,28 @@ interface ScopeRule {
|
|
|
338
555
|
/** `true`: a part sees only the names of the parts before it, as in a sequence. */
|
|
339
556
|
readonly sequential?: boolean;
|
|
340
557
|
}
|
|
558
|
+
/**
|
|
559
|
+
* A capability rule of a kind: what the kind gives some of its parts from the capabilities of its document. A rule
|
|
560
|
+
* only narrows. A part does not get a capability that its document does not have (CAP.NARROW).
|
|
561
|
+
*
|
|
562
|
+
* - `same`: the parts get the capabilities of the document. This is the default.
|
|
563
|
+
* - `mask`: the parts get no capabilities, as the part of `pure`.
|
|
564
|
+
* - `only`: the parts get only the effects that the capabilities of the document and the list `caps` both permit.
|
|
565
|
+
*
|
|
566
|
+
* `in` names the parts that the rule covers, as patterns of their paths in the value. The key `"*"` matches each
|
|
567
|
+
* key. A rule without `in` covers each part.
|
|
568
|
+
*/
|
|
569
|
+
type CapsRule = {
|
|
570
|
+
readonly rule: "same";
|
|
571
|
+
readonly in?: readonly (readonly Key[])[];
|
|
572
|
+
} | {
|
|
573
|
+
readonly rule: "mask";
|
|
574
|
+
readonly in?: readonly (readonly Key[])[];
|
|
575
|
+
} | {
|
|
576
|
+
readonly rule: "only";
|
|
577
|
+
readonly caps: readonly Cap[];
|
|
578
|
+
readonly in?: readonly (readonly Key[])[];
|
|
579
|
+
};
|
|
341
580
|
/** A kind gives the name of an evaluator for each verb, and the contract of its value. */
|
|
342
581
|
interface Kind {
|
|
343
582
|
readonly verbs: Readonly<Record<string, string>>;
|
|
@@ -345,6 +584,13 @@ interface Kind {
|
|
|
345
584
|
readonly parts?: Shape;
|
|
346
585
|
/** The names that the kind binds for its parts. */
|
|
347
586
|
readonly scope?: readonly ScopeRule[];
|
|
587
|
+
/**
|
|
588
|
+
* The capabilities that the kind gives its parts, as rules. A part that no rule covers gets the capabilities of
|
|
589
|
+
* the document. A part that several rules cover gets only what each rule permits. The static kit reads the rules,
|
|
590
|
+
* and the kernel narrows the context of each part by them. Thus an evaluator does not narrow the capabilities
|
|
591
|
+
* itself.
|
|
592
|
+
*/
|
|
593
|
+
readonly caps?: readonly CapsRule[];
|
|
348
594
|
/** The side of the kind. A kind of the run side causes effects. The default is `derive`. */
|
|
349
595
|
readonly side?: Side;
|
|
350
596
|
/**
|
|
@@ -526,223 +772,6 @@ export declare function kindNamed(world: World, name: TypeRef): Kind | undefined
|
|
|
526
772
|
*/
|
|
527
773
|
export declare function ask(world: World, doc: Header, verb: string, options?: AskOptions): Answer;
|
|
528
774
|
//#endregion
|
|
529
|
-
//#region src/deref.d.ts
|
|
530
|
-
/**
|
|
531
|
-
* The brand of a host thing: an object of the host that answers the steps of a path itself. The brand is a
|
|
532
|
-
* global symbol, thus two copies of the kernel in one program know the things of each other.
|
|
533
|
-
*/
|
|
534
|
-
export declare const THING: unique symbol;
|
|
535
|
-
/**
|
|
536
|
-
* A host thing: an object that answers the steps of a path itself, for example a node of a live tree. It is the
|
|
537
|
-
* own entry of the ladder for the verb `deref`.
|
|
538
|
-
*/
|
|
539
|
-
interface HostThing {
|
|
540
|
-
readonly [THING]: true;
|
|
541
|
-
/** A short text for a reader, for example `node card`. */
|
|
542
|
-
readonly label: string;
|
|
543
|
-
/**
|
|
544
|
-
* This function answers one step.
|
|
545
|
-
*
|
|
546
|
-
* @param key - The key of the step.
|
|
547
|
-
* @returns What the step reaches, or `undefined` when it reaches nothing.
|
|
548
|
-
*/
|
|
549
|
-
deref(key: Key): Thing | undefined;
|
|
550
|
-
/**
|
|
551
|
-
* This function gives the thing as a value, when a reference ends on it.
|
|
552
|
-
*
|
|
553
|
-
* @returns The value.
|
|
554
|
-
*/
|
|
555
|
-
toJson(): unknown;
|
|
556
|
-
/**
|
|
557
|
-
* This optional function answers all the steps of a path that are keys, in one call. A store uses it to read a
|
|
558
|
-
* path without one call for each step.
|
|
559
|
-
*
|
|
560
|
-
* @param keys - The keys.
|
|
561
|
-
* @returns What the keys reach, or `undefined` when they reach nothing.
|
|
562
|
-
*/
|
|
563
|
-
resolve?(keys: readonly Key[]): {
|
|
564
|
-
readonly thing: Thing;
|
|
565
|
-
} | undefined;
|
|
566
|
-
}
|
|
567
|
-
/** Something that a path can reach: any value of the host, or a host thing. */
|
|
568
|
-
type Thing = unknown;
|
|
569
|
-
/**
|
|
570
|
-
* This function tells if a thing is a host thing.
|
|
571
|
-
*
|
|
572
|
-
* @param thing - The thing.
|
|
573
|
-
* @returns `true` for a host thing.
|
|
574
|
-
*/
|
|
575
|
-
export declare function isHostThing(thing: unknown): thing is HostThing;
|
|
576
|
-
/** The roots of a context. Each path starts with one of them. */
|
|
577
|
-
export declare const ROOTS: readonly ["self", "names", "world", "event", "caps"];
|
|
578
|
-
/** One root of a context. */
|
|
579
|
-
type Root = (typeof ROOTS)[number];
|
|
580
|
-
/**
|
|
581
|
-
* A capability: the name of a kind of effect, or its keys. A capability permits its kind and each kind under it.
|
|
582
|
-
* Keys are necessary when a key has a dot in it.
|
|
583
|
-
*/
|
|
584
|
-
type Cap = string | readonly Key[];
|
|
585
|
-
/**
|
|
586
|
-
* The context of a term: a record with five roots. A reference reaches outside its term only through them.
|
|
587
|
-
*
|
|
588
|
-
* - `self`: the node that the term is part of.
|
|
589
|
-
* - `names`: the values that the evaluators around the term bound.
|
|
590
|
-
* - `world`: the registry of kinds.
|
|
591
|
-
* - `event`: the event that started a run.
|
|
592
|
-
* - `caps`: the effects that the term can cause.
|
|
593
|
-
*/
|
|
594
|
-
interface Context {
|
|
595
|
-
readonly self: Thing;
|
|
596
|
-
readonly names: Readonly<Record<string, unknown>>;
|
|
597
|
-
readonly world: Thing;
|
|
598
|
-
readonly event: Thing;
|
|
599
|
-
readonly caps: readonly Cap[];
|
|
600
|
-
}
|
|
601
|
-
/** The code of a `deref` evaluator: it answers one step of a path on a document of its kind. */
|
|
602
|
-
type DerefCode = (doc: Envelope, key: Key) => Thing | undefined;
|
|
603
|
-
/**
|
|
604
|
-
* The result of a step document: what it reached, or the reason of a failure. A failure can give its code, for
|
|
605
|
-
* example `#REF!` for a position outside a space. The default code is `#N/A`.
|
|
606
|
-
*/
|
|
607
|
-
type WalkResult = {
|
|
608
|
-
readonly ok: true;
|
|
609
|
-
readonly thing: Thing;
|
|
610
|
-
} | {
|
|
611
|
-
readonly ok: false;
|
|
612
|
-
readonly reason: string;
|
|
613
|
-
readonly code?: ErrorCode;
|
|
614
|
-
};
|
|
615
|
-
/** The input of a walker: the code of a step document, for example `nearest`. */
|
|
616
|
-
interface WalkInput {
|
|
617
|
-
/** The value of the step document. */
|
|
618
|
-
readonly data: Json;
|
|
619
|
-
/** The thing that the path reached before this step. */
|
|
620
|
-
readonly here: Thing;
|
|
621
|
-
readonly context: Context;
|
|
622
|
-
/**
|
|
623
|
-
* This function answers one step on a thing, through the ladder.
|
|
624
|
-
*
|
|
625
|
-
* @param thing - The thing.
|
|
626
|
-
* @param key - The key.
|
|
627
|
-
* @returns What the step reaches, or `undefined`.
|
|
628
|
-
*/
|
|
629
|
-
deref(thing: Thing, key: Key): Thing | undefined;
|
|
630
|
-
}
|
|
631
|
-
/** A walker: the code of the verb `step` of a kind of step documents. */
|
|
632
|
-
type Walker = (input: WalkInput) => WalkResult;
|
|
633
|
-
/**
|
|
634
|
-
* What a resolution needs: the world, and the code of the `deref` evaluators and of the walkers.
|
|
635
|
-
*
|
|
636
|
-
* - `plain`: `true` when the values are data. Then a step does not ask the kind of an envelope, and a reference
|
|
637
|
-
* that a step reaches stays a value (no collapse).
|
|
638
|
-
* - `roots`: the roots that a path can start at. The default is each root.
|
|
639
|
-
* - `adopt`: the thing of each value that a path reaches. A host gives its own values a host thing with this
|
|
640
|
-
* function, for example a value whose fields read through signals. A host thing is not followed as a reference.
|
|
641
|
-
*/
|
|
642
|
-
interface Navigator {
|
|
643
|
-
readonly world: World;
|
|
644
|
-
readonly derefs?: Readonly<Record<string, DerefCode>>;
|
|
645
|
-
readonly walkers?: Readonly<Record<string, Walker>>;
|
|
646
|
-
readonly plain?: boolean;
|
|
647
|
-
readonly roots?: readonly Root[];
|
|
648
|
-
readonly adopt?: (value: unknown) => Thing;
|
|
649
|
-
}
|
|
650
|
-
/** The way that one hop of a path was answered. */
|
|
651
|
-
type HopBy = "root" | "own" | "kind" | "default" | "step" | "collapse";
|
|
652
|
-
/** One hop of a path: the step, what it reached, and who answered it. */
|
|
653
|
-
interface Hop {
|
|
654
|
-
readonly step: Json;
|
|
655
|
-
readonly thing: Thing;
|
|
656
|
-
readonly by: HopBy;
|
|
657
|
-
}
|
|
658
|
-
/** The codes that a resolution gives itself. A walker can give another code for its failure. */
|
|
659
|
-
type ResolveCode = "#REF!" | "#NAME?" | "#N/A" | "#CYCLE!" | "#STEP?";
|
|
660
|
-
/** The result of a resolution: what the path reached, with each hop, or an error with the hops before it. */
|
|
661
|
-
type Resolution = {
|
|
662
|
-
readonly ok: true;
|
|
663
|
-
readonly thing: Thing;
|
|
664
|
-
readonly hops: readonly Hop[];
|
|
665
|
-
} | {
|
|
666
|
-
readonly ok: false;
|
|
667
|
-
readonly code: ResolveCode | ErrorCode;
|
|
668
|
-
readonly reason: string;
|
|
669
|
-
readonly hops: readonly Hop[];
|
|
670
|
-
};
|
|
671
|
-
/** The options of a resolution. */
|
|
672
|
-
interface ResolveOptions {
|
|
673
|
-
/** `false`: do not record the hops. The default is `true`. */
|
|
674
|
-
readonly hops?: boolean;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* This function answers one step of a path on a thing, through the ladder of the verb `deref`. A host thing
|
|
678
|
-
* answers for itself (own). A document asks its own entry, then its kind. The default goes into the value: an own
|
|
679
|
-
* field of an object, or an item of a list.
|
|
680
|
-
*
|
|
681
|
-
* @param nav - The world and the code of the evaluators.
|
|
682
|
-
* @param thing - The thing that the path reached.
|
|
683
|
-
* @param key - The key of the step.
|
|
684
|
-
* @returns What the step reaches and the rung that answered, or `undefined` when it reaches nothing.
|
|
685
|
-
*/
|
|
686
|
-
export declare function derefStep(nav: Navigator, thing: Thing, key: Key): {
|
|
687
|
-
readonly thing: Thing;
|
|
688
|
-
readonly by: HopBy;
|
|
689
|
-
} | undefined;
|
|
690
|
-
/**
|
|
691
|
-
* This function tells if a thing is a reference document: an envelope of the type `ref` with a list for its path.
|
|
692
|
-
*
|
|
693
|
-
* @param thing - The thing.
|
|
694
|
-
* @returns `true` for a reference document.
|
|
695
|
-
*/
|
|
696
|
-
export declare function isRef(thing: unknown): thing is Envelope & {
|
|
697
|
-
readonly value: readonly Json[];
|
|
698
|
-
};
|
|
699
|
-
/**
|
|
700
|
-
* This function makes the thing of the root `world`: the entries of the world as JSON. An alias is a reference
|
|
701
|
-
* document in it, thus a walk through the world follows each alias (collapse). The thing of a world is made one
|
|
702
|
-
* time.
|
|
703
|
-
*
|
|
704
|
-
* @param world - The world.
|
|
705
|
-
* @returns The thing.
|
|
706
|
-
*/
|
|
707
|
-
export declare function worldThing(world: World): Json;
|
|
708
|
-
/**
|
|
709
|
-
* This function makes a context. The world comes from the navigator when the call gives none.
|
|
710
|
-
*
|
|
711
|
-
* @param parts - The roots to set.
|
|
712
|
-
* @returns The context.
|
|
713
|
-
*/
|
|
714
|
-
export declare function context(parts?: Partial<Context>): Context;
|
|
715
|
-
/**
|
|
716
|
-
* This function resolves a path from a context, and records each hop.
|
|
717
|
-
*
|
|
718
|
-
* The first step is a root of the context. Each later step is a key or a step document. A key goes up the ladder
|
|
719
|
-
* of the verb `deref` on the thing that the path reached. A step document is evaluated by the walker of its kind,
|
|
720
|
-
* with the thing that the path reached. After each hop, a reference document is followed until the path reaches
|
|
721
|
-
* something else (collapse), except in a plain navigation.
|
|
722
|
-
*
|
|
723
|
-
* The codes of a failure:
|
|
724
|
-
*
|
|
725
|
-
* - `#REF!`: the path has no root, or a root that is not open here.
|
|
726
|
-
* - `#NAME?`: the root `names` has no such name.
|
|
727
|
-
* - `#N/A`: a step reaches nothing.
|
|
728
|
-
* - `#STEP?`: a step is not a key and not a step document.
|
|
729
|
-
* - `#CYCLE!`: the references form a cycle.
|
|
730
|
-
*
|
|
731
|
-
* @param nav - The world and the code of the evaluators.
|
|
732
|
-
* @param ctx - The context.
|
|
733
|
-
* @param path - The steps.
|
|
734
|
-
* @param options - `hops: false` does not record the hops.
|
|
735
|
-
* @returns What the path reached and each hop, or an error.
|
|
736
|
-
*/
|
|
737
|
-
export declare function resolve(nav: Navigator, ctx: Context, path: readonly unknown[], options?: ResolveOptions): Resolution;
|
|
738
|
-
/**
|
|
739
|
-
* This function gives the value of a thing: the value that a host thing gives, or else the thing itself.
|
|
740
|
-
*
|
|
741
|
-
* @param thing - The thing.
|
|
742
|
-
* @returns The value.
|
|
743
|
-
*/
|
|
744
|
-
export declare function valueOfThing(thing: Thing): unknown;
|
|
745
|
-
//#endregion
|
|
746
775
|
//#region src/classify.d.ts
|
|
747
776
|
/** A shape proposes a kind for each document that has all of its fields. */
|
|
748
777
|
interface Shape$1 {
|
|
@@ -866,6 +895,25 @@ export declare function permits(caps: readonly Cap[], kind: Cap): boolean;
|
|
|
866
895
|
* @returns The context of the part.
|
|
867
896
|
*/
|
|
868
897
|
export declare function narrow(parent: Context, next: Context): Context;
|
|
898
|
+
/**
|
|
899
|
+
* This function gives the capabilities that two lists both permit. An effect is permitted by the result when each
|
|
900
|
+
* list permits it. When the list `b` permits each capability of `a`, the result is the list `a` itself.
|
|
901
|
+
*
|
|
902
|
+
* @param a - The first list, for example the capabilities of a document.
|
|
903
|
+
* @param b - The second list, for example the list of a rule `only`.
|
|
904
|
+
* @returns The capabilities that both lists permit.
|
|
905
|
+
*/
|
|
906
|
+
export declare function intersectCaps(a: readonly Cap[], b: readonly Cap[]): readonly Cap[];
|
|
907
|
+
/**
|
|
908
|
+
* This function gives the capabilities that a kind gives one of its parts, by the capability rules of its contract.
|
|
909
|
+
* The kernel and the static kit both use it, thus a run and a check narrow the same way.
|
|
910
|
+
*
|
|
911
|
+
* @param rules - The capability rules of the kind (`Kind.caps`).
|
|
912
|
+
* @param path - The path of the part in the value of the document.
|
|
913
|
+
* @param caps - The capabilities of the document.
|
|
914
|
+
* @returns The capabilities of the part: the same list or a smaller one.
|
|
915
|
+
*/
|
|
916
|
+
export declare function partCaps(rules: readonly CapsRule[] | undefined, path: readonly Key[], caps: readonly Cap[]): readonly Cap[];
|
|
869
917
|
/**
|
|
870
918
|
* The steps of an evaluation that can wait. It yields a promise only when the host makes it wait. A runner takes the
|
|
871
919
|
* result of a part with `yield*`, thus a run goes on at once until an effect waits. A runner does not yield a
|
|
@@ -1486,6 +1534,11 @@ interface DocVisit {
|
|
|
1486
1534
|
readonly later: ReadonlySet<string>;
|
|
1487
1535
|
/** `true` when the position of the document declares an address: a reference there is not a read of a value. */
|
|
1488
1536
|
readonly address?: true | undefined;
|
|
1537
|
+
/**
|
|
1538
|
+
* The capabilities of the document: the capabilities of the walk, narrowed by the capability rules of the kinds
|
|
1539
|
+
* around it (`Kind.caps`). A walk without capabilities gives none here.
|
|
1540
|
+
*/
|
|
1541
|
+
readonly caps?: readonly Cap[] | undefined;
|
|
1489
1542
|
}
|
|
1490
1543
|
/** A position that a walk cannot read as a document. */
|
|
1491
1544
|
interface WalkProblem {
|
|
@@ -1502,6 +1555,8 @@ interface WalkOptions {
|
|
|
1502
1555
|
readonly declaredType?: string;
|
|
1503
1556
|
/** The names that the host binds at the root. */
|
|
1504
1557
|
readonly names?: readonly string[];
|
|
1558
|
+
/** The capabilities at the root. With them, each visit gets the capabilities of its document. */
|
|
1559
|
+
readonly caps?: readonly Cap[];
|
|
1505
1560
|
/**
|
|
1506
1561
|
* This function gets each position that is not a document.
|
|
1507
1562
|
*
|
|
@@ -1511,14 +1566,15 @@ interface WalkOptions {
|
|
|
1511
1566
|
}
|
|
1512
1567
|
/**
|
|
1513
1568
|
* This function visits each document of a document: the root and each part at each depth, by the contracts of the
|
|
1514
|
-
* kinds. A part of a kind that the world does not have is not visited.
|
|
1569
|
+
* kinds. A part of a kind that the world does not have is not visited. With capabilities in the options, the walk
|
|
1570
|
+
* narrows them for each part by the rules of its kind, as a run does. The walk uses no stack of the host for the
|
|
1515
1571
|
* depth, thus a deep document cannot overflow it. The time and the memory of a walk are linear in the size of the
|
|
1516
1572
|
* document. A visit makes the keys of its place and of its path only when a reader asks for them.
|
|
1517
1573
|
*
|
|
1518
1574
|
* @param world - The world of the kinds.
|
|
1519
1575
|
* @param doc - The document, as JSON.
|
|
1520
1576
|
* @param visit - The function that gets each document. It gives `"skip"` to not visit the parts of a document.
|
|
1521
|
-
* @param options - The type of a bare root value, the names
|
|
1577
|
+
* @param options - The type of a bare root value, the names, the capabilities and a function for the problems.
|
|
1522
1578
|
*/
|
|
1523
1579
|
export declare function walk(world: World, doc: unknown, visit: (visit: DocVisit) => void | "skip", options?: WalkOptions): void;
|
|
1524
1580
|
/** One reference of a document. */
|
|
@@ -1574,7 +1630,10 @@ interface CheckOptions {
|
|
|
1574
1630
|
readonly declaredType?: string;
|
|
1575
1631
|
/** The names that the host binds at the root. `"any"` does not check the names. The default is no names. */
|
|
1576
1632
|
readonly names?: readonly string[] | "any";
|
|
1577
|
-
/**
|
|
1633
|
+
/**
|
|
1634
|
+
* The capabilities at the root. Without them, the check does not check the effects. The check narrows them for
|
|
1635
|
+
* each part by the capability rules of the kinds, as a run does.
|
|
1636
|
+
*/
|
|
1578
1637
|
readonly caps?: readonly Cap[];
|
|
1579
1638
|
}
|
|
1580
1639
|
/**
|
|
@@ -1588,7 +1647,7 @@ interface CheckOptions {
|
|
|
1588
1647
|
* - `#DEPTH!`: too much nesting.
|
|
1589
1648
|
* - `#REF!` and `#STEP?`: a bad path.
|
|
1590
1649
|
* - `#NAME?`: a name that nothing binds.
|
|
1591
|
-
* - `#CAP!`: an effect that the capabilities do not permit.
|
|
1650
|
+
* - `#CAP!`: an effect that the capabilities of its document do not permit. A kind around the document can narrow them.
|
|
1592
1651
|
*
|
|
1593
1652
|
* @param machine - The world and the code of the evaluators.
|
|
1594
1653
|
* @param doc - The document, as JSON.
|
|
@@ -1684,5 +1743,5 @@ export declare function formulaEvaluators(profile?: FormulaProfile): Readonly<Re
|
|
|
1684
1743
|
*/
|
|
1685
1744
|
export declare function formulaMachine(profile?: FormulaProfile, more?: Partial<Machine>): Machine;
|
|
1686
1745
|
//#endregion
|
|
1687
|
-
export type { Alias, AllOptions, Answer, AskOptions, Cap, CheckOptions, Classification, Closure, Code, CompileInput, CompiledEvaluator, CompiledPart, CompiledRunner, Construct, Context, Part as ContextPart, DerefCode, DocVisit, Edge, Effect, Envelope, ErrorCode, EvalError, EvalFn, EvalInput, EvalOptions, Evaluator, ExtFn, Failed, FormulaProfile, Give, Header, Hop, HopBy, HostThing, Issue, Json, JsonRecord, KernelCode, Key, Kind, KindSource, LazyOp, Lookup, Machine, NamesSource, Namespace, Navigator, NearestOptions, OpFn, OrderProblem, Outcome, Part$1 as Part, PartInfo, Shape as PartShape, PartSlot, PartsSpec, Perform, Plan, PrepareOptions, RefUse, Resolution, ResolveCode, ResolveOptions, Result, Root, Run, RunCode, RunFn, RunInput, RunOptions, RunPart, Rung, Runner, Runtime, ScopeRule, Shape$1 as Shape, Side, Split, Step, StepSpec, Steps, StopSignal, Stored, Thing, TraceNode, TypeRef, Use, WalkInput, WalkOptions, WalkProblem, WalkResult, Walker, World, WorldEntry };
|
|
1746
|
+
export type { Alias, AllOptions, Answer, AskOptions, Cap, CapsRule, CheckOptions, Classification, Closure, Code, CompileInput, CompiledEvaluator, CompiledPart, CompiledRunner, Construct, Context, Part as ContextPart, DerefCode, DocVisit, Edge, Effect, Envelope, ErrorCode, EvalError, EvalFn, EvalInput, EvalOptions, Evaluator, ExtFn, Failed, FormulaProfile, Give, Header, Hop, HopBy, HostThing, Issue, Json, JsonRecord, KernelCode, Key, Kind, KindSource, LazyOp, Lookup, Machine, NamesSource, Namespace, Navigator, NearestOptions, OpFn, OrderProblem, Outcome, Part$1 as Part, PartInfo, Shape as PartShape, PartSlot, PartsSpec, Perform, Plan, PrepareOptions, RefUse, Resolution, ResolveCode, ResolveOptions, Result, Root, Run, RunCode, RunFn, RunInput, RunOptions, RunPart, Rung, Runner, Runtime, ScopeRule, Shape$1 as Shape, Side, Split, Step, StepSpec, Steps, StopSignal, Stored, Thing, TraceNode, TypeRef, Use, WalkInput, WalkOptions, WalkProblem, WalkResult, Walker, World, WorldEntry };
|
|
1688
1747
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Shape","Part"],"sources":["../src/doc.ts","../src/errors.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Shape","Part"],"sources":["../src/doc.ts","../src/errors.ts","../src/deref.ts","../src/world.ts","../src/ladder.ts","../src/classify.ts","../src/parts.ts","../src/evaluate.ts","../src/stdlib.ts","../src/order.ts","../src/context.ts","../src/static.ts","../src/formula.ts"],"mappings":";;KACY,mDAAmD;YAAmC,cAAA;;;KAGtF;YAAuC,cAAA;;;KAGvC;;;;;;;;;;;KAYA,4BAA4B;WAAmB;WAAsB,gBAAgB;;;;;;KAMrF;;WAED,MAAM;;WAEN,OAAO;;WAEP;;WAEA,MAAM,SAAS;;;qBAIb;;;;;;;;wBASG,SAAS,iBAAiB,SAAS;;;;;;;;wBAanC,MAAM,QAAQ,YAAY,cAAc;;;;;;;wBAUxC,MAAM,iBAAiB,SAAS;;;;;;;;wBAWhC,UAAU,iBAAiB,SAAS;;;;;;;wBAcpC,SAAS,MAAM,mBAAmB;;;;;;;wBAalC,SAAS,MAAM;;;;;;;;;wBAqBf,WAAW,iBAAiB,SAAS,aAAa;;UAUjD;WACN,UAAU;;WAEV,QAAQ,SAAS,eAAe;;;;;;;;;;wBAW3B,OAAO,gBAAgB,4BAA4B;;;;;;;;;wBAqBnD,MAAM,MAAM,SAAS,OAAO,MAAM;WAAmB;WAAwB,MAAM;IAAgC;;;;;;;wBAUnH,OAAO,eAAe,SAAS;;;;;;;wBAU/B,OAAO,KAAK,WAAW;;;;;;;wBAevB,SAAS,iBAAiB;;;;;;;;;;wBAuB1B,UAAU,YAAY;;;;KCpO1B;;KAkBA,YAAY;;;;;;;UAQP;WACN,MAAM;WACN;WACA,iBAAiB;WACjB;;;KAIC,OAAO;WAA0B;WAAmB,OAAO;;WAAiB;WAAoB,OAAO;;;KAGvG;WAAoB;WAAoB,OAAO;;;;;;;;wBAQ3C,GAAG,GAAG,OAAO,IAAI,OAAO;;;;;;;;;wBAYxB,KAAK,MAAM,WAAW,gBAAgB;WAAiB,iBAAiB;WAAgB;IAAyB;;;;;;;;;wBAejH,OAAO,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