@fncts/base 0.0.29 → 0.0.30
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/_cjs/collection/immutable/HashSet/api.cjs +18 -7
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/definition.cjs +2 -2
- package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +4 -1
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/constructors.cjs +9 -2
- package/_cjs/control/Eval/constructors.cjs.map +1 -1
- package/_cjs/control/Eval/definition.cjs +10 -28
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Eval/run.cjs +7 -7
- package/_cjs/control/Eval/run.cjs.map +1 -1
- package/_cjs/control/{Z → Pure}/api.cjs +146 -115
- package/_cjs/control/Pure/api.cjs.map +1 -0
- package/_cjs/control/Pure/definition.cjs +78 -0
- package/_cjs/control/Pure/definition.cjs.map +1 -0
- package/_cjs/control/{Z → Pure}/instances.cjs +1 -1
- package/_cjs/control/Pure/instances.cjs.map +1 -0
- package/_cjs/control/{Z → Pure}/runtime.cjs +67 -66
- package/_cjs/control/Pure/runtime.cjs.map +1 -0
- package/_cjs/control/{Z.cjs → Pure.cjs} +5 -5
- package/_cjs/control/Pure.cjs.map +1 -0
- package/_cjs/data/Showable/show.cjs +31 -31
- package/_cjs/data/Showable/show.cjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +17 -7
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/definition.mjs +2 -2
- package/_mjs/collection/immutable/HashSet/definition.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +5 -2
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/constructors.mjs +10 -3
- package/_mjs/control/Eval/constructors.mjs.map +1 -1
- package/_mjs/control/Eval/definition.mjs +7 -25
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/run.mjs +7 -7
- package/_mjs/control/Eval/run.mjs.map +1 -1
- package/_mjs/control/{Z → Pure}/api.mjs +134 -104
- package/_mjs/control/Pure/api.mjs.map +1 -0
- package/_mjs/control/Pure/definition.mjs +60 -0
- package/_mjs/control/Pure/definition.mjs.map +1 -0
- package/_mjs/control/{Z → Pure}/instances.mjs +1 -1
- package/_mjs/control/Pure/instances.mjs.map +1 -0
- package/_mjs/control/{Z → Pure}/runtime.mjs +68 -67
- package/_mjs/control/Pure/runtime.mjs.map +1 -0
- package/_mjs/control/Pure.mjs +6 -0
- package/_mjs/control/Pure.mjs.map +1 -0
- package/_mjs/data/Showable/show.mjs +31 -31
- package/_mjs/data/Showable/show.mjs.map +1 -1
- package/_src/collection/immutable/HashSet/api.ts +12 -1
- package/_src/collection/immutable/HashSet/definition.ts +2 -2
- package/_src/control/Eval/api.ts +5 -2
- package/_src/control/Eval/constructors.ts +10 -3
- package/_src/control/Eval/definition.ts +39 -27
- package/_src/control/Eval/run.ts +7 -7
- package/_src/control/Pure/api.ts +629 -0
- package/_src/control/Pure/definition.ts +222 -0
- package/_src/control/{Z → Pure}/instances.ts +3 -3
- package/_src/control/{Z → Pure}/runtime.ts +73 -76
- package/_src/control/Pure.ts +6 -0
- package/_src/control.ts +1 -1
- package/_src/data/Showable/show.ts +55 -53
- package/_src/global.ts +1 -1
- package/collection/immutable/HashSet/api.d.ts +5 -0
- package/collection/immutable/HashSet/definition.d.ts +1 -1
- package/control/Eval/constructors.d.ts +4 -0
- package/control/Eval/definition.d.ts +25 -28
- package/control/Pure/api.d.ts +345 -0
- package/control/Pure/definition.d.ts +156 -0
- package/control/Pure/instances.d.ts +8 -0
- package/control/Pure/runtime.d.ts +56 -0
- package/control/Pure.d.ts +4 -0
- package/control.d.ts +1 -1
- package/data/Showable/show.d.ts +2 -2
- package/global.d.ts +1 -1
- package/package.json +1 -1
- package/_cjs/control/Z/api.cjs.map +0 -1
- package/_cjs/control/Z/definition.cjs +0 -163
- package/_cjs/control/Z/definition.cjs.map +0 -1
- package/_cjs/control/Z/instances.cjs.map +0 -1
- package/_cjs/control/Z/runtime.cjs.map +0 -1
- package/_cjs/control/Z.cjs.map +0 -1
- package/_mjs/control/Z/api.mjs.map +0 -1
- package/_mjs/control/Z/definition.mjs +0 -145
- package/_mjs/control/Z/definition.mjs.map +0 -1
- package/_mjs/control/Z/instances.mjs.map +0 -1
- package/_mjs/control/Z/runtime.mjs.map +0 -1
- package/_mjs/control/Z.mjs +0 -6
- package/_mjs/control/Z.mjs.map +0 -1
- package/_src/control/Z/api.ts +0 -590
- package/_src/control/Z/definition.ts +0 -199
- package/_src/control/Z.ts +0 -6
- package/control/Z/api.d.ts +0 -345
- package/control/Z/definition.d.ts +0 -151
- package/control/Z/instances.d.ts +0 -8
- package/control/Z/runtime.d.ts +0 -56
- package/control/Z.d.ts +0 -4
|
@@ -71,7 +71,7 @@ export interface ShowOptions {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export class ShowContext extends CaseClass<ShowContextArgs> {}
|
|
74
|
-
export type ShowComputationZ<A> =
|
|
74
|
+
export type ShowComputationZ<A> = Pure<never, ShowContext, ShowContext, never, never, A>;
|
|
75
75
|
export type ShowComputation = ShowComputationZ<string>;
|
|
76
76
|
export type ShowComputationChunk = ShowComputationZ<Conc<string>>;
|
|
77
77
|
|
|
@@ -134,24 +134,24 @@ export function showWithOptions(value: unknown, options: Partial<ShowOptions>):
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export function _show(value: unknown): ShowComputation {
|
|
137
|
-
return
|
|
137
|
+
return Pure.getsPure((context) => {
|
|
138
138
|
if (value === undefined) {
|
|
139
|
-
return
|
|
139
|
+
return Pure.succeedNow(context.stylize("undefined", "undefined"));
|
|
140
140
|
}
|
|
141
141
|
if (value === null) {
|
|
142
|
-
return
|
|
142
|
+
return Pure.succeedNow(context.stylize("null", "null"));
|
|
143
143
|
}
|
|
144
144
|
if (!isObject(value) && !isFunction(value)) {
|
|
145
|
-
return
|
|
145
|
+
return Pure.succeedNow(_showPrimitive(context, value as Primitive));
|
|
146
146
|
}
|
|
147
147
|
return showValue(value);
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
function showValue(value: object): ShowComputation {
|
|
152
|
-
return
|
|
152
|
+
return Pure.getsPure((context) => {
|
|
153
153
|
if (context.seen.findIndex((v) => v === value) !== -1) {
|
|
154
|
-
return
|
|
154
|
+
return Pure.modify((context: ShowContext) =>
|
|
155
155
|
context.circular.get(value).match(
|
|
156
156
|
() => [
|
|
157
157
|
context.circular.size + 1,
|
|
@@ -224,7 +224,7 @@ function getInspectionInfo(context: ShowContext, value: object, typedArray?: str
|
|
|
224
224
|
let keys = [] as Array<PropertyKey>;
|
|
225
225
|
let tag = value[Symbol.toStringTag as keyof typeof value] as string;
|
|
226
226
|
let base = "";
|
|
227
|
-
let formatter = (_: any) =>
|
|
227
|
+
let formatter = (_: any) => Pure.succeedNow(Conc.empty<string>()) as ShowComputationChunk;
|
|
228
228
|
let braces = ["", ""] as [string, string];
|
|
229
229
|
let noIterator = true;
|
|
230
230
|
let extrasType = OBJECT_TYPE;
|
|
@@ -342,7 +342,7 @@ function getInspectionInfo(context: ShowContext, value: object, typedArray?: str
|
|
|
342
342
|
return inspectionEarlyReturn(`${getPrefix(constructor, tag, "WeakSet")}{}`);
|
|
343
343
|
} else if (isWeakMap(value)) {
|
|
344
344
|
return inspectionEarlyReturn(`${getPrefix(constructor, tag, "WeakMap")}{}`);
|
|
345
|
-
} else if (
|
|
345
|
+
} else if (Pure.isPure(value)) {
|
|
346
346
|
return constructor !== null ? inspectionEarlyReturn(`Z (${constructor}) {}`) : inspectionEarlyReturn("Z {}");
|
|
347
347
|
} else {
|
|
348
348
|
if (keys.length === 0) {
|
|
@@ -369,28 +369,28 @@ function getInspectionInfo(context: ShowContext, value: object, typedArray?: str
|
|
|
369
369
|
* into a human-readable, formatted string
|
|
370
370
|
*/
|
|
371
371
|
function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
372
|
-
return
|
|
372
|
+
return Pure.gets((context: ShowContext) => tuple(context, getInspectionInfo(context, value, typedArray))).flatMap(
|
|
373
373
|
([context, info]) => {
|
|
374
374
|
if (info._tag === "InspectionInfo" && context.recurseTimes > context.depth) {
|
|
375
375
|
let constructorName = getPrefix(info.constructor, info.tag, "Object").slice(0, -1);
|
|
376
376
|
if (info.constructor !== null) {
|
|
377
377
|
constructorName = `[${constructorName}]`;
|
|
378
378
|
}
|
|
379
|
-
return
|
|
379
|
+
return Pure.update((context: ShowContext) =>
|
|
380
380
|
context.copy({
|
|
381
381
|
recurseTimes: context.recurseTimes - 1,
|
|
382
382
|
currentDepth: context.currentDepth - 1,
|
|
383
383
|
}),
|
|
384
|
-
).zipRight(
|
|
384
|
+
).zipRight(Pure.succeedNow(context.stylize(constructorName, "special")));
|
|
385
385
|
}
|
|
386
386
|
if (info._tag === "InspectionEarlyReturn") {
|
|
387
|
-
return
|
|
387
|
+
return Pure.succeedNow(info.shown);
|
|
388
388
|
} else {
|
|
389
|
-
return
|
|
389
|
+
return Pure.update((context: ShowContext) => {
|
|
390
390
|
context.seen.push(value);
|
|
391
391
|
return context;
|
|
392
392
|
}).zipRight(
|
|
393
|
-
|
|
393
|
+
Pure.defer(() => {
|
|
394
394
|
let keys: ShowComputationChunk;
|
|
395
395
|
let indices: ShowComputationChunk;
|
|
396
396
|
let base: ShowComputation;
|
|
@@ -398,11 +398,11 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
398
398
|
let extrasType: number;
|
|
399
399
|
switch (info._tag) {
|
|
400
400
|
case "InspectionInfo": {
|
|
401
|
-
base =
|
|
401
|
+
base = Pure.succeedNow(info.base);
|
|
402
402
|
keys = Conc.from(info.keys)
|
|
403
|
-
.traverse(
|
|
403
|
+
.traverse(Pure.Applicative)((key) => showProperty(value, key, info.extrasType))
|
|
404
404
|
.crossWith(
|
|
405
|
-
info.protoProps.traverse(
|
|
405
|
+
info.protoProps.traverse(Pure.Applicative)((key) => showProperty(value, key, PROTO_TYPE)),
|
|
406
406
|
(k1, k2) => k1.concat(k2),
|
|
407
407
|
);
|
|
408
408
|
indices = info.formatter(value);
|
|
@@ -413,15 +413,15 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
413
413
|
case "InspectionExternal": {
|
|
414
414
|
const externalComputation = info.computation;
|
|
415
415
|
if (externalComputation._tag === "Primitive") {
|
|
416
|
-
return
|
|
416
|
+
return Pure.getsPure((context) =>
|
|
417
417
|
externalComputation.computation.map((str) =>
|
|
418
418
|
str.replace(/\n/g, `\n${" ".repeat(context.indentationLevel)}`),
|
|
419
419
|
),
|
|
420
420
|
);
|
|
421
421
|
} else {
|
|
422
|
-
base = externalComputation.base ||
|
|
423
|
-
keys = externalComputation.keys ||
|
|
424
|
-
indices = externalComputation.indices ||
|
|
422
|
+
base = externalComputation.base || Pure.succeedNow("");
|
|
423
|
+
keys = externalComputation.keys || Pure.succeedNow(Conc.empty());
|
|
424
|
+
indices = externalComputation.indices || Pure.succeedNow(Conc.empty());
|
|
425
425
|
braces = externalComputation.braces || ["", ""];
|
|
426
426
|
extrasType = externalComputation.extrasType || OBJECT_TYPE;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
const output = indices.crossWith(keys, (idxs, ks) => idxs.concat(ks));
|
|
432
|
-
const baseWithRef =
|
|
432
|
+
const baseWithRef = Pure.getsPure((context: ShowContext) =>
|
|
433
433
|
context.circular.get(value).match(
|
|
434
434
|
() => base,
|
|
435
435
|
(index) =>
|
|
@@ -439,7 +439,7 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
439
439
|
}),
|
|
440
440
|
),
|
|
441
441
|
);
|
|
442
|
-
return
|
|
442
|
+
return Pure.update((_: ShowContext) =>
|
|
443
443
|
_.copy({
|
|
444
444
|
recurseTimes: context.recurseTimes + 1,
|
|
445
445
|
currentDepth: _.recurseTimes + 1,
|
|
@@ -448,7 +448,7 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
448
448
|
.zipRight(output)
|
|
449
449
|
.cross(baseWithRef)
|
|
450
450
|
.flatMap(([output, base]) =>
|
|
451
|
-
|
|
451
|
+
Pure.modify((context) => {
|
|
452
452
|
const res = reduceToSingleString(context, output, base, braces, extrasType, value);
|
|
453
453
|
const budget = context.budget[context.indentationLevel] || 0;
|
|
454
454
|
const newLength = budget + res.length;
|
|
@@ -463,7 +463,7 @@ function showRaw(value: object, typedArray?: string): ShowComputation {
|
|
|
463
463
|
}),
|
|
464
464
|
)
|
|
465
465
|
.zipLeft(
|
|
466
|
-
|
|
466
|
+
Pure.update((context: ShowContext) => {
|
|
467
467
|
context.seen.pop();
|
|
468
468
|
return context.copy({
|
|
469
469
|
recurseTimes: context.recurseTimes - 1,
|
|
@@ -531,20 +531,20 @@ function removeColors(str: string): string {
|
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function showSet(value: Set<unknown>): ShowComputationChunk {
|
|
534
|
-
return
|
|
535
|
-
.zipRight((value as Iterable<unknown>).traverseToConc(
|
|
536
|
-
.zipLeft(
|
|
534
|
+
return Pure.update((_: ShowContext) => _.copy({ indentationLevel: _.indentationLevel + 2 }))
|
|
535
|
+
.zipRight((value as Iterable<unknown>).traverseToConc(Pure.Applicative)(_show))
|
|
536
|
+
.zipLeft(Pure.update((_: ShowContext) => _.copy({ indentationLevel: _.indentationLevel - 2 })));
|
|
537
537
|
}
|
|
538
538
|
|
|
539
539
|
function showMap(value: Map<unknown, unknown>): ShowComputationChunk {
|
|
540
|
-
return
|
|
540
|
+
return Pure.update((_: ShowContext) => _.copy({ indentationLevel: _.indentationLevel + 2 }))
|
|
541
541
|
.zipRight(
|
|
542
|
-
(value as Iterable<[unknown, unknown]>).traverseToConc(
|
|
542
|
+
(value as Iterable<[unknown, unknown]>).traverseToConc(Pure.Applicative)(([k, v]) =>
|
|
543
543
|
_show(k).crossWith(_show(v), (k, v) => `${k} => ${v}`),
|
|
544
544
|
),
|
|
545
545
|
)
|
|
546
546
|
.zipLeft(
|
|
547
|
-
|
|
547
|
+
Pure.update((_: ShowContext) =>
|
|
548
548
|
_.copy({
|
|
549
549
|
indentationLevel: _.indentationLevel - 2,
|
|
550
550
|
}),
|
|
@@ -553,8 +553,8 @@ function showMap(value: Map<unknown, unknown>): ShowComputationChunk {
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
function showTypedArray(value: TypedArray): ShowComputationChunk {
|
|
556
|
-
return
|
|
557
|
-
|
|
556
|
+
return Pure.getsPure((context) =>
|
|
557
|
+
Pure.defer(() => {
|
|
558
558
|
const maxLength = Math.min(Math.max(0, context.maxArrayLength), value.length);
|
|
559
559
|
const remaining = value.length - maxLength;
|
|
560
560
|
let output = Conc.empty<string>();
|
|
@@ -567,26 +567,26 @@ function showTypedArray(value: TypedArray): ShowComputationChunk {
|
|
|
567
567
|
output = output.append(`... ${remaining} more item${pluralize(remaining)}`);
|
|
568
568
|
}
|
|
569
569
|
if (context.showHidden) {
|
|
570
|
-
return
|
|
570
|
+
return Pure.update((_: ShowContext) => _.copy({ indentationLevel: _.indentationLevel + 2 }))
|
|
571
571
|
.zipRight(
|
|
572
|
-
|
|
572
|
+
Pure.succeedNow(output).flatMap((output) =>
|
|
573
573
|
Conc("BYTES_PER_ELEMENT", "length", "byteLength", "byteOffset", "buffer")
|
|
574
|
-
.traverse(
|
|
574
|
+
.traverse(Pure.Applicative)((key) =>
|
|
575
575
|
_show(value[key as keyof TypedArray]).map((shown) => `[${key}]: ${shown}`),
|
|
576
576
|
)
|
|
577
577
|
.map((shownKeys) => output.concat(shownKeys)),
|
|
578
578
|
),
|
|
579
579
|
)
|
|
580
|
-
.zipLeft(
|
|
580
|
+
.zipLeft(Pure.update((_: ShowContext) => _.copy({ indentationLevel: _.indentationLevel - 2 })));
|
|
581
581
|
} else {
|
|
582
|
-
return
|
|
582
|
+
return Pure.succeedNow(output);
|
|
583
583
|
}
|
|
584
584
|
}),
|
|
585
585
|
);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
function showArrayBuffer(value: ArrayBuffer | SharedArrayBuffer): ShowComputationChunk {
|
|
589
|
-
return
|
|
589
|
+
return Pure.gets((context: ShowContext) => {
|
|
590
590
|
let buffer;
|
|
591
591
|
try {
|
|
592
592
|
buffer = new Uint8Array(value);
|
|
@@ -613,7 +613,7 @@ function showSpecialArray(
|
|
|
613
613
|
currentIndex: number,
|
|
614
614
|
currentLength: number,
|
|
615
615
|
): ShowComputationChunk {
|
|
616
|
-
return
|
|
616
|
+
return Pure.getsPure((context) => {
|
|
617
617
|
const keys = Object.keys(value);
|
|
618
618
|
let index = currentIndex;
|
|
619
619
|
let i = currentIndex;
|
|
@@ -657,7 +657,7 @@ function showSpecialArray(
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
function showArray(value: ReadonlyArray<unknown>): ShowComputationChunk {
|
|
660
|
-
return
|
|
660
|
+
return Pure.gets((context: ShowContext) => {
|
|
661
661
|
let chunk = Conc.from(value);
|
|
662
662
|
const valLen = chunk.length;
|
|
663
663
|
const len = Math.min(Math.max(0, context.maxArrayLength), valLen);
|
|
@@ -665,7 +665,7 @@ function showArray(value: ReadonlyArray<unknown>): ShowComputationChunk {
|
|
|
665
665
|
chunk = chunk.take(len);
|
|
666
666
|
return tuple(remaining, chunk);
|
|
667
667
|
}).flatMap(([remaining, chunk]) => {
|
|
668
|
-
let computation =
|
|
668
|
+
let computation = Pure.succeedNow(Conc.empty()) as ShowComputationChunk;
|
|
669
669
|
for (let i = 0; i < chunk.length; i++) {
|
|
670
670
|
if (!Object.prototype.hasOwnProperty.call(value, i)) {
|
|
671
671
|
return showSpecialArray(value, chunk.length, computation, i, i);
|
|
@@ -680,7 +680,7 @@ function showArray(value: ReadonlyArray<unknown>): ShowComputationChunk {
|
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
function showChunk(value: Conc<unknown>): ShowComputationChunk {
|
|
683
|
-
return
|
|
683
|
+
return Pure.gets((context: ShowContext) => {
|
|
684
684
|
const valLen = value.length;
|
|
685
685
|
const len = Math.min(Math.max(0, context.maxArrayLength), valLen);
|
|
686
686
|
const remaining = valLen - len;
|
|
@@ -688,7 +688,7 @@ function showChunk(value: Conc<unknown>): ShowComputationChunk {
|
|
|
688
688
|
return tuple(remaining, chunk);
|
|
689
689
|
}).flatMap(([remaining, chunk]) =>
|
|
690
690
|
chunk
|
|
691
|
-
.traverse(
|
|
691
|
+
.traverse(Pure.Applicative)(_show)
|
|
692
692
|
.map((chunk) => (remaining > 0 ? chunk.append(`... ${remaining} more item${pluralize(remaining)}`) : chunk)),
|
|
693
693
|
);
|
|
694
694
|
}
|
|
@@ -699,8 +699,8 @@ export function showProperty(
|
|
|
699
699
|
type: number,
|
|
700
700
|
desc?: PropertyDescriptor,
|
|
701
701
|
): ShowComputation {
|
|
702
|
-
return
|
|
703
|
-
|
|
702
|
+
return Pure.getsPure((context: ShowContext) =>
|
|
703
|
+
Pure.defer(() => {
|
|
704
704
|
const descriptor = desc ||
|
|
705
705
|
Object.getOwnPropertyDescriptor(value, key) || {
|
|
706
706
|
value: value[key as keyof typeof value],
|
|
@@ -708,22 +708,24 @@ export function showProperty(
|
|
|
708
708
|
};
|
|
709
709
|
if (isDefined(descriptor.value)) {
|
|
710
710
|
const diff = context.compact !== true || (type !== OBJECT_TYPE && type !== PROTO_TYPE) ? 2 : 3;
|
|
711
|
-
return
|
|
711
|
+
return Pure.update((_: ShowContext): ShowContext => _.copy({ indentationLevel: _.indentationLevel + diff }))
|
|
712
712
|
.zipRight(_show(descriptor.value))
|
|
713
713
|
.flatMap((shown: string) =>
|
|
714
|
-
|
|
714
|
+
Pure.gets((_: ShowContext) =>
|
|
715
715
|
diff === 3 && _.breakLength < getStringWidth(shown, _.colors)
|
|
716
716
|
? tuple(descriptor, `\n${" ".repeat(_.indentationLevel)}`, shown)
|
|
717
717
|
: tuple(descriptor, " ", shown),
|
|
718
718
|
),
|
|
719
719
|
)
|
|
720
|
-
.zipLeft(
|
|
720
|
+
.zipLeft(
|
|
721
|
+
Pure.update((_: ShowContext): ShowContext => _.copy({ indentationLevel: _.indentationLevel - diff })),
|
|
722
|
+
);
|
|
721
723
|
} else if (isDefined(descriptor.get)) {
|
|
722
|
-
return
|
|
724
|
+
return Pure.succeedNow(tuple(descriptor, " ", `[${descriptor.set ? "Getter/Settter" : "Getter"}]`));
|
|
723
725
|
} else if (isDefined(descriptor.set)) {
|
|
724
|
-
return
|
|
726
|
+
return Pure.succeedNow(tuple(descriptor, " ", "Setter"));
|
|
725
727
|
} else {
|
|
726
|
-
return
|
|
728
|
+
return Pure.succeedNow(tuple(descriptor, " ", "undefined"));
|
|
727
729
|
}
|
|
728
730
|
}).map(([descriptor, extra, shown]) => {
|
|
729
731
|
if (type === ARRAY_TYPE) {
|
package/_src/global.ts
CHANGED
|
@@ -5,6 +5,11 @@ import { Either } from "@fncts/base/data/Either/definition";
|
|
|
5
5
|
import { HashSet } from "@fncts/base/collection/immutable/HashSet/definition";
|
|
6
6
|
import * as P from "@fncts/base/typeclass";
|
|
7
7
|
import { HashEq } from "@fncts/base/typeclass";
|
|
8
|
+
/**
|
|
9
|
+
* @tsplus static fncts.HashSetOps from
|
|
10
|
+
* @tsplus location "@fncts/base/collection/immutable/HashSet/api"
|
|
11
|
+
*/
|
|
12
|
+
export declare function from<A>(items: Iterable<A>): HashSet<A>;
|
|
8
13
|
/**
|
|
9
14
|
* @tsplus pipeable fncts.HashSet add
|
|
10
15
|
* @tsplus location "@fncts/base/collection/immutable/HashSet/api"
|
|
@@ -97,7 +97,7 @@ export declare class IndexedNode<A> {
|
|
|
97
97
|
edit: number;
|
|
98
98
|
mask: number;
|
|
99
99
|
children: Array<Node<A>>;
|
|
100
|
-
readonly _tag = "
|
|
100
|
+
readonly _tag = "IndexedNode";
|
|
101
101
|
constructor(edit: number, mask: number, children: Array<Node<A>>);
|
|
102
102
|
modify(remove: boolean, edit: number, eq: (y: A) => (x: A) => boolean, shift: number, hash: number, value: A, size: SizeRef): Node<A>;
|
|
103
103
|
}
|
|
@@ -16,4 +16,8 @@ export declare function defer<A>(make: Lazy<Eval<A>>): Eval<A>;
|
|
|
16
16
|
* @tsplus location "@fncts/base/control/Eval/constructors"
|
|
17
17
|
*/
|
|
18
18
|
export declare function always<A>(make: Lazy<A>): Eval<A>;
|
|
19
|
+
/**
|
|
20
|
+
* @tsplus static fncts.control.EvalOps later
|
|
21
|
+
* @tsplus location "@fncts/base/control/Eval/constructors"
|
|
22
|
+
*/
|
|
19
23
|
export declare function later<A>(make: Lazy<A>): Eval<A>;
|
|
@@ -3,6 +3,19 @@ export declare const EvalVariance: unique symbol;
|
|
|
3
3
|
export type EvalVariance = typeof EvalVariance;
|
|
4
4
|
export declare const EvalTypeId: unique symbol;
|
|
5
5
|
export type EvalTypeId = typeof EvalTypeId;
|
|
6
|
+
export declare class EvalPrimitive {
|
|
7
|
+
readonly _tag: unknown;
|
|
8
|
+
readonly [EvalTypeId]: EvalTypeId;
|
|
9
|
+
[EvalVariance]: {
|
|
10
|
+
readonly _A: (_: never) => never;
|
|
11
|
+
};
|
|
12
|
+
constructor(_tag: unknown);
|
|
13
|
+
readonly i0: unknown;
|
|
14
|
+
readonly i1: unknown;
|
|
15
|
+
}
|
|
16
|
+
export type EvalOp<Tag extends number, Body = {}> = EvalPrimitive & Body & {
|
|
17
|
+
_tag: Tag;
|
|
18
|
+
};
|
|
6
19
|
export interface EvalF extends HKT {
|
|
7
20
|
type: Eval<this["A"]>;
|
|
8
21
|
variance: {
|
|
@@ -29,40 +42,24 @@ export declare const enum EvalTag {
|
|
|
29
42
|
Defer = 1,
|
|
30
43
|
Chain = 2
|
|
31
44
|
}
|
|
32
|
-
export
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
readonly [EvalTypeId]: EvalTypeId;
|
|
36
|
-
[EvalVariance]: {
|
|
37
|
-
readonly _A: (_: never) => A;
|
|
38
|
-
};
|
|
39
|
-
constructor(value: A);
|
|
45
|
+
export interface Value extends EvalOp<EvalTag.Value, {
|
|
46
|
+
readonly i0: any;
|
|
47
|
+
}> {
|
|
40
48
|
}
|
|
41
|
-
export
|
|
42
|
-
readonly
|
|
43
|
-
|
|
44
|
-
[EvalVariance]: {
|
|
45
|
-
readonly _A: (_: never) => A;
|
|
46
|
-
};
|
|
47
|
-
readonly _tag = EvalTag.Defer;
|
|
48
|
-
readonly _A: () => A;
|
|
49
|
-
constructor(make: () => Eval<A>);
|
|
49
|
+
export interface Defer extends EvalOp<EvalTag.Defer, {
|
|
50
|
+
readonly i0: () => Primitive;
|
|
51
|
+
}> {
|
|
50
52
|
}
|
|
51
|
-
export
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
|
|
55
|
-
[EvalVariance]: {
|
|
56
|
-
readonly _A: (_: never) => B;
|
|
57
|
-
};
|
|
58
|
-
readonly _tag = EvalTag.Chain;
|
|
59
|
-
constructor(self: Eval<A>, f: (a: A) => Eval<B>);
|
|
53
|
+
export interface FlatMap extends EvalOp<EvalTag.Chain, {
|
|
54
|
+
readonly i0: Primitive;
|
|
55
|
+
readonly i1: (a: any) => Primitive;
|
|
56
|
+
}> {
|
|
60
57
|
}
|
|
61
|
-
type
|
|
58
|
+
type Primitive = Value | Defer | FlatMap;
|
|
62
59
|
/**
|
|
63
60
|
* @tsplus smart:remove
|
|
64
61
|
*/
|
|
65
|
-
export declare function concrete(_: Eval<any>): asserts _ is
|
|
62
|
+
export declare function concrete(_: Eval<any>): asserts _ is Primitive;
|
|
66
63
|
/**
|
|
67
64
|
* @tsplus unify fncts.control.Eval
|
|
68
65
|
*/
|