@lmvz-ds/components 0.12.3-alpha.4 → 0.12.3
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/dist/cjs/{Effect-BIlTHtLK.js → Effect-CNhHt4Xb.js} +615 -885
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +462 -0
- package/dist/cjs/{aria-validation-controller-B7unOPxT.js → aria-validation-controller-B3hMkau3.js} +157 -156
- package/dist/cjs/assets-iuJtMMdw.js +60 -0
- package/dist/cjs/{icons-BFM1yQ_r.js → icons-CAiJpiUC.js} +22 -74
- package/dist/cjs/index.cjs.js +4 -2
- package/dist/cjs/lmvz-button.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-card.cjs.entry.js +7 -2
- package/dist/cjs/lmvz-header.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-icon.cjs.entry.js +5 -3
- package/dist/cjs/lmvz-input.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +3 -2
- package/dist/collection/components/lmvz-card/lmvz-card.js +8 -3
- package/dist/collection/components/lmvz-icon/icons.js +3 -3
- package/dist/collection/utils/{url.js → assets.js} +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/p-3I3wZmp8.js +1 -0
- package/dist/components/p-BQTNPxka.js +1 -0
- package/dist/components/p-CdofjRtQ.js +1 -0
- package/dist/components/p-xpxyPpHZ.js +1 -0
- package/dist/esm/{Effect-D9S7OTyY.js → Effect-BhQLGXPs.js} +568 -829
- package/dist/esm/MutableQueue-CNlEFklh.js +431 -0
- package/dist/esm/{aria-validation-controller-C7nQzCCq.js → aria-validation-controller-iA4YWFG-.js} +2 -1
- package/dist/esm/assets-BymuU366.js +57 -0
- package/dist/esm/{icons-BFqdzPxR.js → icons-D7UubWaN.js} +5 -57
- package/dist/esm/index.js +4 -2
- package/dist/esm/lmvz-button.entry.js +3 -2
- package/dist/esm/lmvz-card.entry.js +8 -3
- package/dist/esm/lmvz-header.entry.js +3 -2
- package/dist/esm/lmvz-icon.entry.js +5 -3
- package/dist/esm/lmvz-input.entry.js +3 -2
- package/dist/esm/lmvz-menuitem.entry.js +3 -2
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-1d916449.entry.js +1 -0
- package/dist/lmvz-components/p-274c36df.entry.js +1 -0
- package/dist/lmvz-components/p-4b70fe08.entry.js +1 -0
- package/dist/lmvz-components/p-68001ab7.entry.js +1 -0
- package/dist/lmvz-components/p-77e26e71.entry.js +1 -0
- package/dist/lmvz-components/p-BhQLGXPs.js +1 -0
- package/dist/lmvz-components/p-CXWyvf0D.js +1 -0
- package/dist/lmvz-components/p-Ce_AL9kY.js +1 -0
- package/dist/lmvz-components/p-D7I-Bc5i.js +1 -0
- package/dist/lmvz-components/p-DohldYb4.js +1 -0
- package/dist/lmvz-components/p-de18e27e.entry.js +1 -0
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-card/lmvz-card.d.ts +1 -0
- package/dist/types/utils/{url.d.ts → assets.d.ts} +1 -1
- package/hydrate/index.js +487 -7
- package/hydrate/index.mjs +487 -7
- package/package.json +4 -4
- package/dist/components/p-BFwzIh71.js +0 -1
- package/dist/components/p-CfWkZ_yJ.js +0 -1
- package/dist/lmvz-components/assets/LMVZ_logo_175.svg +0 -1
- package/dist/lmvz-components/assets/card-placeholder.svg +0 -4
- package/dist/lmvz-components/assets/fonts/Router-Bold.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Book.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Medium.woff +0 -0
- package/dist/lmvz-components/assets/icons/Logo.svg +0 -10
- package/dist/lmvz-components/assets/icons/actions.svg +0 -5
- package/dist/lmvz-components/assets/icons/adduser.svg +0 -3
- package/dist/lmvz-components/assets/icons/alert.svg +0 -3
- package/dist/lmvz-components/assets/icons/apple.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-down.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-left.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-right.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-up.svg +0 -3
- package/dist/lmvz-components/assets/icons/book.svg +0 -3
- package/dist/lmvz-components/assets/icons/bookmark.svg +0 -3
- package/dist/lmvz-components/assets/icons/checkmark.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-down.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-left.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-right.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-up.svg +0 -3
- package/dist/lmvz-components/assets/icons/close-l.svg +0 -3
- package/dist/lmvz-components/assets/icons/close-sm.svg +0 -3
- package/dist/lmvz-components/assets/icons/cog.svg +0 -4
- package/dist/lmvz-components/assets/icons/computer.svg +0 -3
- package/dist/lmvz-components/assets/icons/dashboard.svg +0 -6
- package/dist/lmvz-components/assets/icons/delete.svg +0 -3
- package/dist/lmvz-components/assets/icons/download.svg +0 -3
- package/dist/lmvz-components/assets/icons/edit.svg +0 -3
- package/dist/lmvz-components/assets/icons/external.svg +0 -3
- package/dist/lmvz-components/assets/icons/facebook.svg +0 -3
- package/dist/lmvz-components/assets/icons/favorite.svg +0 -3
- package/dist/lmvz-components/assets/icons/filter.svg +0 -3
- package/dist/lmvz-components/assets/icons/group.svg +0 -3
- package/dist/lmvz-components/assets/icons/hide.svg +0 -3
- package/dist/lmvz-components/assets/icons/home.svg +0 -3
- package/dist/lmvz-components/assets/icons/info.svg +0 -3
- package/dist/lmvz-components/assets/icons/instagram.svg +0 -3
- package/dist/lmvz-components/assets/icons/letter.svg +0 -3
- package/dist/lmvz-components/assets/icons/linkedin.svg +0 -5
- package/dist/lmvz-components/assets/icons/logout.svg +0 -3
- package/dist/lmvz-components/assets/icons/map.svg +0 -3
- package/dist/lmvz-components/assets/icons/minus.svg +0 -3
- package/dist/lmvz-components/assets/icons/navigation.svg +0 -3
- package/dist/lmvz-components/assets/icons/plus.svg +0 -3
- package/dist/lmvz-components/assets/icons/qr-scan.svg +0 -3
- package/dist/lmvz-components/assets/icons/question.svg +0 -10
- package/dist/lmvz-components/assets/icons/reader.svg +0 -3
- package/dist/lmvz-components/assets/icons/reset.svg +0 -3
- package/dist/lmvz-components/assets/icons/school.svg +0 -3
- package/dist/lmvz-components/assets/icons/search.svg +0 -3
- package/dist/lmvz-components/assets/icons/send.svg +0 -3
- package/dist/lmvz-components/assets/icons/settings.svg +0 -3
- package/dist/lmvz-components/assets/icons/share.svg +0 -10
- package/dist/lmvz-components/assets/icons/shopping-cart.svg +0 -3
- package/dist/lmvz-components/assets/icons/show.svg +0 -3
- package/dist/lmvz-components/assets/icons/snapchat.svg +0 -3
- package/dist/lmvz-components/assets/icons/sort.svg +0 -3
- package/dist/lmvz-components/assets/icons/speech-bubble.svg +0 -3
- package/dist/lmvz-components/assets/icons/star.svg +0 -3
- package/dist/lmvz-components/assets/icons/student.svg +0 -3
- package/dist/lmvz-components/assets/icons/upload.svg +0 -3
- package/dist/lmvz-components/assets/icons/user.svg +0 -3
- package/dist/lmvz-components/assets/icons/warn-circle.svg +0 -3
- package/dist/lmvz-components/assets/icons/warn-triangle.svg +0 -3
- package/dist/lmvz-components/assets/icons/whatsapp.svg +0 -4
- package/dist/lmvz-components/assets/icons/world.svg +0 -10
- package/dist/lmvz-components/assets/icons/x.svg +0 -3
- package/dist/lmvz-components/assets/icons/youtube.svg +0 -3
- package/dist/lmvz-components/assets/zukunftslinie.svg +0 -3
- package/dist/lmvz-components/p-6d71c048.entry.js +0 -1
- package/dist/lmvz-components/p-CDfcYSci.js +0 -1
- package/dist/lmvz-components/p-D9S7OTyY.js +0 -1
- package/dist/lmvz-components/p-DlrjrWsu.js +0 -1
- package/dist/lmvz-components/p-a4615e4b.entry.js +0 -1
- package/dist/lmvz-components/p-a8c88454.entry.js +0 -1
- package/dist/lmvz-components/p-e63e239a.entry.js +0 -1
- package/dist/lmvz-components/p-f956a5e7.entry.js +0 -1
- package/dist/lmvz-components/p-fefd2fe4.entry.js +0 -1
|
@@ -273,19 +273,19 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
273
273
|
* @category constructors
|
|
274
274
|
* @since 2.0.0
|
|
275
275
|
*/
|
|
276
|
-
const make$
|
|
276
|
+
const make$s = isEquivalent => (self, that) => self === that || isEquivalent(self, that);
|
|
277
277
|
/**
|
|
278
278
|
* @category mapping
|
|
279
279
|
* @since 2.0.0
|
|
280
280
|
*/
|
|
281
|
-
const mapInput$1 = /*#__PURE__*/dual(2, (self, f) => make$
|
|
281
|
+
const mapInput$1 = /*#__PURE__*/dual(2, (self, f) => make$s((x, y) => self(f(x), f(y))));
|
|
282
282
|
/**
|
|
283
283
|
* Creates a new `Equivalence` for an array of values based on a given `Equivalence` for the elements of the array.
|
|
284
284
|
*
|
|
285
285
|
* @category combinators
|
|
286
286
|
* @since 2.0.0
|
|
287
287
|
*/
|
|
288
|
-
const array$1 = item => make$
|
|
288
|
+
const array$1 = item => make$s((self, that) => {
|
|
289
289
|
if (self.length !== that.length) {
|
|
290
290
|
return false;
|
|
291
291
|
}
|
|
@@ -1323,10 +1323,10 @@ const Base$1 = /*#__PURE__*/function () {
|
|
|
1323
1323
|
/**
|
|
1324
1324
|
* @since 2.0.0
|
|
1325
1325
|
*/
|
|
1326
|
-
const TypeId$
|
|
1326
|
+
const TypeId$b = /*#__PURE__*/Symbol.for("effect/Option");
|
|
1327
1327
|
const CommonProto$1 = {
|
|
1328
1328
|
...EffectPrototype$1,
|
|
1329
|
-
[TypeId$
|
|
1329
|
+
[TypeId$b]: {
|
|
1330
1330
|
_A: _ => _
|
|
1331
1331
|
},
|
|
1332
1332
|
[NodeInspectSymbol]() {
|
|
@@ -1371,7 +1371,7 @@ const NoneProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonPr
|
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
1373
|
/** @internal */
|
|
1374
|
-
const isOption = input => hasProperty(input, TypeId$
|
|
1374
|
+
const isOption = input => hasProperty(input, TypeId$b);
|
|
1375
1375
|
/** @internal */
|
|
1376
1376
|
const isNone$1 = fa => fa._tag === "None";
|
|
1377
1377
|
/** @internal */
|
|
@@ -1391,10 +1391,10 @@ const some$1 = value => {
|
|
|
1391
1391
|
/**
|
|
1392
1392
|
* @internal
|
|
1393
1393
|
*/
|
|
1394
|
-
const TypeId$
|
|
1394
|
+
const TypeId$a = /*#__PURE__*/Symbol.for("effect/Either");
|
|
1395
1395
|
const CommonProto = {
|
|
1396
1396
|
...EffectPrototype$1,
|
|
1397
|
-
[TypeId$
|
|
1397
|
+
[TypeId$a]: {
|
|
1398
1398
|
_R: _ => _
|
|
1399
1399
|
},
|
|
1400
1400
|
[NodeInspectSymbol]() {
|
|
@@ -1439,7 +1439,7 @@ const LeftProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonPr
|
|
|
1439
1439
|
}
|
|
1440
1440
|
});
|
|
1441
1441
|
/** @internal */
|
|
1442
|
-
const isEither = input => hasProperty(input, TypeId$
|
|
1442
|
+
const isEither = input => hasProperty(input, TypeId$a);
|
|
1443
1443
|
/** @internal */
|
|
1444
1444
|
const isLeft$1 = ma => ma._tag === "Left";
|
|
1445
1445
|
/** @internal */
|
|
@@ -1533,7 +1533,7 @@ const isRight = isRight$1;
|
|
|
1533
1533
|
* @category pattern matching
|
|
1534
1534
|
* @since 2.0.0
|
|
1535
1535
|
*/
|
|
1536
|
-
const match$
|
|
1536
|
+
const match$6 = /*#__PURE__*/dual(2, (self, {
|
|
1537
1537
|
onLeft,
|
|
1538
1538
|
onRight
|
|
1539
1539
|
}) => isLeft(self) ? onLeft(self.left) : onRight(self.right));
|
|
@@ -1541,7 +1541,7 @@ const match$7 = /*#__PURE__*/dual(2, (self, {
|
|
|
1541
1541
|
* @category getters
|
|
1542
1542
|
* @since 2.0.0
|
|
1543
1543
|
*/
|
|
1544
|
-
const merge$3 = /*#__PURE__*/match$
|
|
1544
|
+
const merge$3 = /*#__PURE__*/match$6({
|
|
1545
1545
|
onLeft: identity,
|
|
1546
1546
|
onRight: identity
|
|
1547
1547
|
});
|
|
@@ -1600,17 +1600,17 @@ const isNonEmptyArray$1 = self => self.length > 0;
|
|
|
1600
1600
|
* @category constructors
|
|
1601
1601
|
* @since 2.0.0
|
|
1602
1602
|
*/
|
|
1603
|
-
const make$
|
|
1603
|
+
const make$r = compare => (self, that) => self === that ? 0 : compare(self, that);
|
|
1604
1604
|
/**
|
|
1605
1605
|
* @category instances
|
|
1606
1606
|
* @since 2.0.0
|
|
1607
1607
|
*/
|
|
1608
|
-
const number = /*#__PURE__*/make$
|
|
1608
|
+
const number = /*#__PURE__*/make$r((self, that) => self < that ? -1 : 1);
|
|
1609
1609
|
/**
|
|
1610
1610
|
* @category mapping
|
|
1611
1611
|
* @since 2.0.0
|
|
1612
1612
|
*/
|
|
1613
|
-
const mapInput = /*#__PURE__*/dual(2, (self, f) => make$
|
|
1613
|
+
const mapInput = /*#__PURE__*/dual(2, (self, f) => make$r((b1, b2) => self(f(b1), f(b2))));
|
|
1614
1614
|
/**
|
|
1615
1615
|
* Test whether one value is _strictly greater than_ another.
|
|
1616
1616
|
*
|
|
@@ -1749,7 +1749,7 @@ const isSome = isSome$1;
|
|
|
1749
1749
|
* @category Pattern matching
|
|
1750
1750
|
* @since 2.0.0
|
|
1751
1751
|
*/
|
|
1752
|
-
const match$
|
|
1752
|
+
const match$5 = /*#__PURE__*/dual(2, (self, {
|
|
1753
1753
|
onNone,
|
|
1754
1754
|
onSome
|
|
1755
1755
|
}) => isNone(self) ? onNone() : onSome(self.value));
|
|
@@ -1997,7 +1997,7 @@ const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error("getOrThrow calle
|
|
|
1997
1997
|
* @category Mapping
|
|
1998
1998
|
* @since 2.0.0
|
|
1999
1999
|
*/
|
|
2000
|
-
const map$
|
|
2000
|
+
const map$8 = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none$4() : some(f(self.value)));
|
|
2001
2001
|
/**
|
|
2002
2002
|
* Applies a function to the value of a `Some` and flattens the resulting
|
|
2003
2003
|
* `Option`. If the input is `None`, it remains `None`.
|
|
@@ -2153,7 +2153,7 @@ const mergeWith = f => (o1, o2) => {
|
|
|
2153
2153
|
* @category constructors
|
|
2154
2154
|
* @since 2.0.0
|
|
2155
2155
|
*/
|
|
2156
|
-
const make$
|
|
2156
|
+
const make$q = (...elements) => elements;
|
|
2157
2157
|
|
|
2158
2158
|
/**
|
|
2159
2159
|
* This module provides utility functions for working with arrays in TypeScript.
|
|
@@ -2267,7 +2267,7 @@ const prepend$2 = /*#__PURE__*/dual(2, (self, head) => [head, ...self]);
|
|
|
2267
2267
|
* @category concatenating
|
|
2268
2268
|
* @since 2.0.0
|
|
2269
2269
|
*/
|
|
2270
|
-
const append$
|
|
2270
|
+
const append$1 = /*#__PURE__*/dual(2, (self, last) => [...self, last]);
|
|
2271
2271
|
/**
|
|
2272
2272
|
* Concatenates two arrays (or iterables), combining their elements.
|
|
2273
2273
|
* If either array is non-empty, the result is also a non-empty array.
|
|
@@ -2517,7 +2517,7 @@ const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
2517
2517
|
* @category zipping
|
|
2518
2518
|
* @since 2.0.0
|
|
2519
2519
|
*/
|
|
2520
|
-
const zip$
|
|
2520
|
+
const zip$2 = /*#__PURE__*/dual(2, (self, that) => zipWith$2(self, that, make$q));
|
|
2521
2521
|
/**
|
|
2522
2522
|
* Apply a function to pairs of elements at the same index in two `Iterable`s, collecting the results in a new `Array`. If one
|
|
2523
2523
|
* input `Iterable` is short, excess elements of the longer `Iterable` are discarded.
|
|
@@ -2655,7 +2655,7 @@ const union$2 = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that, _equi
|
|
|
2655
2655
|
* @category constructors
|
|
2656
2656
|
* @since 2.0.0
|
|
2657
2657
|
*/
|
|
2658
|
-
const empty$
|
|
2658
|
+
const empty$l = () => [];
|
|
2659
2659
|
/**
|
|
2660
2660
|
* Constructs a new `NonEmptyArray<A>` from the specified value.
|
|
2661
2661
|
*
|
|
@@ -2667,7 +2667,7 @@ const of$2 = a => [a];
|
|
|
2667
2667
|
* @category mapping
|
|
2668
2668
|
* @since 2.0.0
|
|
2669
2669
|
*/
|
|
2670
|
-
const map$
|
|
2670
|
+
const map$7 = /*#__PURE__*/dual(2, (self, f) => self.map(f));
|
|
2671
2671
|
/**
|
|
2672
2672
|
* Applies a function to each element in an array and returns a new array containing the concatenated mapped elements.
|
|
2673
2673
|
*
|
|
@@ -3006,7 +3006,7 @@ const TagProto = {
|
|
|
3006
3006
|
return self;
|
|
3007
3007
|
},
|
|
3008
3008
|
context(self) {
|
|
3009
|
-
return make$
|
|
3009
|
+
return make$p(this, self);
|
|
3010
3010
|
}
|
|
3011
3011
|
};
|
|
3012
3012
|
const ReferenceProto = {
|
|
@@ -3046,10 +3046,10 @@ const Reference$1 = () => (id, options) => {
|
|
|
3046
3046
|
return ReferenceClass;
|
|
3047
3047
|
};
|
|
3048
3048
|
/** @internal */
|
|
3049
|
-
const TypeId$
|
|
3049
|
+
const TypeId$9 = /*#__PURE__*/Symbol.for("effect/Context");
|
|
3050
3050
|
/** @internal */
|
|
3051
3051
|
const ContextProto = {
|
|
3052
|
-
[TypeId$
|
|
3052
|
+
[TypeId$9]: {
|
|
3053
3053
|
_Services: _ => _
|
|
3054
3054
|
},
|
|
3055
3055
|
[symbol](that) {
|
|
@@ -3109,14 +3109,14 @@ const serviceNotFoundError = tag => {
|
|
|
3109
3109
|
return error;
|
|
3110
3110
|
};
|
|
3111
3111
|
/** @internal */
|
|
3112
|
-
const isContext$1 = u => hasProperty(u, TypeId$
|
|
3112
|
+
const isContext$1 = u => hasProperty(u, TypeId$9);
|
|
3113
3113
|
/** @internal */
|
|
3114
3114
|
const isReference = u => hasProperty(u, ReferenceTypeId);
|
|
3115
3115
|
const _empty$6 = /*#__PURE__*/makeContext(/*#__PURE__*/new Map());
|
|
3116
3116
|
/** @internal */
|
|
3117
|
-
const empty$
|
|
3117
|
+
const empty$k = () => _empty$6;
|
|
3118
3118
|
/** @internal */
|
|
3119
|
-
const make$
|
|
3119
|
+
const make$p = (tag, service) => makeContext(new Map([[tag.key, service]]));
|
|
3120
3120
|
/** @internal */
|
|
3121
3121
|
const add$3 = /*#__PURE__*/dual(3, (self, tag, service) => {
|
|
3122
3122
|
const map = new Map(self.unsafeMap);
|
|
@@ -3216,7 +3216,7 @@ const isContext = isContext$1;
|
|
|
3216
3216
|
* @since 2.0.0
|
|
3217
3217
|
* @category constructors
|
|
3218
3218
|
*/
|
|
3219
|
-
const empty$
|
|
3219
|
+
const empty$j = empty$k;
|
|
3220
3220
|
/**
|
|
3221
3221
|
* Creates a new `Context` with a single service associated to the tag.
|
|
3222
3222
|
*
|
|
@@ -3235,7 +3235,7 @@ const empty$k = empty$l;
|
|
|
3235
3235
|
* @since 2.0.0
|
|
3236
3236
|
* @category constructors
|
|
3237
3237
|
*/
|
|
3238
|
-
const make$
|
|
3238
|
+
const make$o = make$p;
|
|
3239
3239
|
/**
|
|
3240
3240
|
* Adds a service to a given `Context`.
|
|
3241
3241
|
*
|
|
@@ -3440,7 +3440,7 @@ const Reference = Reference$1;
|
|
|
3440
3440
|
/**
|
|
3441
3441
|
* @since 2.0.0
|
|
3442
3442
|
*/
|
|
3443
|
-
const TypeId$
|
|
3443
|
+
const TypeId$8 = /*#__PURE__*/Symbol.for("effect/Chunk");
|
|
3444
3444
|
function copy(src, srcPos, dest, destPos, len) {
|
|
3445
3445
|
for (let i = srcPos; i < Math.min(src.length, srcPos + len); i++) {
|
|
3446
3446
|
dest[destPos + i - srcPos] = src[i];
|
|
@@ -3454,10 +3454,10 @@ const emptyArray = [];
|
|
|
3454
3454
|
* @category equivalence
|
|
3455
3455
|
* @since 2.0.0
|
|
3456
3456
|
*/
|
|
3457
|
-
const getEquivalence$1 = isEquivalent => make$
|
|
3457
|
+
const getEquivalence$1 = isEquivalent => make$s((self, that) => self.length === that.length && toReadonlyArray(self).every((value, i) => isEquivalent(value, unsafeGet(that, i))));
|
|
3458
3458
|
const _equivalence$1 = /*#__PURE__*/getEquivalence$1(equals$1);
|
|
3459
3459
|
const ChunkProto = {
|
|
3460
|
-
[TypeId$
|
|
3460
|
+
[TypeId$8]: {
|
|
3461
3461
|
_A: _ => _
|
|
3462
3462
|
},
|
|
3463
3463
|
toString() {
|
|
@@ -3551,7 +3551,7 @@ const makeChunk = backing => {
|
|
|
3551
3551
|
* @category constructors
|
|
3552
3552
|
* @since 2.0.0
|
|
3553
3553
|
*/
|
|
3554
|
-
const isChunk = u => hasProperty(u, TypeId$
|
|
3554
|
+
const isChunk = u => hasProperty(u, TypeId$8);
|
|
3555
3555
|
const _empty$5 = /*#__PURE__*/makeChunk({
|
|
3556
3556
|
_tag: "IEmpty"
|
|
3557
3557
|
});
|
|
@@ -3559,14 +3559,14 @@ const _empty$5 = /*#__PURE__*/makeChunk({
|
|
|
3559
3559
|
* @category constructors
|
|
3560
3560
|
* @since 2.0.0
|
|
3561
3561
|
*/
|
|
3562
|
-
const empty$
|
|
3562
|
+
const empty$i = () => _empty$5;
|
|
3563
3563
|
/**
|
|
3564
3564
|
* Builds a `NonEmptyChunk` from an non-empty collection of elements.
|
|
3565
3565
|
*
|
|
3566
3566
|
* @category constructors
|
|
3567
3567
|
* @since 2.0.0
|
|
3568
3568
|
*/
|
|
3569
|
-
const make$
|
|
3569
|
+
const make$n = (...as) => unsafeFromNonEmptyArray(as);
|
|
3570
3570
|
/**
|
|
3571
3571
|
* Builds a `NonEmptyChunk` from a single element.
|
|
3572
3572
|
*
|
|
@@ -3706,7 +3706,7 @@ const get$6 = /*#__PURE__*/dual(2, (self, index) => index < 0 || index >= self.l
|
|
|
3706
3706
|
* @since 2.0.0
|
|
3707
3707
|
* @category unsafe
|
|
3708
3708
|
*/
|
|
3709
|
-
const unsafeFromArray = self => self.length === 0 ? empty$
|
|
3709
|
+
const unsafeFromArray = self => self.length === 0 ? empty$i() : self.length === 1 ? of$1(self[0]) : makeChunk({
|
|
3710
3710
|
_tag: "IArray",
|
|
3711
3711
|
array: self
|
|
3712
3712
|
});
|
|
@@ -3759,7 +3759,7 @@ const unsafeGet = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
3759
3759
|
* @category concatenating
|
|
3760
3760
|
* @since 2.0.0
|
|
3761
3761
|
*/
|
|
3762
|
-
const append
|
|
3762
|
+
const append = /*#__PURE__*/dual(2, (self, a) => appendAll$1(self, of$1(a)));
|
|
3763
3763
|
/**
|
|
3764
3764
|
* Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
|
|
3765
3765
|
*
|
|
@@ -3977,7 +3977,7 @@ const filter = /*#__PURE__*/dual(2, (self, predicate) => unsafeFromArray(filter$
|
|
|
3977
3977
|
* @since 2.0.0
|
|
3978
3978
|
* @category elements
|
|
3979
3979
|
*/
|
|
3980
|
-
const isEmpty$
|
|
3980
|
+
const isEmpty$5 = self => self.length === 0;
|
|
3981
3981
|
/**
|
|
3982
3982
|
* Determines if the chunk is not empty.
|
|
3983
3983
|
*
|
|
@@ -4026,7 +4026,7 @@ const headNonEmpty = unsafeHead;
|
|
|
4026
4026
|
* @since 2.0.0
|
|
4027
4027
|
* @category mapping
|
|
4028
4028
|
*/
|
|
4029
|
-
const map$
|
|
4029
|
+
const map$6 = /*#__PURE__*/dual(2, (self, f) => self.backing._tag === "ISingleton" ? of$1(f(self.backing.a, 0)) : unsafeFromArray(pipe(toReadonlyArray(self), map$7((a, i) => f(a, i)))));
|
|
4030
4030
|
/**
|
|
4031
4031
|
* Returns two splits of this chunk at the specified index.
|
|
4032
4032
|
*
|
|
@@ -4068,7 +4068,7 @@ const reduce$6 = reduce$7;
|
|
|
4068
4068
|
/**
|
|
4069
4069
|
* @since 2.0.0
|
|
4070
4070
|
*/
|
|
4071
|
-
const TypeId$
|
|
4071
|
+
const TypeId$7 = /*#__PURE__*/Symbol.for("effect/Duration");
|
|
4072
4072
|
const bigint0$1 = /*#__PURE__*/BigInt(0);
|
|
4073
4073
|
const bigint24 = /*#__PURE__*/BigInt(24);
|
|
4074
4074
|
const bigint60 = /*#__PURE__*/BigInt(60);
|
|
@@ -4137,7 +4137,7 @@ const infinityValue = {
|
|
|
4137
4137
|
_tag: "Infinity"
|
|
4138
4138
|
};
|
|
4139
4139
|
const DurationProto = {
|
|
4140
|
-
[TypeId$
|
|
4140
|
+
[TypeId$7]: TypeId$7,
|
|
4141
4141
|
[symbol$1]() {
|
|
4142
4142
|
return cached(this, structure(this.value));
|
|
4143
4143
|
},
|
|
@@ -4175,7 +4175,7 @@ const DurationProto = {
|
|
|
4175
4175
|
return pipeArguments(this, arguments);
|
|
4176
4176
|
}
|
|
4177
4177
|
};
|
|
4178
|
-
const make$
|
|
4178
|
+
const make$m = input => {
|
|
4179
4179
|
const duration = Object.create(DurationProto);
|
|
4180
4180
|
if (isNumber(input)) {
|
|
4181
4181
|
if (isNaN(input) || input <= 0) {
|
|
@@ -4207,7 +4207,7 @@ const make$o = input => {
|
|
|
4207
4207
|
* @since 2.0.0
|
|
4208
4208
|
* @category guards
|
|
4209
4209
|
*/
|
|
4210
|
-
const isDuration = u => hasProperty(u, TypeId$
|
|
4210
|
+
const isDuration = u => hasProperty(u, TypeId$7);
|
|
4211
4211
|
/**
|
|
4212
4212
|
* @since 3.5.0
|
|
4213
4213
|
* @category guards
|
|
@@ -4232,57 +4232,57 @@ const isZero = self => {
|
|
|
4232
4232
|
* @since 2.0.0
|
|
4233
4233
|
* @category constructors
|
|
4234
4234
|
*/
|
|
4235
|
-
const zero = /*#__PURE__*/make$
|
|
4235
|
+
const zero = /*#__PURE__*/make$m(0);
|
|
4236
4236
|
/**
|
|
4237
4237
|
* @since 2.0.0
|
|
4238
4238
|
* @category constructors
|
|
4239
4239
|
*/
|
|
4240
|
-
const infinity = /*#__PURE__*/make$
|
|
4240
|
+
const infinity = /*#__PURE__*/make$m(Infinity);
|
|
4241
4241
|
/**
|
|
4242
4242
|
* @since 2.0.0
|
|
4243
4243
|
* @category constructors
|
|
4244
4244
|
*/
|
|
4245
|
-
const nanos = nanos => make$
|
|
4245
|
+
const nanos = nanos => make$m(nanos);
|
|
4246
4246
|
/**
|
|
4247
4247
|
* @since 2.0.0
|
|
4248
4248
|
* @category constructors
|
|
4249
4249
|
*/
|
|
4250
|
-
const micros = micros => make$
|
|
4250
|
+
const micros = micros => make$m(micros * bigint1e3);
|
|
4251
4251
|
/**
|
|
4252
4252
|
* @since 2.0.0
|
|
4253
4253
|
* @category constructors
|
|
4254
4254
|
*/
|
|
4255
|
-
const millis = millis => make$
|
|
4255
|
+
const millis = millis => make$m(millis);
|
|
4256
4256
|
/**
|
|
4257
4257
|
* @since 2.0.0
|
|
4258
4258
|
* @category constructors
|
|
4259
4259
|
*/
|
|
4260
|
-
const seconds = seconds => make$
|
|
4260
|
+
const seconds = seconds => make$m(seconds * 1000);
|
|
4261
4261
|
/**
|
|
4262
4262
|
* @since 2.0.0
|
|
4263
4263
|
* @category constructors
|
|
4264
4264
|
*/
|
|
4265
|
-
const minutes = minutes => make$
|
|
4265
|
+
const minutes = minutes => make$m(minutes * 60_000);
|
|
4266
4266
|
/**
|
|
4267
4267
|
* @since 2.0.0
|
|
4268
4268
|
* @category constructors
|
|
4269
4269
|
*/
|
|
4270
|
-
const hours = hours => make$
|
|
4270
|
+
const hours = hours => make$m(hours * 3_600_000);
|
|
4271
4271
|
/**
|
|
4272
4272
|
* @since 2.0.0
|
|
4273
4273
|
* @category constructors
|
|
4274
4274
|
*/
|
|
4275
|
-
const days = days => make$
|
|
4275
|
+
const days = days => make$m(days * 86_400_000);
|
|
4276
4276
|
/**
|
|
4277
4277
|
* @since 2.0.0
|
|
4278
4278
|
* @category constructors
|
|
4279
4279
|
*/
|
|
4280
|
-
const weeks = weeks => make$
|
|
4280
|
+
const weeks = weeks => make$m(weeks * 604_800_000);
|
|
4281
4281
|
/**
|
|
4282
4282
|
* @since 2.0.0
|
|
4283
4283
|
* @category getters
|
|
4284
4284
|
*/
|
|
4285
|
-
const toMillis = self => match$
|
|
4285
|
+
const toMillis = self => match$4(self, {
|
|
4286
4286
|
onMillis: millis => millis,
|
|
4287
4287
|
onNanos: nanos => Number(nanos) / 1_000_000
|
|
4288
4288
|
});
|
|
@@ -4324,7 +4324,7 @@ const toHrTime = self => {
|
|
|
4324
4324
|
* @since 2.0.0
|
|
4325
4325
|
* @category pattern matching
|
|
4326
4326
|
*/
|
|
4327
|
-
const match$
|
|
4327
|
+
const match$4 = /*#__PURE__*/dual(2, (self, options) => {
|
|
4328
4328
|
const _self = decode(self);
|
|
4329
4329
|
switch (_self.value._tag) {
|
|
4330
4330
|
case "Nanos":
|
|
@@ -4496,7 +4496,7 @@ function fromBitmap(bitmap, bit) {
|
|
|
4496
4496
|
return popcount(bitmap & bit - 1);
|
|
4497
4497
|
}
|
|
4498
4498
|
|
|
4499
|
-
const make$
|
|
4499
|
+
const make$l = (value, previous) => ({
|
|
4500
4500
|
value,
|
|
4501
4501
|
previous
|
|
4502
4502
|
});
|
|
@@ -4782,7 +4782,7 @@ function mergeLeaves(edit, shift, h1, n1, h2, n2) {
|
|
|
4782
4782
|
while (true) {
|
|
4783
4783
|
const res = mergeLeavesInner(edit, currentShift, h1, n1, h2, n2);
|
|
4784
4784
|
if (typeof res === "function") {
|
|
4785
|
-
stack = make$
|
|
4785
|
+
stack = make$l(res, stack);
|
|
4786
4786
|
currentShift = currentShift + SIZE;
|
|
4787
4787
|
} else {
|
|
4788
4788
|
let final = res;
|
|
@@ -4917,10 +4917,10 @@ const visitLazyChildren = (len, children, i, f, cont) => {
|
|
|
4917
4917
|
};
|
|
4918
4918
|
const _empty$4 = /*#__PURE__*/makeImpl$1(false, 0, /*#__PURE__*/new EmptyNode(), 0);
|
|
4919
4919
|
/** @internal */
|
|
4920
|
-
const empty$
|
|
4920
|
+
const empty$h = () => _empty$4;
|
|
4921
4921
|
/** @internal */
|
|
4922
4922
|
const fromIterable$4 = entries => {
|
|
4923
|
-
const map = beginMutation$1(empty$
|
|
4923
|
+
const map = beginMutation$1(empty$h());
|
|
4924
4924
|
for (const entry of entries) {
|
|
4925
4925
|
set$4(map, entry[0], entry[1]);
|
|
4926
4926
|
}
|
|
@@ -4929,7 +4929,7 @@ const fromIterable$4 = entries => {
|
|
|
4929
4929
|
/** @internal */
|
|
4930
4930
|
const isHashMap = u => hasProperty(u, HashMapTypeId);
|
|
4931
4931
|
/** @internal */
|
|
4932
|
-
const isEmpty$
|
|
4932
|
+
const isEmpty$4 = self => self && isEmptyNode(self._root);
|
|
4933
4933
|
/** @internal */
|
|
4934
4934
|
const get$5 = /*#__PURE__*/dual(2, (self, key) => getHash(self, key, hash(key)));
|
|
4935
4935
|
/** @internal */
|
|
@@ -5015,14 +5015,14 @@ const modifyHash = /*#__PURE__*/dual(4, (self, key, hash, f) => {
|
|
|
5015
5015
|
return pipe(self, setTree(newRoot, size.value));
|
|
5016
5016
|
});
|
|
5017
5017
|
/** @internal */
|
|
5018
|
-
const remove$
|
|
5018
|
+
const remove$3 = /*#__PURE__*/dual(2, (self, key) => modifyAt$1(self, key, none$4));
|
|
5019
5019
|
/**
|
|
5020
5020
|
* Maps over the entries of the `HashMap` using the specified function.
|
|
5021
5021
|
*
|
|
5022
5022
|
* @since 2.0.0
|
|
5023
5023
|
* @category mapping
|
|
5024
5024
|
*/
|
|
5025
|
-
const map$
|
|
5025
|
+
const map$5 = /*#__PURE__*/dual(2, (self, f) => reduce$5(self, empty$h(), (map, value, key) => set$4(map, key, f(value, key))));
|
|
5026
5026
|
/** @internal */
|
|
5027
5027
|
const forEach$3 = /*#__PURE__*/dual(2, (self, f) => reduce$5(self, void 0, (_, value, key) => f(value, key)));
|
|
5028
5028
|
/** @internal */
|
|
@@ -5094,20 +5094,20 @@ const makeImpl = keyMap => {
|
|
|
5094
5094
|
};
|
|
5095
5095
|
/** @internal */
|
|
5096
5096
|
const isHashSet = u => hasProperty(u, HashSetTypeId);
|
|
5097
|
-
const _empty$3 = /*#__PURE__*/makeImpl(/*#__PURE__*/empty$
|
|
5097
|
+
const _empty$3 = /*#__PURE__*/makeImpl(/*#__PURE__*/empty$h());
|
|
5098
5098
|
/** @internal */
|
|
5099
|
-
const empty$
|
|
5099
|
+
const empty$g = () => _empty$3;
|
|
5100
5100
|
/** @internal */
|
|
5101
5101
|
const fromIterable$3 = elements => {
|
|
5102
|
-
const set = beginMutation(empty$
|
|
5102
|
+
const set = beginMutation(empty$g());
|
|
5103
5103
|
for (const value of elements) {
|
|
5104
5104
|
add$1(set, value);
|
|
5105
5105
|
}
|
|
5106
5106
|
return endMutation(set);
|
|
5107
5107
|
};
|
|
5108
5108
|
/** @internal */
|
|
5109
|
-
const make$
|
|
5110
|
-
const set = beginMutation(empty$
|
|
5109
|
+
const make$k = (...elements) => {
|
|
5110
|
+
const set = beginMutation(empty$g());
|
|
5111
5111
|
for (const value of elements) {
|
|
5112
5112
|
add$1(set, value);
|
|
5113
5113
|
}
|
|
@@ -5133,15 +5133,15 @@ const mutate = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
5133
5133
|
/** @internal */
|
|
5134
5134
|
const add$1 = /*#__PURE__*/dual(2, (self, value) => self._keyMap._editable ? (set$4(value, true)(self._keyMap), self) : makeImpl(set$4(value, true)(self._keyMap)));
|
|
5135
5135
|
/** @internal */
|
|
5136
|
-
const remove$
|
|
5136
|
+
const remove$2 = /*#__PURE__*/dual(2, (self, value) => self._keyMap._editable ? (remove$3(value)(self._keyMap), self) : makeImpl(remove$3(value)(self._keyMap)));
|
|
5137
5137
|
/** @internal */
|
|
5138
5138
|
const difference$1 = /*#__PURE__*/dual(2, (self, that) => mutate(self, set => {
|
|
5139
5139
|
for (const value of that) {
|
|
5140
|
-
remove$
|
|
5140
|
+
remove$2(set, value);
|
|
5141
5141
|
}
|
|
5142
5142
|
}));
|
|
5143
5143
|
/** @internal */
|
|
5144
|
-
const union$1 = /*#__PURE__*/dual(2, (self, that) => mutate(empty$
|
|
5144
|
+
const union$1 = /*#__PURE__*/dual(2, (self, that) => mutate(empty$g(), set => {
|
|
5145
5145
|
forEach$2(self, value => add$1(set, value));
|
|
5146
5146
|
for (const value of that) {
|
|
5147
5147
|
add$1(set, value);
|
|
@@ -5432,7 +5432,7 @@ const reduce$4 = /*#__PURE__*/dual(3, (self, zero, f) => reduce$5(self._keyMap,
|
|
|
5432
5432
|
*
|
|
5433
5433
|
* @see Other `HashSet` constructors are {@link module:HashSet.make} {@link module:HashSet.fromIterable}
|
|
5434
5434
|
*/
|
|
5435
|
-
const empty$
|
|
5435
|
+
const empty$f = empty$g;
|
|
5436
5436
|
/**
|
|
5437
5437
|
* Creates a new `HashSet` from an iterable collection of values.
|
|
5438
5438
|
*
|
|
@@ -5614,7 +5614,7 @@ const fromIterable$2 = fromIterable$3;
|
|
|
5614
5614
|
*
|
|
5615
5615
|
* @see Other `HashSet` constructors are {@link module:HashSet.fromIterable} {@link module:HashSet.empty}
|
|
5616
5616
|
*/
|
|
5617
|
-
const make$
|
|
5617
|
+
const make$j = make$k;
|
|
5618
5618
|
/**
|
|
5619
5619
|
* Checks if the specified value exists in the `HashSet`.
|
|
5620
5620
|
*
|
|
@@ -5726,7 +5726,7 @@ const add = add$1;
|
|
|
5726
5726
|
*
|
|
5727
5727
|
* @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.toggle} {@link module:HashSet.beginMutation} {@link module:HashSet.endMutation} {@link module:HashSet.mutate}
|
|
5728
5728
|
*/
|
|
5729
|
-
const remove$
|
|
5729
|
+
const remove$1 = remove$2;
|
|
5730
5730
|
/**
|
|
5731
5731
|
* Computes the set difference `(A - B)` between this `HashSet` and the
|
|
5732
5732
|
* specified `Iterable<A>`.
|
|
@@ -5820,9 +5820,9 @@ const reduce$3 = reduce$4;
|
|
|
5820
5820
|
/**
|
|
5821
5821
|
* @since 2.0.0
|
|
5822
5822
|
*/
|
|
5823
|
-
const TypeId$
|
|
5823
|
+
const TypeId$6 = /*#__PURE__*/Symbol.for("effect/MutableRef");
|
|
5824
5824
|
const MutableRefProto = {
|
|
5825
|
-
[TypeId$
|
|
5825
|
+
[TypeId$6]: TypeId$6,
|
|
5826
5826
|
toString() {
|
|
5827
5827
|
return format$2(this.toJSON());
|
|
5828
5828
|
},
|
|
@@ -5843,7 +5843,7 @@ const MutableRefProto = {
|
|
|
5843
5843
|
* @since 2.0.0
|
|
5844
5844
|
* @category constructors
|
|
5845
5845
|
*/
|
|
5846
|
-
const make$
|
|
5846
|
+
const make$i = value => {
|
|
5847
5847
|
const ref = Object.create(MutableRefProto);
|
|
5848
5848
|
ref.current = value;
|
|
5849
5849
|
return ref;
|
|
@@ -5995,11 +5995,11 @@ const ids = self => {
|
|
|
5995
5995
|
switch (self._tag) {
|
|
5996
5996
|
case OP_NONE:
|
|
5997
5997
|
{
|
|
5998
|
-
return empty$
|
|
5998
|
+
return empty$f();
|
|
5999
5999
|
}
|
|
6000
6000
|
case OP_RUNTIME:
|
|
6001
6001
|
{
|
|
6002
|
-
return make$
|
|
6002
|
+
return make$j(self.id);
|
|
6003
6003
|
}
|
|
6004
6004
|
case OP_COMPOSITE:
|
|
6005
6005
|
{
|
|
@@ -6007,14 +6007,14 @@ const ids = self => {
|
|
|
6007
6007
|
}
|
|
6008
6008
|
}
|
|
6009
6009
|
};
|
|
6010
|
-
const _fiberCounter = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make$
|
|
6010
|
+
const _fiberCounter = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make$i(0));
|
|
6011
6011
|
/** @internal */
|
|
6012
6012
|
const threadName$1 = self => {
|
|
6013
6013
|
const identifiers = Array.from(ids(self)).map(n => `#${n}`).join(",");
|
|
6014
6014
|
return identifiers;
|
|
6015
6015
|
};
|
|
6016
6016
|
/** @internal */
|
|
6017
|
-
const unsafeMake$
|
|
6017
|
+
const unsafeMake$5 = () => {
|
|
6018
6018
|
const id = get$4(_fiberCounter);
|
|
6019
6019
|
pipe(_fiberCounter, set$3(id + 1));
|
|
6020
6020
|
return new Runtime(id, Date.now());
|
|
@@ -6053,7 +6053,7 @@ const threadName = threadName$1;
|
|
|
6053
6053
|
* @since 2.0.0
|
|
6054
6054
|
* @category unsafe
|
|
6055
6055
|
*/
|
|
6056
|
-
const unsafeMake$
|
|
6056
|
+
const unsafeMake$4 = unsafeMake$5;
|
|
6057
6057
|
|
|
6058
6058
|
/**
|
|
6059
6059
|
* @since 2.0.0
|
|
@@ -6064,7 +6064,7 @@ const unsafeMake$5 = unsafeMake$6;
|
|
|
6064
6064
|
* @since 2.0.0
|
|
6065
6065
|
* @category constructors
|
|
6066
6066
|
*/
|
|
6067
|
-
const empty$
|
|
6067
|
+
const empty$e = empty$h;
|
|
6068
6068
|
/**
|
|
6069
6069
|
* Creates a new `HashMap` from an iterable collection of key/value pairs.
|
|
6070
6070
|
*
|
|
@@ -6078,7 +6078,7 @@ const fromIterable$1 = fromIterable$4;
|
|
|
6078
6078
|
* @since 2.0.0
|
|
6079
6079
|
* @category elements
|
|
6080
6080
|
*/
|
|
6081
|
-
const isEmpty$
|
|
6081
|
+
const isEmpty$3 = isEmpty$4;
|
|
6082
6082
|
/**
|
|
6083
6083
|
* Safely lookup the value for the specified key in the `HashMap` using the
|
|
6084
6084
|
* internal hashing function.
|
|
@@ -6118,7 +6118,7 @@ const modifyAt = modifyAt$1;
|
|
|
6118
6118
|
* @since 2.0.0
|
|
6119
6119
|
* @category mapping
|
|
6120
6120
|
*/
|
|
6121
|
-
const map$
|
|
6121
|
+
const map$4 = map$5;
|
|
6122
6122
|
/**
|
|
6123
6123
|
* Reduces the specified state over the entries of the `HashMap`.
|
|
6124
6124
|
*
|
|
@@ -6153,7 +6153,7 @@ const reduce$2 = reduce$5;
|
|
|
6153
6153
|
* @since 2.0.0
|
|
6154
6154
|
* @category symbol
|
|
6155
6155
|
*/
|
|
6156
|
-
const TypeId$
|
|
6156
|
+
const TypeId$5 = /*#__PURE__*/Symbol.for("effect/List");
|
|
6157
6157
|
/**
|
|
6158
6158
|
* Converts the specified `List` to an `Array`.
|
|
6159
6159
|
*
|
|
@@ -6168,7 +6168,7 @@ const toArray = self => fromIterable$6(self);
|
|
|
6168
6168
|
const getEquivalence = isEquivalent => mapInput$1(getEquivalence$2(isEquivalent), toArray);
|
|
6169
6169
|
const _equivalence = /*#__PURE__*/getEquivalence(equals$1);
|
|
6170
6170
|
const ConsProto = {
|
|
6171
|
-
[TypeId$
|
|
6171
|
+
[TypeId$5]: TypeId$5,
|
|
6172
6172
|
_tag: "Cons",
|
|
6173
6173
|
toString() {
|
|
6174
6174
|
return format$2(this.toJSON());
|
|
@@ -6232,7 +6232,7 @@ const makeCons = (head, tail) => {
|
|
|
6232
6232
|
};
|
|
6233
6233
|
const NilHash = /*#__PURE__*/string("Nil");
|
|
6234
6234
|
const NilProto = {
|
|
6235
|
-
[TypeId$
|
|
6235
|
+
[TypeId$5]: TypeId$5,
|
|
6236
6236
|
_tag: "Nil",
|
|
6237
6237
|
toString() {
|
|
6238
6238
|
return format$2(this.toJSON());
|
|
@@ -6273,7 +6273,7 @@ const _Nil = /*#__PURE__*/Object.create(NilProto);
|
|
|
6273
6273
|
* @since 2.0.0
|
|
6274
6274
|
* @category refinements
|
|
6275
6275
|
*/
|
|
6276
|
-
const isList = u => hasProperty(u, TypeId$
|
|
6276
|
+
const isList = u => hasProperty(u, TypeId$5);
|
|
6277
6277
|
/**
|
|
6278
6278
|
* Returns `true` if the specified value is a `List.Nil<A>`, `false` otherwise.
|
|
6279
6279
|
*
|
|
@@ -6310,7 +6310,7 @@ const cons = (head, tail) => makeCons(head, tail);
|
|
|
6310
6310
|
* @since 2.0.0
|
|
6311
6311
|
* @category constructors
|
|
6312
6312
|
*/
|
|
6313
|
-
const empty$
|
|
6313
|
+
const empty$d = nil;
|
|
6314
6314
|
/**
|
|
6315
6315
|
* Constructs a new `List<A>` from the specified value.
|
|
6316
6316
|
*
|
|
@@ -6403,7 +6403,7 @@ const reduce$1 = /*#__PURE__*/dual(3, (self, zero, f) => {
|
|
|
6403
6403
|
* @category elements
|
|
6404
6404
|
*/
|
|
6405
6405
|
const reverse = self => {
|
|
6406
|
-
let result = empty$
|
|
6406
|
+
let result = empty$d();
|
|
6407
6407
|
let these = self;
|
|
6408
6408
|
while (!isNil(these)) {
|
|
6409
6409
|
result = prepend(result, these.head);
|
|
@@ -6445,7 +6445,7 @@ const _empty$2 = /*#__PURE__*/Object.create(EmptyProto$2);
|
|
|
6445
6445
|
/**
|
|
6446
6446
|
* @internal
|
|
6447
6447
|
*/
|
|
6448
|
-
const empty$
|
|
6448
|
+
const empty$c = () => _empty$2;
|
|
6449
6449
|
const AndThenProto$2 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto$2), {
|
|
6450
6450
|
_tag: "AndThen"
|
|
6451
6451
|
});
|
|
@@ -6484,7 +6484,7 @@ const makeUpdateService = (key, update) => {
|
|
|
6484
6484
|
/** @internal */
|
|
6485
6485
|
const diff$6 = (oldValue, newValue) => {
|
|
6486
6486
|
const missingServices = new Map(oldValue.unsafeMap);
|
|
6487
|
-
let patch = empty$
|
|
6487
|
+
let patch = empty$c();
|
|
6488
6488
|
for (const [tag, newService] of newValue.unsafeMap.entries()) {
|
|
6489
6489
|
if (missingServices.has(tag)) {
|
|
6490
6490
|
const old = missingServices.get(tag);
|
|
@@ -6582,7 +6582,7 @@ const EmptyProto$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(Patch
|
|
|
6582
6582
|
});
|
|
6583
6583
|
const _empty$1 = /*#__PURE__*/Object.create(EmptyProto$1);
|
|
6584
6584
|
/** @internal */
|
|
6585
|
-
const empty$
|
|
6585
|
+
const empty$b = () => _empty$1;
|
|
6586
6586
|
const AndThenProto$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto$1), {
|
|
6587
6587
|
_tag: "AndThen"
|
|
6588
6588
|
});
|
|
@@ -6613,9 +6613,9 @@ const makeRemove = value => {
|
|
|
6613
6613
|
};
|
|
6614
6614
|
/** @internal */
|
|
6615
6615
|
const diff$5 = (oldValue, newValue) => {
|
|
6616
|
-
const [removed, patch] = reduce$3([oldValue, empty$
|
|
6616
|
+
const [removed, patch] = reduce$3([oldValue, empty$b()], ([set, patch], value) => {
|
|
6617
6617
|
if (has$1(value)(set)) {
|
|
6618
|
-
return [remove$
|
|
6618
|
+
return [remove$1(value)(set), patch];
|
|
6619
6619
|
}
|
|
6620
6620
|
return [set, combine$3(makeAdd(value))(patch)];
|
|
6621
6621
|
})(newValue);
|
|
@@ -6652,7 +6652,7 @@ const patch$6 = /*#__PURE__*/dual(2, (self, oldValue) => {
|
|
|
6652
6652
|
}
|
|
6653
6653
|
case "Remove":
|
|
6654
6654
|
{
|
|
6655
|
-
set = remove$
|
|
6655
|
+
set = remove$1(head.value)(set);
|
|
6656
6656
|
patches = tail;
|
|
6657
6657
|
}
|
|
6658
6658
|
}
|
|
@@ -6679,7 +6679,7 @@ const _empty = /*#__PURE__*/Object.create(EmptyProto);
|
|
|
6679
6679
|
/**
|
|
6680
6680
|
* @internal
|
|
6681
6681
|
*/
|
|
6682
|
-
const empty$
|
|
6682
|
+
const empty$a = () => _empty;
|
|
6683
6683
|
const AndThenProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {
|
|
6684
6684
|
_tag: "AndThen"
|
|
6685
6685
|
});
|
|
@@ -6718,7 +6718,7 @@ const makeUpdate = (index, patch) => {
|
|
|
6718
6718
|
/** @internal */
|
|
6719
6719
|
const diff$4 = options => {
|
|
6720
6720
|
let i = 0;
|
|
6721
|
-
let patch = empty$
|
|
6721
|
+
let patch = empty$a();
|
|
6722
6722
|
while (i < options.oldValue.length && i < options.newValue.length) {
|
|
6723
6723
|
const oldElement = options.oldValue[i];
|
|
6724
6724
|
const newElement = options.newValue[i];
|
|
@@ -6798,7 +6798,7 @@ const DifferProto = {
|
|
|
6798
6798
|
}
|
|
6799
6799
|
};
|
|
6800
6800
|
/** @internal */
|
|
6801
|
-
const make$
|
|
6801
|
+
const make$h = params => {
|
|
6802
6802
|
const differ = Object.create(DifferProto);
|
|
6803
6803
|
differ.empty = params.empty;
|
|
6804
6804
|
differ.diff = params.diff;
|
|
@@ -6807,22 +6807,22 @@ const make$j = params => {
|
|
|
6807
6807
|
return differ;
|
|
6808
6808
|
};
|
|
6809
6809
|
/** @internal */
|
|
6810
|
-
const environment = () => make$
|
|
6811
|
-
empty: empty$
|
|
6810
|
+
const environment = () => make$h({
|
|
6811
|
+
empty: empty$c(),
|
|
6812
6812
|
combine: (first, second) => combine$4(second)(first),
|
|
6813
6813
|
diff: (oldValue, newValue) => diff$6(oldValue, newValue),
|
|
6814
6814
|
patch: (patch, oldValue) => patch$7(oldValue)(patch)
|
|
6815
6815
|
});
|
|
6816
6816
|
/** @internal */
|
|
6817
|
-
const hashSet = () => make$
|
|
6818
|
-
empty: empty$
|
|
6817
|
+
const hashSet = () => make$h({
|
|
6818
|
+
empty: empty$b(),
|
|
6819
6819
|
combine: (first, second) => combine$3(second)(first),
|
|
6820
6820
|
diff: (oldValue, newValue) => diff$5(oldValue, newValue),
|
|
6821
6821
|
patch: (patch, oldValue) => patch$6(oldValue)(patch)
|
|
6822
6822
|
});
|
|
6823
6823
|
/** @internal */
|
|
6824
|
-
const readonlyArray = differ => make$
|
|
6825
|
-
empty: empty$
|
|
6824
|
+
const readonlyArray = differ => make$h({
|
|
6825
|
+
empty: empty$a(),
|
|
6826
6826
|
combine: (first, second) => combine$2(first, second),
|
|
6827
6827
|
diff: (oldValue, newValue) => diff$4({
|
|
6828
6828
|
oldValue,
|
|
@@ -6834,7 +6834,7 @@ const readonlyArray = differ => make$j({
|
|
|
6834
6834
|
/** @internal */
|
|
6835
6835
|
const update$2 = () => updateWith((_, a) => a);
|
|
6836
6836
|
/** @internal */
|
|
6837
|
-
const updateWith = f => make$
|
|
6837
|
+
const updateWith = f => make$h({
|
|
6838
6838
|
empty: identity,
|
|
6839
6839
|
combine: (first, second) => {
|
|
6840
6840
|
if (first === identity) {
|
|
@@ -6863,15 +6863,15 @@ const active = patch => patch & BIT_MASK;
|
|
|
6863
6863
|
/** @internal */
|
|
6864
6864
|
const enabled = patch => patch >> BIT_SHIFT & BIT_MASK;
|
|
6865
6865
|
/** @internal */
|
|
6866
|
-
const make$
|
|
6866
|
+
const make$g = (active, enabled) => (active & BIT_MASK) + ((enabled & active & BIT_MASK) << BIT_SHIFT);
|
|
6867
6867
|
/** @internal */
|
|
6868
|
-
const empty$
|
|
6868
|
+
const empty$9 = /*#__PURE__*/make$g(0, 0);
|
|
6869
6869
|
/** @internal */
|
|
6870
|
-
const enable$2 = flag => make$
|
|
6870
|
+
const enable$2 = flag => make$g(flag, flag);
|
|
6871
6871
|
/** @internal */
|
|
6872
|
-
const disable$1 = flag => make$
|
|
6872
|
+
const disable$1 = flag => make$g(flag, 0);
|
|
6873
6873
|
/** @internal */
|
|
6874
|
-
const exclude$1 = /*#__PURE__*/dual(2, (self, flag) => make$
|
|
6874
|
+
const exclude$1 = /*#__PURE__*/dual(2, (self, flag) => make$g(active(self) & ~flag, enabled(self)));
|
|
6875
6875
|
/** @internal */
|
|
6876
6876
|
const andThen = /*#__PURE__*/dual(2, (self, that) => self | that);
|
|
6877
6877
|
/** @internal */
|
|
@@ -6900,19 +6900,19 @@ const interruption = self => isEnabled(self, Interruption);
|
|
|
6900
6900
|
/** @internal */
|
|
6901
6901
|
const isEnabled = /*#__PURE__*/dual(2, (self, flag) => (self & flag) !== 0);
|
|
6902
6902
|
/** @internal */
|
|
6903
|
-
const make$
|
|
6903
|
+
const make$f = (...flags) => flags.reduce((a, b) => a | b, 0);
|
|
6904
6904
|
/** @internal */
|
|
6905
|
-
const none$1 = /*#__PURE__*/make$
|
|
6905
|
+
const none$1 = /*#__PURE__*/make$f(None$1);
|
|
6906
6906
|
/** @internal */
|
|
6907
6907
|
const runtimeMetrics = self => isEnabled(self, RuntimeMetrics);
|
|
6908
6908
|
const windDown = self => isEnabled(self, WindDown);
|
|
6909
6909
|
/** @internal */
|
|
6910
|
-
const diff$3 = /*#__PURE__*/dual(2, (self, that) => make$
|
|
6910
|
+
const diff$3 = /*#__PURE__*/dual(2, (self, that) => make$g(self ^ that, that));
|
|
6911
6911
|
/** @internal */
|
|
6912
6912
|
const patch$4 = /*#__PURE__*/dual(2, (self, patch) => self & (invert(active(patch)) | enabled(patch)) | active(patch) & enabled(patch));
|
|
6913
6913
|
/** @internal */
|
|
6914
|
-
const differ$1 = /*#__PURE__*/make$
|
|
6915
|
-
empty: empty$
|
|
6914
|
+
const differ$1 = /*#__PURE__*/make$h({
|
|
6915
|
+
empty: empty$9,
|
|
6916
6916
|
diff: (oldValue, newValue) => diff$3(oldValue, newValue),
|
|
6917
6917
|
combine: (first, second) => andThen(second)(first),
|
|
6918
6918
|
patch: (_patch, oldValue) => patch$4(oldValue, _patch)
|
|
@@ -6974,10 +6974,10 @@ const seq = (self, that) => ({
|
|
|
6974
6974
|
*/
|
|
6975
6975
|
const flatten$2 = self => {
|
|
6976
6976
|
let current = of(self);
|
|
6977
|
-
let updated = empty$
|
|
6977
|
+
let updated = empty$d();
|
|
6978
6978
|
// eslint-disable-next-line no-constant-condition
|
|
6979
6979
|
while (1) {
|
|
6980
|
-
const [parallel, sequential] = reduce$1(current, [parallelCollectionEmpty(), empty$
|
|
6980
|
+
const [parallel, sequential] = reduce$1(current, [parallelCollectionEmpty(), empty$d()], ([parallel, sequential], blockedRequest) => {
|
|
6981
6981
|
const [par, seq] = step$1(blockedRequest);
|
|
6982
6982
|
return [parallelCollectionCombine(parallel, par), appendAll(sequential, seq)];
|
|
6983
6983
|
});
|
|
@@ -6998,8 +6998,8 @@ const flatten$2 = self => {
|
|
|
6998
6998
|
const step$1 = requests => {
|
|
6999
6999
|
let current = requests;
|
|
7000
7000
|
let parallel = parallelCollectionEmpty();
|
|
7001
|
-
let stack = empty$
|
|
7002
|
-
let sequential = empty$
|
|
7001
|
+
let stack = empty$d();
|
|
7002
|
+
let sequential = empty$d();
|
|
7003
7003
|
// eslint-disable-next-line no-constant-condition
|
|
7004
7004
|
while (1) {
|
|
7005
7005
|
switch (current._tag) {
|
|
@@ -7099,20 +7099,20 @@ class ParallelImpl {
|
|
|
7099
7099
|
}
|
|
7100
7100
|
}
|
|
7101
7101
|
/** @internal */
|
|
7102
|
-
const parallelCollectionEmpty = () => new ParallelImpl(empty$
|
|
7102
|
+
const parallelCollectionEmpty = () => new ParallelImpl(empty$e());
|
|
7103
7103
|
/** @internal */
|
|
7104
|
-
const parallelCollectionAdd = (self, blockedRequest) => new ParallelImpl(modifyAt(self.map, blockedRequest.dataSource, _ => orElseSome(map$
|
|
7104
|
+
const parallelCollectionAdd = (self, blockedRequest) => new ParallelImpl(modifyAt(self.map, blockedRequest.dataSource, _ => orElseSome(map$8(_, append(blockedRequest.blockedRequest)), () => of$1(blockedRequest.blockedRequest))));
|
|
7105
7105
|
/** @internal */
|
|
7106
|
-
const parallelCollectionCombine = (self, that) => new ParallelImpl(reduce$2(self.map, that.map, (map, value, key) => set$2(map, key, match$
|
|
7106
|
+
const parallelCollectionCombine = (self, that) => new ParallelImpl(reduce$2(self.map, that.map, (map, value, key) => set$2(map, key, match$5(get$3(map, key), {
|
|
7107
7107
|
onNone: () => value,
|
|
7108
7108
|
onSome: other => appendAll$1(value, other)
|
|
7109
7109
|
}))));
|
|
7110
7110
|
/** @internal */
|
|
7111
|
-
const parallelCollectionIsEmpty = self => isEmpty$
|
|
7111
|
+
const parallelCollectionIsEmpty = self => isEmpty$3(self.map);
|
|
7112
7112
|
/** @internal */
|
|
7113
7113
|
const parallelCollectionKeys = self => Array.from(keys(self.map));
|
|
7114
7114
|
/** @internal */
|
|
7115
|
-
const parallelCollectionToSequentialCollection = self => sequentialCollectionMake(map$
|
|
7115
|
+
const parallelCollectionToSequentialCollection = self => sequentialCollectionMake(map$4(self.map, x => of$1(x)));
|
|
7116
7116
|
// TODO
|
|
7117
7117
|
// /** @internal */
|
|
7118
7118
|
// export const parallelCollectionToChunk = <R>(
|
|
@@ -7134,8 +7134,8 @@ class SequentialImpl {
|
|
|
7134
7134
|
/** @internal */
|
|
7135
7135
|
const sequentialCollectionMake = map => new SequentialImpl(map);
|
|
7136
7136
|
/** @internal */
|
|
7137
|
-
const sequentialCollectionCombine = (self, that) => new SequentialImpl(reduce$2(that.map, self.map, (map, value, key) => set$2(map, key, match$
|
|
7138
|
-
onNone: () => empty$
|
|
7137
|
+
const sequentialCollectionCombine = (self, that) => new SequentialImpl(reduce$2(that.map, self.map, (map, value, key) => set$2(map, key, match$5(get$3(map, key), {
|
|
7138
|
+
onNone: () => empty$i(),
|
|
7139
7139
|
onSome: a => appendAll$1(a, value)
|
|
7140
7140
|
}))));
|
|
7141
7141
|
/** @internal */
|
|
@@ -7225,27 +7225,27 @@ const proto$2 = {
|
|
|
7225
7225
|
// Constructors
|
|
7226
7226
|
// -----------------------------------------------------------------------------
|
|
7227
7227
|
/** @internal */
|
|
7228
|
-
const empty$
|
|
7228
|
+
const empty$8 = /*#__PURE__*/(() => {
|
|
7229
7229
|
const o = /*#__PURE__*/Object.create(proto$2);
|
|
7230
7230
|
o._tag = OP_EMPTY$2;
|
|
7231
7231
|
return o;
|
|
7232
7232
|
})();
|
|
7233
7233
|
/** @internal */
|
|
7234
|
-
const fail$
|
|
7234
|
+
const fail$2 = error => {
|
|
7235
7235
|
const o = Object.create(proto$2);
|
|
7236
7236
|
o._tag = OP_FAIL$1;
|
|
7237
7237
|
o.error = error;
|
|
7238
7238
|
return o;
|
|
7239
7239
|
};
|
|
7240
7240
|
/** @internal */
|
|
7241
|
-
const die$
|
|
7241
|
+
const die$1 = defect => {
|
|
7242
7242
|
const o = Object.create(proto$2);
|
|
7243
7243
|
o._tag = OP_DIE;
|
|
7244
7244
|
o.defect = defect;
|
|
7245
7245
|
return o;
|
|
7246
7246
|
};
|
|
7247
7247
|
/** @internal */
|
|
7248
|
-
const interrupt$
|
|
7248
|
+
const interrupt$2 = fiberId => {
|
|
7249
7249
|
const o = Object.create(proto$2);
|
|
7250
7250
|
o._tag = OP_INTERRUPT;
|
|
7251
7251
|
o.fiberId = fiberId;
|
|
@@ -7277,7 +7277,7 @@ const isEmptyType = self => self._tag === OP_EMPTY$2;
|
|
|
7277
7277
|
/** @internal */
|
|
7278
7278
|
const isDieType = self => self._tag === OP_DIE;
|
|
7279
7279
|
/** @internal */
|
|
7280
|
-
const isEmpty$
|
|
7280
|
+
const isEmpty$2 = self => {
|
|
7281
7281
|
if (self._tag === OP_EMPTY$2) {
|
|
7282
7282
|
return true;
|
|
7283
7283
|
}
|
|
@@ -7305,11 +7305,11 @@ const isInterrupted = self => isSome(interruptOption(self));
|
|
|
7305
7305
|
/** @internal */
|
|
7306
7306
|
const isInterruptedOnly = self => reduceWithContext(undefined, IsInterruptedOnlyCauseReducer)(self);
|
|
7307
7307
|
/** @internal */
|
|
7308
|
-
const failures = self => reverse$1(reduce(self, empty$
|
|
7308
|
+
const failures = self => reverse$1(reduce(self, empty$i(), (list, cause) => cause._tag === OP_FAIL$1 ? some(pipe(list, prepend$1(cause.error))) : none$4()));
|
|
7309
7309
|
/** @internal */
|
|
7310
|
-
const defects = self => reverse$1(reduce(self, empty$
|
|
7310
|
+
const defects = self => reverse$1(reduce(self, empty$i(), (list, cause) => cause._tag === OP_DIE ? some(pipe(list, prepend$1(cause.defect))) : none$4()));
|
|
7311
7311
|
/** @internal */
|
|
7312
|
-
const interruptors = self => reduce(self, empty$
|
|
7312
|
+
const interruptors = self => reduce(self, empty$f(), (set, cause) => cause._tag === OP_INTERRUPT ? some(pipe(set, add(cause.fiberId))) : none$4());
|
|
7313
7313
|
/** @internal */
|
|
7314
7314
|
const failureOption = self => find(self, cause => cause._tag === OP_FAIL$1 ? some(cause.error) : none$4());
|
|
7315
7315
|
/** @internal */
|
|
@@ -7328,54 +7328,54 @@ const failureOrCause = self => {
|
|
|
7328
7328
|
}
|
|
7329
7329
|
};
|
|
7330
7330
|
/** @internal */
|
|
7331
|
-
const flipCauseOption = self => match$
|
|
7332
|
-
onEmpty: some(empty$
|
|
7333
|
-
onFail: map$
|
|
7334
|
-
onDie: defect => some(die$
|
|
7335
|
-
onInterrupt: fiberId => some(interrupt$
|
|
7331
|
+
const flipCauseOption = self => match$3(self, {
|
|
7332
|
+
onEmpty: some(empty$8),
|
|
7333
|
+
onFail: map$8(fail$2),
|
|
7334
|
+
onDie: defect => some(die$1(defect)),
|
|
7335
|
+
onInterrupt: fiberId => some(interrupt$2(fiberId)),
|
|
7336
7336
|
onSequential: mergeWith(sequential$2),
|
|
7337
7337
|
onParallel: mergeWith(parallel$2)
|
|
7338
7338
|
});
|
|
7339
7339
|
/** @internal */
|
|
7340
7340
|
const interruptOption = self => find(self, cause => cause._tag === OP_INTERRUPT ? some(cause.fiberId) : none$4());
|
|
7341
7341
|
/** @internal */
|
|
7342
|
-
const keepDefectsAndElectFailures = self => match$
|
|
7342
|
+
const keepDefectsAndElectFailures = self => match$3(self, {
|
|
7343
7343
|
onEmpty: none$4(),
|
|
7344
|
-
onFail: failure => some(die$
|
|
7345
|
-
onDie: defect => some(die$
|
|
7344
|
+
onFail: failure => some(die$1(failure)),
|
|
7345
|
+
onDie: defect => some(die$1(defect)),
|
|
7346
7346
|
onInterrupt: () => none$4(),
|
|
7347
7347
|
onSequential: mergeWith(sequential$2),
|
|
7348
7348
|
onParallel: mergeWith(parallel$2)
|
|
7349
7349
|
});
|
|
7350
7350
|
/** @internal */
|
|
7351
|
-
const stripFailures = self => match$
|
|
7352
|
-
onEmpty: empty$
|
|
7353
|
-
onFail: () => empty$
|
|
7354
|
-
onDie: die$
|
|
7355
|
-
onInterrupt: interrupt$
|
|
7351
|
+
const stripFailures = self => match$3(self, {
|
|
7352
|
+
onEmpty: empty$8,
|
|
7353
|
+
onFail: () => empty$8,
|
|
7354
|
+
onDie: die$1,
|
|
7355
|
+
onInterrupt: interrupt$2,
|
|
7356
7356
|
onSequential: sequential$2,
|
|
7357
7357
|
onParallel: parallel$2
|
|
7358
7358
|
});
|
|
7359
7359
|
/** @internal */
|
|
7360
|
-
const electFailures = self => match$
|
|
7361
|
-
onEmpty: empty$
|
|
7362
|
-
onFail: die$
|
|
7363
|
-
onDie: die$
|
|
7364
|
-
onInterrupt: interrupt$
|
|
7360
|
+
const electFailures = self => match$3(self, {
|
|
7361
|
+
onEmpty: empty$8,
|
|
7362
|
+
onFail: die$1,
|
|
7363
|
+
onDie: die$1,
|
|
7364
|
+
onInterrupt: interrupt$2,
|
|
7365
7365
|
onSequential: sequential$2,
|
|
7366
7366
|
onParallel: parallel$2
|
|
7367
7367
|
});
|
|
7368
7368
|
/** @internal */
|
|
7369
|
-
const map$
|
|
7369
|
+
const map$3 = /*#__PURE__*/dual(2, (self, f) => flatMap$3(self, e => fail$2(f(e))));
|
|
7370
7370
|
// -----------------------------------------------------------------------------
|
|
7371
7371
|
// Sequencing
|
|
7372
7372
|
// -----------------------------------------------------------------------------
|
|
7373
7373
|
/** @internal */
|
|
7374
|
-
const flatMap$3 = /*#__PURE__*/dual(2, (self, f) => match$
|
|
7375
|
-
onEmpty: empty$
|
|
7374
|
+
const flatMap$3 = /*#__PURE__*/dual(2, (self, f) => match$3(self, {
|
|
7375
|
+
onEmpty: empty$8,
|
|
7376
7376
|
onFail: error => f(error),
|
|
7377
|
-
onDie: defect => die$
|
|
7378
|
-
onInterrupt: fiberId => interrupt$
|
|
7377
|
+
onDie: defect => die$1(defect),
|
|
7378
|
+
onInterrupt: fiberId => interrupt$2(fiberId),
|
|
7379
7379
|
onSequential: (left, right) => sequential$2(left, right),
|
|
7380
7380
|
onParallel: (left, right) => parallel$2(left, right)
|
|
7381
7381
|
}));
|
|
@@ -7384,11 +7384,11 @@ const causeEquals = (left, right) => {
|
|
|
7384
7384
|
let leftStack = of$1(left);
|
|
7385
7385
|
let rightStack = of$1(right);
|
|
7386
7386
|
while (isNonEmpty$2(leftStack) && isNonEmpty$2(rightStack)) {
|
|
7387
|
-
const [leftParallel, leftSequential] = pipe(headNonEmpty(leftStack), reduce([empty$
|
|
7387
|
+
const [leftParallel, leftSequential] = pipe(headNonEmpty(leftStack), reduce([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7388
7388
|
const [par, seq] = evaluateCause(cause);
|
|
7389
7389
|
return some([pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))]);
|
|
7390
7390
|
}));
|
|
7391
|
-
const [rightParallel, rightSequential] = pipe(headNonEmpty(rightStack), reduce([empty$
|
|
7391
|
+
const [rightParallel, rightSequential] = pipe(headNonEmpty(rightStack), reduce([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7392
7392
|
const [par, seq] = evaluateCause(cause);
|
|
7393
7393
|
return some([pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))]);
|
|
7394
7394
|
}));
|
|
@@ -7411,18 +7411,18 @@ const causeEquals = (left, right) => {
|
|
|
7411
7411
|
* @internal
|
|
7412
7412
|
*/
|
|
7413
7413
|
const flattenCause = cause => {
|
|
7414
|
-
return flattenCauseLoop(of$1(cause), empty$
|
|
7414
|
+
return flattenCauseLoop(of$1(cause), empty$i());
|
|
7415
7415
|
};
|
|
7416
7416
|
/** @internal */
|
|
7417
7417
|
const flattenCauseLoop = (causes, flattened) => {
|
|
7418
7418
|
// eslint-disable-next-line no-constant-condition
|
|
7419
7419
|
while (1) {
|
|
7420
|
-
const [parallel, sequential] = pipe(causes, reduce$7([empty$
|
|
7420
|
+
const [parallel, sequential] = pipe(causes, reduce$7([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7421
7421
|
const [par, seq] = evaluateCause(cause);
|
|
7422
7422
|
return [pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))];
|
|
7423
7423
|
}));
|
|
7424
7424
|
const updated = size$1(parallel) > 0 ? pipe(flattened, prepend$1(parallel)) : flattened;
|
|
7425
|
-
if (isEmpty$
|
|
7425
|
+
if (isEmpty$5(sequential)) {
|
|
7426
7426
|
return reverse$1(updated);
|
|
7427
7427
|
}
|
|
7428
7428
|
causes = sequential;
|
|
@@ -7473,8 +7473,8 @@ const find = /*#__PURE__*/dual(2, (self, pf) => {
|
|
|
7473
7473
|
const evaluateCause = self => {
|
|
7474
7474
|
let cause = self;
|
|
7475
7475
|
const stack = [];
|
|
7476
|
-
let _parallel = empty$
|
|
7477
|
-
let _sequential = empty$
|
|
7476
|
+
let _parallel = empty$f();
|
|
7477
|
+
let _sequential = empty$i();
|
|
7478
7478
|
while (cause !== undefined) {
|
|
7479
7479
|
switch (cause._tag) {
|
|
7480
7480
|
case OP_EMPTY$2:
|
|
@@ -7487,7 +7487,7 @@ const evaluateCause = self => {
|
|
|
7487
7487
|
}
|
|
7488
7488
|
case OP_FAIL$1:
|
|
7489
7489
|
{
|
|
7490
|
-
_parallel = add(_parallel, make$
|
|
7490
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.error));
|
|
7491
7491
|
if (stack.length === 0) {
|
|
7492
7492
|
return [_parallel, _sequential];
|
|
7493
7493
|
}
|
|
@@ -7496,7 +7496,7 @@ const evaluateCause = self => {
|
|
|
7496
7496
|
}
|
|
7497
7497
|
case OP_DIE:
|
|
7498
7498
|
{
|
|
7499
|
-
_parallel = add(_parallel, make$
|
|
7499
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.defect));
|
|
7500
7500
|
if (stack.length === 0) {
|
|
7501
7501
|
return [_parallel, _sequential];
|
|
7502
7502
|
}
|
|
@@ -7505,7 +7505,7 @@ const evaluateCause = self => {
|
|
|
7505
7505
|
}
|
|
7506
7506
|
case OP_INTERRUPT:
|
|
7507
7507
|
{
|
|
7508
|
-
_parallel = add(_parallel, make$
|
|
7508
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.fiberId));
|
|
7509
7509
|
if (stack.length === 0) {
|
|
7510
7510
|
return [_parallel, _sequential];
|
|
7511
7511
|
}
|
|
@@ -7561,7 +7561,7 @@ const IsInterruptedOnlyCauseReducer = {
|
|
|
7561
7561
|
const OP_SEQUENTIAL_CASE = "SequentialCase";
|
|
7562
7562
|
const OP_PARALLEL_CASE = "ParallelCase";
|
|
7563
7563
|
/** @internal */
|
|
7564
|
-
const match$
|
|
7564
|
+
const match$3 = /*#__PURE__*/dual(2, (self, {
|
|
7565
7565
|
onDie,
|
|
7566
7566
|
onEmpty,
|
|
7567
7567
|
onFail,
|
|
@@ -7872,7 +7872,7 @@ const pending = joiners => {
|
|
|
7872
7872
|
};
|
|
7873
7873
|
};
|
|
7874
7874
|
/** @internal */
|
|
7875
|
-
const done$
|
|
7875
|
+
const done$4 = effect => {
|
|
7876
7876
|
return {
|
|
7877
7877
|
_tag: OP_STATE_DONE,
|
|
7878
7878
|
effect
|
|
@@ -8089,16 +8089,16 @@ const acquireUseRelease$1 = /*#__PURE__*/dual(3, (acquire, use, release) => unin
|
|
|
8089
8089
|
onFailure: cause => {
|
|
8090
8090
|
switch (exit._tag) {
|
|
8091
8091
|
case OP_FAILURE:
|
|
8092
|
-
return failCause$
|
|
8092
|
+
return failCause$2(sequential$2(exit.effect_instruction_i0, cause));
|
|
8093
8093
|
case OP_SUCCESS:
|
|
8094
|
-
return failCause$
|
|
8094
|
+
return failCause$2(cause);
|
|
8095
8095
|
}
|
|
8096
8096
|
},
|
|
8097
8097
|
onSuccess: () => exit
|
|
8098
8098
|
}));
|
|
8099
8099
|
}))));
|
|
8100
8100
|
/* @internal */
|
|
8101
|
-
const as$1 = /*#__PURE__*/dual(2, (self, value) => flatMap$2(self, () => succeed$
|
|
8101
|
+
const as$1 = /*#__PURE__*/dual(2, (self, value) => flatMap$2(self, () => succeed$2(value)));
|
|
8102
8102
|
/* @internal */
|
|
8103
8103
|
const asVoid$1 = self => as$1(self, void 0);
|
|
8104
8104
|
/* @internal */
|
|
@@ -8141,7 +8141,7 @@ const unsafeAsync = (register, blockingOn = none$2) => {
|
|
|
8141
8141
|
cancelerRef = register(resume);
|
|
8142
8142
|
};
|
|
8143
8143
|
effect.effect_instruction_i1 = blockingOn;
|
|
8144
|
-
return onInterrupt(effect, _ => isEffect$1(cancelerRef) ? cancelerRef : void_$
|
|
8144
|
+
return onInterrupt(effect, _ => isEffect$1(cancelerRef) ? cancelerRef : void_$1);
|
|
8145
8145
|
};
|
|
8146
8146
|
/* @internal */
|
|
8147
8147
|
const asyncInterrupt = (register, blockingOn = none$2) => suspend$1(() => unsafeAsync(register, blockingOn));
|
|
@@ -8176,7 +8176,7 @@ const async_ = (resume, blockingOn = none$2) => {
|
|
|
8176
8176
|
if (controllerRef) {
|
|
8177
8177
|
controllerRef.abort();
|
|
8178
8178
|
}
|
|
8179
|
-
return cancelerRef ?? void_$
|
|
8179
|
+
return cancelerRef ?? void_$1;
|
|
8180
8180
|
}) : effect;
|
|
8181
8181
|
});
|
|
8182
8182
|
};
|
|
@@ -8190,7 +8190,7 @@ const catchAllCause$1 = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
8190
8190
|
/* @internal */
|
|
8191
8191
|
const catchAll$1 = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {
|
|
8192
8192
|
onFailure: f,
|
|
8193
|
-
onSuccess: succeed$
|
|
8193
|
+
onSuccess: succeed$2
|
|
8194
8194
|
}));
|
|
8195
8195
|
const originalSymbol = /*#__PURE__*/Symbol.for("effect/OriginalAnnotation");
|
|
8196
8196
|
/* @internal */
|
|
@@ -8215,13 +8215,13 @@ const capture = (obj, span) => {
|
|
|
8215
8215
|
return obj;
|
|
8216
8216
|
};
|
|
8217
8217
|
/* @internal */
|
|
8218
|
-
const die
|
|
8218
|
+
const die = defect => isObject(defect) && !(spanSymbol in defect) ? withFiberRuntime$1(fiber => failCause$2(die$1(capture(defect, currentSpanFromFiber(fiber))))) : failCause$2(die$1(defect));
|
|
8219
8219
|
/* @internal */
|
|
8220
|
-
const dieMessage$1 = message => failCauseSync(() => die$
|
|
8220
|
+
const dieMessage$1 = message => failCauseSync(() => die$1(new RuntimeException(message)));
|
|
8221
8221
|
/* @internal */
|
|
8222
8222
|
const either = self => matchEffect(self, {
|
|
8223
|
-
onFailure: e => succeed$
|
|
8224
|
-
onSuccess: a => succeed$
|
|
8223
|
+
onFailure: e => succeed$2(left(e)),
|
|
8224
|
+
onSuccess: a => succeed$2(right(a))
|
|
8225
8225
|
});
|
|
8226
8226
|
/* @internal */
|
|
8227
8227
|
const exit$1 = self => matchCause$1(self, {
|
|
@@ -8229,19 +8229,19 @@ const exit$1 = self => matchCause$1(self, {
|
|
|
8229
8229
|
onSuccess: exitSucceed$1
|
|
8230
8230
|
});
|
|
8231
8231
|
/* @internal */
|
|
8232
|
-
const fail$
|
|
8232
|
+
const fail$1 = error => isObject(error) && !(spanSymbol in error) ? withFiberRuntime$1(fiber => failCause$2(fail$2(capture(error, currentSpanFromFiber(fiber))))) : failCause$2(fail$2(error));
|
|
8233
8233
|
/* @internal */
|
|
8234
|
-
const failSync = evaluate => flatMap$2(sync$1(evaluate), fail$
|
|
8234
|
+
const failSync = evaluate => flatMap$2(sync$1(evaluate), fail$1);
|
|
8235
8235
|
/* @internal */
|
|
8236
|
-
const failCause$
|
|
8236
|
+
const failCause$2 = cause => {
|
|
8237
8237
|
const effect = new EffectPrimitiveFailure(OP_FAILURE);
|
|
8238
8238
|
effect.effect_instruction_i0 = cause;
|
|
8239
8239
|
return effect;
|
|
8240
8240
|
};
|
|
8241
8241
|
/* @internal */
|
|
8242
|
-
const failCauseSync = evaluate => flatMap$2(sync$1(evaluate), failCause$
|
|
8242
|
+
const failCauseSync = evaluate => flatMap$2(sync$1(evaluate), failCause$2);
|
|
8243
8243
|
/* @internal */
|
|
8244
|
-
const fiberId = /*#__PURE__*/withFiberRuntime$1(state => succeed$
|
|
8244
|
+
const fiberId = /*#__PURE__*/withFiberRuntime$1(state => succeed$2(state.id()));
|
|
8245
8245
|
/* @internal */
|
|
8246
8246
|
const fiberIdWith$1 = f => withFiberRuntime$1(state => f(state.id()));
|
|
8247
8247
|
/* @internal */
|
|
@@ -8261,8 +8261,8 @@ const step = self => {
|
|
|
8261
8261
|
const flatten$1 = self => flatMap$2(self, identity);
|
|
8262
8262
|
/* @internal */
|
|
8263
8263
|
const matchCause$1 = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect$2(self, {
|
|
8264
|
-
onFailure: cause => succeed$
|
|
8265
|
-
onSuccess: a => succeed$
|
|
8264
|
+
onFailure: cause => succeed$2(options.onFailure(cause)),
|
|
8265
|
+
onSuccess: a => succeed$2(options.onSuccess(a))
|
|
8266
8266
|
}));
|
|
8267
8267
|
/* @internal */
|
|
8268
8268
|
const matchCauseEffect$2 = /*#__PURE__*/dual(2, (self, options) => {
|
|
@@ -8277,13 +8277,13 @@ const matchEffect = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect$2(s
|
|
|
8277
8277
|
onFailure: cause => {
|
|
8278
8278
|
const defects$1 = defects(cause);
|
|
8279
8279
|
if (defects$1.length > 0) {
|
|
8280
|
-
return failCause$
|
|
8280
|
+
return failCause$2(electFailures(cause));
|
|
8281
8281
|
}
|
|
8282
8282
|
const failures$1 = failures(cause);
|
|
8283
8283
|
if (failures$1.length > 0) {
|
|
8284
8284
|
return options.onFailure(unsafeHead(failures$1));
|
|
8285
8285
|
}
|
|
8286
|
-
return failCause$
|
|
8286
|
+
return failCause$2(cause);
|
|
8287
8287
|
},
|
|
8288
8288
|
onSuccess: options.onSuccess
|
|
8289
8289
|
}));
|
|
@@ -8313,9 +8313,9 @@ const forEachSequentialDiscard = /*#__PURE__*/dual(2, (self, f) => suspend$1(()
|
|
|
8313
8313
|
});
|
|
8314
8314
|
}));
|
|
8315
8315
|
/* @internal */
|
|
8316
|
-
const interrupt$
|
|
8316
|
+
const interrupt$1 = /*#__PURE__*/flatMap$2(fiberId, fiberId => interruptWith(fiberId));
|
|
8317
8317
|
/* @internal */
|
|
8318
|
-
const interruptWith = fiberId => failCause$
|
|
8318
|
+
const interruptWith = fiberId => failCause$2(interrupt$2(fiberId));
|
|
8319
8319
|
/* @internal */
|
|
8320
8320
|
const interruptible$2 = self => {
|
|
8321
8321
|
const effect = new EffectPrimitive(OP_UPDATE_RUNTIME_FLAGS);
|
|
@@ -8326,7 +8326,7 @@ const interruptible$2 = self => {
|
|
|
8326
8326
|
/* @internal */
|
|
8327
8327
|
const intoDeferred$1 = /*#__PURE__*/dual(2, (self, deferred) => uninterruptibleMask$2(restore => flatMap$2(exit$1(restore(self)), exit => deferredDone(deferred, exit))));
|
|
8328
8328
|
/* @internal */
|
|
8329
|
-
const map$
|
|
8329
|
+
const map$2 = /*#__PURE__*/dual(2, (self, f) => flatMap$2(self, a => sync$1(() => f(a))));
|
|
8330
8330
|
/* @internal */
|
|
8331
8331
|
const mapBoth = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {
|
|
8332
8332
|
onFailure: e => failSync(() => options.onFailure(e)),
|
|
@@ -8343,11 +8343,11 @@ const mapError$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
|
8343
8343
|
}
|
|
8344
8344
|
case "Right":
|
|
8345
8345
|
{
|
|
8346
|
-
return failCause$
|
|
8346
|
+
return failCause$2(either.right);
|
|
8347
8347
|
}
|
|
8348
8348
|
}
|
|
8349
8349
|
},
|
|
8350
|
-
onSuccess: succeed$
|
|
8350
|
+
onSuccess: succeed$2
|
|
8351
8351
|
}));
|
|
8352
8352
|
/* @internal */
|
|
8353
8353
|
const onExit$1 = /*#__PURE__*/dual(2, (self, cleanup) => uninterruptibleMask$2(restore => matchCauseEffect$2(restore(self), {
|
|
@@ -8360,25 +8360,25 @@ const onExit$1 = /*#__PURE__*/dual(2, (self, cleanup) => uninterruptibleMask$2(r
|
|
|
8360
8360
|
},
|
|
8361
8361
|
onSuccess: success => {
|
|
8362
8362
|
const result = exitSucceed$1(success);
|
|
8363
|
-
return zipRight$
|
|
8363
|
+
return zipRight$1(cleanup(result), result);
|
|
8364
8364
|
}
|
|
8365
8365
|
})));
|
|
8366
8366
|
/* @internal */
|
|
8367
8367
|
const onInterrupt = /*#__PURE__*/dual(2, (self, cleanup) => onExit$1(self, exitMatch({
|
|
8368
|
-
onFailure: cause => isInterruptedOnly(cause) ? asVoid$1(cleanup(interruptors(cause))) : void_$
|
|
8369
|
-
onSuccess: () => void_$
|
|
8368
|
+
onFailure: cause => isInterruptedOnly(cause) ? asVoid$1(cleanup(interruptors(cause))) : void_$1,
|
|
8369
|
+
onSuccess: () => void_$1
|
|
8370
8370
|
})));
|
|
8371
8371
|
/* @internal */
|
|
8372
|
-
const orElse = /*#__PURE__*/dual(2, (self, that) => attemptOrElse(self, that, succeed$
|
|
8372
|
+
const orElse = /*#__PURE__*/dual(2, (self, that) => attemptOrElse(self, that, succeed$2));
|
|
8373
8373
|
/* @internal */
|
|
8374
8374
|
const orDie = self => orDieWith(self, identity);
|
|
8375
8375
|
/* @internal */
|
|
8376
8376
|
const orDieWith = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {
|
|
8377
|
-
onFailure: e => die
|
|
8378
|
-
onSuccess: succeed$
|
|
8377
|
+
onFailure: e => die(f(e)),
|
|
8378
|
+
onSuccess: succeed$2
|
|
8379
8379
|
}));
|
|
8380
8380
|
/* @internal */
|
|
8381
|
-
const succeed$
|
|
8381
|
+
const succeed$2 = value => {
|
|
8382
8382
|
const effect = new EffectPrimitiveSuccess(OP_SUCCESS);
|
|
8383
8383
|
effect.effect_instruction_i0 = value;
|
|
8384
8384
|
return effect;
|
|
@@ -8402,10 +8402,10 @@ const tap$1 = /*#__PURE__*/dual(args => args.length === 3 || args.length === 2 &
|
|
|
8402
8402
|
return as$1(b, a);
|
|
8403
8403
|
} else if (isPromiseLike(b)) {
|
|
8404
8404
|
return unsafeAsync(resume => {
|
|
8405
|
-
b.then(_ => resume(succeed$
|
|
8405
|
+
b.then(_ => resume(succeed$2(a)), e => resume(fail$1(new UnknownException(e, "An unknown error occurred in Effect.tap"))));
|
|
8406
8406
|
});
|
|
8407
8407
|
}
|
|
8408
|
-
return succeed$
|
|
8408
|
+
return succeed$2(a);
|
|
8409
8409
|
}));
|
|
8410
8410
|
/* @internal */
|
|
8411
8411
|
const transplant = f => withFiberRuntime$1(state => {
|
|
@@ -8418,7 +8418,7 @@ const attemptOrElse = /*#__PURE__*/dual(3, (self, that, onSuccess) => matchCause
|
|
|
8418
8418
|
onFailure: cause => {
|
|
8419
8419
|
const defects$1 = defects(cause);
|
|
8420
8420
|
if (defects$1.length > 0) {
|
|
8421
|
-
return failCause$
|
|
8421
|
+
return failCause$2(getOrThrow(keepDefectsAndElectFailures(cause)));
|
|
8422
8422
|
}
|
|
8423
8423
|
return that();
|
|
8424
8424
|
},
|
|
@@ -8438,7 +8438,7 @@ const uninterruptibleMask$2 = f => custom(f, function () {
|
|
|
8438
8438
|
effect.effect_instruction_i1 = oldFlags => interruption(oldFlags) ? internalCall(() => this.effect_instruction_i0(interruptible$2)) : internalCall(() => this.effect_instruction_i0(uninterruptible$1));
|
|
8439
8439
|
return effect;
|
|
8440
8440
|
});
|
|
8441
|
-
const void_$
|
|
8441
|
+
const void_$1 = /*#__PURE__*/succeed$2(void 0);
|
|
8442
8442
|
/* @internal */
|
|
8443
8443
|
const updateRuntimeFlags = patch => {
|
|
8444
8444
|
const effect = new EffectPrimitive(OP_UPDATE_RUNTIME_FLAGS);
|
|
@@ -8449,9 +8449,9 @@ const updateRuntimeFlags = patch => {
|
|
|
8449
8449
|
/* @internal */
|
|
8450
8450
|
const whenEffect = /*#__PURE__*/dual(2, (self, condition) => flatMap$2(condition, b => {
|
|
8451
8451
|
if (b) {
|
|
8452
|
-
return pipe(self, map$
|
|
8452
|
+
return pipe(self, map$2(some));
|
|
8453
8453
|
}
|
|
8454
|
-
return succeed$
|
|
8454
|
+
return succeed$2(none$4());
|
|
8455
8455
|
}));
|
|
8456
8456
|
/* @internal */
|
|
8457
8457
|
const whileLoop = options => {
|
|
@@ -8491,13 +8491,13 @@ const yieldNow$2 = options => {
|
|
|
8491
8491
|
return typeof options?.priority !== "undefined" ? withSchedulingPriority(effect, options.priority) : effect;
|
|
8492
8492
|
};
|
|
8493
8493
|
/* @internal */
|
|
8494
|
-
const zip$
|
|
8494
|
+
const zip$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, a => map$2(that, b => [a, b])));
|
|
8495
8495
|
/* @internal */
|
|
8496
8496
|
const zipLeft$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, a => as$1(that, a)));
|
|
8497
8497
|
/* @internal */
|
|
8498
|
-
const zipRight$
|
|
8498
|
+
const zipRight$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, () => that));
|
|
8499
8499
|
/* @internal */
|
|
8500
|
-
const zipWith$1 = /*#__PURE__*/dual(3, (self, that, f) => flatMap$2(self, a => map$
|
|
8500
|
+
const zipWith$1 = /*#__PURE__*/dual(3, (self, that, f) => flatMap$2(self, a => map$2(that, b => f(a, b))));
|
|
8501
8501
|
// -----------------------------------------------------------------------------
|
|
8502
8502
|
// Fiber
|
|
8503
8503
|
// -----------------------------------------------------------------------------
|
|
@@ -8609,7 +8609,7 @@ const fiberRefSet = /*#__PURE__*/dual(2, (self, value) => fiberRefModify(self, (
|
|
|
8609
8609
|
const fiberRefModify = /*#__PURE__*/dual(2, (self, f) => withFiberRuntime$1(state => {
|
|
8610
8610
|
const [b, a] = f(state.getFiberRef(self));
|
|
8611
8611
|
state.setFiberRef(self, a);
|
|
8612
|
-
return succeed$
|
|
8612
|
+
return succeed$2(b);
|
|
8613
8613
|
}));
|
|
8614
8614
|
/* @internal */
|
|
8615
8615
|
const fiberRefLocally = /*#__PURE__*/dual(3, (use, self, value) => acquireUseRelease$1(zipLeft$1(fiberRefGet(self), fiberRefSet(self, value)), () => use, oldValue => fiberRefSet(self, oldValue)));
|
|
@@ -8668,17 +8668,17 @@ const fiberRefUnsafeMakeRuntimeFlags = initial => fiberRefUnsafeMakePatch(initia
|
|
|
8668
8668
|
fork: differ$1.empty
|
|
8669
8669
|
});
|
|
8670
8670
|
/** @internal */
|
|
8671
|
-
const currentContext = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentContext"), () => fiberRefUnsafeMakeContext(empty$
|
|
8671
|
+
const currentContext = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentContext"), () => fiberRefUnsafeMakeContext(empty$j()));
|
|
8672
8672
|
/** @internal */
|
|
8673
8673
|
const currentSchedulingPriority = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentSchedulingPriority"), () => fiberRefUnsafeMake(0));
|
|
8674
8674
|
/** @internal */
|
|
8675
8675
|
const currentMaxOpsBeforeYield = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"), () => fiberRefUnsafeMake(2048));
|
|
8676
8676
|
/** @internal */
|
|
8677
|
-
const currentLogAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogAnnotation"), () => fiberRefUnsafeMake(empty$
|
|
8677
|
+
const currentLogAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogAnnotation"), () => fiberRefUnsafeMake(empty$e()));
|
|
8678
8678
|
/** @internal */
|
|
8679
8679
|
const currentLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogLevel"), () => fiberRefUnsafeMake(logLevelInfo));
|
|
8680
8680
|
/** @internal */
|
|
8681
|
-
const currentLogSpan = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogSpan"), () => fiberRefUnsafeMake(empty$
|
|
8681
|
+
const currentLogSpan = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogSpan"), () => fiberRefUnsafeMake(empty$d()));
|
|
8682
8682
|
/** @internal */
|
|
8683
8683
|
const withSchedulingPriority = /*#__PURE__*/dual(2, (self, scheduler) => fiberRefLocally(self, currentSchedulingPriority, scheduler));
|
|
8684
8684
|
/** @internal */
|
|
@@ -8692,15 +8692,15 @@ const currentUnhandledErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symb
|
|
|
8692
8692
|
/** @internal */
|
|
8693
8693
|
const currentVersionMismatchErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"), () => fiberRefUnsafeMake(some(logLevelWarning)));
|
|
8694
8694
|
/** @internal */
|
|
8695
|
-
const currentMetricLabels = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMetricLabels"), () => fiberRefUnsafeMakeReadonlyArray(empty$
|
|
8695
|
+
const currentMetricLabels = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMetricLabels"), () => fiberRefUnsafeMakeReadonlyArray(empty$l()));
|
|
8696
8696
|
/** @internal */
|
|
8697
8697
|
const currentForkScopeOverride = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentForkScopeOverride"), () => fiberRefUnsafeMake(none$4(), {
|
|
8698
8698
|
fork: () => none$4(),
|
|
8699
8699
|
join: (parent, _) => parent
|
|
8700
8700
|
}));
|
|
8701
8701
|
/** @internal */
|
|
8702
|
-
const currentInterruptedCause = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentInterruptedCause"), () => fiberRefUnsafeMake(empty$
|
|
8703
|
-
fork: () => empty$
|
|
8702
|
+
const currentInterruptedCause = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentInterruptedCause"), () => fiberRefUnsafeMake(empty$8, {
|
|
8703
|
+
fork: () => empty$8,
|
|
8704
8704
|
join: (parent, _) => parent
|
|
8705
8705
|
}));
|
|
8706
8706
|
// -----------------------------------------------------------------------------
|
|
@@ -8725,7 +8725,7 @@ const scopeFork = (self, strategy) => self.fork(strategy);
|
|
|
8725
8725
|
const YieldableError = /*#__PURE__*/function () {
|
|
8726
8726
|
class YieldableError extends globalThis.Error {
|
|
8727
8727
|
commit() {
|
|
8728
|
-
return fail$
|
|
8728
|
+
return fail$1(this);
|
|
8729
8729
|
}
|
|
8730
8730
|
toJSON() {
|
|
8731
8731
|
const obj = {
|
|
@@ -8739,7 +8739,7 @@ const YieldableError = /*#__PURE__*/function () {
|
|
|
8739
8739
|
if (this.toString !== globalThis.Error.prototype.toString) {
|
|
8740
8740
|
return this.stack ? `${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
8741
8741
|
} else if ("Bun" in globalThis) {
|
|
8742
|
-
return pretty(fail$
|
|
8742
|
+
return pretty(fail$2(this), {
|
|
8743
8743
|
renderErrorCause: true
|
|
8744
8744
|
});
|
|
8745
8745
|
}
|
|
@@ -8821,9 +8821,9 @@ const exitAsVoid = self => exitAs(self, void 0);
|
|
|
8821
8821
|
/** @internal */
|
|
8822
8822
|
const exitCollectAll = (exits, options) => exitCollectAllInternal(exits, options?.parallel ? parallel$2 : sequential$2);
|
|
8823
8823
|
/** @internal */
|
|
8824
|
-
const exitDie$1 = defect => exitFailCause$1(die$
|
|
8824
|
+
const exitDie$1 = defect => exitFailCause$1(die$1(defect));
|
|
8825
8825
|
/** @internal */
|
|
8826
|
-
const exitFail = error => exitFailCause$1(fail$
|
|
8826
|
+
const exitFail = error => exitFailCause$1(fail$2(error));
|
|
8827
8827
|
/** @internal */
|
|
8828
8828
|
const exitFailCause$1 = cause => {
|
|
8829
8829
|
const effect = new EffectPrimitiveFailure(OP_FAILURE);
|
|
@@ -8831,7 +8831,7 @@ const exitFailCause$1 = cause => {
|
|
|
8831
8831
|
return effect;
|
|
8832
8832
|
};
|
|
8833
8833
|
/** @internal */
|
|
8834
|
-
const exitInterrupt$1 = fiberId => exitFailCause$1(interrupt$
|
|
8834
|
+
const exitInterrupt$1 = fiberId => exitFailCause$1(interrupt$2(fiberId));
|
|
8835
8835
|
/** @internal */
|
|
8836
8836
|
const exitMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
8837
8837
|
switch (self._tag) {
|
|
@@ -8929,7 +8929,7 @@ const deferredUnsafeMake = fiberId => {
|
|
|
8929
8929
|
const _deferred = {
|
|
8930
8930
|
...CommitPrototype,
|
|
8931
8931
|
[DeferredTypeId]: deferredVariance,
|
|
8932
|
-
state: make$
|
|
8932
|
+
state: make$i(pending([])),
|
|
8933
8933
|
commit() {
|
|
8934
8934
|
return deferredAwait(this);
|
|
8935
8935
|
},
|
|
@@ -8967,7 +8967,7 @@ const deferredCompleteWith = /*#__PURE__*/dual(2, (self, effect) => sync$1(() =>
|
|
|
8967
8967
|
}
|
|
8968
8968
|
case OP_STATE_PENDING:
|
|
8969
8969
|
{
|
|
8970
|
-
set$3(self.state, done$
|
|
8970
|
+
set$3(self.state, done$4(effect));
|
|
8971
8971
|
for (let i = 0, len = state.joiners.length; i < len; i++) {
|
|
8972
8972
|
state.joiners[i](effect);
|
|
8973
8973
|
}
|
|
@@ -8978,7 +8978,7 @@ const deferredCompleteWith = /*#__PURE__*/dual(2, (self, effect) => sync$1(() =>
|
|
|
8978
8978
|
/* @internal */
|
|
8979
8979
|
const deferredDone = /*#__PURE__*/dual(2, (self, exit) => deferredCompleteWith(self, exit));
|
|
8980
8980
|
/* @internal */
|
|
8981
|
-
const deferredFailCause = /*#__PURE__*/dual(2, (self, cause) => deferredCompleteWith(self, failCause$
|
|
8981
|
+
const deferredFailCause = /*#__PURE__*/dual(2, (self, cause) => deferredCompleteWith(self, failCause$2(cause)));
|
|
8982
8982
|
/* @internal */
|
|
8983
8983
|
const deferredInterrupt = self => flatMap$2(fiberId, fiberId => deferredCompleteWith(self, interruptWith(fiberId)));
|
|
8984
8984
|
/* @internal */
|
|
@@ -8986,12 +8986,12 @@ const deferredInterruptWith = /*#__PURE__*/dual(2, (self, fiberId) => deferredCo
|
|
|
8986
8986
|
/* @internal */
|
|
8987
8987
|
const deferredIsDone = self => sync$1(() => get$4(self.state)._tag === OP_STATE_DONE);
|
|
8988
8988
|
/* @internal */
|
|
8989
|
-
const deferredSucceed = /*#__PURE__*/dual(2, (self, value) => deferredCompleteWith(self, succeed$
|
|
8989
|
+
const deferredSucceed = /*#__PURE__*/dual(2, (self, value) => deferredCompleteWith(self, succeed$2(value)));
|
|
8990
8990
|
/** @internal */
|
|
8991
8991
|
const deferredUnsafeDone = (self, effect) => {
|
|
8992
8992
|
const state = get$4(self.state);
|
|
8993
8993
|
if (state._tag === OP_STATE_PENDING) {
|
|
8994
|
-
set$3(self.state, done$
|
|
8994
|
+
set$3(self.state, done$4(effect));
|
|
8995
8995
|
for (let i = 0, len = state.joiners.length; i < len; i++) {
|
|
8996
8996
|
state.joiners[i](effect);
|
|
8997
8997
|
}
|
|
@@ -9030,147 +9030,9 @@ const currentSpanFromFiber = fiber => {
|
|
|
9030
9030
|
return span !== undefined && span._tag === "Span" ? some(span) : none$4();
|
|
9031
9031
|
};
|
|
9032
9032
|
|
|
9033
|
-
|
|
9034
|
-
* Creates a new `Deferred`.
|
|
9035
|
-
*
|
|
9036
|
-
* @since 2.0.0
|
|
9037
|
-
* @category constructors
|
|
9038
|
-
*/
|
|
9039
|
-
const make$g = deferredMake;
|
|
9040
|
-
const _await$1 = deferredAwait;
|
|
9041
|
-
/**
|
|
9042
|
-
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
9043
|
-
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
9044
|
-
*
|
|
9045
|
-
* @since 2.0.0
|
|
9046
|
-
* @category utils
|
|
9047
|
-
*/
|
|
9048
|
-
const done$4 = deferredDone;
|
|
9049
|
-
/**
|
|
9050
|
-
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
|
|
9051
|
-
* all fibers waiting on the value of the `Deferred`.
|
|
9052
|
-
*
|
|
9053
|
-
* @since 2.0.0
|
|
9054
|
-
* @category utils
|
|
9055
|
-
*/
|
|
9056
|
-
const failCause$3 = deferredFailCause;
|
|
9057
|
-
/**
|
|
9058
|
-
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
9059
|
-
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
9060
|
-
* calling this method.
|
|
9061
|
-
*
|
|
9062
|
-
* @since 2.0.0
|
|
9063
|
-
* @category utils
|
|
9064
|
-
*/
|
|
9065
|
-
const interrupt$1 = deferredInterrupt;
|
|
9066
|
-
/**
|
|
9067
|
-
* Returns `true` if this `Deferred` has already been completed with a value or
|
|
9068
|
-
* an error, `false` otherwise.
|
|
9069
|
-
*
|
|
9070
|
-
* @since 2.0.0
|
|
9071
|
-
* @category getters
|
|
9072
|
-
*/
|
|
9073
|
-
const isDone$4 = deferredIsDone;
|
|
9074
|
-
/**
|
|
9075
|
-
* Completes the `Deferred` with the specified value.
|
|
9076
|
-
*
|
|
9077
|
-
* @since 2.0.0
|
|
9078
|
-
* @category utils
|
|
9079
|
-
*/
|
|
9080
|
-
const succeed$3 = deferredSucceed;
|
|
9081
|
-
/**
|
|
9082
|
-
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
9083
|
-
*
|
|
9084
|
-
* @since 2.0.0
|
|
9085
|
-
* @category unsafe
|
|
9086
|
-
*/
|
|
9087
|
-
const unsafeMake$4 = deferredUnsafeMake;
|
|
9088
|
-
|
|
9089
|
-
/**
|
|
9090
|
-
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
|
9091
|
-
*
|
|
9092
|
-
* @since 2.0.0
|
|
9093
|
-
* @category refinements
|
|
9094
|
-
*/
|
|
9095
|
-
const isFailure = exitIsFailure;
|
|
9096
|
-
/**
|
|
9097
|
-
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
|
9098
|
-
*
|
|
9099
|
-
* @since 2.0.0
|
|
9100
|
-
* @category refinements
|
|
9101
|
-
*/
|
|
9102
|
-
const isSuccess = exitIsSuccess;
|
|
9103
|
-
/**
|
|
9104
|
-
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
|
|
9105
|
-
* the provided iterable contains no elements, `None` will be returned.
|
|
9106
|
-
*
|
|
9107
|
-
* @since 2.0.0
|
|
9108
|
-
* @category constructors
|
|
9109
|
-
*/
|
|
9110
|
-
const all$2 = exitCollectAll;
|
|
9111
|
-
/**
|
|
9112
|
-
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
|
9113
|
-
*
|
|
9114
|
-
* @since 2.0.0
|
|
9115
|
-
* @category constructors
|
|
9116
|
-
*/
|
|
9117
|
-
const die = exitDie$1;
|
|
9118
|
-
/**
|
|
9119
|
-
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
|
9120
|
-
* `E`.
|
|
9121
|
-
*
|
|
9122
|
-
* @since 2.0.0
|
|
9123
|
-
* @category constructors
|
|
9124
|
-
*/
|
|
9125
|
-
const fail$1 = exitFail;
|
|
9126
|
-
/**
|
|
9127
|
-
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
|
9128
|
-
*
|
|
9129
|
-
* @since 2.0.0
|
|
9130
|
-
* @category constructors
|
|
9131
|
-
*/
|
|
9132
|
-
const failCause$2 = exitFailCause$1;
|
|
9133
|
-
/**
|
|
9134
|
-
* Maps over the `Success` value of the specified exit using the provided
|
|
9135
|
-
* function.
|
|
9136
|
-
*
|
|
9137
|
-
* @since 2.0.0
|
|
9138
|
-
* @category mapping
|
|
9139
|
-
*/
|
|
9140
|
-
const map$2 = exitMap;
|
|
9141
|
-
/**
|
|
9142
|
-
* @since 2.0.0
|
|
9143
|
-
* @category folding
|
|
9144
|
-
*/
|
|
9145
|
-
const match$3 = exitMatch;
|
|
9146
|
-
/**
|
|
9147
|
-
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
9148
|
-
*
|
|
9149
|
-
* @since 2.0.0
|
|
9150
|
-
* @category constructors
|
|
9151
|
-
*/
|
|
9152
|
-
const succeed$2 = exitSucceed$1;
|
|
9153
|
-
const void_$1 = exitVoid$1;
|
|
9154
|
-
/**
|
|
9155
|
-
* Sequentially zips the this result with the specified result or else returns
|
|
9156
|
-
* the failed `Cause<E | E2>`.
|
|
9157
|
-
*
|
|
9158
|
-
* @since 2.0.0
|
|
9159
|
-
* @category zipping
|
|
9160
|
-
*/
|
|
9161
|
-
const zip$1 = exitZip;
|
|
9162
|
-
/**
|
|
9163
|
-
* Sequentially zips the this result with the specified result discarding the
|
|
9164
|
-
* first element of the tuple or else returns the failed `Cause<E | E2>`.
|
|
9165
|
-
*
|
|
9166
|
-
* @since 2.0.0
|
|
9167
|
-
* @category zipping
|
|
9168
|
-
*/
|
|
9169
|
-
const zipRight$1 = exitZipRight;
|
|
9170
|
-
|
|
9171
|
-
const TypeId$6 = /*#__PURE__*/Symbol.for("effect/MutableHashMap");
|
|
9033
|
+
const TypeId$4 = /*#__PURE__*/Symbol.for("effect/MutableHashMap");
|
|
9172
9034
|
const MutableHashMapProto = {
|
|
9173
|
-
[TypeId$
|
|
9035
|
+
[TypeId$4]: TypeId$4,
|
|
9174
9036
|
[Symbol.iterator]() {
|
|
9175
9037
|
return new MutableHashMapIterator(this);
|
|
9176
9038
|
},
|
|
@@ -9239,7 +9101,7 @@ class BucketIterator {
|
|
|
9239
9101
|
* @since 2.0.0
|
|
9240
9102
|
* @category constructors
|
|
9241
9103
|
*/
|
|
9242
|
-
const empty$
|
|
9104
|
+
const empty$7 = () => {
|
|
9243
9105
|
const self = Object.create(MutableHashMapProto);
|
|
9244
9106
|
self.referential = new Map();
|
|
9245
9107
|
self.buckets = new Map();
|
|
@@ -9311,7 +9173,7 @@ const removeFromBucket = (self, bucket, key) => {
|
|
|
9311
9173
|
/**
|
|
9312
9174
|
* @since 2.0.0
|
|
9313
9175
|
*/
|
|
9314
|
-
const remove
|
|
9176
|
+
const remove = /*#__PURE__*/dual(2, (self, key) => {
|
|
9315
9177
|
if (isEqual(key) === false) {
|
|
9316
9178
|
self.referential.delete(key);
|
|
9317
9179
|
return self;
|
|
@@ -9335,296 +9197,6 @@ const size = self => {
|
|
|
9335
9197
|
return self.referential.size + self.bucketsSize;
|
|
9336
9198
|
};
|
|
9337
9199
|
|
|
9338
|
-
/**
|
|
9339
|
-
* @since 2.0.0
|
|
9340
|
-
*/
|
|
9341
|
-
const TypeId$5 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
9342
|
-
const MutableListProto = {
|
|
9343
|
-
[TypeId$5]: TypeId$5,
|
|
9344
|
-
[Symbol.iterator]() {
|
|
9345
|
-
let done = false;
|
|
9346
|
-
let head = this.head;
|
|
9347
|
-
return {
|
|
9348
|
-
next() {
|
|
9349
|
-
if (done) {
|
|
9350
|
-
return this.return();
|
|
9351
|
-
}
|
|
9352
|
-
if (head == null) {
|
|
9353
|
-
done = true;
|
|
9354
|
-
return this.return();
|
|
9355
|
-
}
|
|
9356
|
-
const value = head.value;
|
|
9357
|
-
head = head.next;
|
|
9358
|
-
return {
|
|
9359
|
-
done,
|
|
9360
|
-
value
|
|
9361
|
-
};
|
|
9362
|
-
},
|
|
9363
|
-
return(value) {
|
|
9364
|
-
if (!done) {
|
|
9365
|
-
done = true;
|
|
9366
|
-
}
|
|
9367
|
-
return {
|
|
9368
|
-
done: true,
|
|
9369
|
-
value
|
|
9370
|
-
};
|
|
9371
|
-
}
|
|
9372
|
-
};
|
|
9373
|
-
},
|
|
9374
|
-
toString() {
|
|
9375
|
-
return format$2(this.toJSON());
|
|
9376
|
-
},
|
|
9377
|
-
toJSON() {
|
|
9378
|
-
return {
|
|
9379
|
-
_id: "MutableList",
|
|
9380
|
-
values: Array.from(this).map(toJSON)
|
|
9381
|
-
};
|
|
9382
|
-
},
|
|
9383
|
-
[NodeInspectSymbol]() {
|
|
9384
|
-
return this.toJSON();
|
|
9385
|
-
},
|
|
9386
|
-
pipe() {
|
|
9387
|
-
return pipeArguments(this, arguments);
|
|
9388
|
-
}
|
|
9389
|
-
};
|
|
9390
|
-
/** @internal */
|
|
9391
|
-
const makeNode = value => ({
|
|
9392
|
-
value,
|
|
9393
|
-
removed: false,
|
|
9394
|
-
prev: undefined,
|
|
9395
|
-
next: undefined
|
|
9396
|
-
});
|
|
9397
|
-
/**
|
|
9398
|
-
* Creates an empty `MutableList`.
|
|
9399
|
-
*
|
|
9400
|
-
* @since 2.0.0
|
|
9401
|
-
* @category constructors
|
|
9402
|
-
*/
|
|
9403
|
-
const empty$7 = () => {
|
|
9404
|
-
const list = Object.create(MutableListProto);
|
|
9405
|
-
list.head = undefined;
|
|
9406
|
-
list.tail = undefined;
|
|
9407
|
-
list._length = 0;
|
|
9408
|
-
return list;
|
|
9409
|
-
};
|
|
9410
|
-
/**
|
|
9411
|
-
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
9412
|
-
*
|
|
9413
|
-
* @since 2.0.0
|
|
9414
|
-
* @category getters
|
|
9415
|
-
*/
|
|
9416
|
-
const isEmpty$3 = self => length$1(self) === 0;
|
|
9417
|
-
/**
|
|
9418
|
-
* Returns the length of the list.
|
|
9419
|
-
*
|
|
9420
|
-
* @since 2.0.0
|
|
9421
|
-
* @category getters
|
|
9422
|
-
*/
|
|
9423
|
-
const length$1 = self => self._length;
|
|
9424
|
-
/**
|
|
9425
|
-
* Appends the specified element to the end of the `MutableList`.
|
|
9426
|
-
*
|
|
9427
|
-
* @category concatenating
|
|
9428
|
-
* @since 2.0.0
|
|
9429
|
-
*/
|
|
9430
|
-
const append = /*#__PURE__*/dual(2, (self, value) => {
|
|
9431
|
-
const node = makeNode(value);
|
|
9432
|
-
if (self.head === undefined) {
|
|
9433
|
-
self.head = node;
|
|
9434
|
-
}
|
|
9435
|
-
if (self.tail === undefined) {
|
|
9436
|
-
self.tail = node;
|
|
9437
|
-
} else {
|
|
9438
|
-
self.tail.next = node;
|
|
9439
|
-
node.prev = self.tail;
|
|
9440
|
-
self.tail = node;
|
|
9441
|
-
}
|
|
9442
|
-
self._length += 1;
|
|
9443
|
-
return self;
|
|
9444
|
-
});
|
|
9445
|
-
/**
|
|
9446
|
-
* Removes the first value from the list and returns it, if it exists.
|
|
9447
|
-
*
|
|
9448
|
-
* @since 0.0.1
|
|
9449
|
-
*/
|
|
9450
|
-
const shift = self => {
|
|
9451
|
-
const head = self.head;
|
|
9452
|
-
if (head !== undefined) {
|
|
9453
|
-
remove(self, head);
|
|
9454
|
-
return head.value;
|
|
9455
|
-
}
|
|
9456
|
-
return undefined;
|
|
9457
|
-
};
|
|
9458
|
-
const remove = (self, node) => {
|
|
9459
|
-
if (node.removed) {
|
|
9460
|
-
return;
|
|
9461
|
-
}
|
|
9462
|
-
node.removed = true;
|
|
9463
|
-
if (node.prev !== undefined && node.next !== undefined) {
|
|
9464
|
-
node.prev.next = node.next;
|
|
9465
|
-
node.next.prev = node.prev;
|
|
9466
|
-
} else if (node.prev !== undefined) {
|
|
9467
|
-
self.tail = node.prev;
|
|
9468
|
-
node.prev.next = undefined;
|
|
9469
|
-
} else if (node.next !== undefined) {
|
|
9470
|
-
self.head = node.next;
|
|
9471
|
-
node.next.prev = undefined;
|
|
9472
|
-
} else {
|
|
9473
|
-
self.tail = undefined;
|
|
9474
|
-
self.head = undefined;
|
|
9475
|
-
}
|
|
9476
|
-
if (self._length > 0) {
|
|
9477
|
-
self._length -= 1;
|
|
9478
|
-
}
|
|
9479
|
-
};
|
|
9480
|
-
|
|
9481
|
-
/**
|
|
9482
|
-
* @since 2.0.0
|
|
9483
|
-
*/
|
|
9484
|
-
const TypeId$4 = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
9485
|
-
/**
|
|
9486
|
-
* @since 2.0.0
|
|
9487
|
-
* @category symbol
|
|
9488
|
-
*/
|
|
9489
|
-
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
9490
|
-
const MutableQueueProto = {
|
|
9491
|
-
[TypeId$4]: TypeId$4,
|
|
9492
|
-
[Symbol.iterator]() {
|
|
9493
|
-
return Array.from(this.queue)[Symbol.iterator]();
|
|
9494
|
-
},
|
|
9495
|
-
toString() {
|
|
9496
|
-
return format$2(this.toJSON());
|
|
9497
|
-
},
|
|
9498
|
-
toJSON() {
|
|
9499
|
-
return {
|
|
9500
|
-
_id: "MutableQueue",
|
|
9501
|
-
values: Array.from(this).map(toJSON)
|
|
9502
|
-
};
|
|
9503
|
-
},
|
|
9504
|
-
[NodeInspectSymbol]() {
|
|
9505
|
-
return this.toJSON();
|
|
9506
|
-
},
|
|
9507
|
-
pipe() {
|
|
9508
|
-
return pipeArguments(this, arguments);
|
|
9509
|
-
}
|
|
9510
|
-
};
|
|
9511
|
-
const make$f = capacity => {
|
|
9512
|
-
const queue = Object.create(MutableQueueProto);
|
|
9513
|
-
queue.queue = empty$7();
|
|
9514
|
-
queue.capacity = capacity;
|
|
9515
|
-
return queue;
|
|
9516
|
-
};
|
|
9517
|
-
/**
|
|
9518
|
-
* Creates a new bounded `MutableQueue`.
|
|
9519
|
-
*
|
|
9520
|
-
* @since 2.0.0
|
|
9521
|
-
* @category constructors
|
|
9522
|
-
*/
|
|
9523
|
-
const bounded = capacity => make$f(capacity);
|
|
9524
|
-
/**
|
|
9525
|
-
* Creates a new unbounded `MutableQueue`.
|
|
9526
|
-
*
|
|
9527
|
-
* @since 2.0.0
|
|
9528
|
-
* @category constructors
|
|
9529
|
-
*/
|
|
9530
|
-
const unbounded = () => make$f(undefined);
|
|
9531
|
-
/**
|
|
9532
|
-
* Returns the current number of elements in the queue.
|
|
9533
|
-
*
|
|
9534
|
-
* @since 2.0.0
|
|
9535
|
-
* @category getters
|
|
9536
|
-
*/
|
|
9537
|
-
const length = self => length$1(self.queue);
|
|
9538
|
-
/**
|
|
9539
|
-
* Returns `true` if the queue is empty, `false` otherwise.
|
|
9540
|
-
*
|
|
9541
|
-
* @since 2.0.0
|
|
9542
|
-
* @category getters
|
|
9543
|
-
*/
|
|
9544
|
-
const isEmpty$2 = self => isEmpty$3(self.queue);
|
|
9545
|
-
/**
|
|
9546
|
-
* The **maximum** number of elements that a queue can hold.
|
|
9547
|
-
*
|
|
9548
|
-
* **Note**: unbounded queues can still implement this interface with
|
|
9549
|
-
* `capacity = Infinity`.
|
|
9550
|
-
*
|
|
9551
|
-
* @since 2.0.0
|
|
9552
|
-
* @category getters
|
|
9553
|
-
*/
|
|
9554
|
-
const capacity = self => self.capacity === undefined ? Infinity : self.capacity;
|
|
9555
|
-
/**
|
|
9556
|
-
* Offers an element to the queue.
|
|
9557
|
-
*
|
|
9558
|
-
* Returns whether the enqueue was successful or not.
|
|
9559
|
-
*
|
|
9560
|
-
* @since 2.0.0
|
|
9561
|
-
*/
|
|
9562
|
-
const offer = /*#__PURE__*/dual(2, (self, value) => {
|
|
9563
|
-
const queueLength = length$1(self.queue);
|
|
9564
|
-
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
9565
|
-
return false;
|
|
9566
|
-
}
|
|
9567
|
-
append(value)(self.queue);
|
|
9568
|
-
return true;
|
|
9569
|
-
});
|
|
9570
|
-
/**
|
|
9571
|
-
* Enqueues a collection of values into the queue.
|
|
9572
|
-
*
|
|
9573
|
-
* Returns a `Chunk` of the values that were **not** able to be enqueued.
|
|
9574
|
-
*
|
|
9575
|
-
* @since 2.0.0
|
|
9576
|
-
*/
|
|
9577
|
-
const offerAll = /*#__PURE__*/dual(2, (self, values) => {
|
|
9578
|
-
const iterator = values[Symbol.iterator]();
|
|
9579
|
-
let next;
|
|
9580
|
-
let remainder = empty$j();
|
|
9581
|
-
let offering = true;
|
|
9582
|
-
while (offering && (next = iterator.next()) && !next.done) {
|
|
9583
|
-
offering = offer(next.value)(self);
|
|
9584
|
-
}
|
|
9585
|
-
while (next != null && !next.done) {
|
|
9586
|
-
remainder = prepend$1(next.value)(remainder);
|
|
9587
|
-
next = iterator.next();
|
|
9588
|
-
}
|
|
9589
|
-
return reverse$1(remainder);
|
|
9590
|
-
});
|
|
9591
|
-
/**
|
|
9592
|
-
* Dequeues an element from the queue.
|
|
9593
|
-
*
|
|
9594
|
-
* Returns either an element from the queue, or the `def` param.
|
|
9595
|
-
*
|
|
9596
|
-
* **Note**: if there is no meaningful default for your type, you can always
|
|
9597
|
-
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
9598
|
-
*
|
|
9599
|
-
* @since 2.0.0
|
|
9600
|
-
*/
|
|
9601
|
-
const poll = /*#__PURE__*/dual(2, (self, def) => {
|
|
9602
|
-
if (isEmpty$3(self.queue)) {
|
|
9603
|
-
return def;
|
|
9604
|
-
}
|
|
9605
|
-
return shift(self.queue);
|
|
9606
|
-
});
|
|
9607
|
-
/**
|
|
9608
|
-
* Dequeues up to `n` elements from the queue.
|
|
9609
|
-
*
|
|
9610
|
-
* Returns a `List` of up to `n` elements.
|
|
9611
|
-
*
|
|
9612
|
-
* @since 2.0.0
|
|
9613
|
-
*/
|
|
9614
|
-
const pollUpTo = /*#__PURE__*/dual(2, (self, n) => {
|
|
9615
|
-
let result = empty$j();
|
|
9616
|
-
let count = 0;
|
|
9617
|
-
while (count < n) {
|
|
9618
|
-
const element = poll(EmptyMutableQueue)(self);
|
|
9619
|
-
if (element === EmptyMutableQueue) {
|
|
9620
|
-
break;
|
|
9621
|
-
}
|
|
9622
|
-
result = prepend$1(element)(result);
|
|
9623
|
-
count += 1;
|
|
9624
|
-
}
|
|
9625
|
-
return reverse$1(result);
|
|
9626
|
-
});
|
|
9627
|
-
|
|
9628
9200
|
/** @internal */
|
|
9629
9201
|
const ClockSymbolKey = "effect/Clock";
|
|
9630
9202
|
/** @internal */
|
|
@@ -9686,11 +9258,11 @@ class ClockImpl {
|
|
|
9686
9258
|
currentTimeMillis = /*#__PURE__*/sync$1(() => this.unsafeCurrentTimeMillis());
|
|
9687
9259
|
currentTimeNanos = /*#__PURE__*/sync$1(() => this.unsafeCurrentTimeNanos());
|
|
9688
9260
|
scheduler() {
|
|
9689
|
-
return succeed$
|
|
9261
|
+
return succeed$2(globalClockScheduler);
|
|
9690
9262
|
}
|
|
9691
9263
|
sleep(duration) {
|
|
9692
9264
|
return async_(resume => {
|
|
9693
|
-
const canceler = globalClockScheduler.unsafeSchedule(() => resume(void_$
|
|
9265
|
+
const canceler = globalClockScheduler.unsafeSchedule(() => resume(void_$1), duration);
|
|
9694
9266
|
return asVoid$1(sync$1(canceler));
|
|
9695
9267
|
});
|
|
9696
9268
|
}
|
|
@@ -9882,7 +9454,7 @@ const patch$3 = /*#__PURE__*/dual(2, (path, patch) => {
|
|
|
9882
9454
|
}
|
|
9883
9455
|
case "MapName":
|
|
9884
9456
|
{
|
|
9885
|
-
output = map$
|
|
9457
|
+
output = map$7(output, patch.f);
|
|
9886
9458
|
input = input.tail;
|
|
9887
9459
|
break;
|
|
9888
9460
|
}
|
|
@@ -9959,9 +9531,9 @@ const makeFlat = options => ({
|
|
|
9959
9531
|
});
|
|
9960
9532
|
/** @internal */
|
|
9961
9533
|
const fromFlat = flat => make$d({
|
|
9962
|
-
load: config => flatMap$2(fromFlatLoop(flat, empty$
|
|
9963
|
-
onNone: () => fail$
|
|
9964
|
-
onSome: succeed$
|
|
9534
|
+
load: config => flatMap$2(fromFlatLoop(flat, empty$l(), config, false), chunk => match$5(head$1(chunk), {
|
|
9535
|
+
onNone: () => fail$1(MissingData(empty$l(), `Expected a single value having structure: ${config}`)),
|
|
9536
|
+
onSome: succeed$2
|
|
9965
9537
|
})),
|
|
9966
9538
|
flattened: flat
|
|
9967
9539
|
});
|
|
@@ -10029,7 +9601,7 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10029
9601
|
switch (op._tag) {
|
|
10030
9602
|
case OP_CONSTANT:
|
|
10031
9603
|
{
|
|
10032
|
-
return succeed$
|
|
9604
|
+
return succeed$2(of$2(op.value));
|
|
10033
9605
|
}
|
|
10034
9606
|
case OP_DESCRIBED:
|
|
10035
9607
|
{
|
|
@@ -10037,15 +9609,15 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10037
9609
|
}
|
|
10038
9610
|
case OP_FAIL:
|
|
10039
9611
|
{
|
|
10040
|
-
return fail$
|
|
9612
|
+
return fail$1(MissingData(prefix, op.message));
|
|
10041
9613
|
}
|
|
10042
9614
|
case OP_FALLBACK:
|
|
10043
9615
|
{
|
|
10044
9616
|
return pipe(suspend$1(() => fromFlatLoop(flat, prefix, op.first, split)), catchAll$1(error1 => {
|
|
10045
9617
|
if (op.condition(error1)) {
|
|
10046
|
-
return pipe(fromFlatLoop(flat, prefix, op.second, split), catchAll$1(error2 => fail$
|
|
9618
|
+
return pipe(fromFlatLoop(flat, prefix, op.second, split), catchAll$1(error2 => fail$1(Or(error1, error2))));
|
|
10047
9619
|
}
|
|
10048
|
-
return fail$
|
|
9620
|
+
return fail$1(error1);
|
|
10049
9621
|
}));
|
|
10050
9622
|
}
|
|
10051
9623
|
case OP_LAZY:
|
|
@@ -10065,21 +9637,21 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10065
9637
|
return pipe(patch$3(prefix, flat.patch), flatMap$2(prefix => pipe(flat.load(prefix, op, split), flatMap$2(values => {
|
|
10066
9638
|
if (values.length === 0) {
|
|
10067
9639
|
const name = pipe(last(prefix), getOrElse(() => "<n/a>"));
|
|
10068
|
-
return fail$
|
|
9640
|
+
return fail$1(MissingData([], `Expected ${op.description} with name ${name}`));
|
|
10069
9641
|
}
|
|
10070
|
-
return succeed$
|
|
9642
|
+
return succeed$2(values);
|
|
10071
9643
|
}))));
|
|
10072
9644
|
}
|
|
10073
9645
|
case OP_SEQUENCE:
|
|
10074
9646
|
{
|
|
10075
9647
|
return pipe(patch$3(prefix, flat.patch), flatMap$2(patchedPrefix => pipe(flat.enumerateChildren(patchedPrefix), flatMap$2(indicesFrom), flatMap$2(indices => {
|
|
10076
9648
|
if (indices.length === 0) {
|
|
10077
|
-
return suspend$1(() => map$
|
|
9649
|
+
return suspend$1(() => map$2(fromFlatLoop(flat, prefix, op.config, true), of$2));
|
|
10078
9650
|
}
|
|
10079
|
-
return pipe(forEachSequential(indices, index => fromFlatLoop(flat, append$
|
|
9651
|
+
return pipe(forEachSequential(indices, index => fromFlatLoop(flat, append$1(prefix, `[${index}]`), op.config, true)), map$2(chunkChunk => {
|
|
10080
9652
|
const flattened = flatten$3(chunkChunk);
|
|
10081
9653
|
if (flattened.length === 0) {
|
|
10082
|
-
return of$2(empty$
|
|
9654
|
+
return of$2(empty$l());
|
|
10083
9655
|
}
|
|
10084
9656
|
return of$2(flattened);
|
|
10085
9657
|
}));
|
|
@@ -10088,11 +9660,11 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10088
9660
|
case OP_HASHMAP:
|
|
10089
9661
|
{
|
|
10090
9662
|
return suspend$1(() => pipe(patch$3(prefix, flat.patch), flatMap$2(prefix => pipe(flat.enumerateChildren(prefix), flatMap$2(keys => {
|
|
10091
|
-
return pipe(keys, forEachSequential(key => fromFlatLoop(flat, concat(prefix, of$2(key)), op.valueConfig, split)), map$
|
|
9663
|
+
return pipe(keys, forEachSequential(key => fromFlatLoop(flat, concat(prefix, of$2(key)), op.valueConfig, split)), map$2(matrix => {
|
|
10092
9664
|
if (matrix.length === 0) {
|
|
10093
|
-
return of$2(empty$
|
|
9665
|
+
return of$2(empty$e());
|
|
10094
9666
|
}
|
|
10095
|
-
return pipe(transpose(matrix), map$
|
|
9667
|
+
return pipe(transpose(matrix), map$7(values => fromIterable$1(zip$2(fromIterable$6(keys), values))));
|
|
10096
9668
|
}));
|
|
10097
9669
|
})))));
|
|
10098
9670
|
}
|
|
@@ -10100,19 +9672,19 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10100
9672
|
{
|
|
10101
9673
|
return suspend$1(() => pipe(fromFlatLoop(flat, prefix, op.left, split), either, flatMap$2(left => pipe(fromFlatLoop(flat, prefix, op.right, split), either, flatMap$2(right$1 => {
|
|
10102
9674
|
if (isLeft(left) && isLeft(right$1)) {
|
|
10103
|
-
return fail$
|
|
9675
|
+
return fail$1(And(left.left, right$1.left));
|
|
10104
9676
|
}
|
|
10105
9677
|
if (isLeft(left) && isRight(right$1)) {
|
|
10106
|
-
return fail$
|
|
9678
|
+
return fail$1(left.left);
|
|
10107
9679
|
}
|
|
10108
9680
|
if (isRight(left) && isLeft(right$1)) {
|
|
10109
|
-
return fail$
|
|
9681
|
+
return fail$1(right$1.left);
|
|
10110
9682
|
}
|
|
10111
9683
|
if (isRight(left) && isRight(right$1)) {
|
|
10112
9684
|
const path = pipe(prefix, join$1("."));
|
|
10113
9685
|
const fail = fromFlatLoopFail(prefix, path);
|
|
10114
|
-
const [lefts, rights] = extend$1(fail, fail, pipe(left.right, map$
|
|
10115
|
-
return pipe(lefts, zip$
|
|
9686
|
+
const [lefts, rights] = extend$1(fail, fail, pipe(left.right, map$7(right)), pipe(right$1.right, map$7(right)));
|
|
9687
|
+
return pipe(lefts, zip$2(rights), forEachSequential(([left, right]) => pipe(zip$1(left, right), map$2(([left, right]) => op.zip(left, right)))));
|
|
10116
9688
|
}
|
|
10117
9689
|
throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues");
|
|
10118
9690
|
})))));
|
|
@@ -10137,9 +9709,9 @@ const transpose = array => {
|
|
|
10137
9709
|
return Object.keys(array[0]).map(column => array.map(row => row[column]));
|
|
10138
9710
|
};
|
|
10139
9711
|
const indicesFrom = quotedIndices => pipe(forEachSequential(quotedIndices, parseQuotedIndex), mapBoth({
|
|
10140
|
-
onFailure: () => empty$
|
|
9712
|
+
onFailure: () => empty$l(),
|
|
10141
9713
|
onSuccess: sort(Order$1)
|
|
10142
|
-
}), either, map$
|
|
9714
|
+
}), either, map$2(merge$3));
|
|
10143
9715
|
const QUOTED_INDEX_REGEX = /^(\[(\d+)\])$/;
|
|
10144
9716
|
const parseQuotedIndex = str => {
|
|
10145
9717
|
const match = str.match(QUOTED_INDEX_REGEX);
|
|
@@ -10263,13 +9835,13 @@ class RandomImpl {
|
|
|
10263
9835
|
return sync$1(() => this.PRNG.number());
|
|
10264
9836
|
}
|
|
10265
9837
|
get nextBoolean() {
|
|
10266
|
-
return map$
|
|
9838
|
+
return map$2(this.next, n => n > 0.5);
|
|
10267
9839
|
}
|
|
10268
9840
|
get nextInt() {
|
|
10269
9841
|
return sync$1(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
|
|
10270
9842
|
}
|
|
10271
9843
|
nextRange(min, max) {
|
|
10272
|
-
return map$
|
|
9844
|
+
return map$2(this.next, n => (max - min) * n + min);
|
|
10273
9845
|
}
|
|
10274
9846
|
nextIntBetween(min, max) {
|
|
10275
9847
|
return sync$1(() => this.PRNG.integer(max - min) + min);
|
|
@@ -10284,7 +9856,7 @@ const shuffleWith = (elements, nextIntBounded) => {
|
|
|
10284
9856
|
for (let i = buffer.length; i >= 2; i = i - 1) {
|
|
10285
9857
|
numbers.push(i);
|
|
10286
9858
|
}
|
|
10287
|
-
return pipe(numbers, forEachSequentialDiscard(n => pipe(nextIntBounded(n), map$
|
|
9859
|
+
return pipe(numbers, forEachSequentialDiscard(n => pipe(nextIntBounded(n), map$2(k => swap(buffer, n - 1, k)))), as$1(fromIterable$5(buffer)));
|
|
10288
9860
|
})));
|
|
10289
9861
|
};
|
|
10290
9862
|
const swap = (buffer, index1, index2) => {
|
|
@@ -10376,7 +9948,7 @@ const nativeTracer = /*#__PURE__*/make$b({
|
|
|
10376
9948
|
});
|
|
10377
9949
|
|
|
10378
9950
|
/** @internal */
|
|
10379
|
-
const liveServices = /*#__PURE__*/pipe(/*#__PURE__*/empty$
|
|
9951
|
+
const liveServices = /*#__PURE__*/pipe(/*#__PURE__*/empty$j(), /*#__PURE__*/add$2(clockTag, /*#__PURE__*/make$e()), /*#__PURE__*/add$2(consoleTag, defaultConsole), /*#__PURE__*/add$2(randomTag, /*#__PURE__*/make$c(/*#__PURE__*/Math.random())), /*#__PURE__*/add$2(configProviderTag, /*#__PURE__*/fromEnv()), /*#__PURE__*/add$2(tracerTag, nativeTracer));
|
|
10380
9952
|
/**
|
|
10381
9953
|
* The `FiberRef` holding the default `Effect` services.
|
|
10382
9954
|
*
|
|
@@ -10752,7 +10324,7 @@ class RefImpl extends Class {
|
|
|
10752
10324
|
}
|
|
10753
10325
|
}
|
|
10754
10326
|
/** @internal */
|
|
10755
|
-
const unsafeMake$2 = value => new RefImpl(make$
|
|
10327
|
+
const unsafeMake$2 = value => new RefImpl(make$i(value));
|
|
10756
10328
|
/** @internal */
|
|
10757
10329
|
const make$a = value => sync$1(() => unsafeMake$2(value));
|
|
10758
10330
|
/** @internal */
|
|
@@ -10900,7 +10472,7 @@ const make$9 = (key, value) => {
|
|
|
10900
10472
|
const isMetricLabel = u => hasProperty(u, MetricLabelTypeId);
|
|
10901
10473
|
|
|
10902
10474
|
/* @internal */
|
|
10903
|
-
const asSome = self => map$
|
|
10475
|
+
const asSome = self => map$2(self, some);
|
|
10904
10476
|
/* @internal */
|
|
10905
10477
|
const try_$1 = arg => {
|
|
10906
10478
|
let evaluate;
|
|
@@ -10913,9 +10485,9 @@ const try_$1 = arg => {
|
|
|
10913
10485
|
}
|
|
10914
10486
|
return suspend$1(() => {
|
|
10915
10487
|
try {
|
|
10916
|
-
return succeed$
|
|
10488
|
+
return succeed$2(internalCall(evaluate));
|
|
10917
10489
|
} catch (error) {
|
|
10918
|
-
return fail$
|
|
10490
|
+
return fail$1(onFailure ? internalCall(() => onFailure(error)) : new UnknownException(error, "An unknown error occurred in Effect.try"));
|
|
10919
10491
|
}
|
|
10920
10492
|
});
|
|
10921
10493
|
};
|
|
@@ -10926,7 +10498,7 @@ const catchSomeCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(se
|
|
|
10926
10498
|
switch (option._tag) {
|
|
10927
10499
|
case "None":
|
|
10928
10500
|
{
|
|
10929
|
-
return failCause$
|
|
10501
|
+
return failCause$2(cause);
|
|
10930
10502
|
}
|
|
10931
10503
|
case "Some":
|
|
10932
10504
|
{
|
|
@@ -10934,7 +10506,7 @@ const catchSomeCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(se
|
|
|
10934
10506
|
}
|
|
10935
10507
|
}
|
|
10936
10508
|
},
|
|
10937
|
-
onSuccess: succeed$
|
|
10509
|
+
onSuccess: succeed$2
|
|
10938
10510
|
}));
|
|
10939
10511
|
/* @internal */
|
|
10940
10512
|
const clockWith = clockWith$1;
|
|
@@ -10942,8 +10514,8 @@ const clockWith = clockWith$1;
|
|
|
10942
10514
|
const diffFiberRefs = self => summarized(self, fiberRefs, diff$2);
|
|
10943
10515
|
/* @internal */
|
|
10944
10516
|
const match$2 = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {
|
|
10945
|
-
onFailure: e => succeed$
|
|
10946
|
-
onSuccess: a => succeed$
|
|
10517
|
+
onFailure: e => succeed$2(options.onFailure(e)),
|
|
10518
|
+
onSuccess: a => succeed$2(options.onSuccess(a))
|
|
10947
10519
|
}));
|
|
10948
10520
|
/* @internal */
|
|
10949
10521
|
const forever$2 = self => {
|
|
@@ -10951,7 +10523,7 @@ const forever$2 = self => {
|
|
|
10951
10523
|
return loop;
|
|
10952
10524
|
};
|
|
10953
10525
|
/* @internal */
|
|
10954
|
-
const fiberRefs = /*#__PURE__*/withFiberRuntime$1(state => succeed$
|
|
10526
|
+
const fiberRefs = /*#__PURE__*/withFiberRuntime$1(state => succeed$2(state.getFiberRefs()));
|
|
10955
10527
|
/* @internal */
|
|
10956
10528
|
const ignore$1 = self => match$2(self, {
|
|
10957
10529
|
onFailure: constVoid,
|
|
@@ -10974,11 +10546,11 @@ const logWithLevel = level => (...message) => {
|
|
|
10974
10546
|
}
|
|
10975
10547
|
}
|
|
10976
10548
|
if (cause === undefined) {
|
|
10977
|
-
cause = empty$
|
|
10549
|
+
cause = empty$8;
|
|
10978
10550
|
}
|
|
10979
10551
|
return withFiberRuntime$1(fiberState => {
|
|
10980
10552
|
fiberState.log(message, cause, levelOption);
|
|
10981
|
-
return void_$
|
|
10553
|
+
return void_$1;
|
|
10982
10554
|
});
|
|
10983
10555
|
};
|
|
10984
10556
|
/** @internal */
|
|
@@ -10988,10 +10560,10 @@ const logError$1 = /*#__PURE__*/logWithLevel(Error$1);
|
|
|
10988
10560
|
/* @internal */
|
|
10989
10561
|
const mapErrorCause = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
10990
10562
|
onFailure: c => failCauseSync(() => f(c)),
|
|
10991
|
-
onSuccess: succeed$
|
|
10563
|
+
onSuccess: succeed$2
|
|
10992
10564
|
}));
|
|
10993
10565
|
/* @internal */
|
|
10994
|
-
const negate = self => map$
|
|
10566
|
+
const negate = self => map$2(self, b => !b);
|
|
10995
10567
|
/* @internal */
|
|
10996
10568
|
const orElseSucceed$1 = /*#__PURE__*/dual(2, (self, evaluate) => orElse(self, () => sync$1(evaluate)));
|
|
10997
10569
|
/* @internal */
|
|
@@ -10999,15 +10571,15 @@ const patchFiberRefs = patch => updateFiberRefs((fiberId, fiberRefs) => pipe(pat
|
|
|
10999
10571
|
/* @internal */
|
|
11000
10572
|
const promise$1 = evaluate => evaluate.length >= 1 ? async_((resolve, signal) => {
|
|
11001
10573
|
try {
|
|
11002
|
-
evaluate(signal).then(a => resolve(succeed$
|
|
10574
|
+
evaluate(signal).then(a => resolve(succeed$2(a)), e => resolve(die(e)));
|
|
11003
10575
|
} catch (e) {
|
|
11004
|
-
resolve(die
|
|
10576
|
+
resolve(die(e));
|
|
11005
10577
|
}
|
|
11006
10578
|
}) : async_(resolve => {
|
|
11007
10579
|
try {
|
|
11008
|
-
evaluate().then(a => resolve(succeed$
|
|
10580
|
+
evaluate().then(a => resolve(succeed$2(a)), e => resolve(die(e)));
|
|
11009
10581
|
} catch (e) {
|
|
11010
|
-
resolve(die
|
|
10582
|
+
resolve(die(e));
|
|
11011
10583
|
}
|
|
11012
10584
|
});
|
|
11013
10585
|
/* @internal */
|
|
@@ -11017,26 +10589,26 @@ const provideServiceEffect = /*#__PURE__*/dual(3, (self, tag, effect) => context
|
|
|
11017
10589
|
/* @internal */
|
|
11018
10590
|
const sleep = sleep$1;
|
|
11019
10591
|
/* @internal */
|
|
11020
|
-
const succeedNone = /*#__PURE__*/succeed$
|
|
10592
|
+
const succeedNone = /*#__PURE__*/succeed$2(/*#__PURE__*/none$4());
|
|
11021
10593
|
/* @internal */
|
|
11022
|
-
const summarized = /*#__PURE__*/dual(3, (self, summary, f) => flatMap$2(summary, start => flatMap$2(self, value => map$
|
|
10594
|
+
const summarized = /*#__PURE__*/dual(3, (self, summary, f) => flatMap$2(summary, start => flatMap$2(self, value => map$2(summary, end => [f(start, end), value]))));
|
|
11023
10595
|
/* @internal */
|
|
11024
10596
|
const tapError$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
11025
10597
|
onFailure: cause => {
|
|
11026
10598
|
const either = failureOrCause(cause);
|
|
11027
10599
|
switch (either._tag) {
|
|
11028
10600
|
case "Left":
|
|
11029
|
-
return zipRight$
|
|
10601
|
+
return zipRight$1(f(either.left), failCause$2(cause));
|
|
11030
10602
|
case "Right":
|
|
11031
|
-
return failCause$
|
|
10603
|
+
return failCause$2(cause);
|
|
11032
10604
|
}
|
|
11033
10605
|
},
|
|
11034
|
-
onSuccess: succeed$
|
|
10606
|
+
onSuccess: succeed$2
|
|
11035
10607
|
}));
|
|
11036
10608
|
/* @internal */
|
|
11037
10609
|
const tapErrorCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
11038
|
-
onFailure: cause => zipRight$
|
|
11039
|
-
onSuccess: succeed$
|
|
10610
|
+
onFailure: cause => zipRight$1(f(cause), failCause$2(cause)),
|
|
10611
|
+
onSuccess: succeed$2
|
|
11040
10612
|
}));
|
|
11041
10613
|
/* @internal */
|
|
11042
10614
|
const tryPromise$1 = arg => {
|
|
@@ -11048,11 +10620,11 @@ const tryPromise$1 = arg => {
|
|
|
11048
10620
|
evaluate = arg.try;
|
|
11049
10621
|
catcher = arg.catch;
|
|
11050
10622
|
}
|
|
11051
|
-
const fail = e => catcher ? failSync(() => catcher(e)) : fail$
|
|
10623
|
+
const fail = e => catcher ? failSync(() => catcher(e)) : fail$1(new UnknownException(e, "An unknown error occurred in Effect.tryPromise"));
|
|
11052
10624
|
if (evaluate.length >= 1) {
|
|
11053
10625
|
return async_((resolve, signal) => {
|
|
11054
10626
|
try {
|
|
11055
|
-
evaluate(signal).then(a => resolve(succeed$
|
|
10627
|
+
evaluate(signal).then(a => resolve(succeed$2(a)), e => resolve(fail(e)));
|
|
11056
10628
|
} catch (e) {
|
|
11057
10629
|
resolve(fail(e));
|
|
11058
10630
|
}
|
|
@@ -11060,7 +10632,7 @@ const tryPromise$1 = arg => {
|
|
|
11060
10632
|
}
|
|
11061
10633
|
return async_(resolve => {
|
|
11062
10634
|
try {
|
|
11063
|
-
evaluate().then(a => resolve(succeed$
|
|
10635
|
+
evaluate().then(a => resolve(succeed$2(a)), e => resolve(fail(e)));
|
|
11064
10636
|
} catch (e) {
|
|
11065
10637
|
resolve(fail(e));
|
|
11066
10638
|
}
|
|
@@ -11069,10 +10641,10 @@ const tryPromise$1 = arg => {
|
|
|
11069
10641
|
/* @internal */
|
|
11070
10642
|
const updateFiberRefs = f => withFiberRuntime$1(state => {
|
|
11071
10643
|
state.setFiberRefs(f(state.id(), state.getFiberRefs()));
|
|
11072
|
-
return void_$
|
|
10644
|
+
return void_$1;
|
|
11073
10645
|
});
|
|
11074
10646
|
/* @internal */
|
|
11075
|
-
const when$1 = /*#__PURE__*/dual(2, (self, condition) => suspend$1(() => condition() ? map$
|
|
10647
|
+
const when$1 = /*#__PURE__*/dual(2, (self, condition) => suspend$1(() => condition() ? map$2(self, some) : succeed$2(none$4())));
|
|
11076
10648
|
|
|
11077
10649
|
/** @internal */
|
|
11078
10650
|
const OP_SEQUENTIAL = "Sequential";
|
|
@@ -11996,6 +11568,51 @@ class MixedScheduler {
|
|
|
11996
11568
|
* @category schedulers
|
|
11997
11569
|
*/
|
|
11998
11570
|
const defaultScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Scheduler/defaultScheduler"), () => new MixedScheduler(2048));
|
|
11571
|
+
/**
|
|
11572
|
+
* @since 2.0.0
|
|
11573
|
+
* @category constructors
|
|
11574
|
+
*/
|
|
11575
|
+
class SyncScheduler {
|
|
11576
|
+
/**
|
|
11577
|
+
* @since 2.0.0
|
|
11578
|
+
*/
|
|
11579
|
+
tasks = /*#__PURE__*/new PriorityBuckets();
|
|
11580
|
+
/**
|
|
11581
|
+
* @since 2.0.0
|
|
11582
|
+
*/
|
|
11583
|
+
deferred = false;
|
|
11584
|
+
/**
|
|
11585
|
+
* @since 2.0.0
|
|
11586
|
+
*/
|
|
11587
|
+
scheduleTask(task, priority) {
|
|
11588
|
+
if (this.deferred) {
|
|
11589
|
+
defaultScheduler.scheduleTask(task, priority);
|
|
11590
|
+
} else {
|
|
11591
|
+
this.tasks.scheduleTask(task, priority);
|
|
11592
|
+
}
|
|
11593
|
+
}
|
|
11594
|
+
/**
|
|
11595
|
+
* @since 2.0.0
|
|
11596
|
+
*/
|
|
11597
|
+
shouldYield(fiber) {
|
|
11598
|
+
return fiber.currentOpCount > fiber.getFiberRef(currentMaxOpsBeforeYield) ? fiber.getFiberRef(currentSchedulingPriority) : false;
|
|
11599
|
+
}
|
|
11600
|
+
/**
|
|
11601
|
+
* @since 2.0.0
|
|
11602
|
+
*/
|
|
11603
|
+
flush() {
|
|
11604
|
+
while (this.tasks.buckets.length > 0) {
|
|
11605
|
+
const tasks = this.tasks.buckets;
|
|
11606
|
+
this.tasks.buckets = [];
|
|
11607
|
+
for (const [_, toRun] of tasks) {
|
|
11608
|
+
for (let i = 0; i < toRun.length; i++) {
|
|
11609
|
+
toRun[i]();
|
|
11610
|
+
}
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
this.deferred = true;
|
|
11614
|
+
}
|
|
11615
|
+
}
|
|
11999
11616
|
/** @internal */
|
|
12000
11617
|
const currentScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentScheduler"), () => fiberRefUnsafeMake(defaultScheduler));
|
|
12001
11618
|
|
|
@@ -12595,7 +12212,7 @@ const histogram$1 = key => {
|
|
|
12595
12212
|
let sum = 0;
|
|
12596
12213
|
let min = Number.MAX_VALUE;
|
|
12597
12214
|
let max = Number.MIN_VALUE;
|
|
12598
|
-
pipe(bounds, sort(Order$1), map$
|
|
12215
|
+
pipe(bounds, sort(Order$1), map$7((n, i) => {
|
|
12599
12216
|
boundaries[i] = n;
|
|
12600
12217
|
}));
|
|
12601
12218
|
// Insert the value into the right bucket with a binary search
|
|
@@ -12725,7 +12342,7 @@ const calculateQuantiles = (error, sortedQuantiles, sortedSamples) => {
|
|
|
12725
12342
|
// The number of samples examined
|
|
12726
12343
|
const sampleCount = sortedSamples.length;
|
|
12727
12344
|
if (!isNonEmptyReadonlyArray(sortedQuantiles)) {
|
|
12728
|
-
return empty$
|
|
12345
|
+
return empty$l();
|
|
12729
12346
|
}
|
|
12730
12347
|
const head = sortedQuantiles[0];
|
|
12731
12348
|
const tail = sortedQuantiles.slice(1);
|
|
@@ -12734,7 +12351,7 @@ const calculateQuantiles = (error, sortedQuantiles, sortedSamples) => {
|
|
|
12734
12351
|
tail.forEach(quantile => {
|
|
12735
12352
|
resolved.push(resolveQuantile(error, sampleCount, resolvedHead.value, resolvedHead.consumed, quantile, resolvedHead.rest));
|
|
12736
12353
|
});
|
|
12737
|
-
return map$
|
|
12354
|
+
return map$7(resolved, rq => [rq.quantile, rq.value]);
|
|
12738
12355
|
};
|
|
12739
12356
|
/** @internal */
|
|
12740
12357
|
const resolveQuantile = (error, sampleCount, current, consumed, quantile, rest) => {
|
|
@@ -12886,7 +12503,7 @@ const MetricRegistryTypeId = /*#__PURE__*/Symbol.for(MetricRegistrySymbolKey);
|
|
|
12886
12503
|
/** @internal */
|
|
12887
12504
|
class MetricRegistryImpl {
|
|
12888
12505
|
[MetricRegistryTypeId] = MetricRegistryTypeId;
|
|
12889
|
-
map = /*#__PURE__*/empty$
|
|
12506
|
+
map = /*#__PURE__*/empty$7();
|
|
12890
12507
|
snapshot() {
|
|
12891
12508
|
const result = [];
|
|
12892
12509
|
for (const [key, hook] of this.map) {
|
|
@@ -13093,7 +12710,7 @@ class ProxySupervisor {
|
|
|
13093
12710
|
this.underlying.onResume(fiber);
|
|
13094
12711
|
}
|
|
13095
12712
|
map(f) {
|
|
13096
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12713
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13097
12714
|
}
|
|
13098
12715
|
zip(right) {
|
|
13099
12716
|
return new Zip(this, right);
|
|
@@ -13110,7 +12727,7 @@ class Zip {
|
|
|
13110
12727
|
this.right = right;
|
|
13111
12728
|
}
|
|
13112
12729
|
get value() {
|
|
13113
|
-
return zip$
|
|
12730
|
+
return zip$1(this.left.value, this.right.value);
|
|
13114
12731
|
}
|
|
13115
12732
|
onStart(context, effect, parent, fiber) {
|
|
13116
12733
|
this.left.onStart(context, effect, parent, fiber);
|
|
@@ -13133,7 +12750,7 @@ class Zip {
|
|
|
13133
12750
|
this.right.onResume(fiber);
|
|
13134
12751
|
}
|
|
13135
12752
|
map(f) {
|
|
13136
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12753
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13137
12754
|
}
|
|
13138
12755
|
zip(right) {
|
|
13139
12756
|
return new Zip(this, right);
|
|
@@ -13167,7 +12784,7 @@ class Const {
|
|
|
13167
12784
|
//
|
|
13168
12785
|
}
|
|
13169
12786
|
map(f) {
|
|
13170
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12787
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13171
12788
|
}
|
|
13172
12789
|
zip(right) {
|
|
13173
12790
|
return new Zip(this, right);
|
|
@@ -13181,7 +12798,7 @@ const fromEffect = effect => {
|
|
|
13181
12798
|
return new Const(effect);
|
|
13182
12799
|
};
|
|
13183
12800
|
/** @internal */
|
|
13184
|
-
const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect(void_$
|
|
12801
|
+
const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect(void_$1));
|
|
13185
12802
|
|
|
13186
12803
|
/**
|
|
13187
12804
|
* Constructs a new `Differ`.
|
|
@@ -13189,7 +12806,7 @@ const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect
|
|
|
13189
12806
|
* @since 2.0.0
|
|
13190
12807
|
* @category constructors
|
|
13191
12808
|
*/
|
|
13192
|
-
const make$5 = make$
|
|
12809
|
+
const make$5 = make$h;
|
|
13193
12810
|
|
|
13194
12811
|
/** @internal */
|
|
13195
12812
|
const OP_EMPTY = "Empty";
|
|
@@ -13276,12 +12893,12 @@ const removeSupervisor = (self, that) => {
|
|
|
13276
12893
|
/** @internal */
|
|
13277
12894
|
const toSet = self => {
|
|
13278
12895
|
if (equals$1(self, none)) {
|
|
13279
|
-
return empty$
|
|
12896
|
+
return empty$f();
|
|
13280
12897
|
} else {
|
|
13281
12898
|
if (isZip(self)) {
|
|
13282
12899
|
return pipe(toSet(self.left), union(toSet(self.right)));
|
|
13283
12900
|
} else {
|
|
13284
|
-
return make$
|
|
12901
|
+
return make$j(self);
|
|
13285
12902
|
}
|
|
13286
12903
|
}
|
|
13287
12904
|
};
|
|
@@ -13373,7 +12990,7 @@ const contOpSuccess = {
|
|
|
13373
12990
|
self.pushStack(cont);
|
|
13374
12991
|
return internalCall(() => cont.effect_instruction_i1());
|
|
13375
12992
|
} else {
|
|
13376
|
-
return void_$
|
|
12993
|
+
return void_$1;
|
|
13377
12994
|
}
|
|
13378
12995
|
},
|
|
13379
12996
|
[OP_ITERATOR]: (self, cont, value) => {
|
|
@@ -13563,7 +13180,7 @@ class FiberRuntime extends Class {
|
|
|
13563
13180
|
}
|
|
13564
13181
|
get await() {
|
|
13565
13182
|
return async_(resume => {
|
|
13566
|
-
const cb = exit => resume(succeed$
|
|
13183
|
+
const cb = exit => resume(succeed$2(exit));
|
|
13567
13184
|
this.tell(stateful((fiber, _) => {
|
|
13568
13185
|
if (fiber._exitValue !== null) {
|
|
13569
13186
|
cb(this._exitValue);
|
|
@@ -13609,13 +13226,13 @@ class FiberRuntime extends Class {
|
|
|
13609
13226
|
* In the background, interrupts the fiber as if interrupted from the specified fiber.
|
|
13610
13227
|
*/
|
|
13611
13228
|
interruptAsFork(fiberId) {
|
|
13612
|
-
return sync$1(() => this.tell(interruptSignal(interrupt$
|
|
13229
|
+
return sync$1(() => this.tell(interruptSignal(interrupt$2(fiberId))));
|
|
13613
13230
|
}
|
|
13614
13231
|
/**
|
|
13615
13232
|
* In the background, interrupts the fiber as if interrupted from the specified fiber.
|
|
13616
13233
|
*/
|
|
13617
13234
|
unsafeInterruptAsFork(fiberId) {
|
|
13618
|
-
this.tell(interruptSignal(interrupt$
|
|
13235
|
+
this.tell(interruptSignal(interrupt$2(fiberId)));
|
|
13619
13236
|
}
|
|
13620
13237
|
/**
|
|
13621
13238
|
* Adds an observer to the list of observers.
|
|
@@ -13809,7 +13426,7 @@ class FiberRuntime extends Class {
|
|
|
13809
13426
|
* log annotations and log level) may not be up-to-date.
|
|
13810
13427
|
*/
|
|
13811
13428
|
isInterrupted() {
|
|
13812
|
-
return !isEmpty$
|
|
13429
|
+
return !isEmpty$2(this.getFiberRef(currentInterruptedCause));
|
|
13813
13430
|
}
|
|
13814
13431
|
/**
|
|
13815
13432
|
* Adds an interruptor to the set of interruptors that are interrupting this
|
|
@@ -13843,7 +13460,7 @@ class FiberRuntime extends Class {
|
|
|
13843
13460
|
}
|
|
13844
13461
|
let told = false;
|
|
13845
13462
|
for (const child of this._children) {
|
|
13846
|
-
child.tell(interruptSignal(interrupt$
|
|
13463
|
+
child.tell(interruptSignal(interrupt$2(this.id())));
|
|
13847
13464
|
told = true;
|
|
13848
13465
|
}
|
|
13849
13466
|
return told;
|
|
@@ -14110,7 +13727,7 @@ class FiberRuntime extends Class {
|
|
|
14110
13727
|
try {
|
|
14111
13728
|
asyncRegister(callback);
|
|
14112
13729
|
} catch (e) {
|
|
14113
|
-
callback(failCause$
|
|
13730
|
+
callback(failCause$2(die$1(e)));
|
|
14114
13731
|
}
|
|
14115
13732
|
}
|
|
14116
13733
|
pushStack(cont) {
|
|
@@ -14154,10 +13771,10 @@ class FiberRuntime extends Class {
|
|
|
14154
13771
|
return sync$1(() => unsafeGet$1(this.currentContext, op));
|
|
14155
13772
|
}
|
|
14156
13773
|
["Left"](op) {
|
|
14157
|
-
return fail$
|
|
13774
|
+
return fail$1(op.left);
|
|
14158
13775
|
}
|
|
14159
13776
|
["None"](_) {
|
|
14160
|
-
return fail$
|
|
13777
|
+
return fail$1(new NoSuchElementException());
|
|
14161
13778
|
}
|
|
14162
13779
|
["Right"](op) {
|
|
14163
13780
|
return exitSucceed$1(op.right);
|
|
@@ -14176,21 +13793,21 @@ class FiberRuntime extends Class {
|
|
|
14176
13793
|
switch (exit.cause._tag) {
|
|
14177
13794
|
case "Interrupt":
|
|
14178
13795
|
{
|
|
14179
|
-
return resume(exitFailCause$1(interrupt$
|
|
13796
|
+
return resume(exitFailCause$1(interrupt$2(none$2)));
|
|
14180
13797
|
}
|
|
14181
13798
|
case "Fail":
|
|
14182
13799
|
{
|
|
14183
|
-
return resume(fail$
|
|
13800
|
+
return resume(fail$1(exit.cause.error));
|
|
14184
13801
|
}
|
|
14185
13802
|
case "Die":
|
|
14186
13803
|
{
|
|
14187
|
-
return resume(die
|
|
13804
|
+
return resume(die(exit.cause.defect));
|
|
14188
13805
|
}
|
|
14189
13806
|
}
|
|
14190
13807
|
});
|
|
14191
13808
|
return unsafeAsync(abortResume => {
|
|
14192
13809
|
resume = _ => {
|
|
14193
|
-
abortResume(void_$
|
|
13810
|
+
abortResume(void_$1);
|
|
14194
13811
|
};
|
|
14195
13812
|
fiber.unsafeInterrupt();
|
|
14196
13813
|
});
|
|
@@ -14399,7 +14016,7 @@ class FiberRuntime extends Class {
|
|
|
14399
14016
|
const level = this.getFiberRef(currentVersionMismatchErrorLogLevel);
|
|
14400
14017
|
if (level._tag === "Some") {
|
|
14401
14018
|
const effectVersion = cur[EffectTypeId]._V;
|
|
14402
|
-
this.log(`Executing an Effect versioned ${effectVersion} with a Runtime of version ${getCurrentVersion()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`, empty$
|
|
14019
|
+
this.log(`Executing an Effect versioned ${effectVersion} with a Runtime of version ${getCurrentVersion()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`, empty$8, level);
|
|
14403
14020
|
}
|
|
14404
14021
|
}
|
|
14405
14022
|
// @ts-expect-error
|
|
@@ -14411,15 +14028,15 @@ class FiberRuntime extends Class {
|
|
|
14411
14028
|
return YieldedOp;
|
|
14412
14029
|
}
|
|
14413
14030
|
yieldedOpChannel.currentOp = null;
|
|
14414
|
-
return op._op === OP_SUCCESS || op._op === OP_FAILURE ? op : exitFailCause$1(die$
|
|
14031
|
+
return op._op === OP_SUCCESS || op._op === OP_FAILURE ? op : exitFailCause$1(die$1(op));
|
|
14415
14032
|
}
|
|
14416
14033
|
} catch (e) {
|
|
14417
14034
|
if (cur !== YieldedOp && !hasProperty(cur, "_op") || !(cur._op in this)) {
|
|
14418
14035
|
cur = dieMessage$1(`Not a valid effect: ${toStringUnknown(cur)}`);
|
|
14419
14036
|
} else if (isInterruptedException(e)) {
|
|
14420
|
-
cur = exitFailCause$1(sequential$2(die$
|
|
14037
|
+
cur = exitFailCause$1(sequential$2(die$1(e), interrupt$2(none$2)));
|
|
14421
14038
|
} else {
|
|
14422
|
-
cur = die
|
|
14039
|
+
cur = die(e);
|
|
14423
14040
|
}
|
|
14424
14041
|
}
|
|
14425
14042
|
}
|
|
@@ -14466,7 +14083,7 @@ const tracerLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Lo
|
|
|
14466
14083
|
span.value.event(toStringUnknown(Array.isArray(message) && message.length === 1 ? message[0] : message), clockService.unsafeCurrentTimeNanos(), attributes);
|
|
14467
14084
|
}));
|
|
14468
14085
|
/** @internal */
|
|
14469
|
-
const currentLoggers = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLoggers"), () => fiberRefUnsafeMakeHashSet(make$
|
|
14086
|
+
const currentLoggers = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLoggers"), () => fiberRefUnsafeMakeHashSet(make$j(defaultLogger, tracerLogger)));
|
|
14470
14087
|
// === all
|
|
14471
14088
|
const allResolveInput = input => {
|
|
14472
14089
|
if (Array.isArray(input) || isIterable(input)) {
|
|
@@ -14508,11 +14125,11 @@ const allValidate = (effects, reconcile, options) => {
|
|
|
14508
14125
|
}
|
|
14509
14126
|
}
|
|
14510
14127
|
if (errored) {
|
|
14511
|
-
return reconcile._tag === "Some" ? fail$
|
|
14128
|
+
return reconcile._tag === "Some" ? fail$1(reconcile.value(errors)) : fail$1(errors);
|
|
14512
14129
|
} else if (options?.discard) {
|
|
14513
|
-
return void_$
|
|
14130
|
+
return void_$1;
|
|
14514
14131
|
}
|
|
14515
|
-
return reconcile._tag === "Some" ? succeed$
|
|
14132
|
+
return reconcile._tag === "Some" ? succeed$2(reconcile.value(successes)) : succeed$2(successes);
|
|
14516
14133
|
});
|
|
14517
14134
|
};
|
|
14518
14135
|
const allEither = (effects, reconcile, options) => {
|
|
@@ -14528,7 +14145,7 @@ const allEither = (effects, reconcile, options) => {
|
|
|
14528
14145
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
14529
14146
|
});
|
|
14530
14147
|
}
|
|
14531
|
-
return map$
|
|
14148
|
+
return map$2(forEach$1(eitherEffects, identity, {
|
|
14532
14149
|
concurrency: options?.concurrency,
|
|
14533
14150
|
batching: options?.batching,
|
|
14534
14151
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
@@ -14542,7 +14159,7 @@ const all$1 = (arg, options) => {
|
|
|
14542
14159
|
} else if (options?.mode === "either") {
|
|
14543
14160
|
return allEither(effects, reconcile, options);
|
|
14544
14161
|
}
|
|
14545
|
-
return options?.discard !== true && reconcile._tag === "Some" ? map$
|
|
14162
|
+
return options?.discard !== true && reconcile._tag === "Some" ? map$2(forEach$1(effects, identity, options), reconcile.value) : forEach$1(effects, identity, options);
|
|
14546
14163
|
};
|
|
14547
14164
|
/* @internal */
|
|
14548
14165
|
const forEach$1 = /*#__PURE__*/dual(args => isIterable(args[0]), (self, f, options) => withFiberRuntime$1(r => {
|
|
@@ -14557,14 +14174,14 @@ const forEachParUnbounded = (self, f, batching) => suspend$1(() => {
|
|
|
14557
14174
|
const as = fromIterable$6(self);
|
|
14558
14175
|
const array = new Array(as.length);
|
|
14559
14176
|
const fn = (a, i) => flatMap$2(f(a, i), b => sync$1(() => array[i] = b));
|
|
14560
|
-
return zipRight$
|
|
14177
|
+
return zipRight$1(forEachConcurrentDiscard(as, fn, batching, false), succeed$2(array));
|
|
14561
14178
|
});
|
|
14562
14179
|
/** @internal */
|
|
14563
14180
|
const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterruptibleMask$2(restore => transplant(graft => withFiberRuntime$1(parent => {
|
|
14564
14181
|
let todos = Array.from(self).reverse();
|
|
14565
14182
|
let target = todos.length;
|
|
14566
14183
|
if (target === 0) {
|
|
14567
|
-
return void_$
|
|
14184
|
+
return void_$1;
|
|
14568
14185
|
}
|
|
14569
14186
|
let counter = 0;
|
|
14570
14187
|
let interrupted = false;
|
|
@@ -14640,7 +14257,7 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14640
14257
|
return returnNextElement();
|
|
14641
14258
|
}
|
|
14642
14259
|
}
|
|
14643
|
-
return succeed$
|
|
14260
|
+
return succeed$2(res);
|
|
14644
14261
|
};
|
|
14645
14262
|
const todo = flatMap$2(stepOrExit(restore(f(a, index))), onRes);
|
|
14646
14263
|
const fiber = runFiber(todo);
|
|
@@ -14662,13 +14279,13 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14662
14279
|
fibers.delete(fiber);
|
|
14663
14280
|
pushResult(exit, index);
|
|
14664
14281
|
if (results.length === target) {
|
|
14665
|
-
resume(succeed$
|
|
14282
|
+
resume(succeed$2(getOrElse(exitCollectAll(collectExits(), {
|
|
14666
14283
|
parallel: true
|
|
14667
14284
|
}), () => exitVoid$1)));
|
|
14668
14285
|
} else if (residual.length + results.length === target) {
|
|
14669
14286
|
const exits = collectExits();
|
|
14670
14287
|
const requests = residual.map(blocked => blocked.effect_instruction_i0).reduce(par);
|
|
14671
|
-
resume(succeed$
|
|
14288
|
+
resume(succeed$2(blocked(requests, forEachConcurrentDiscard([getOrElse(exitCollectAll(exits, {
|
|
14672
14289
|
parallel: true
|
|
14673
14290
|
}), () => exitVoid$1), ...residual.map(blocked => blocked.effect_instruction_i1)], i => i, batching, true, n))));
|
|
14674
14291
|
} else {
|
|
@@ -14717,8 +14334,8 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14717
14334
|
const forEachParN = (self, n, f, batching) => suspend$1(() => {
|
|
14718
14335
|
const as = fromIterable$6(self);
|
|
14719
14336
|
const array = new Array(as.length);
|
|
14720
|
-
const fn = (a, i) => map$
|
|
14721
|
-
return zipRight$
|
|
14337
|
+
const fn = (a, i) => map$2(f(a, i), b => array[i] = b);
|
|
14338
|
+
return zipRight$1(forEachConcurrentDiscard(as, fn, batching, false, n), succeed$2(array));
|
|
14722
14339
|
});
|
|
14723
14340
|
/* @internal */
|
|
14724
14341
|
const forkDaemon$1 = self => forkWithScopeOverride(self, globalScope);
|
|
@@ -14735,7 +14352,7 @@ const unsafeForkUnstarted = (effect, parentFiber, parentRuntimeFlags, overrideSc
|
|
|
14735
14352
|
};
|
|
14736
14353
|
/** @internal */
|
|
14737
14354
|
const unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
|
|
14738
|
-
const childId = unsafeMake$
|
|
14355
|
+
const childId = unsafeMake$4();
|
|
14739
14356
|
const parentFiberRefs = parentFiber.getFiberRefs();
|
|
14740
14357
|
const childFiberRefs = forkAs(parentFiberRefs, childId);
|
|
14741
14358
|
const childFiber = new FiberRuntime(childId, childFiberRefs, parentRuntimeFlags);
|
|
@@ -14748,9 +14365,9 @@ const unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideS
|
|
|
14748
14365
|
return childFiber;
|
|
14749
14366
|
};
|
|
14750
14367
|
/* @internal */
|
|
14751
|
-
const forkWithScopeOverride = (self, scopeOverride) => withFiberRuntime$1((parentFiber, parentStatus) => succeed$
|
|
14368
|
+
const forkWithScopeOverride = (self, scopeOverride) => withFiberRuntime$1((parentFiber, parentStatus) => succeed$2(unsafeFork$1(self, parentFiber, parentStatus.runtimeFlags, scopeOverride)));
|
|
14752
14369
|
/* @internal */
|
|
14753
|
-
const parallelFinalizers = self => contextWithEffect(context => match$
|
|
14370
|
+
const parallelFinalizers = self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14754
14371
|
onNone: () => self,
|
|
14755
14372
|
onSome: scope => {
|
|
14756
14373
|
switch (scope.strategy._tag) {
|
|
@@ -14763,7 +14380,7 @@ const parallelFinalizers = self => contextWithEffect(context => match$6(getOptio
|
|
|
14763
14380
|
}
|
|
14764
14381
|
}));
|
|
14765
14382
|
/* @internal */
|
|
14766
|
-
const parallelNFinalizers = parallelism => self => contextWithEffect(context => match$
|
|
14383
|
+
const parallelNFinalizers = parallelism => self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14767
14384
|
onNone: () => self,
|
|
14768
14385
|
onSome: scope => {
|
|
14769
14386
|
if (scope.strategy._tag === "ParallelN" && scope.strategy.parallelism === parallelism) {
|
|
@@ -14773,7 +14390,7 @@ const parallelNFinalizers = parallelism => self => contextWithEffect(context =>
|
|
|
14773
14390
|
}
|
|
14774
14391
|
}));
|
|
14775
14392
|
/* @internal */
|
|
14776
|
-
const finalizersMaskInternal = (strategy, concurrentFinalizers) => self => contextWithEffect(context => match$
|
|
14393
|
+
const finalizersMaskInternal = (strategy, concurrentFinalizers) => self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14777
14394
|
onNone: () => self(identity),
|
|
14778
14395
|
onSome: scope => {
|
|
14779
14396
|
if (concurrentFinalizers === true) {
|
|
@@ -14796,7 +14413,7 @@ const scopeWith = f => flatMap$2(scopeTag, f);
|
|
|
14796
14413
|
/** @internal */
|
|
14797
14414
|
const scopedWith$1 = f => flatMap$2(scopeMake(), scope => onExit$1(f(scope), exit => scope.close(exit)));
|
|
14798
14415
|
/* @internal */
|
|
14799
|
-
const sequentialFinalizers = self => contextWithEffect(context => match$
|
|
14416
|
+
const sequentialFinalizers = self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14800
14417
|
onNone: () => self,
|
|
14801
14418
|
onSome: scope => {
|
|
14802
14419
|
switch (scope.strategy._tag) {
|
|
@@ -14820,12 +14437,12 @@ const zipLeftOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, tha
|
|
|
14820
14437
|
/** @internal */
|
|
14821
14438
|
const zipRightOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, options) => {
|
|
14822
14439
|
if (options?.concurrent !== true && (options?.batching === undefined || options.batching === false)) {
|
|
14823
|
-
return zipRight$
|
|
14440
|
+
return zipRight$1(self, that);
|
|
14824
14441
|
}
|
|
14825
14442
|
return zipWithOptions(self, that, (_, b) => b, options);
|
|
14826
14443
|
});
|
|
14827
14444
|
/** @internal */
|
|
14828
|
-
const zipWithOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, f, options) => map$
|
|
14445
|
+
const zipWithOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, f, options) => map$2(all$1([self, that], {
|
|
14829
14446
|
concurrency: options?.concurrent ? 2 : 1,
|
|
14830
14447
|
batching: options?.batching,
|
|
14831
14448
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
@@ -14867,7 +14484,7 @@ const ScopeImplProto = {
|
|
|
14867
14484
|
close(exit) {
|
|
14868
14485
|
return suspend$1(() => {
|
|
14869
14486
|
if (this.state._tag === "Closed") {
|
|
14870
|
-
return void_$
|
|
14487
|
+
return void_$1;
|
|
14871
14488
|
}
|
|
14872
14489
|
const finalizers = Array.from(this.state.finalizers.values()).reverse();
|
|
14873
14490
|
this.state = {
|
|
@@ -14875,13 +14492,13 @@ const ScopeImplProto = {
|
|
|
14875
14492
|
exit
|
|
14876
14493
|
};
|
|
14877
14494
|
if (finalizers.length === 0) {
|
|
14878
|
-
return void_$
|
|
14495
|
+
return void_$1;
|
|
14879
14496
|
}
|
|
14880
|
-
return isSequential(this.strategy) ? pipe(forEachSequential(finalizers, fin => exit$1(fin(exit))), flatMap$2(results => pipe(exitCollectAll(results), map$
|
|
14497
|
+
return isSequential(this.strategy) ? pipe(forEachSequential(finalizers, fin => exit$1(fin(exit))), flatMap$2(results => pipe(exitCollectAll(results), map$8(exitAsVoid), getOrElse(() => exitVoid$1)))) : isParallel(this.strategy) ? pipe(forEachParUnbounded(finalizers, fin => exit$1(fin(exit)), false), flatMap$2(results => pipe(exitCollectAll(results, {
|
|
14881
14498
|
parallel: true
|
|
14882
|
-
}), map$
|
|
14499
|
+
}), map$8(exitAsVoid), getOrElse(() => exitVoid$1)))) : pipe(forEachParN(finalizers, this.strategy.parallelism, fin => exit$1(fin(exit)), false), flatMap$2(results => pipe(exitCollectAll(results, {
|
|
14883
14500
|
parallel: true
|
|
14884
|
-
}), map$
|
|
14501
|
+
}), map$8(exitAsVoid), getOrElse(() => exitVoid$1))));
|
|
14885
14502
|
});
|
|
14886
14503
|
},
|
|
14887
14504
|
addFinalizer(fin) {
|
|
@@ -14890,7 +14507,7 @@ const ScopeImplProto = {
|
|
|
14890
14507
|
return fin(this.state.exit);
|
|
14891
14508
|
}
|
|
14892
14509
|
this.state.finalizers.set({}, fin);
|
|
14893
|
-
return void_$
|
|
14510
|
+
return void_$1;
|
|
14894
14511
|
});
|
|
14895
14512
|
}
|
|
14896
14513
|
};
|
|
@@ -14908,7 +14525,7 @@ const scopeMake = (strategy = sequential$1) => sync$1(() => scopeUnsafeMake(stra
|
|
|
14908
14525
|
/* @internal */
|
|
14909
14526
|
const scopeExtend = /*#__PURE__*/dual(2, (effect, scope) => mapInputContext(effect,
|
|
14910
14527
|
// @ts-expect-error
|
|
14911
|
-
merge$1(make$
|
|
14528
|
+
merge$1(make$o(scopeTag, scope))));
|
|
14912
14529
|
// circular with Supervisor
|
|
14913
14530
|
/** @internal */
|
|
14914
14531
|
const fiberRefUnsafeMakeSupervisor = initial => fiberRefUnsafeMakePatch(initial, {
|
|
@@ -14963,7 +14580,7 @@ const race$1 = /*#__PURE__*/dual(2, (self, that) => fiberIdWith$1(parentFiberId
|
|
|
14963
14580
|
/** @internal */
|
|
14964
14581
|
const raceFibersWith = /*#__PURE__*/dual(3, (self, other, options) => withFiberRuntime$1((parentFiber, parentStatus) => {
|
|
14965
14582
|
const parentRuntimeFlags = parentStatus.runtimeFlags;
|
|
14966
|
-
const raceIndicator = make$
|
|
14583
|
+
const raceIndicator = make$i(true);
|
|
14967
14584
|
const leftFiber = unsafeMakeChildFiber(self, parentFiber, parentRuntimeFlags, options.selfScope);
|
|
14968
14585
|
const rightFiber = unsafeMakeChildFiber(other, parentFiber, parentRuntimeFlags, options.otherScope);
|
|
14969
14586
|
return async_(cb => {
|
|
@@ -14981,8 +14598,8 @@ const completeRace = (winner, loser, cont, ab, cb) => {
|
|
|
14981
14598
|
/** @internal */
|
|
14982
14599
|
const ensuring$1 = /*#__PURE__*/dual(2, (self, finalizer) => uninterruptibleMask$2(restore => matchCauseEffect$2(restore(self), {
|
|
14983
14600
|
onFailure: cause1 => matchCauseEffect$2(finalizer, {
|
|
14984
|
-
onFailure: cause2 => failCause$
|
|
14985
|
-
onSuccess: () => failCause$
|
|
14601
|
+
onFailure: cause2 => failCause$2(sequential$2(cause1, cause2)),
|
|
14602
|
+
onSuccess: () => failCause$2(cause1)
|
|
14986
14603
|
}),
|
|
14987
14604
|
onSuccess: a => as$1(finalizer, a)
|
|
14988
14605
|
})));
|
|
@@ -15130,7 +14747,7 @@ const make$3 = intervals => {
|
|
|
15130
14747
|
};
|
|
15131
14748
|
};
|
|
15132
14749
|
/** @internal */
|
|
15133
|
-
const intersect$2 = /*#__PURE__*/dual(2, (self, that) => intersectLoop(self.intervals, that.intervals, empty$
|
|
14750
|
+
const intersect$2 = /*#__PURE__*/dual(2, (self, that) => intersectLoop(self.intervals, that.intervals, empty$i()));
|
|
15134
14751
|
/** @internal */
|
|
15135
14752
|
const intersectLoop = (_left, _right, _acc) => {
|
|
15136
14753
|
let left = _left;
|
|
@@ -15343,7 +14960,7 @@ class Semaphore {
|
|
|
15343
14960
|
}
|
|
15344
14961
|
this.waiters.delete(observer);
|
|
15345
14962
|
this.taken += n;
|
|
15346
|
-
resume(succeed$
|
|
14963
|
+
resume(succeed$2(n));
|
|
15347
14964
|
};
|
|
15348
14965
|
this.waiters.add(observer);
|
|
15349
14966
|
return sync$1(() => {
|
|
@@ -15351,7 +14968,7 @@ class Semaphore {
|
|
|
15351
14968
|
});
|
|
15352
14969
|
}
|
|
15353
14970
|
this.taken += n;
|
|
15354
|
-
return resume(succeed$
|
|
14971
|
+
return resume(succeed$2(n));
|
|
15355
14972
|
});
|
|
15356
14973
|
updateTakenUnsafe(fiber, f) {
|
|
15357
14974
|
this.taken = f(this.taken);
|
|
@@ -15365,7 +14982,7 @@ class Semaphore {
|
|
|
15365
14982
|
}
|
|
15366
14983
|
}, fiber.getFiberRef(currentSchedulingPriority));
|
|
15367
14984
|
}
|
|
15368
|
-
return succeed$
|
|
14985
|
+
return succeed$2(this.free);
|
|
15369
14986
|
}
|
|
15370
14987
|
updateTaken(f) {
|
|
15371
14988
|
return withFiberRuntime$1(fiber => this.updateTakenUnsafe(fiber, f));
|
|
@@ -15373,7 +14990,7 @@ class Semaphore {
|
|
|
15373
14990
|
resize = permits => asVoid$1(withFiberRuntime$1(fiber => {
|
|
15374
14991
|
this.permits = permits;
|
|
15375
14992
|
if (this.free < 0) {
|
|
15376
|
-
return void_$
|
|
14993
|
+
return void_$1;
|
|
15377
14994
|
}
|
|
15378
14995
|
return this.updateTakenUnsafe(fiber, taken => taken);
|
|
15379
14996
|
}));
|
|
@@ -15397,7 +15014,7 @@ const forkIn$1 = /*#__PURE__*/dual(2, (self, scope) => withFiberRuntime$1((paren
|
|
|
15397
15014
|
const scopeImpl = scope;
|
|
15398
15015
|
const fiber = unsafeFork$1(self, parent, parentStatus.runtimeFlags, globalScope);
|
|
15399
15016
|
if (scopeImpl.state._tag === "Open") {
|
|
15400
|
-
const finalizer = () => fiberIdWith$1(fiberId => equals$1(fiberId, fiber.id()) ? void_$
|
|
15017
|
+
const finalizer = () => fiberIdWith$1(fiberId => equals$1(fiberId, fiber.id()) ? void_$1 : asVoid$1(interruptFiber(fiber)));
|
|
15401
15018
|
const key = {};
|
|
15402
15019
|
scopeImpl.state.finalizers.set(key, finalizer);
|
|
15403
15020
|
fiber.addObserver(() => {
|
|
@@ -15407,7 +15024,7 @@ const forkIn$1 = /*#__PURE__*/dual(2, (self, scope) => withFiberRuntime$1((paren
|
|
|
15407
15024
|
} else {
|
|
15408
15025
|
fiber.unsafeInterruptAsFork(parent.id());
|
|
15409
15026
|
}
|
|
15410
|
-
return succeed$
|
|
15027
|
+
return succeed$2(fiber);
|
|
15411
15028
|
}));
|
|
15412
15029
|
/** @internal */
|
|
15413
15030
|
const raceFirst$1 = /*#__PURE__*/dual(2, (self, that) => pipe(exit$1(self), race$1(exit$1(that)), effect => flatten$1(effect)));
|
|
@@ -15439,7 +15056,7 @@ class SynchronizedImpl extends Class {
|
|
|
15439
15056
|
return this.get;
|
|
15440
15057
|
}
|
|
15441
15058
|
modify(f) {
|
|
15442
|
-
return this.modifyEffect(a => succeed$
|
|
15059
|
+
return this.modifyEffect(a => succeed$2(f(a)));
|
|
15443
15060
|
}
|
|
15444
15061
|
modifyEffect(f) {
|
|
15445
15062
|
return this.withLock(pipe(flatMap$2(get(this.ref), f), flatMap$2(([b, a]) => as$1(set(this.ref, a), b))));
|
|
@@ -15473,7 +15090,7 @@ const makeDual = f => function () {
|
|
|
15473
15090
|
};
|
|
15474
15091
|
/** @internal */
|
|
15475
15092
|
const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
15476
|
-
const fiberId = unsafeMake$
|
|
15093
|
+
const fiberId = unsafeMake$4();
|
|
15477
15094
|
const fiberRefUpdates = [[currentContext, [[fiberId, runtime.context]]]];
|
|
15478
15095
|
if (options?.scheduler) {
|
|
15479
15096
|
fiberRefUpdates.push([currentScheduler, [[fiberId, options.scheduler]]]);
|
|
@@ -15488,7 +15105,7 @@ const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
|
15488
15105
|
const fiberRuntime = new FiberRuntime(fiberId, fiberRefs, runtime.runtimeFlags);
|
|
15489
15106
|
let effect = self;
|
|
15490
15107
|
if (options?.scope) {
|
|
15491
|
-
effect = flatMap$2(fork(options.scope, sequential$1), closeableScope => zipRight$
|
|
15108
|
+
effect = flatMap$2(fork(options.scope, sequential$1), closeableScope => zipRight$1(scopeAddFinalizer(closeableScope, fiberIdWith$1(id => equals$1(id, fiberRuntime.id()) ? void_$1 : interruptAsFiber(fiberRuntime, id))), onExit$1(self, exit => close(closeableScope, exit))));
|
|
15492
15109
|
}
|
|
15493
15110
|
const supervisor = fiberRuntime.currentSupervisor;
|
|
15494
15111
|
// we can compare by reference here as _supervisor.none is wrapped with globalValue
|
|
@@ -15506,6 +15123,31 @@ const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
|
15506
15123
|
return fiberRuntime;
|
|
15507
15124
|
});
|
|
15508
15125
|
/** @internal */
|
|
15126
|
+
const unsafeRunSync = /*#__PURE__*/makeDual((runtime, effect) => {
|
|
15127
|
+
const result = unsafeRunSyncExit(runtime)(effect);
|
|
15128
|
+
if (result._tag === "Failure") {
|
|
15129
|
+
throw fiberFailure(result.effect_instruction_i0);
|
|
15130
|
+
}
|
|
15131
|
+
return result.effect_instruction_i0;
|
|
15132
|
+
});
|
|
15133
|
+
class AsyncFiberExceptionImpl extends Error {
|
|
15134
|
+
fiber;
|
|
15135
|
+
_tag = "AsyncFiberException";
|
|
15136
|
+
constructor(fiber) {
|
|
15137
|
+
super(`Fiber #${fiber.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);
|
|
15138
|
+
this.fiber = fiber;
|
|
15139
|
+
this.name = this._tag;
|
|
15140
|
+
this.stack = this.message;
|
|
15141
|
+
}
|
|
15142
|
+
}
|
|
15143
|
+
const asyncFiberException = fiber => {
|
|
15144
|
+
const limit = Error.stackTraceLimit;
|
|
15145
|
+
Error.stackTraceLimit = 0;
|
|
15146
|
+
const error = new AsyncFiberExceptionImpl(fiber);
|
|
15147
|
+
Error.stackTraceLimit = limit;
|
|
15148
|
+
return error;
|
|
15149
|
+
};
|
|
15150
|
+
/** @internal */
|
|
15509
15151
|
const FiberFailureId = /*#__PURE__*/Symbol.for("effect/Runtime/FiberFailure");
|
|
15510
15152
|
/** @internal */
|
|
15511
15153
|
const FiberFailureCauseId = /*#__PURE__*/Symbol.for("effect/Runtime/FiberFailure/Cause");
|
|
@@ -15574,6 +15216,23 @@ const fastPath = effect => {
|
|
|
15574
15216
|
}
|
|
15575
15217
|
};
|
|
15576
15218
|
/** @internal */
|
|
15219
|
+
const unsafeRunSyncExit = /*#__PURE__*/makeDual((runtime, effect) => {
|
|
15220
|
+
const op = fastPath(effect);
|
|
15221
|
+
if (op) {
|
|
15222
|
+
return op;
|
|
15223
|
+
}
|
|
15224
|
+
const scheduler = new SyncScheduler();
|
|
15225
|
+
const fiberRuntime = unsafeFork(runtime)(effect, {
|
|
15226
|
+
scheduler
|
|
15227
|
+
});
|
|
15228
|
+
scheduler.flush();
|
|
15229
|
+
const result = fiberRuntime.unsafePoll();
|
|
15230
|
+
if (result) {
|
|
15231
|
+
return result;
|
|
15232
|
+
}
|
|
15233
|
+
return exitDie$1(capture(asyncFiberException(fiberRuntime), currentSpanFromFiber(fiberRuntime)));
|
|
15234
|
+
});
|
|
15235
|
+
/** @internal */
|
|
15577
15236
|
const unsafeRunPromise = /*#__PURE__*/makeDual((runtime, effect, options) => unsafeRunPromiseExit(runtime, effect, options).then(result => {
|
|
15578
15237
|
switch (result._tag) {
|
|
15579
15238
|
case OP_SUCCESS:
|
|
@@ -15625,12 +15284,12 @@ class RuntimeImpl {
|
|
|
15625
15284
|
/** @internal */
|
|
15626
15285
|
const make = options => new RuntimeImpl(options.context, options.runtimeFlags, options.fiberRefs);
|
|
15627
15286
|
/** @internal */
|
|
15628
|
-
const runtime$1 = () => withFiberRuntime$1((state, status) => succeed$
|
|
15287
|
+
const runtime$1 = () => withFiberRuntime$1((state, status) => succeed$2(new RuntimeImpl(state.getFiberRef(currentContext), status.runtimeFlags, state.getFiberRefs())));
|
|
15629
15288
|
/** @internal */
|
|
15630
|
-
const defaultRuntimeFlags = /*#__PURE__*/make$
|
|
15289
|
+
const defaultRuntimeFlags = /*#__PURE__*/make$f(Interruption, CooperativeYielding, RuntimeMetrics);
|
|
15631
15290
|
/** @internal */
|
|
15632
15291
|
const defaultRuntime = /*#__PURE__*/make({
|
|
15633
|
-
context: /*#__PURE__*/empty$
|
|
15292
|
+
context: /*#__PURE__*/empty$j(),
|
|
15634
15293
|
runtimeFlags: defaultRuntimeFlags,
|
|
15635
15294
|
fiberRefs: /*#__PURE__*/empty$4()
|
|
15636
15295
|
});
|
|
@@ -15638,6 +15297,8 @@ const defaultRuntime = /*#__PURE__*/make({
|
|
|
15638
15297
|
const unsafeForkEffect = /*#__PURE__*/unsafeFork(defaultRuntime);
|
|
15639
15298
|
/** @internal */
|
|
15640
15299
|
const unsafeRunPromiseEffect = /*#__PURE__*/unsafeRunPromise(defaultRuntime);
|
|
15300
|
+
/** @internal */
|
|
15301
|
+
const unsafeRunSyncEffect = /*#__PURE__*/unsafeRunSync(defaultRuntime);
|
|
15641
15302
|
|
|
15642
15303
|
/** @internal */
|
|
15643
15304
|
const modifyEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(f));
|
|
@@ -15697,26 +15358,26 @@ class MemoMapImpl {
|
|
|
15697
15358
|
if (inMap !== undefined) {
|
|
15698
15359
|
const [acquire, release] = inMap;
|
|
15699
15360
|
const cached = pipe(acquire, flatMap$2(([patch, b]) => pipe(patchFiberRefs(patch), as$1(b))), onExit$1(exitMatch({
|
|
15700
|
-
onFailure: () => void_$
|
|
15361
|
+
onFailure: () => void_$1,
|
|
15701
15362
|
onSuccess: () => scopeAddFinalizerExit(scope, release)
|
|
15702
15363
|
})));
|
|
15703
|
-
return succeed$
|
|
15364
|
+
return succeed$2([cached, map]);
|
|
15704
15365
|
}
|
|
15705
|
-
return pipe(make$a(0), flatMap$2(observers => pipe(deferredMake(), flatMap$2(deferred => pipe(make$a(() => void_$
|
|
15366
|
+
return pipe(make$a(0), flatMap$2(observers => pipe(deferredMake(), flatMap$2(deferred => pipe(make$a(() => void_$1), map$2(finalizerRef => {
|
|
15706
15367
|
const resource = uninterruptibleMask$2(restore => pipe(scopeMake(), flatMap$2(innerScope => pipe(restore(flatMap$2(makeBuilder(layer, innerScope, true), f => diffFiberRefs(f(this)))), exit$1, flatMap$2(exit => {
|
|
15707
15368
|
switch (exit._tag) {
|
|
15708
15369
|
case OP_FAILURE:
|
|
15709
15370
|
{
|
|
15710
|
-
return pipe(deferredFailCause(deferred, exit.effect_instruction_i0), zipRight$
|
|
15371
|
+
return pipe(deferredFailCause(deferred, exit.effect_instruction_i0), zipRight$1(scopeClose(innerScope, exit)), zipRight$1(failCause$2(exit.effect_instruction_i0)));
|
|
15711
15372
|
}
|
|
15712
15373
|
case OP_SUCCESS:
|
|
15713
15374
|
{
|
|
15714
|
-
return pipe(set(finalizerRef, exit => pipe(scopeClose(innerScope, exit), whenEffect(modify(observers, n => [n === 1, n - 1])), asVoid$1)), zipRight$
|
|
15375
|
+
return pipe(set(finalizerRef, exit => pipe(scopeClose(innerScope, exit), whenEffect(modify(observers, n => [n === 1, n - 1])), asVoid$1)), zipRight$1(update$1(observers, n => n + 1)), zipRight$1(scopeAddFinalizerExit(scope, exit => pipe(sync$1(() => map.delete(layer)), zipRight$1(get(finalizerRef)), flatMap$2(finalizer => finalizer(exit))))), zipRight$1(deferredSucceed(deferred, exit.effect_instruction_i0)), as$1(exit.effect_instruction_i0[1]));
|
|
15715
15376
|
}
|
|
15716
15377
|
}
|
|
15717
15378
|
})))));
|
|
15718
15379
|
const memoized = [pipe(deferredAwait(deferred), onExit$1(exitMatchEffect({
|
|
15719
|
-
onFailure: () => void_$
|
|
15380
|
+
onFailure: () => void_$1,
|
|
15720
15381
|
onSuccess: () => update$1(observers, n => n + 1)
|
|
15721
15382
|
}))), exit => pipe(get(finalizerRef), flatMap$2(finalizer => finalizer(exit)))];
|
|
15722
15383
|
return [resource, isFresh(layer) ? map : map.set(layer, memoized)];
|
|
@@ -15725,7 +15386,7 @@ class MemoMapImpl {
|
|
|
15725
15386
|
}
|
|
15726
15387
|
}
|
|
15727
15388
|
/** @internal */
|
|
15728
|
-
const makeMemoMap = /*#__PURE__*/suspend$1(() => map$
|
|
15389
|
+
const makeMemoMap = /*#__PURE__*/suspend$1(() => map$2(makeSynchronized(new Map()), ref => new MemoMapImpl(ref)));
|
|
15729
15390
|
/** @internal */
|
|
15730
15391
|
const unsafeMakeMemoMap = () => new MemoMapImpl(unsafeMakeSynchronized(new Map()));
|
|
15731
15392
|
/** @internal */
|
|
@@ -15788,9 +15449,9 @@ const makeBuilder = (self, scope, inMemoMap = false) => {
|
|
|
15788
15449
|
case "MergeAll":
|
|
15789
15450
|
{
|
|
15790
15451
|
const layers = op.layers;
|
|
15791
|
-
return map$
|
|
15452
|
+
return map$2(scopeFork(scope, parallel$1), parallelScope => memoMap => {
|
|
15792
15453
|
const contexts = new Array(layers.length);
|
|
15793
|
-
return map$
|
|
15454
|
+
return map$2(forEachConcurrentDiscard(layers, fnUntraced(function* (layer, i) {
|
|
15794
15455
|
const scope = yield* scopeFork(parallelScope, sequential$1);
|
|
15795
15456
|
const context = yield* memoMap.getOrElseMemoize(layer, scope);
|
|
15796
15457
|
contexts[i] = context;
|
|
@@ -15824,7 +15485,7 @@ const provideSomeRuntime = /*#__PURE__*/dual(2, (self, rt) => {
|
|
|
15824
15485
|
return ensuring$1(provideSomeContext(restore(self), merge$1(oldContext, rt.context)), withFiberRuntime$1(fiber => {
|
|
15825
15486
|
fiber.setFiberRefs(patch$1(fiber.id(), fiber.getFiberRefs())(rollbackRefs));
|
|
15826
15487
|
fiber.currentRuntimeFlags = patch$4(rollbackFlags)(fiber.currentRuntimeFlags);
|
|
15827
|
-
return void_$
|
|
15488
|
+
return void_$1;
|
|
15828
15489
|
}));
|
|
15829
15490
|
}));
|
|
15830
15491
|
});
|
|
@@ -15925,7 +15586,7 @@ class ScheduleDriverImpl {
|
|
|
15925
15586
|
this.ref = ref;
|
|
15926
15587
|
}
|
|
15927
15588
|
get state() {
|
|
15928
|
-
return map$
|
|
15589
|
+
return map$2(get(this.ref), tuple => tuple[1]);
|
|
15929
15590
|
}
|
|
15930
15591
|
get last() {
|
|
15931
15592
|
return flatMap$2(get(this.ref), ([element, _]) => {
|
|
@@ -15936,7 +15597,7 @@ class ScheduleDriverImpl {
|
|
|
15936
15597
|
}
|
|
15937
15598
|
case "Some":
|
|
15938
15599
|
{
|
|
15939
|
-
return succeed$
|
|
15600
|
+
return succeed$2(element.value);
|
|
15940
15601
|
}
|
|
15941
15602
|
}
|
|
15942
15603
|
});
|
|
@@ -15946,17 +15607,17 @@ class ScheduleDriverImpl {
|
|
|
15946
15607
|
return set(this.ref, [none$4(), this.schedule.initial]).pipe(zipLeft$1(set(this.iterationMeta, defaultIterationMetadata)));
|
|
15947
15608
|
}
|
|
15948
15609
|
next(input) {
|
|
15949
|
-
return pipe(map$
|
|
15610
|
+
return pipe(map$2(get(this.ref), tuple => tuple[1]), flatMap$2(state => pipe(currentTimeMillis, flatMap$2(now => pipe(suspend$1(() => this.schedule.step(now, input, state)), flatMap$2(([state, out, decision]) => {
|
|
15950
15611
|
const setState = set(this.ref, [some(out), state]);
|
|
15951
15612
|
if (isDone(decision)) {
|
|
15952
|
-
return setState.pipe(zipRight$
|
|
15613
|
+
return setState.pipe(zipRight$1(fail$1(none$4())));
|
|
15953
15614
|
}
|
|
15954
15615
|
const millis$1 = start(decision.intervals) - now;
|
|
15955
15616
|
if (millis$1 <= 0) {
|
|
15956
|
-
return setState.pipe(zipRight$
|
|
15617
|
+
return setState.pipe(zipRight$1(updateInfo(this.iterationMeta, now, input, out)), as$1(out));
|
|
15957
15618
|
}
|
|
15958
15619
|
const duration = millis(millis$1);
|
|
15959
|
-
return pipe(setState, zipRight$
|
|
15620
|
+
return pipe(setState, zipRight$1(updateInfo(this.iterationMeta, now, input, out)), zipRight$1(sleep(duration)), as$1(out));
|
|
15960
15621
|
}))))));
|
|
15961
15622
|
}
|
|
15962
15623
|
}
|
|
@@ -15967,12 +15628,12 @@ const check = /*#__PURE__*/dual(2, (self, test) => checkEffect(self, (input, out
|
|
|
15967
15628
|
/** @internal */
|
|
15968
15629
|
const checkEffect = /*#__PURE__*/dual(2, (self, test) => makeWithState(self.initial, (now, input, state) => flatMap$2(self.step(now, input, state), ([state, out, decision]) => {
|
|
15969
15630
|
if (isDone(decision)) {
|
|
15970
|
-
return succeed$
|
|
15631
|
+
return succeed$2([state, out, done]);
|
|
15971
15632
|
}
|
|
15972
|
-
return map$
|
|
15633
|
+
return map$2(test(input, out), cont => cont ? [state, out, decision] : [state, out, done]);
|
|
15973
15634
|
})));
|
|
15974
15635
|
/** @internal */
|
|
15975
|
-
const driver = self => pipe(make$a([none$4(), self.initial]), map$
|
|
15636
|
+
const driver = self => pipe(make$a([none$4(), self.initial]), map$2(ref => new ScheduleDriverImpl(self, ref)));
|
|
15976
15637
|
/** @internal */
|
|
15977
15638
|
const intersect = /*#__PURE__*/dual(2, (self, that) => intersectWith(self, that, intersect$1));
|
|
15978
15639
|
/** @internal */
|
|
@@ -15980,25 +15641,25 @@ const intersectWith = /*#__PURE__*/dual(3, (self, that, f) => makeWithState([sel
|
|
|
15980
15641
|
if (isContinue(lDecision) && isContinue(rDecision)) {
|
|
15981
15642
|
return intersectWithLoop(self, that, input, lState, out, lDecision.intervals, rState, out2, rDecision.intervals, f);
|
|
15982
15643
|
}
|
|
15983
|
-
return succeed$
|
|
15644
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
15984
15645
|
}))));
|
|
15985
15646
|
/** @internal */
|
|
15986
15647
|
const intersectWithLoop = (self, that, input, lState, out, lInterval, rState, out2, rInterval, f) => {
|
|
15987
15648
|
const combined = f(lInterval, rInterval);
|
|
15988
15649
|
if (isNonEmpty(combined)) {
|
|
15989
|
-
return succeed$
|
|
15650
|
+
return succeed$2([[lState, rState], [out, out2], _continue(combined)]);
|
|
15990
15651
|
}
|
|
15991
15652
|
if (pipe(lInterval, lessThan(rInterval))) {
|
|
15992
15653
|
return flatMap$2(self.step(end(lInterval), input, lState), ([lState, out, decision]) => {
|
|
15993
15654
|
if (isDone(decision)) {
|
|
15994
|
-
return succeed$
|
|
15655
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
15995
15656
|
}
|
|
15996
15657
|
return intersectWithLoop(self, that, input, lState, out, decision.intervals, rState, out2, rInterval, f);
|
|
15997
15658
|
});
|
|
15998
15659
|
}
|
|
15999
15660
|
return flatMap$2(that.step(end(rInterval), input, rState), ([rState, out2, decision]) => {
|
|
16000
15661
|
if (isDone(decision)) {
|
|
16001
|
-
return succeed$
|
|
15662
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
16002
15663
|
}
|
|
16003
15664
|
return intersectWithLoop(self, that, input, lState, out, lInterval, rState, out2, decision.intervals, f);
|
|
16004
15665
|
});
|
|
@@ -16006,9 +15667,9 @@ const intersectWithLoop = (self, that, input, lState, out, lInterval, rState, ou
|
|
|
16006
15667
|
/** @internal */
|
|
16007
15668
|
const map$1 = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, out => sync$1(() => f(out))));
|
|
16008
15669
|
/** @internal */
|
|
16009
|
-
const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => flatMap$2(self.step(now, input, state), ([state, out, decision]) => map$
|
|
15670
|
+
const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => flatMap$2(self.step(now, input, state), ([state, out, decision]) => map$2(f(out), out2 => [state, out2, decision]))));
|
|
16010
15671
|
/** @internal */
|
|
16011
|
-
const passthrough = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), map$
|
|
15672
|
+
const passthrough = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), map$2(([state, _, decision]) => [state, input, decision])));
|
|
16012
15673
|
/** @internal */
|
|
16013
15674
|
const recurs = n => whileOutput(forever$1, out => out < n);
|
|
16014
15675
|
/** @internal */
|
|
@@ -16030,16 +15691,16 @@ class ScheduleDefect {
|
|
|
16030
15691
|
}
|
|
16031
15692
|
}
|
|
16032
15693
|
const isScheduleDefect = u => hasProperty(u, ScheduleDefectTypeId);
|
|
16033
|
-
const scheduleDefectWrap = self => catchAll$1(self, e => die
|
|
15694
|
+
const scheduleDefectWrap = self => catchAll$1(self, e => die(new ScheduleDefect(e)));
|
|
16034
15695
|
/** @internal */
|
|
16035
|
-
const scheduleDefectRefailCause = cause => match$
|
|
15696
|
+
const scheduleDefectRefailCause = cause => match$5(find(cause, _ => isDieType(_) && isScheduleDefect(_.defect) ? some(_.defect) : none$4()), {
|
|
16036
15697
|
onNone: () => cause,
|
|
16037
|
-
onSome: error => fail$
|
|
15698
|
+
onSome: error => fail$2(error.error)
|
|
16038
15699
|
});
|
|
16039
15700
|
/** @internal */
|
|
16040
|
-
const scheduleDefectRefail = effect => catchAllCause$1(effect, cause => failCause$
|
|
15701
|
+
const scheduleDefectRefail = effect => catchAllCause$1(effect, cause => failCause$2(scheduleDefectRefailCause(cause)));
|
|
16041
15702
|
/** @internal */
|
|
16042
|
-
const repeat_Effect = /*#__PURE__*/dual(2, (self, schedule) => repeatOrElse_Effect(self, schedule, (e, _) => fail$
|
|
15703
|
+
const repeat_Effect = /*#__PURE__*/dual(2, (self, schedule) => repeatOrElse_Effect(self, schedule, (e, _) => fail$1(e)));
|
|
16043
15704
|
/** @internal */
|
|
16044
15705
|
const repeat_combined = /*#__PURE__*/dual(2, (self, options) => {
|
|
16045
15706
|
if (isSchedule(options)) {
|
|
@@ -16049,14 +15710,14 @@ const repeat_combined = /*#__PURE__*/dual(2, (self, options) => {
|
|
|
16049
15710
|
const withWhile = options.while ? whileInputEffect(base, a => {
|
|
16050
15711
|
const applied = options.while(a);
|
|
16051
15712
|
if (typeof applied === "boolean") {
|
|
16052
|
-
return succeed$
|
|
15713
|
+
return succeed$2(applied);
|
|
16053
15714
|
}
|
|
16054
15715
|
return scheduleDefectWrap(applied);
|
|
16055
15716
|
}) : base;
|
|
16056
15717
|
const withUntil = options.until ? untilInputEffect(withWhile, a => {
|
|
16057
15718
|
const applied = options.until(a);
|
|
16058
15719
|
if (typeof applied === "boolean") {
|
|
16059
|
-
return succeed$
|
|
15720
|
+
return succeed$2(applied);
|
|
16060
15721
|
}
|
|
16061
15722
|
return scheduleDefectWrap(applied);
|
|
16062
15723
|
}) : withWhile;
|
|
@@ -16540,14 +16201,14 @@ const withFiberRuntime = withFiberRuntime$1;
|
|
|
16540
16201
|
* @since 2.0.0
|
|
16541
16202
|
* @category Creating Effects
|
|
16542
16203
|
*/
|
|
16543
|
-
const fail = fail$
|
|
16204
|
+
const fail = fail$1;
|
|
16544
16205
|
/**
|
|
16545
16206
|
* Creates an `Effect` that fails with the specified `Cause`.
|
|
16546
16207
|
*
|
|
16547
16208
|
* @since 2.0.0
|
|
16548
16209
|
* @category Creating Effects
|
|
16549
16210
|
*/
|
|
16550
|
-
const failCause = failCause$
|
|
16211
|
+
const failCause = failCause$2;
|
|
16551
16212
|
/**
|
|
16552
16213
|
* Creates an effect that terminates a fiber with a `RuntimeException`
|
|
16553
16214
|
* containing the specified message.
|
|
@@ -16718,7 +16379,7 @@ const promise = promise$1;
|
|
|
16718
16379
|
* @since 2.0.0
|
|
16719
16380
|
* @category Creating Effects
|
|
16720
16381
|
*/
|
|
16721
|
-
const succeed = succeed$
|
|
16382
|
+
const succeed = succeed$2;
|
|
16722
16383
|
/**
|
|
16723
16384
|
* Delays the creation of an `Effect` until it is actually needed.
|
|
16724
16385
|
*
|
|
@@ -16856,7 +16517,7 @@ const suspend = suspend$1;
|
|
|
16856
16517
|
* @category Creating Effects
|
|
16857
16518
|
*/
|
|
16858
16519
|
const sync = sync$1;
|
|
16859
|
-
const _void = void_$
|
|
16520
|
+
const _void = void_$1;
|
|
16860
16521
|
/**
|
|
16861
16522
|
* Handles all errors in an effect by providing a fallback effect.
|
|
16862
16523
|
*
|
|
@@ -17106,7 +16767,7 @@ const tryPromise = tryPromise$1;
|
|
|
17106
16767
|
* @since 2.0.0
|
|
17107
16768
|
* @category Interruption
|
|
17108
16769
|
*/
|
|
17109
|
-
const interrupt = interrupt$
|
|
16770
|
+
const interrupt = interrupt$1;
|
|
17110
16771
|
/**
|
|
17111
16772
|
* Marks an effect as interruptible.
|
|
17112
16773
|
*
|
|
@@ -17218,7 +16879,7 @@ const asVoid = asVoid$1;
|
|
|
17218
16879
|
* @since 2.0.0
|
|
17219
16880
|
* @category Mapping
|
|
17220
16881
|
*/
|
|
17221
|
-
const map = map$
|
|
16882
|
+
const map = map$2;
|
|
17222
16883
|
/**
|
|
17223
16884
|
* Transforms or modifies the error produced by an effect without affecting its
|
|
17224
16885
|
* success value.
|
|
@@ -18739,6 +18400,84 @@ const runFork = unsafeForkEffect;
|
|
|
18739
18400
|
* @category Running Effects
|
|
18740
18401
|
*/
|
|
18741
18402
|
const runPromise = unsafeRunPromiseEffect;
|
|
18403
|
+
/**
|
|
18404
|
+
* Executes an effect synchronously, running it immediately and returning the
|
|
18405
|
+
* result.
|
|
18406
|
+
*
|
|
18407
|
+
* **Details**
|
|
18408
|
+
*
|
|
18409
|
+
* This function evaluates the provided effect synchronously, returning its
|
|
18410
|
+
* result directly. It is ideal for effects that do not fail or include
|
|
18411
|
+
* asynchronous operations. If the effect does fail or involves async tasks, it
|
|
18412
|
+
* will throw an error. Execution stops at the point of failure or asynchronous
|
|
18413
|
+
* operation, making it unsuitable for effects that require asynchronous
|
|
18414
|
+
* handling.
|
|
18415
|
+
*
|
|
18416
|
+
* **Important**: Attempting to run effects that involve asynchronous operations
|
|
18417
|
+
* or failures will result in exceptions being thrown, so use this function with
|
|
18418
|
+
* care for purely synchronous and error-free effects.
|
|
18419
|
+
*
|
|
18420
|
+
* **When to Use**
|
|
18421
|
+
*
|
|
18422
|
+
* Use this function when:
|
|
18423
|
+
* - You are sure that the effect will not fail or involve asynchronous
|
|
18424
|
+
* operations.
|
|
18425
|
+
* - You need a direct, synchronous result from the effect.
|
|
18426
|
+
* - You are working within a context where asynchronous effects are not
|
|
18427
|
+
* allowed.
|
|
18428
|
+
*
|
|
18429
|
+
* Avoid using this function for effects that can fail or require asynchronous
|
|
18430
|
+
* handling. For such cases, consider using {@link runPromise} or
|
|
18431
|
+
* {@link runSyncExit}.
|
|
18432
|
+
*
|
|
18433
|
+
* **Example** (Synchronous Logging)
|
|
18434
|
+
*
|
|
18435
|
+
* ```ts
|
|
18436
|
+
* import { Effect } from "effect"
|
|
18437
|
+
*
|
|
18438
|
+
* const program = Effect.sync(() => {
|
|
18439
|
+
* console.log("Hello, World!")
|
|
18440
|
+
* return 1
|
|
18441
|
+
* })
|
|
18442
|
+
*
|
|
18443
|
+
* const result = Effect.runSync(program)
|
|
18444
|
+
* // Output: Hello, World!
|
|
18445
|
+
*
|
|
18446
|
+
* console.log(result)
|
|
18447
|
+
* // Output: 1
|
|
18448
|
+
* ```
|
|
18449
|
+
*
|
|
18450
|
+
* **Example** (Incorrect Usage with Failing or Async Effects)
|
|
18451
|
+
*
|
|
18452
|
+
* ```ts
|
|
18453
|
+
* import { Effect } from "effect"
|
|
18454
|
+
*
|
|
18455
|
+
* try {
|
|
18456
|
+
* // Attempt to run an effect that fails
|
|
18457
|
+
* Effect.runSync(Effect.fail("my error"))
|
|
18458
|
+
* } catch (e) {
|
|
18459
|
+
* console.error(e)
|
|
18460
|
+
* }
|
|
18461
|
+
* // Output:
|
|
18462
|
+
* // (FiberFailure) Error: my error
|
|
18463
|
+
*
|
|
18464
|
+
* try {
|
|
18465
|
+
* // Attempt to run an effect that involves async work
|
|
18466
|
+
* Effect.runSync(Effect.promise(() => Promise.resolve(1)))
|
|
18467
|
+
* } catch (e) {
|
|
18468
|
+
* console.error(e)
|
|
18469
|
+
* }
|
|
18470
|
+
* // Output:
|
|
18471
|
+
* // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work
|
|
18472
|
+
* ```
|
|
18473
|
+
*
|
|
18474
|
+
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
18475
|
+
* throwing an error.
|
|
18476
|
+
*
|
|
18477
|
+
* @since 2.0.0
|
|
18478
|
+
* @category Running Effects
|
|
18479
|
+
*/
|
|
18480
|
+
const runSync = unsafeRunSyncEffect;
|
|
18742
18481
|
/**
|
|
18743
18482
|
* Combines two effects into a single effect, producing a tuple of their
|
|
18744
18483
|
* results.
|
|
@@ -18960,4 +18699,4 @@ const zipRight = zipRightOptions;
|
|
|
18960
18699
|
*/
|
|
18961
18700
|
const zipWith = zipWithOptions;
|
|
18962
18701
|
|
|
18963
|
-
export {
|
|
18702
|
+
export { gen as $, isSome as A, some as B, getOrUndefined as C, set$1 as D, struct as E, flatMap$2 as F, remove as G, empty$7 as H, clockWith as I, compareAndSet as J, set$3 as K, make$i as L, symbol$1 as M, pipe as N, cached as O, combine$7 as P, hash as Q, symbol as R, hasProperty as S, equals$1 as T, asVoid$1 as U, when$1 as V, toMillis as W, onInterrupt as X, zipRight$1 as Y, exit$1 as Z, provideContext$1 as _, runSync as a, forkDaemon as a$, tryPromise as a0, try_ as a1, logWarning as a2, infinity as a3, YieldableError as a4, orElseSucceed as a5, make$a as a6, modify as a7, get as a8, update$1 as a9, forEachConcurrentDiscard as aA, deferredAwait as aB, fromIterable$6 as aC, empty$l as aD, splitAt$1 as aE, isEmpty$5 as aF, deferredUnsafeMake as aG, fromIterable$5 as aH, deferredUnsafeDone as aI, prepend$1 as aJ, filter as aK, appendAll$1 as aL, append as aM, deferredInterruptWith as aN, empty$i as aO, void_$1 as aP, isEffect as aQ, match$6 as aR, _void as aS, ignore as aT, zipWith as aU, exit as aV, sync as aW, provide as aX, matchCauseEffect as aY, zipRight as aZ, flatMap as a_, isInterrupted as aa, fail$2 as ab, failureOrCause as ac, flipCauseOption as ad, map$3 as ae, die$1 as af, interrupt$2 as ag, isDieType as ah, interruptors as ai, isInterruptedOnly as aj, join as ak, interruptFiber as al, _await as am, inheritAll as an, interruptAsFiber as ao, dual as ap, deferredMake as aq, Class as ar, pipeArguments as as, catchAll$1 as at, interrupt$1 as au, get$4 as av, uninterruptible$1 as aw, withFiberRuntime$1 as ax, whenEffect as ay, deferredSucceed as az, right as b, deferredDone as b$, interruptible as b0, suspend as b1, ensuring as b2, uninterruptible as b3, map as b4, zip as b5, forEach as b6, getOrElse as b7, dieMessage as b8, catchAllCause as b9, runtime as bA, tap as bB, addFinalizerExit as bC, makeSemaphore as bD, when as bE, race as bF, as as bG, repeat as bH, asVoid as bI, raceFirst as bJ, forever as bK, of$1 as bL, fail as bM, mapError as bN, reduce$6 as bO, map$6 as bP, match as bQ, splitWhere as bR, head as bS, filterMap as bT, catchSomeCause as bU, unsafeFromArray as bV, runFork as bW, promise as bX, async as bY, deferredFailCause as bZ, deferredInterrupt as b_, uninterruptibleMask as ba, all as bb, fork as bc, sequential as bd, acquireUseRelease as be, forkIn as bf, size$1 as bg, combineAll as bh, intoDeferred as bi, zipLeft as bj, tapErrorCause as bk, addFinalizer as bl, failCause as bm, flatten as bn, fiberIdWith as bo, interrupt as bp, matchCause as bq, scopedWith as br, unsafeGet as bs, constVoid as bt, scope as bu, withFiberRuntime as bv, make$1 as bw, extend as bx, close as by, raceWith as bz, catchAll as c, deferredIsDone as c0, exitIsFailure as c1, exitIsSuccess as c2, exitMatch as c3, exitFailCause$1 as c4, exitSucceed$1 as c5, exitFail as c6, exitZipRight as c7, exitCollectAll as c8, exitVoid$1 as c9, exitDie$1 as ca, exitMap as cb, exitZip as cc, NodeInspectSymbol as cd, toJSON as ce, format$2 as cf, reverse$1 as cg, left as d, isRight as e, getRight as f, getOrThrowWith$1 as g, decode as h, identity as i, map$2 as j, all$1 as k, logError as l, match$5 as m, context as n, fiberId as o, merge$3 as p, sync$1 as q, runPromise as r, succeed as s, tapError as t, size as u, suspend$1 as v, get$2 as w, succeed$2 as x, none$4 as y, has as z };
|