@fncts/io 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/Differ/api.d.ts +24 -0
- package/Differ/definition.d.ts +15 -0
- package/FiberRef/unsafe.d.ts +12 -6
- package/IOEnv/services.d.ts +2 -2
- package/Supervisor/api.d.ts +11 -5
- package/Supervisor/definition.d.ts +28 -0
- package/SupervisorPatch.d.ts +61 -0
- package/_cjs/Differ/api.cjs +108 -0
- package/_cjs/Differ/api.cjs.map +1 -0
- package/_cjs/Differ/definition.cjs +23 -0
- package/_cjs/Differ/definition.cjs.map +1 -0
- package/_cjs/FiberRef/unsafe.cjs +35 -21
- package/_cjs/FiberRef/unsafe.cjs.map +1 -1
- package/_cjs/IOEnv/definition.cjs.map +1 -1
- package/_cjs/IOEnv/services.cjs.map +1 -1
- package/_cjs/Supervisor/api.cjs +44 -33
- package/_cjs/Supervisor/api.cjs.map +1 -1
- package/_cjs/Supervisor/definition.cjs +66 -1
- package/_cjs/Supervisor/definition.cjs.map +1 -1
- package/_cjs/SupervisorPatch.cjs +172 -0
- package/_cjs/SupervisorPatch.cjs.map +1 -0
- package/_mjs/Differ/api.mjs +90 -0
- package/_mjs/Differ/api.mjs.map +1 -0
- package/_mjs/Differ/definition.mjs +13 -0
- package/_mjs/Differ/definition.mjs.map +1 -0
- package/_mjs/FiberRef/unsafe.mjs +31 -20
- package/_mjs/FiberRef/unsafe.mjs.map +1 -1
- package/_mjs/IOEnv/definition.mjs.map +1 -1
- package/_mjs/IOEnv/services.mjs.map +1 -1
- package/_mjs/Supervisor/api.mjs +39 -32
- package/_mjs/Supervisor/api.mjs.map +1 -1
- package/_mjs/Supervisor/definition.mjs +55 -0
- package/_mjs/Supervisor/definition.mjs.map +1 -1
- package/_mjs/SupervisorPatch.mjs +131 -0
- package/_mjs/SupervisorPatch.mjs.map +1 -0
- package/_src/Differ/api.ts +72 -0
- package/_src/Differ/definition.ts +16 -0
- package/_src/FiberRef/unsafe.ts +24 -22
- package/_src/IOEnv/definition.ts +0 -2
- package/_src/IOEnv/services.ts +5 -4
- package/_src/Supervisor/api.ts +33 -29
- package/_src/Supervisor/definition.ts +59 -0
- package/_src/SupervisorPatch.ts +107 -0
- package/_src/global.ts +4 -0
- package/global.d.ts +4 -0
- package/package.json +2 -2
package/Differ/api.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { Environment } from "@fncts/base/data/Environment";
|
2
|
+
import type { Supervisor } from "@fncts/io/Supervisor";
|
3
|
+
import { Differ } from "./definition.js";
|
4
|
+
/**
|
5
|
+
* Constructs a differ that just diffs two values by returning a function that
|
6
|
+
* sets the value to the new value. This differ does not support combining
|
7
|
+
* multiple updates to the value compositionally and should only be used when
|
8
|
+
* there is no compositional way to update them.
|
9
|
+
* @tsplus static fncts.io.DifferOps update
|
10
|
+
* @tsplus location "@fncts/io/Differ/api"
|
11
|
+
*/
|
12
|
+
export declare function update<A>(): Differ<A, (_: A) => A>;
|
13
|
+
/**
|
14
|
+
* Constructs a differ that knows how to diff `Environment` values.
|
15
|
+
* @tsplus static fncts.io.DifferOps environment
|
16
|
+
* @tsplus location "@fncts/io/Differ/api"
|
17
|
+
*/
|
18
|
+
export declare function environment<A>(): Differ<Environment<A>, Environment.Patch<A, A>>;
|
19
|
+
/**
|
20
|
+
* Constructs a differ that knows how to diff `Supervisor` values.
|
21
|
+
* @tsplus static fncts.io.DifferOps supervisor
|
22
|
+
* @tsplus location "@fncts/io/Differ/api"
|
23
|
+
*/
|
24
|
+
export declare function supervisor(): Differ<Supervisor<any>, Supervisor.Patch>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export declare const DifferTypeId: unique symbol;
|
2
|
+
export type DifferTypeId = typeof DifferTypeId;
|
3
|
+
/**
|
4
|
+
* @tsplus type fncts.io.Differ
|
5
|
+
* @tsplus companion fncts.io.DifferOps
|
6
|
+
*/
|
7
|
+
export declare abstract class Differ<Value, Patch> {
|
8
|
+
readonly _typeId: DifferTypeId;
|
9
|
+
_Value: Value;
|
10
|
+
_Patch: Patch;
|
11
|
+
abstract readonly empty: Patch;
|
12
|
+
abstract combine(first: Patch, second: Patch): Patch;
|
13
|
+
abstract diff(oldValue: Value, newValue: Value): Patch;
|
14
|
+
abstract patch(patch: Patch): (oldValue: Value) => Value;
|
15
|
+
}
|
package/FiberRef/unsafe.d.ts
CHANGED
@@ -1,25 +1,31 @@
|
|
1
1
|
import { FiberRef } from "@fncts/io/FiberRef/definition";
|
2
2
|
import { Environment } from "@fncts/base/data/Environment/definition";
|
3
|
+
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
4
|
+
import { SupervisorPatch } from "@fncts/io/SupervisorPatch";
|
3
5
|
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
4
6
|
import { FiberScope } from "@fncts/io/FiberScope";
|
5
7
|
import { LogLevel } from "@fncts/io/LogLevel";
|
6
8
|
import { List } from "@fncts/base/collection/immutable/List/definition";
|
7
9
|
import { HashMap } from "@fncts/base/collection/immutable/HashMap/definition";
|
8
|
-
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
9
10
|
import type { LogSpan } from "../LogSpan.js";
|
10
11
|
import type { Scheduler } from "@fncts/io/internal/Scheduler.js";
|
11
|
-
import {
|
12
|
+
import { Differ } from "@fncts/io/Differ/definition";
|
12
13
|
import { IsFatal } from "../internal/IsFatal.js";
|
13
14
|
/**
|
14
15
|
* @tsplus static fncts.io.FiberRefOps unsafeMakePatch
|
15
16
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
16
17
|
*/
|
17
|
-
export declare function unsafeMakePatch<Value, Patch>(initial: Value,
|
18
|
+
export declare function unsafeMakePatch<Value, Patch>(initial: Value, differ: Differ<Value, Patch>, fork: Patch, join?: (oldValue: Value, newValue: Value) => Value): FiberRef.WithPatch<Value, Patch>;
|
18
19
|
/**
|
19
20
|
* @tsplus static fncts.io.FiberRefOps unsafeMakeEnvironment
|
20
21
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
21
22
|
*/
|
22
|
-
export declare function unsafeMakeEnvironment<A>(initial: Environment<A>): FiberRef.WithPatch<Environment<A>, Patch<A, A>>;
|
23
|
+
export declare function unsafeMakeEnvironment<A>(initial: Environment<A>): FiberRef.WithPatch<Environment<A>, Environment.Patch<A, A>>;
|
24
|
+
/**
|
25
|
+
* @tsplus static fncts.io.FiberRefOps unsafeMakeSupervisor
|
26
|
+
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
27
|
+
*/
|
28
|
+
export declare function unsafeMakeSupervisor(initial: Supervisor<any>): FiberRef.WithPatch<Supervisor<any>, SupervisorPatch>;
|
23
29
|
/**
|
24
30
|
* @tsplus static fncts.io.FiberRefOps unsafeMake
|
25
31
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
@@ -34,7 +40,7 @@ export declare const forkScopeOverride: import("./definition.js").FiberRef.WithP
|
|
34
40
|
* @tsplus static fncts.io.FiberRefOps currentEnvironment
|
35
41
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
36
42
|
*/
|
37
|
-
export declare const currentEnvironment: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/data/Environment.js").Environment<unknown>, Patch<unknown, unknown>>;
|
43
|
+
export declare const currentEnvironment: import("./definition.js").FiberRef.WithPatch<import("@fncts/base/data/Environment.js").Environment<unknown>, import("@fncts/base/data/Environment.js").Environment.Patch<unknown, unknown>>;
|
38
44
|
/**
|
39
45
|
* @tsplus static fncts.io.FiberRefOps fiberName
|
40
46
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
@@ -64,7 +70,7 @@ export declare const currentScheduler: import("./definition.js").FiberRef.WithPa
|
|
64
70
|
* @tsplus static fncts.io.FiberRefOps currentSupervisor
|
65
71
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
66
72
|
*/
|
67
|
-
export declare const currentSupervisor: import("./definition.js").FiberRef.WithPatch<import("../Supervisor.js").Supervisor<any>,
|
73
|
+
export declare const currentSupervisor: import("./definition.js").FiberRef.WithPatch<import("../Supervisor.js").Supervisor<any>, import("../SupervisorPatch.js").SupervisorPatch>;
|
68
74
|
/**
|
69
75
|
* @tsplus static fncts.io.FiberRefOps currentIsFatal
|
70
76
|
* @tsplus location "@fncts/io/FiberRef/unsafe"
|
package/IOEnv/services.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { FiberRef } from "@fncts/io/FiberRef/definition";
|
2
2
|
import { Environment } from "@fncts/base/data/Environment/definition";
|
3
3
|
import { IOEnv } from "@fncts/io/IOEnv";
|
4
|
-
import type {
|
4
|
+
import type { EnvironmentPatch } from "@fncts/base/data/EnvironmentPatch";
|
5
5
|
/**
|
6
6
|
* @tsplus static fncts.io.IOEnvOps services
|
7
7
|
* @tsplus location "@fncts/io/IOEnv/services"
|
8
8
|
*/
|
9
|
-
export declare const services: FiberRef.WithPatch<Environment<IOEnv>,
|
9
|
+
export declare const services: FiberRef.WithPatch<Environment<IOEnv>, EnvironmentPatch<IOEnv, IOEnv>>;
|
package/Supervisor/api.d.ts
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
2
|
-
import {
|
3
|
-
import { IO } from "@fncts/io/IO/definition";
|
4
|
-
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
5
|
-
import { Fiber } from "@fncts/io/Fiber/definition";
|
6
|
-
import { Exit } from "@fncts/base/data/Exit/definition";
|
2
|
+
import { HashSet } from "@fncts/base/collection/immutable/HashSet/definition";
|
7
3
|
/**
|
8
4
|
* @tsplus fluent fncts.io.Supervisor zip
|
9
5
|
* @tsplus location "@fncts/io/Supervisor/api"
|
10
6
|
*/
|
11
7
|
export declare function zip_<A, B>(fa: Supervisor<A>, fb: Supervisor<B>): Supervisor<readonly [A, B]>;
|
8
|
+
/**
|
9
|
+
* @tsplus getter fncts.io.Supervisor toSet
|
10
|
+
* @tsplus location "@fncts/io/Supervisor/api"
|
11
|
+
*/
|
12
|
+
export declare function toSet(self: Supervisor<any>): HashSet<Supervisor<any>>;
|
13
|
+
/**
|
14
|
+
* @tsplus fluent fncts.io.Supervisor removeSupervisor
|
15
|
+
* @tsplus location "@fncts/io/Supervisor/api"
|
16
|
+
*/
|
17
|
+
export declare function removeSupervisor(self: Supervisor<any>, that: Supervisor<any>): Supervisor<any>;
|
@@ -3,6 +3,12 @@ import { Environment } from "@fncts/base/data/Environment/definition";
|
|
3
3
|
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
4
4
|
import { Fiber } from "@fncts/io/Fiber/definition";
|
5
5
|
import { Exit } from "@fncts/base/data/Exit/definition";
|
6
|
+
import type { SupervisorPatch } from "@fncts/io/SupervisorPatch";
|
7
|
+
export declare const enum SupervisorTag {
|
8
|
+
Const = 0,
|
9
|
+
Proxy = 1,
|
10
|
+
Zip = 2
|
11
|
+
}
|
6
12
|
/**
|
7
13
|
* @tsplus type fncts.io.Supervisor
|
8
14
|
* @tsplus companion fncts.io.SupervisorOps
|
@@ -15,8 +21,12 @@ export declare abstract class Supervisor<A> {
|
|
15
21
|
unsafeOnSuspend<E, A>(_fiber: Fiber.Runtime<E, A>): void;
|
16
22
|
unsafeOnResume<E, A>(_fiber: Fiber.Runtime<E, A>): void;
|
17
23
|
}
|
24
|
+
export declare namespace Supervisor {
|
25
|
+
type Patch = SupervisorPatch;
|
26
|
+
}
|
18
27
|
export declare class ConstSupervisor<A> extends Supervisor<A> {
|
19
28
|
readonly value: UIO<A>;
|
29
|
+
readonly _tag = SupervisorTag.Const;
|
20
30
|
constructor(value: UIO<A>);
|
21
31
|
unsafeOnStart(): void;
|
22
32
|
unsafeOnEnd(): void;
|
@@ -27,6 +37,7 @@ export declare class ConstSupervisor<A> extends Supervisor<A> {
|
|
27
37
|
export declare class ProxySupervisor<A> extends Supervisor<A> {
|
28
38
|
readonly value: UIO<A>;
|
29
39
|
readonly underlying: Supervisor<any>;
|
40
|
+
readonly _tag = SupervisorTag.Proxy;
|
30
41
|
constructor(value: UIO<A>, underlying: Supervisor<any>);
|
31
42
|
unsafeOnStart<R, E, A>(environment: Environment<R>, effect: IO<R, E, A>, parent: Maybe<Fiber.Runtime<E, A>>, fiber: Fiber.Runtime<E, A>): void;
|
32
43
|
unsafeOnEnd<E, A>(value: Exit<E, A>, fiber: Fiber.Runtime<E, A>): void;
|
@@ -34,3 +45,20 @@ export declare class ProxySupervisor<A> extends Supervisor<A> {
|
|
34
45
|
unsafeOnSuspend<E, A>(fiber: Fiber.Runtime<E, A>): void;
|
35
46
|
unsafeOnResume<E, A>(fiber: Fiber.Runtime<E, A>): void;
|
36
47
|
}
|
48
|
+
export declare class Zip<A, B> extends Supervisor<readonly [A, B]> {
|
49
|
+
readonly first: Supervisor<A>;
|
50
|
+
readonly second: Supervisor<B>;
|
51
|
+
readonly _tag = SupervisorTag.Zip;
|
52
|
+
constructor(first: Supervisor<A>, second: Supervisor<B>);
|
53
|
+
value: import("../IO").IO<never, never, readonly [A, B]>;
|
54
|
+
unsafeOnStart<R, E, A>(environment: Environment<R>, effect: IO<R, E, A>, parent: Maybe<Fiber.Runtime<any, any>>, fiber: Fiber.Runtime<E, A>): void;
|
55
|
+
unsafeOnEnd<E, A>(value: Exit<E, A>, fiber: Fiber.Runtime<E, A>): void;
|
56
|
+
unsafeOnEffect<E, A>(fiber: Fiber.Runtime<E, A>, effect: IO<any, any, any>): void;
|
57
|
+
unsafeOnSuspend<E, A>(fiber: Fiber.Runtime<E, A>): void;
|
58
|
+
unsafeOnResume<E, A>(fiber: Fiber.Runtime<E, A>): void;
|
59
|
+
}
|
60
|
+
export type Concrete = ConstSupervisor<any> | ProxySupervisor<any> | Zip<any, any>;
|
61
|
+
/**
|
62
|
+
* @tsplus macro remove
|
63
|
+
*/
|
64
|
+
export declare function concrete(_: Supervisor<any>): asserts _ is Concrete;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Supervisor } from "@fncts/io/Supervisor/definition";
|
2
|
+
import { List } from "@fncts/base/collection/immutable/List/definition";
|
3
|
+
export declare const SupervisorPatchTypeId: unique symbol;
|
4
|
+
export type SupervisorPatchTypeId = typeof SupervisorPatchTypeId;
|
5
|
+
export declare const enum SupervisorPatchTag {
|
6
|
+
AddSupervisor = 0,
|
7
|
+
Combine = 1,
|
8
|
+
Empty = 2,
|
9
|
+
RemoveSupervisor = 3
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* @tsplus type fncts.io.SupervisorPatch
|
13
|
+
* @tsplus companion fncts.io.SupervisorPatchOps
|
14
|
+
*/
|
15
|
+
export declare abstract class SupervisorPatch {
|
16
|
+
readonly _typeId: SupervisorPatchTypeId;
|
17
|
+
}
|
18
|
+
export declare class AddSupervisor extends SupervisorPatch {
|
19
|
+
readonly supervisor: Supervisor<any>;
|
20
|
+
readonly _tag = SupervisorPatchTag.AddSupervisor;
|
21
|
+
constructor(supervisor: Supervisor<any>);
|
22
|
+
}
|
23
|
+
export declare class Combine extends SupervisorPatch {
|
24
|
+
readonly first: SupervisorPatch;
|
25
|
+
readonly second: SupervisorPatch;
|
26
|
+
readonly _tag = SupervisorPatchTag.Combine;
|
27
|
+
constructor(first: SupervisorPatch, second: SupervisorPatch);
|
28
|
+
}
|
29
|
+
export declare class Empty extends SupervisorPatch {
|
30
|
+
readonly _tag = SupervisorPatchTag.Empty;
|
31
|
+
}
|
32
|
+
export declare class RemoveSupervisor extends SupervisorPatch {
|
33
|
+
readonly supervisor: Supervisor<any>;
|
34
|
+
readonly _tag = SupervisorPatchTag.RemoveSupervisor;
|
35
|
+
constructor(supervisor: Supervisor<any>);
|
36
|
+
}
|
37
|
+
export type Concrete = AddSupervisor | Combine | Empty | RemoveSupervisor;
|
38
|
+
/**
|
39
|
+
* @tsplus macro remove
|
40
|
+
*/
|
41
|
+
export declare function concrete(_: SupervisorPatch): asserts _ is Concrete;
|
42
|
+
/**
|
43
|
+
* @tsplus static fncts.io.SupervisorPatchOps empty
|
44
|
+
* @tsplus location "@fncts/io/SupervisorPatch"
|
45
|
+
*/
|
46
|
+
export declare const empty: SupervisorPatch;
|
47
|
+
/**
|
48
|
+
* @tsplus fluent fncts.io.SupervisorPatch combine
|
49
|
+
* @tsplus location "@fncts/io/SupervisorPatch"
|
50
|
+
*/
|
51
|
+
export declare function combine(first: SupervisorPatch, second: SupervisorPatch): SupervisorPatch;
|
52
|
+
/**
|
53
|
+
* @tsplus static fncts.io.SupervisorPatchOps diff
|
54
|
+
* @tsplus location "@fncts/io/SupervisorPatch"
|
55
|
+
*/
|
56
|
+
export declare function diff(oldValue: Supervisor<any>, newValue: Supervisor<any>): SupervisorPatch;
|
57
|
+
/**
|
58
|
+
* @tsplus fluent fncts.io.SupervisorPatch __call
|
59
|
+
* @tsplus location "@fncts/io/SupervisorPatch"
|
60
|
+
*/
|
61
|
+
export declare function apply(self: SupervisorPatch, supervisor: Supervisor<any>): Supervisor<any>;
|
@@ -0,0 +1,108 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.environment = environment;
|
7
|
+
exports.supervisor = supervisor;
|
8
|
+
exports.update = update;
|
9
|
+
|
10
|
+
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/function/api"));
|
11
|
+
|
12
|
+
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/EnvironmentPatch"));
|
13
|
+
|
14
|
+
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/SupervisorPatch"));
|
15
|
+
|
16
|
+
var _definition = /*#__PURE__*/require("./definition.cjs");
|
17
|
+
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Constructs a differ that just diffs two values by returning a function that
|
24
|
+
* sets the value to the new value. This differ does not support combining
|
25
|
+
* multiple updates to the value compositionally and should only be used when
|
26
|
+
* there is no compositional way to update them.
|
27
|
+
*
|
28
|
+
* @tsplus static fncts.io.DifferOps update
|
29
|
+
*/
|
30
|
+
function update() {
|
31
|
+
return new class extends _definition.Differ {
|
32
|
+
constructor() {
|
33
|
+
super(...arguments);
|
34
|
+
this.empty = tsplus_module_1.identity;
|
35
|
+
}
|
36
|
+
|
37
|
+
combine(first, second) {
|
38
|
+
if (first === this.empty) return second;else if (second === this.empty) return first;
|
39
|
+
return tsplus_module_1.compose_(first, second);
|
40
|
+
}
|
41
|
+
|
42
|
+
diff(oldValue, newValue) {
|
43
|
+
if (oldValue === newValue) return this.empty;else return () => newValue;
|
44
|
+
}
|
45
|
+
|
46
|
+
patch(patch) {
|
47
|
+
return patch;
|
48
|
+
}
|
49
|
+
|
50
|
+
}();
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Constructs a differ that knows how to diff `Environment` values.
|
54
|
+
*
|
55
|
+
* @tsplus static fncts.io.DifferOps environment
|
56
|
+
*/
|
57
|
+
|
58
|
+
|
59
|
+
function environment() {
|
60
|
+
return new class extends _definition.Differ {
|
61
|
+
constructor() {
|
62
|
+
super(...arguments);
|
63
|
+
this.empty = tsplus_module_2.empty();
|
64
|
+
}
|
65
|
+
|
66
|
+
combine(first, second) {
|
67
|
+
return tsplus_module_2.combine(first, second);
|
68
|
+
}
|
69
|
+
|
70
|
+
diff(oldValue, newValue) {
|
71
|
+
return tsplus_module_2.diff(oldValue, newValue);
|
72
|
+
}
|
73
|
+
|
74
|
+
patch(patch) {
|
75
|
+
return oldValue => tsplus_module_2.apply(patch, oldValue);
|
76
|
+
}
|
77
|
+
|
78
|
+
}();
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* Constructs a differ that knows how to diff `Supervisor` values.
|
82
|
+
*
|
83
|
+
* @tsplus static fncts.io.DifferOps supervisor
|
84
|
+
*/
|
85
|
+
|
86
|
+
|
87
|
+
function supervisor() {
|
88
|
+
return new class extends _definition.Differ {
|
89
|
+
constructor() {
|
90
|
+
super(...arguments);
|
91
|
+
this.empty = tsplus_module_3.empty;
|
92
|
+
}
|
93
|
+
|
94
|
+
combine(first, second) {
|
95
|
+
return tsplus_module_3.combine(first, second);
|
96
|
+
}
|
97
|
+
|
98
|
+
diff(oldValue, newValue) {
|
99
|
+
return tsplus_module_3.diff(oldValue, newValue);
|
100
|
+
}
|
101
|
+
|
102
|
+
patch(patch) {
|
103
|
+
return oldValue => tsplus_module_3.apply(patch, oldValue);
|
104
|
+
}
|
105
|
+
|
106
|
+
}();
|
107
|
+
}
|
108
|
+
//# sourceMappingURL=api.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api.cjs","mappings":";;;;;;;;;;;;;;;AAKA;;;;;;AAEA;;;;;;;;AAQM,SAAUA,MAAV,GAAgB;EACpB,OAAO,IAAK,cAAcC,kBAAd,CAAoC;IAApCC;;MAUV,aAAKC,wBAAL;IAID;;IAbCC,OAAO,CAACC,KAAD,EAAqBC,MAArB,EAAwC;MAC7C,IAAID,KAAK,KAAK,KAAKE,KAAnB,EAA0B,OAAOD,MAAP,CAA1B,KACK,IAAIA,MAAM,KAAK,KAAKC,KAApB,EAA2B,OAAOF,KAAP;MAChC,OAAOF,gCAAcG,MAAd,CAAP;IACD;;IACDE,IAAI,CAACC,QAAD,EAAcC,QAAd,EAAyB;MAC3B,IAAID,QAAQ,KAAKC,QAAjB,EAA2B,OAAO,KAAKH,KAAZ,CAA3B,KACK,OAAO,MAAMG,QAAb;IACN;;IAEDC,KAAK,CAACA,KAAD,EAAmB;MACtB,OAAOA,KAAP;IACD;;EAb6C,CAAzC,EAAP;AAeD;AAED;;;;;;;AAKM,SAAUC,WAAV,GAAqB;EACzB,OAAO,IAAK,cAAcX,kBAAd,CAA6D;IAA7DC;;MAOV,aAAQW,uBAAR;IAID;;IAVCT,OAAO,CAACC,KAAD,EAAiCC,MAAjC,EAAgE;MACrE,OAAOO,+BAAcP,MAAd,CAAP;IACD;;IACDE,IAAI,CAACC,QAAD,EAA2BC,QAA3B,EAAmD;MACrD,OAAOG,qBAAsBJ,QAAtB,EAAgCC,QAAhC,CAAP;IACD;;IAEDC,KAAK,CAACA,KAAD,EAA+B;MAClC,OAAQF,QAAD,IAAcI,6BAAMJ,QAAN,CAArB;IACD;;EAVsE,CAAlE,EAAP;AAYD;AAED;;;;;;;AAKM,SAAUK,UAAV,GAAoB;EACxB,OAAO,IAAK,cAAcb,kBAAd,CAAuD;IAAvDC;;MAOV,aAAKa,qBAAL;IAID;;IAVCX,OAAO,CAACC,KAAD,EAAyBC,MAAzB,EAAgD;MACrD,OAAOS,+BAAcT,MAAd,CAAP;IACD;;IACDE,IAAI,CAACC,QAAD,EAA4BC,QAA5B,EAAqD;MACvD,OAAOK,qBAAqBN,QAArB,EAA+BC,QAA/B,CAAP;IACD;;IAEDC,KAAK,CAACA,KAAD,EAAuB;MAC1B,OAAQF,QAAD,IAAcM,6BAAMN,QAAN,CAArB;IACD;;EAVgE,CAA5D,EAAP;AAYD","names":["update","Differ","constructor","tsplus_module_1","combine","first","second","empty","diff","oldValue","newValue","patch","environment","tsplus_module_2","supervisor","tsplus_module_3"],"sourceRoot":"","sources":["../../_src/Differ/api.ts"],"sourcesContent":[null]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.DifferTypeId = exports.Differ = void 0;
|
7
|
+
const DifferTypeId = /*#__PURE__*/Symbol.for("fncts.io.Differ");
|
8
|
+
/**
|
9
|
+
* @tsplus type fncts.io.Differ
|
10
|
+
* @tsplus companion fncts.io.DifferOps
|
11
|
+
*/
|
12
|
+
|
13
|
+
exports.DifferTypeId = DifferTypeId;
|
14
|
+
|
15
|
+
class Differ {
|
16
|
+
constructor() {
|
17
|
+
this._typeId = DifferTypeId;
|
18
|
+
}
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
exports.Differ = Differ;
|
23
|
+
//# sourceMappingURL=definition.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"definition.cjs","mappings":";;;;;;AAAO,MAAMA,YAAY,gBAAGC,MAAM,CAACC,GAAP,CAAW,iBAAX,CAArB;AAGP;;;;;;;AAIM,MAAgBC,MAAhB,CAAsB;EAA5BC;IACW,eAAwBJ,YAAxB;EAOV;;AAR2B","names":["DifferTypeId","Symbol","for","Differ","constructor"],"sourceRoot":"","sources":["../../_src/Differ/definition.ts"],"sourcesContent":[null]}
|
package/_cjs/FiberRef/unsafe.cjs
CHANGED
@@ -3,23 +3,27 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.unsafeMakePatch = exports.unsafeMakeEnvironment = exports.unsafeMake = exports.forkScopeOverride = exports.fiberName = exports.currentSupervisor = exports.currentScheduler = exports.currentReportFatal = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentIsFatal = exports.currentEnvironment = void 0;
|
6
|
+
exports.unsafeMakeSupervisor = exports.unsafeMakePatch = exports.unsafeMakeEnvironment = exports.unsafeMake = exports.forkScopeOverride = exports.fiberName = exports.currentSupervisor = exports.currentScheduler = exports.currentReportFatal = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentIsFatal = exports.currentEnvironment = void 0;
|
7
7
|
|
8
|
-
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
8
|
+
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Differ/api"));
|
9
9
|
|
10
|
-
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/
|
10
|
+
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/EnvironmentPatch"));
|
11
11
|
|
12
|
-
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
12
|
+
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/SupervisorPatch"));
|
13
13
|
|
14
|
-
var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
14
|
+
var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
|
15
15
|
|
16
|
-
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/
|
16
|
+
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Environment/api"));
|
17
17
|
|
18
|
-
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
18
|
+
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/LogLevel"));
|
19
19
|
|
20
|
-
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
20
|
+
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/constructors"));
|
21
21
|
|
22
|
-
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/
|
22
|
+
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashMap/api"));
|
23
|
+
|
24
|
+
var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Supervisor/constructors"));
|
25
|
+
|
26
|
+
var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/internal/IsFatal"));
|
23
27
|
|
24
28
|
var _function = /*#__PURE__*/require("@fncts/base/data/function");
|
25
29
|
|
@@ -35,14 +39,16 @@ const unsafeMakePatch = unsafeMakePatch_1;
|
|
35
39
|
exports.unsafeMakePatch = unsafeMakePatch;
|
36
40
|
const unsafeMakeEnvironment = unsafeMakeEnvironment_1;
|
37
41
|
exports.unsafeMakeEnvironment = unsafeMakeEnvironment;
|
42
|
+
const unsafeMakeSupervisor = unsafeMakeSupervisor_1;
|
43
|
+
exports.unsafeMakeSupervisor = unsafeMakeSupervisor;
|
38
44
|
const unsafeMake = unsafeMake_1;
|
39
45
|
exports.unsafeMake = unsafeMake;
|
40
46
|
|
41
47
|
/**
|
42
48
|
* @tsplus static fncts.io.FiberRefOps unsafeMakePatch
|
43
49
|
*/
|
44
|
-
function unsafeMakePatch_1(initial,
|
45
|
-
return new _definition.FiberRefInternal(initial, diff, combine, patch, fork, join);
|
50
|
+
function unsafeMakePatch_1(initial, differ, fork, join = (_, newValue) => newValue) {
|
51
|
+
return new _definition.FiberRefInternal(initial, (oldValue, newValue) => differ.diff(oldValue, newValue), (first, second) => differ.combine(first, second), patch => oldValue => differ.patch(patch)(oldValue), fork, join);
|
46
52
|
}
|
47
53
|
/**
|
48
54
|
* @tsplus static fncts.io.FiberRefOps unsafeMakeEnvironment
|
@@ -50,7 +56,15 @@ function unsafeMakePatch_1(initial, diff, combine, patch, fork, join = (_, newVa
|
|
50
56
|
|
51
57
|
|
52
58
|
function unsafeMakeEnvironment_1(initial) {
|
53
|
-
return unsafeMakePatch_1(initial, tsplus_module_1.
|
59
|
+
return unsafeMakePatch_1(initial, tsplus_module_1.environment(), tsplus_module_2.empty());
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* @tsplus static fncts.io.FiberRefOps unsafeMakeSupervisor
|
63
|
+
*/
|
64
|
+
|
65
|
+
|
66
|
+
function unsafeMakeSupervisor_1(initial) {
|
67
|
+
return unsafeMakePatch_1(initial, tsplus_module_1.supervisor(), tsplus_module_3.empty);
|
54
68
|
}
|
55
69
|
/**
|
56
70
|
* @tsplus static fncts.io.FiberRefOps unsafeMake
|
@@ -58,44 +72,44 @@ function unsafeMakeEnvironment_1(initial) {
|
|
58
72
|
|
59
73
|
|
60
74
|
function unsafeMake_1(initial, fork = _function.identity, join = (_, a) => a) {
|
61
|
-
return unsafeMakePatch_1(initial, (
|
75
|
+
return unsafeMakePatch_1(initial, tsplus_module_1.update(), fork, join);
|
62
76
|
}
|
63
77
|
/**
|
64
78
|
* @tsplus static fncts.io.FiberRefOps forkScopeOverride
|
65
79
|
*/
|
66
80
|
|
67
81
|
|
68
|
-
const forkScopeOverride = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/
|
82
|
+
const forkScopeOverride = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/tsplus_module_4.nothing(), () => tsplus_module_4.nothing(), (parent, _) => parent);
|
69
83
|
/**
|
70
84
|
* @tsplus static fncts.io.FiberRefOps currentEnvironment
|
71
85
|
*/
|
72
86
|
|
73
87
|
exports.forkScopeOverride = forkScopeOverride;
|
74
|
-
const currentEnvironment = /*#__PURE__*/unsafeMakeEnvironment_1(
|
88
|
+
const currentEnvironment = /*#__PURE__*/unsafeMakeEnvironment_1(tsplus_module_5.empty);
|
75
89
|
/**
|
76
90
|
* @tsplus static fncts.io.FiberRefOps fiberName
|
77
91
|
*/
|
78
92
|
|
79
93
|
exports.currentEnvironment = currentEnvironment;
|
80
|
-
const fiberName = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/
|
94
|
+
const fiberName = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/tsplus_module_4.nothing());
|
81
95
|
/**
|
82
96
|
* @tsplus static fncts.io.FiberRefOps currentLogLevel
|
83
97
|
*/
|
84
98
|
|
85
99
|
exports.fiberName = fiberName;
|
86
|
-
const currentLogLevel = /*#__PURE__*/unsafeMake_1(
|
100
|
+
const currentLogLevel = /*#__PURE__*/unsafeMake_1(tsplus_module_6.Info);
|
87
101
|
/**
|
88
102
|
* @tsplus static fncts.io.FiberRefOps currentLogSpan
|
89
103
|
*/
|
90
104
|
|
91
105
|
exports.currentLogLevel = currentLogLevel;
|
92
|
-
const currentLogSpan = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/
|
106
|
+
const currentLogSpan = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/tsplus_module_7.nil());
|
93
107
|
/**
|
94
108
|
* @tsplus static fncts.io.FiberRefOps currentLogAnnotations
|
95
109
|
*/
|
96
110
|
|
97
111
|
exports.currentLogSpan = currentLogSpan;
|
98
|
-
const currentLogAnnotations = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/
|
112
|
+
const currentLogAnnotations = /*#__PURE__*/unsafeMake_1( /*#__PURE__*/tsplus_module_8.makeDefault());
|
99
113
|
/**
|
100
114
|
* @tsplus static fncts.io.FiberRefOps currentScheduler
|
101
115
|
*/
|
@@ -107,13 +121,13 @@ const currentScheduler = /*#__PURE__*/unsafeMake_1(_Scheduler.defaultScheduler);
|
|
107
121
|
*/
|
108
122
|
|
109
123
|
exports.currentScheduler = currentScheduler;
|
110
|
-
const currentSupervisor = /*#__PURE__*/
|
124
|
+
const currentSupervisor = /*#__PURE__*/unsafeMakeSupervisor_1(tsplus_module_9.none);
|
111
125
|
/**
|
112
126
|
* @tsplus static fncts.io.FiberRefOps currentIsFatal
|
113
127
|
*/
|
114
128
|
|
115
129
|
exports.currentSupervisor = currentSupervisor;
|
116
|
-
const currentIsFatal = /*#__PURE__*/unsafeMake_1(
|
130
|
+
const currentIsFatal = /*#__PURE__*/unsafeMake_1(tsplus_module_10.empty);
|
117
131
|
/**
|
118
132
|
* @tsplus static fncts.io.FiberRefOps currentReportFatal
|
119
133
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unsafe.cjs","mappings":"
|
1
|
+
{"version":3,"file":"unsafe.cjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAGA;;;;;;MAKgBA,eAAe;;MAmBfC,qBAAqB;;MASrBC,oBAAoB;;MAOpBC,UAAU;;;AAtC1B;;;AAGA,2BACEC,OADF,EAEEC,MAFF,EAGEC,IAHF,EAIEC,OAAoD,CAACC,CAAD,EAAIC,QAAJ,KAAiBA,QAJvE,EAI+E;EAE7E,OAAO,IAAIC,4BAAJ,CACLN,OADK,EAEL,CAACO,QAAD,EAAWF,QAAX,KAAwBJ,MAAM,CAACO,IAAP,CAAYD,QAAZ,EAAsBF,QAAtB,CAFnB,EAGL,CAACI,KAAD,EAAQC,MAAR,KAAmBT,MAAM,CAACU,OAAP,CAAeF,KAAf,EAAsBC,MAAtB,CAHd,EAIJE,KAAD,IAAYL,QAAD,IAAcN,MAAM,CAACW,KAAP,CAAaA,KAAb,EAAoBL,QAApB,CAJpB,EAKLL,IALK,EAMLC,IANK,CAAP;AAQD;AAED;;;;;AAGA,iCACEH,OADF,EACyB;EAEvB,OAAOa,kBAAyBb,OAAzB,EAAkCc,6BAAlC,EAAwDC,uBAAxD,CAAP;AACD;AAED;;;;;AAGA,gCAAqCf,OAArC,EAA6D;EAC3D,OAAOa,kBAAyBb,OAAzB,EAAkCc,4BAAlC,EAAqDE,qBAArD,CAAP;AACD;AAED;;;;;AAGA,sBACEhB,OADF,EAEEE,OAAoBe,kBAFtB,EAGEd,OAA4B,CAACC,CAAD,EAAIc,CAAJ,KAAUA,CAHxC,EAGyC;EAEvC,OAAOL,kBAAyBb,OAAzB,EAAkCc,wBAAlC,EAAmDZ,IAAnD,EAAyDC,IAAzD,CAAP;AACD;AAED;;;;;AAGO,MAAMgB,iBAAiB,gBAAGC,2BAC/BC,yBAD+B,EAE/B,MAAMA,yBAFyB,EAG/B,CAACC,MAAD,EAASlB,CAAT,KAAekB,MAHgB,CAA1B;AAMP;;;;;AAGO,MAAMC,kBAAkB,gBAAGC,8CAA3B;AAEP;;;;;AAGO,MAAMC,SAAS,gBAAGL,2BAAmCC,yBAAnC,CAAlB;AAEP;;;;;AAGO,MAAMK,eAAe,gBAAGN,kCAAxB;AAEP;;;;;AAGO,MAAMO,cAAc,gBAAGP,2BAAmCQ,qBAAnC,CAAvB;AAEP;;;;;AAGO,MAAMC,qBAAqB,gBAAGT,2BAA6CU,6BAA7C,CAA9B;AAEP;;;;;AAGO,MAAMC,gBAAgB,gBAAGX,aAA+BY,2BAA/B,CAAzB;AAEP;;;;;AAGO,MAAMC,iBAAiB,gBAAGC,4CAA1B;AAEP;;;;;AAGO,MAAMC,cAAc,gBAAGf,oCAAvB;AAEP;;;;;AAGO,MAAMgB,kBAAkB,gBAAGhB,aAA4CiB,CAAD,IAAM;EACjF,MAAMA,CAAN;AACD,CAFiC,CAA3B","names":["unsafeMakePatch","unsafeMakeEnvironment","unsafeMakeSupervisor","unsafeMake","initial","differ","fork","join","_","newValue","FiberRefInternal","oldValue","diff","first","second","combine","patch","unsafeMakePatch_1","tsplus_module_1","tsplus_module_2","tsplus_module_3","identity","a","forkScopeOverride","unsafeMake_1","tsplus_module_4","parent","currentEnvironment","unsafeMakeEnvironment_1","fiberName","currentLogLevel","currentLogSpan","tsplus_module_7","currentLogAnnotations","tsplus_module_8","currentScheduler","defaultScheduler","currentSupervisor","unsafeMakeSupervisor_1","currentIsFatal","currentReportFatal","t"],"sourceRoot":"","sources":["../../_src/FiberRef/unsafe.ts"],"sourcesContent":[null]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.cjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"definition.cjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAMA,KAAK,GAAa,EAAxB;AAEP;;;;;AAGO,MAAMC,WAAW,gBAAGC,8HAAaC,oBAAb,EAAaC,wBAAb,GACEC,oBADF,EACEC,yBADF,GAEIC,oBAFJ,EAEIC,0BAFJ,CAApB","names":["IOEnv","environment","tsplus_module_7","tsplus_module_5","tsplus_module_6","tsplus_module_3","tsplus_module_4","tsplus_module_1","tsplus_module_2"],"sourceRoot":"","sources":["../../_src/IOEnv/definition.ts"],"sourcesContent":[null]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"services.cjs","mappings":";;;;;;;;;AAEA;;;;;;AAEA;;;AAGO,MAAMA,QAAQ,
|
1
|
+
{"version":3,"file":"services.cjs","mappings":";;;;;;;;;AAEA;;;;;;AAEA;;;AAGO,MAAMA,QAAQ,gBAGjBC,sCAA+BC,uBAA/B,CAHG","names":["services","tsplus_module_1","environment"],"sourceRoot":"","sources":["../../_src/IOEnv/services.ts"],"sourcesContent":[null]}
|