@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
|
@@ -275,19 +275,19 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
275
275
|
* @category constructors
|
|
276
276
|
* @since 2.0.0
|
|
277
277
|
*/
|
|
278
|
-
const make$
|
|
278
|
+
const make$s = isEquivalent => (self, that) => self === that || isEquivalent(self, that);
|
|
279
279
|
/**
|
|
280
280
|
* @category mapping
|
|
281
281
|
* @since 2.0.0
|
|
282
282
|
*/
|
|
283
|
-
const mapInput$1 = /*#__PURE__*/dual(2, (self, f) => make$
|
|
283
|
+
const mapInput$1 = /*#__PURE__*/dual(2, (self, f) => make$s((x, y) => self(f(x), f(y))));
|
|
284
284
|
/**
|
|
285
285
|
* Creates a new `Equivalence` for an array of values based on a given `Equivalence` for the elements of the array.
|
|
286
286
|
*
|
|
287
287
|
* @category combinators
|
|
288
288
|
* @since 2.0.0
|
|
289
289
|
*/
|
|
290
|
-
const array$1 = item => make$
|
|
290
|
+
const array$1 = item => make$s((self, that) => {
|
|
291
291
|
if (self.length !== that.length) {
|
|
292
292
|
return false;
|
|
293
293
|
}
|
|
@@ -1325,10 +1325,10 @@ const Base$1 = /*#__PURE__*/function () {
|
|
|
1325
1325
|
/**
|
|
1326
1326
|
* @since 2.0.0
|
|
1327
1327
|
*/
|
|
1328
|
-
const TypeId$
|
|
1328
|
+
const TypeId$b = /*#__PURE__*/Symbol.for("effect/Option");
|
|
1329
1329
|
const CommonProto$1 = {
|
|
1330
1330
|
...EffectPrototype$1,
|
|
1331
|
-
[TypeId$
|
|
1331
|
+
[TypeId$b]: {
|
|
1332
1332
|
_A: _ => _
|
|
1333
1333
|
},
|
|
1334
1334
|
[NodeInspectSymbol]() {
|
|
@@ -1373,7 +1373,7 @@ const NoneProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonPr
|
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
1375
|
/** @internal */
|
|
1376
|
-
const isOption = input => hasProperty(input, TypeId$
|
|
1376
|
+
const isOption = input => hasProperty(input, TypeId$b);
|
|
1377
1377
|
/** @internal */
|
|
1378
1378
|
const isNone$1 = fa => fa._tag === "None";
|
|
1379
1379
|
/** @internal */
|
|
@@ -1393,10 +1393,10 @@ const some$1 = value => {
|
|
|
1393
1393
|
/**
|
|
1394
1394
|
* @internal
|
|
1395
1395
|
*/
|
|
1396
|
-
const TypeId$
|
|
1396
|
+
const TypeId$a = /*#__PURE__*/Symbol.for("effect/Either");
|
|
1397
1397
|
const CommonProto = {
|
|
1398
1398
|
...EffectPrototype$1,
|
|
1399
|
-
[TypeId$
|
|
1399
|
+
[TypeId$a]: {
|
|
1400
1400
|
_R: _ => _
|
|
1401
1401
|
},
|
|
1402
1402
|
[NodeInspectSymbol]() {
|
|
@@ -1441,7 +1441,7 @@ const LeftProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonPr
|
|
|
1441
1441
|
}
|
|
1442
1442
|
});
|
|
1443
1443
|
/** @internal */
|
|
1444
|
-
const isEither = input => hasProperty(input, TypeId$
|
|
1444
|
+
const isEither = input => hasProperty(input, TypeId$a);
|
|
1445
1445
|
/** @internal */
|
|
1446
1446
|
const isLeft$1 = ma => ma._tag === "Left";
|
|
1447
1447
|
/** @internal */
|
|
@@ -1535,7 +1535,7 @@ const isRight = isRight$1;
|
|
|
1535
1535
|
* @category pattern matching
|
|
1536
1536
|
* @since 2.0.0
|
|
1537
1537
|
*/
|
|
1538
|
-
const match$
|
|
1538
|
+
const match$6 = /*#__PURE__*/dual(2, (self, {
|
|
1539
1539
|
onLeft,
|
|
1540
1540
|
onRight
|
|
1541
1541
|
}) => isLeft(self) ? onLeft(self.left) : onRight(self.right));
|
|
@@ -1543,7 +1543,7 @@ const match$7 = /*#__PURE__*/dual(2, (self, {
|
|
|
1543
1543
|
* @category getters
|
|
1544
1544
|
* @since 2.0.0
|
|
1545
1545
|
*/
|
|
1546
|
-
const merge$3 = /*#__PURE__*/match$
|
|
1546
|
+
const merge$3 = /*#__PURE__*/match$6({
|
|
1547
1547
|
onLeft: identity,
|
|
1548
1548
|
onRight: identity
|
|
1549
1549
|
});
|
|
@@ -1602,17 +1602,17 @@ const isNonEmptyArray$1 = self => self.length > 0;
|
|
|
1602
1602
|
* @category constructors
|
|
1603
1603
|
* @since 2.0.0
|
|
1604
1604
|
*/
|
|
1605
|
-
const make$
|
|
1605
|
+
const make$r = compare => (self, that) => self === that ? 0 : compare(self, that);
|
|
1606
1606
|
/**
|
|
1607
1607
|
* @category instances
|
|
1608
1608
|
* @since 2.0.0
|
|
1609
1609
|
*/
|
|
1610
|
-
const number = /*#__PURE__*/make$
|
|
1610
|
+
const number = /*#__PURE__*/make$r((self, that) => self < that ? -1 : 1);
|
|
1611
1611
|
/**
|
|
1612
1612
|
* @category mapping
|
|
1613
1613
|
* @since 2.0.0
|
|
1614
1614
|
*/
|
|
1615
|
-
const mapInput = /*#__PURE__*/dual(2, (self, f) => make$
|
|
1615
|
+
const mapInput = /*#__PURE__*/dual(2, (self, f) => make$r((b1, b2) => self(f(b1), f(b2))));
|
|
1616
1616
|
/**
|
|
1617
1617
|
* Test whether one value is _strictly greater than_ another.
|
|
1618
1618
|
*
|
|
@@ -1751,7 +1751,7 @@ const isSome = isSome$1;
|
|
|
1751
1751
|
* @category Pattern matching
|
|
1752
1752
|
* @since 2.0.0
|
|
1753
1753
|
*/
|
|
1754
|
-
const match$
|
|
1754
|
+
const match$5 = /*#__PURE__*/dual(2, (self, {
|
|
1755
1755
|
onNone,
|
|
1756
1756
|
onSome
|
|
1757
1757
|
}) => isNone(self) ? onNone() : onSome(self.value));
|
|
@@ -1999,7 +1999,7 @@ const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error("getOrThrow calle
|
|
|
1999
1999
|
* @category Mapping
|
|
2000
2000
|
* @since 2.0.0
|
|
2001
2001
|
*/
|
|
2002
|
-
const map$
|
|
2002
|
+
const map$8 = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none$4() : some(f(self.value)));
|
|
2003
2003
|
/**
|
|
2004
2004
|
* Applies a function to the value of a `Some` and flattens the resulting
|
|
2005
2005
|
* `Option`. If the input is `None`, it remains `None`.
|
|
@@ -2155,7 +2155,7 @@ const mergeWith = f => (o1, o2) => {
|
|
|
2155
2155
|
* @category constructors
|
|
2156
2156
|
* @since 2.0.0
|
|
2157
2157
|
*/
|
|
2158
|
-
const make$
|
|
2158
|
+
const make$q = (...elements) => elements;
|
|
2159
2159
|
|
|
2160
2160
|
/**
|
|
2161
2161
|
* This module provides utility functions for working with arrays in TypeScript.
|
|
@@ -2269,7 +2269,7 @@ const prepend$2 = /*#__PURE__*/dual(2, (self, head) => [head, ...self]);
|
|
|
2269
2269
|
* @category concatenating
|
|
2270
2270
|
* @since 2.0.0
|
|
2271
2271
|
*/
|
|
2272
|
-
const append$
|
|
2272
|
+
const append$1 = /*#__PURE__*/dual(2, (self, last) => [...self, last]);
|
|
2273
2273
|
/**
|
|
2274
2274
|
* Concatenates two arrays (or iterables), combining their elements.
|
|
2275
2275
|
* If either array is non-empty, the result is also a non-empty array.
|
|
@@ -2519,7 +2519,7 @@ const sort = /*#__PURE__*/dual(2, (self, O) => {
|
|
|
2519
2519
|
* @category zipping
|
|
2520
2520
|
* @since 2.0.0
|
|
2521
2521
|
*/
|
|
2522
|
-
const zip$
|
|
2522
|
+
const zip$2 = /*#__PURE__*/dual(2, (self, that) => zipWith$2(self, that, make$q));
|
|
2523
2523
|
/**
|
|
2524
2524
|
* Apply a function to pairs of elements at the same index in two `Iterable`s, collecting the results in a new `Array`. If one
|
|
2525
2525
|
* input `Iterable` is short, excess elements of the longer `Iterable` are discarded.
|
|
@@ -2657,7 +2657,7 @@ const union$2 = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that, _equi
|
|
|
2657
2657
|
* @category constructors
|
|
2658
2658
|
* @since 2.0.0
|
|
2659
2659
|
*/
|
|
2660
|
-
const empty$
|
|
2660
|
+
const empty$l = () => [];
|
|
2661
2661
|
/**
|
|
2662
2662
|
* Constructs a new `NonEmptyArray<A>` from the specified value.
|
|
2663
2663
|
*
|
|
@@ -2669,7 +2669,7 @@ const of$2 = a => [a];
|
|
|
2669
2669
|
* @category mapping
|
|
2670
2670
|
* @since 2.0.0
|
|
2671
2671
|
*/
|
|
2672
|
-
const map$
|
|
2672
|
+
const map$7 = /*#__PURE__*/dual(2, (self, f) => self.map(f));
|
|
2673
2673
|
/**
|
|
2674
2674
|
* Applies a function to each element in an array and returns a new array containing the concatenated mapped elements.
|
|
2675
2675
|
*
|
|
@@ -3008,7 +3008,7 @@ const TagProto = {
|
|
|
3008
3008
|
return self;
|
|
3009
3009
|
},
|
|
3010
3010
|
context(self) {
|
|
3011
|
-
return make$
|
|
3011
|
+
return make$p(this, self);
|
|
3012
3012
|
}
|
|
3013
3013
|
};
|
|
3014
3014
|
const ReferenceProto = {
|
|
@@ -3048,10 +3048,10 @@ const Reference$1 = () => (id, options) => {
|
|
|
3048
3048
|
return ReferenceClass;
|
|
3049
3049
|
};
|
|
3050
3050
|
/** @internal */
|
|
3051
|
-
const TypeId$
|
|
3051
|
+
const TypeId$9 = /*#__PURE__*/Symbol.for("effect/Context");
|
|
3052
3052
|
/** @internal */
|
|
3053
3053
|
const ContextProto = {
|
|
3054
|
-
[TypeId$
|
|
3054
|
+
[TypeId$9]: {
|
|
3055
3055
|
_Services: _ => _
|
|
3056
3056
|
},
|
|
3057
3057
|
[symbol](that) {
|
|
@@ -3111,14 +3111,14 @@ const serviceNotFoundError = tag => {
|
|
|
3111
3111
|
return error;
|
|
3112
3112
|
};
|
|
3113
3113
|
/** @internal */
|
|
3114
|
-
const isContext$1 = u => hasProperty(u, TypeId$
|
|
3114
|
+
const isContext$1 = u => hasProperty(u, TypeId$9);
|
|
3115
3115
|
/** @internal */
|
|
3116
3116
|
const isReference = u => hasProperty(u, ReferenceTypeId);
|
|
3117
3117
|
const _empty$6 = /*#__PURE__*/makeContext(/*#__PURE__*/new Map());
|
|
3118
3118
|
/** @internal */
|
|
3119
|
-
const empty$
|
|
3119
|
+
const empty$k = () => _empty$6;
|
|
3120
3120
|
/** @internal */
|
|
3121
|
-
const make$
|
|
3121
|
+
const make$p = (tag, service) => makeContext(new Map([[tag.key, service]]));
|
|
3122
3122
|
/** @internal */
|
|
3123
3123
|
const add$3 = /*#__PURE__*/dual(3, (self, tag, service) => {
|
|
3124
3124
|
const map = new Map(self.unsafeMap);
|
|
@@ -3218,7 +3218,7 @@ const isContext = isContext$1;
|
|
|
3218
3218
|
* @since 2.0.0
|
|
3219
3219
|
* @category constructors
|
|
3220
3220
|
*/
|
|
3221
|
-
const empty$
|
|
3221
|
+
const empty$j = empty$k;
|
|
3222
3222
|
/**
|
|
3223
3223
|
* Creates a new `Context` with a single service associated to the tag.
|
|
3224
3224
|
*
|
|
@@ -3237,7 +3237,7 @@ const empty$k = empty$l;
|
|
|
3237
3237
|
* @since 2.0.0
|
|
3238
3238
|
* @category constructors
|
|
3239
3239
|
*/
|
|
3240
|
-
const make$
|
|
3240
|
+
const make$o = make$p;
|
|
3241
3241
|
/**
|
|
3242
3242
|
* Adds a service to a given `Context`.
|
|
3243
3243
|
*
|
|
@@ -3442,7 +3442,7 @@ const Reference = Reference$1;
|
|
|
3442
3442
|
/**
|
|
3443
3443
|
* @since 2.0.0
|
|
3444
3444
|
*/
|
|
3445
|
-
const TypeId$
|
|
3445
|
+
const TypeId$8 = /*#__PURE__*/Symbol.for("effect/Chunk");
|
|
3446
3446
|
function copy(src, srcPos, dest, destPos, len) {
|
|
3447
3447
|
for (let i = srcPos; i < Math.min(src.length, srcPos + len); i++) {
|
|
3448
3448
|
dest[destPos + i - srcPos] = src[i];
|
|
@@ -3456,10 +3456,10 @@ const emptyArray = [];
|
|
|
3456
3456
|
* @category equivalence
|
|
3457
3457
|
* @since 2.0.0
|
|
3458
3458
|
*/
|
|
3459
|
-
const getEquivalence$1 = isEquivalent => make$
|
|
3459
|
+
const getEquivalence$1 = isEquivalent => make$s((self, that) => self.length === that.length && toReadonlyArray(self).every((value, i) => isEquivalent(value, unsafeGet(that, i))));
|
|
3460
3460
|
const _equivalence$1 = /*#__PURE__*/getEquivalence$1(equals$1);
|
|
3461
3461
|
const ChunkProto = {
|
|
3462
|
-
[TypeId$
|
|
3462
|
+
[TypeId$8]: {
|
|
3463
3463
|
_A: _ => _
|
|
3464
3464
|
},
|
|
3465
3465
|
toString() {
|
|
@@ -3553,7 +3553,7 @@ const makeChunk = backing => {
|
|
|
3553
3553
|
* @category constructors
|
|
3554
3554
|
* @since 2.0.0
|
|
3555
3555
|
*/
|
|
3556
|
-
const isChunk = u => hasProperty(u, TypeId$
|
|
3556
|
+
const isChunk = u => hasProperty(u, TypeId$8);
|
|
3557
3557
|
const _empty$5 = /*#__PURE__*/makeChunk({
|
|
3558
3558
|
_tag: "IEmpty"
|
|
3559
3559
|
});
|
|
@@ -3561,14 +3561,14 @@ const _empty$5 = /*#__PURE__*/makeChunk({
|
|
|
3561
3561
|
* @category constructors
|
|
3562
3562
|
* @since 2.0.0
|
|
3563
3563
|
*/
|
|
3564
|
-
const empty$
|
|
3564
|
+
const empty$i = () => _empty$5;
|
|
3565
3565
|
/**
|
|
3566
3566
|
* Builds a `NonEmptyChunk` from an non-empty collection of elements.
|
|
3567
3567
|
*
|
|
3568
3568
|
* @category constructors
|
|
3569
3569
|
* @since 2.0.0
|
|
3570
3570
|
*/
|
|
3571
|
-
const make$
|
|
3571
|
+
const make$n = (...as) => unsafeFromNonEmptyArray(as);
|
|
3572
3572
|
/**
|
|
3573
3573
|
* Builds a `NonEmptyChunk` from a single element.
|
|
3574
3574
|
*
|
|
@@ -3708,7 +3708,7 @@ const get$6 = /*#__PURE__*/dual(2, (self, index) => index < 0 || index >= self.l
|
|
|
3708
3708
|
* @since 2.0.0
|
|
3709
3709
|
* @category unsafe
|
|
3710
3710
|
*/
|
|
3711
|
-
const unsafeFromArray = self => self.length === 0 ? empty$
|
|
3711
|
+
const unsafeFromArray = self => self.length === 0 ? empty$i() : self.length === 1 ? of$1(self[0]) : makeChunk({
|
|
3712
3712
|
_tag: "IArray",
|
|
3713
3713
|
array: self
|
|
3714
3714
|
});
|
|
@@ -3761,7 +3761,7 @@ const unsafeGet = /*#__PURE__*/dual(2, (self, index) => {
|
|
|
3761
3761
|
* @category concatenating
|
|
3762
3762
|
* @since 2.0.0
|
|
3763
3763
|
*/
|
|
3764
|
-
const append
|
|
3764
|
+
const append = /*#__PURE__*/dual(2, (self, a) => appendAll$1(self, of$1(a)));
|
|
3765
3765
|
/**
|
|
3766
3766
|
* Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
|
|
3767
3767
|
*
|
|
@@ -3979,7 +3979,7 @@ const filter = /*#__PURE__*/dual(2, (self, predicate) => unsafeFromArray(filter$
|
|
|
3979
3979
|
* @since 2.0.0
|
|
3980
3980
|
* @category elements
|
|
3981
3981
|
*/
|
|
3982
|
-
const isEmpty$
|
|
3982
|
+
const isEmpty$5 = self => self.length === 0;
|
|
3983
3983
|
/**
|
|
3984
3984
|
* Determines if the chunk is not empty.
|
|
3985
3985
|
*
|
|
@@ -4028,7 +4028,7 @@ const headNonEmpty = unsafeHead;
|
|
|
4028
4028
|
* @since 2.0.0
|
|
4029
4029
|
* @category mapping
|
|
4030
4030
|
*/
|
|
4031
|
-
const map$
|
|
4031
|
+
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)))));
|
|
4032
4032
|
/**
|
|
4033
4033
|
* Returns two splits of this chunk at the specified index.
|
|
4034
4034
|
*
|
|
@@ -4070,7 +4070,7 @@ const reduce$6 = reduce$7;
|
|
|
4070
4070
|
/**
|
|
4071
4071
|
* @since 2.0.0
|
|
4072
4072
|
*/
|
|
4073
|
-
const TypeId$
|
|
4073
|
+
const TypeId$7 = /*#__PURE__*/Symbol.for("effect/Duration");
|
|
4074
4074
|
const bigint0$1 = /*#__PURE__*/BigInt(0);
|
|
4075
4075
|
const bigint24 = /*#__PURE__*/BigInt(24);
|
|
4076
4076
|
const bigint60 = /*#__PURE__*/BigInt(60);
|
|
@@ -4139,7 +4139,7 @@ const infinityValue = {
|
|
|
4139
4139
|
_tag: "Infinity"
|
|
4140
4140
|
};
|
|
4141
4141
|
const DurationProto = {
|
|
4142
|
-
[TypeId$
|
|
4142
|
+
[TypeId$7]: TypeId$7,
|
|
4143
4143
|
[symbol$1]() {
|
|
4144
4144
|
return cached(this, structure(this.value));
|
|
4145
4145
|
},
|
|
@@ -4177,7 +4177,7 @@ const DurationProto = {
|
|
|
4177
4177
|
return pipeArguments(this, arguments);
|
|
4178
4178
|
}
|
|
4179
4179
|
};
|
|
4180
|
-
const make$
|
|
4180
|
+
const make$m = input => {
|
|
4181
4181
|
const duration = Object.create(DurationProto);
|
|
4182
4182
|
if (isNumber(input)) {
|
|
4183
4183
|
if (isNaN(input) || input <= 0) {
|
|
@@ -4209,7 +4209,7 @@ const make$o = input => {
|
|
|
4209
4209
|
* @since 2.0.0
|
|
4210
4210
|
* @category guards
|
|
4211
4211
|
*/
|
|
4212
|
-
const isDuration = u => hasProperty(u, TypeId$
|
|
4212
|
+
const isDuration = u => hasProperty(u, TypeId$7);
|
|
4213
4213
|
/**
|
|
4214
4214
|
* @since 3.5.0
|
|
4215
4215
|
* @category guards
|
|
@@ -4234,57 +4234,57 @@ const isZero = self => {
|
|
|
4234
4234
|
* @since 2.0.0
|
|
4235
4235
|
* @category constructors
|
|
4236
4236
|
*/
|
|
4237
|
-
const zero = /*#__PURE__*/make$
|
|
4237
|
+
const zero = /*#__PURE__*/make$m(0);
|
|
4238
4238
|
/**
|
|
4239
4239
|
* @since 2.0.0
|
|
4240
4240
|
* @category constructors
|
|
4241
4241
|
*/
|
|
4242
|
-
const infinity = /*#__PURE__*/make$
|
|
4242
|
+
const infinity = /*#__PURE__*/make$m(Infinity);
|
|
4243
4243
|
/**
|
|
4244
4244
|
* @since 2.0.0
|
|
4245
4245
|
* @category constructors
|
|
4246
4246
|
*/
|
|
4247
|
-
const nanos = nanos => make$
|
|
4247
|
+
const nanos = nanos => make$m(nanos);
|
|
4248
4248
|
/**
|
|
4249
4249
|
* @since 2.0.0
|
|
4250
4250
|
* @category constructors
|
|
4251
4251
|
*/
|
|
4252
|
-
const micros = micros => make$
|
|
4252
|
+
const micros = micros => make$m(micros * bigint1e3);
|
|
4253
4253
|
/**
|
|
4254
4254
|
* @since 2.0.0
|
|
4255
4255
|
* @category constructors
|
|
4256
4256
|
*/
|
|
4257
|
-
const millis = millis => make$
|
|
4257
|
+
const millis = millis => make$m(millis);
|
|
4258
4258
|
/**
|
|
4259
4259
|
* @since 2.0.0
|
|
4260
4260
|
* @category constructors
|
|
4261
4261
|
*/
|
|
4262
|
-
const seconds = seconds => make$
|
|
4262
|
+
const seconds = seconds => make$m(seconds * 1000);
|
|
4263
4263
|
/**
|
|
4264
4264
|
* @since 2.0.0
|
|
4265
4265
|
* @category constructors
|
|
4266
4266
|
*/
|
|
4267
|
-
const minutes = minutes => make$
|
|
4267
|
+
const minutes = minutes => make$m(minutes * 60_000);
|
|
4268
4268
|
/**
|
|
4269
4269
|
* @since 2.0.0
|
|
4270
4270
|
* @category constructors
|
|
4271
4271
|
*/
|
|
4272
|
-
const hours = hours => make$
|
|
4272
|
+
const hours = hours => make$m(hours * 3_600_000);
|
|
4273
4273
|
/**
|
|
4274
4274
|
* @since 2.0.0
|
|
4275
4275
|
* @category constructors
|
|
4276
4276
|
*/
|
|
4277
|
-
const days = days => make$
|
|
4277
|
+
const days = days => make$m(days * 86_400_000);
|
|
4278
4278
|
/**
|
|
4279
4279
|
* @since 2.0.0
|
|
4280
4280
|
* @category constructors
|
|
4281
4281
|
*/
|
|
4282
|
-
const weeks = weeks => make$
|
|
4282
|
+
const weeks = weeks => make$m(weeks * 604_800_000);
|
|
4283
4283
|
/**
|
|
4284
4284
|
* @since 2.0.0
|
|
4285
4285
|
* @category getters
|
|
4286
4286
|
*/
|
|
4287
|
-
const toMillis = self => match$
|
|
4287
|
+
const toMillis = self => match$4(self, {
|
|
4288
4288
|
onMillis: millis => millis,
|
|
4289
4289
|
onNanos: nanos => Number(nanos) / 1_000_000
|
|
4290
4290
|
});
|
|
@@ -4326,7 +4326,7 @@ const toHrTime = self => {
|
|
|
4326
4326
|
* @since 2.0.0
|
|
4327
4327
|
* @category pattern matching
|
|
4328
4328
|
*/
|
|
4329
|
-
const match$
|
|
4329
|
+
const match$4 = /*#__PURE__*/dual(2, (self, options) => {
|
|
4330
4330
|
const _self = decode(self);
|
|
4331
4331
|
switch (_self.value._tag) {
|
|
4332
4332
|
case "Nanos":
|
|
@@ -4498,7 +4498,7 @@ function fromBitmap(bitmap, bit) {
|
|
|
4498
4498
|
return popcount(bitmap & bit - 1);
|
|
4499
4499
|
}
|
|
4500
4500
|
|
|
4501
|
-
const make$
|
|
4501
|
+
const make$l = (value, previous) => ({
|
|
4502
4502
|
value,
|
|
4503
4503
|
previous
|
|
4504
4504
|
});
|
|
@@ -4784,7 +4784,7 @@ function mergeLeaves(edit, shift, h1, n1, h2, n2) {
|
|
|
4784
4784
|
while (true) {
|
|
4785
4785
|
const res = mergeLeavesInner(edit, currentShift, h1, n1, h2, n2);
|
|
4786
4786
|
if (typeof res === "function") {
|
|
4787
|
-
stack = make$
|
|
4787
|
+
stack = make$l(res, stack);
|
|
4788
4788
|
currentShift = currentShift + SIZE;
|
|
4789
4789
|
} else {
|
|
4790
4790
|
let final = res;
|
|
@@ -4919,10 +4919,10 @@ const visitLazyChildren = (len, children, i, f, cont) => {
|
|
|
4919
4919
|
};
|
|
4920
4920
|
const _empty$4 = /*#__PURE__*/makeImpl$1(false, 0, /*#__PURE__*/new EmptyNode(), 0);
|
|
4921
4921
|
/** @internal */
|
|
4922
|
-
const empty$
|
|
4922
|
+
const empty$h = () => _empty$4;
|
|
4923
4923
|
/** @internal */
|
|
4924
4924
|
const fromIterable$4 = entries => {
|
|
4925
|
-
const map = beginMutation$1(empty$
|
|
4925
|
+
const map = beginMutation$1(empty$h());
|
|
4926
4926
|
for (const entry of entries) {
|
|
4927
4927
|
set$4(map, entry[0], entry[1]);
|
|
4928
4928
|
}
|
|
@@ -4931,7 +4931,7 @@ const fromIterable$4 = entries => {
|
|
|
4931
4931
|
/** @internal */
|
|
4932
4932
|
const isHashMap = u => hasProperty(u, HashMapTypeId);
|
|
4933
4933
|
/** @internal */
|
|
4934
|
-
const isEmpty$
|
|
4934
|
+
const isEmpty$4 = self => self && isEmptyNode(self._root);
|
|
4935
4935
|
/** @internal */
|
|
4936
4936
|
const get$5 = /*#__PURE__*/dual(2, (self, key) => getHash(self, key, hash(key)));
|
|
4937
4937
|
/** @internal */
|
|
@@ -5017,14 +5017,14 @@ const modifyHash = /*#__PURE__*/dual(4, (self, key, hash, f) => {
|
|
|
5017
5017
|
return pipe(self, setTree(newRoot, size.value));
|
|
5018
5018
|
});
|
|
5019
5019
|
/** @internal */
|
|
5020
|
-
const remove$
|
|
5020
|
+
const remove$3 = /*#__PURE__*/dual(2, (self, key) => modifyAt$1(self, key, none$4));
|
|
5021
5021
|
/**
|
|
5022
5022
|
* Maps over the entries of the `HashMap` using the specified function.
|
|
5023
5023
|
*
|
|
5024
5024
|
* @since 2.0.0
|
|
5025
5025
|
* @category mapping
|
|
5026
5026
|
*/
|
|
5027
|
-
const map$
|
|
5027
|
+
const map$5 = /*#__PURE__*/dual(2, (self, f) => reduce$5(self, empty$h(), (map, value, key) => set$4(map, key, f(value, key))));
|
|
5028
5028
|
/** @internal */
|
|
5029
5029
|
const forEach$3 = /*#__PURE__*/dual(2, (self, f) => reduce$5(self, void 0, (_, value, key) => f(value, key)));
|
|
5030
5030
|
/** @internal */
|
|
@@ -5096,20 +5096,20 @@ const makeImpl = keyMap => {
|
|
|
5096
5096
|
};
|
|
5097
5097
|
/** @internal */
|
|
5098
5098
|
const isHashSet = u => hasProperty(u, HashSetTypeId);
|
|
5099
|
-
const _empty$3 = /*#__PURE__*/makeImpl(/*#__PURE__*/empty$
|
|
5099
|
+
const _empty$3 = /*#__PURE__*/makeImpl(/*#__PURE__*/empty$h());
|
|
5100
5100
|
/** @internal */
|
|
5101
|
-
const empty$
|
|
5101
|
+
const empty$g = () => _empty$3;
|
|
5102
5102
|
/** @internal */
|
|
5103
5103
|
const fromIterable$3 = elements => {
|
|
5104
|
-
const set = beginMutation(empty$
|
|
5104
|
+
const set = beginMutation(empty$g());
|
|
5105
5105
|
for (const value of elements) {
|
|
5106
5106
|
add$1(set, value);
|
|
5107
5107
|
}
|
|
5108
5108
|
return endMutation(set);
|
|
5109
5109
|
};
|
|
5110
5110
|
/** @internal */
|
|
5111
|
-
const make$
|
|
5112
|
-
const set = beginMutation(empty$
|
|
5111
|
+
const make$k = (...elements) => {
|
|
5112
|
+
const set = beginMutation(empty$g());
|
|
5113
5113
|
for (const value of elements) {
|
|
5114
5114
|
add$1(set, value);
|
|
5115
5115
|
}
|
|
@@ -5135,15 +5135,15 @@ const mutate = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
5135
5135
|
/** @internal */
|
|
5136
5136
|
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)));
|
|
5137
5137
|
/** @internal */
|
|
5138
|
-
const remove$
|
|
5138
|
+
const remove$2 = /*#__PURE__*/dual(2, (self, value) => self._keyMap._editable ? (remove$3(value)(self._keyMap), self) : makeImpl(remove$3(value)(self._keyMap)));
|
|
5139
5139
|
/** @internal */
|
|
5140
5140
|
const difference$1 = /*#__PURE__*/dual(2, (self, that) => mutate(self, set => {
|
|
5141
5141
|
for (const value of that) {
|
|
5142
|
-
remove$
|
|
5142
|
+
remove$2(set, value);
|
|
5143
5143
|
}
|
|
5144
5144
|
}));
|
|
5145
5145
|
/** @internal */
|
|
5146
|
-
const union$1 = /*#__PURE__*/dual(2, (self, that) => mutate(empty$
|
|
5146
|
+
const union$1 = /*#__PURE__*/dual(2, (self, that) => mutate(empty$g(), set => {
|
|
5147
5147
|
forEach$2(self, value => add$1(set, value));
|
|
5148
5148
|
for (const value of that) {
|
|
5149
5149
|
add$1(set, value);
|
|
@@ -5434,7 +5434,7 @@ const reduce$4 = /*#__PURE__*/dual(3, (self, zero, f) => reduce$5(self._keyMap,
|
|
|
5434
5434
|
*
|
|
5435
5435
|
* @see Other `HashSet` constructors are {@link module:HashSet.make} {@link module:HashSet.fromIterable}
|
|
5436
5436
|
*/
|
|
5437
|
-
const empty$
|
|
5437
|
+
const empty$f = empty$g;
|
|
5438
5438
|
/**
|
|
5439
5439
|
* Creates a new `HashSet` from an iterable collection of values.
|
|
5440
5440
|
*
|
|
@@ -5616,7 +5616,7 @@ const fromIterable$2 = fromIterable$3;
|
|
|
5616
5616
|
*
|
|
5617
5617
|
* @see Other `HashSet` constructors are {@link module:HashSet.fromIterable} {@link module:HashSet.empty}
|
|
5618
5618
|
*/
|
|
5619
|
-
const make$
|
|
5619
|
+
const make$j = make$k;
|
|
5620
5620
|
/**
|
|
5621
5621
|
* Checks if the specified value exists in the `HashSet`.
|
|
5622
5622
|
*
|
|
@@ -5728,7 +5728,7 @@ const add = add$1;
|
|
|
5728
5728
|
*
|
|
5729
5729
|
* @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}
|
|
5730
5730
|
*/
|
|
5731
|
-
const remove$
|
|
5731
|
+
const remove$1 = remove$2;
|
|
5732
5732
|
/**
|
|
5733
5733
|
* Computes the set difference `(A - B)` between this `HashSet` and the
|
|
5734
5734
|
* specified `Iterable<A>`.
|
|
@@ -5822,9 +5822,9 @@ const reduce$3 = reduce$4;
|
|
|
5822
5822
|
/**
|
|
5823
5823
|
* @since 2.0.0
|
|
5824
5824
|
*/
|
|
5825
|
-
const TypeId$
|
|
5825
|
+
const TypeId$6 = /*#__PURE__*/Symbol.for("effect/MutableRef");
|
|
5826
5826
|
const MutableRefProto = {
|
|
5827
|
-
[TypeId$
|
|
5827
|
+
[TypeId$6]: TypeId$6,
|
|
5828
5828
|
toString() {
|
|
5829
5829
|
return format$2(this.toJSON());
|
|
5830
5830
|
},
|
|
@@ -5845,7 +5845,7 @@ const MutableRefProto = {
|
|
|
5845
5845
|
* @since 2.0.0
|
|
5846
5846
|
* @category constructors
|
|
5847
5847
|
*/
|
|
5848
|
-
const make$
|
|
5848
|
+
const make$i = value => {
|
|
5849
5849
|
const ref = Object.create(MutableRefProto);
|
|
5850
5850
|
ref.current = value;
|
|
5851
5851
|
return ref;
|
|
@@ -5997,11 +5997,11 @@ const ids = self => {
|
|
|
5997
5997
|
switch (self._tag) {
|
|
5998
5998
|
case OP_NONE:
|
|
5999
5999
|
{
|
|
6000
|
-
return empty$
|
|
6000
|
+
return empty$f();
|
|
6001
6001
|
}
|
|
6002
6002
|
case OP_RUNTIME:
|
|
6003
6003
|
{
|
|
6004
|
-
return make$
|
|
6004
|
+
return make$j(self.id);
|
|
6005
6005
|
}
|
|
6006
6006
|
case OP_COMPOSITE:
|
|
6007
6007
|
{
|
|
@@ -6009,14 +6009,14 @@ const ids = self => {
|
|
|
6009
6009
|
}
|
|
6010
6010
|
}
|
|
6011
6011
|
};
|
|
6012
|
-
const _fiberCounter = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make$
|
|
6012
|
+
const _fiberCounter = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make$i(0));
|
|
6013
6013
|
/** @internal */
|
|
6014
6014
|
const threadName$1 = self => {
|
|
6015
6015
|
const identifiers = Array.from(ids(self)).map(n => `#${n}`).join(",");
|
|
6016
6016
|
return identifiers;
|
|
6017
6017
|
};
|
|
6018
6018
|
/** @internal */
|
|
6019
|
-
const unsafeMake$
|
|
6019
|
+
const unsafeMake$5 = () => {
|
|
6020
6020
|
const id = get$4(_fiberCounter);
|
|
6021
6021
|
pipe(_fiberCounter, set$3(id + 1));
|
|
6022
6022
|
return new Runtime(id, Date.now());
|
|
@@ -6055,7 +6055,7 @@ const threadName = threadName$1;
|
|
|
6055
6055
|
* @since 2.0.0
|
|
6056
6056
|
* @category unsafe
|
|
6057
6057
|
*/
|
|
6058
|
-
const unsafeMake$
|
|
6058
|
+
const unsafeMake$4 = unsafeMake$5;
|
|
6059
6059
|
|
|
6060
6060
|
/**
|
|
6061
6061
|
* @since 2.0.0
|
|
@@ -6066,7 +6066,7 @@ const unsafeMake$5 = unsafeMake$6;
|
|
|
6066
6066
|
* @since 2.0.0
|
|
6067
6067
|
* @category constructors
|
|
6068
6068
|
*/
|
|
6069
|
-
const empty$
|
|
6069
|
+
const empty$e = empty$h;
|
|
6070
6070
|
/**
|
|
6071
6071
|
* Creates a new `HashMap` from an iterable collection of key/value pairs.
|
|
6072
6072
|
*
|
|
@@ -6080,7 +6080,7 @@ const fromIterable$1 = fromIterable$4;
|
|
|
6080
6080
|
* @since 2.0.0
|
|
6081
6081
|
* @category elements
|
|
6082
6082
|
*/
|
|
6083
|
-
const isEmpty$
|
|
6083
|
+
const isEmpty$3 = isEmpty$4;
|
|
6084
6084
|
/**
|
|
6085
6085
|
* Safely lookup the value for the specified key in the `HashMap` using the
|
|
6086
6086
|
* internal hashing function.
|
|
@@ -6120,7 +6120,7 @@ const modifyAt = modifyAt$1;
|
|
|
6120
6120
|
* @since 2.0.0
|
|
6121
6121
|
* @category mapping
|
|
6122
6122
|
*/
|
|
6123
|
-
const map$
|
|
6123
|
+
const map$4 = map$5;
|
|
6124
6124
|
/**
|
|
6125
6125
|
* Reduces the specified state over the entries of the `HashMap`.
|
|
6126
6126
|
*
|
|
@@ -6155,7 +6155,7 @@ const reduce$2 = reduce$5;
|
|
|
6155
6155
|
* @since 2.0.0
|
|
6156
6156
|
* @category symbol
|
|
6157
6157
|
*/
|
|
6158
|
-
const TypeId$
|
|
6158
|
+
const TypeId$5 = /*#__PURE__*/Symbol.for("effect/List");
|
|
6159
6159
|
/**
|
|
6160
6160
|
* Converts the specified `List` to an `Array`.
|
|
6161
6161
|
*
|
|
@@ -6170,7 +6170,7 @@ const toArray = self => fromIterable$6(self);
|
|
|
6170
6170
|
const getEquivalence = isEquivalent => mapInput$1(getEquivalence$2(isEquivalent), toArray);
|
|
6171
6171
|
const _equivalence = /*#__PURE__*/getEquivalence(equals$1);
|
|
6172
6172
|
const ConsProto = {
|
|
6173
|
-
[TypeId$
|
|
6173
|
+
[TypeId$5]: TypeId$5,
|
|
6174
6174
|
_tag: "Cons",
|
|
6175
6175
|
toString() {
|
|
6176
6176
|
return format$2(this.toJSON());
|
|
@@ -6234,7 +6234,7 @@ const makeCons = (head, tail) => {
|
|
|
6234
6234
|
};
|
|
6235
6235
|
const NilHash = /*#__PURE__*/string("Nil");
|
|
6236
6236
|
const NilProto = {
|
|
6237
|
-
[TypeId$
|
|
6237
|
+
[TypeId$5]: TypeId$5,
|
|
6238
6238
|
_tag: "Nil",
|
|
6239
6239
|
toString() {
|
|
6240
6240
|
return format$2(this.toJSON());
|
|
@@ -6275,7 +6275,7 @@ const _Nil = /*#__PURE__*/Object.create(NilProto);
|
|
|
6275
6275
|
* @since 2.0.0
|
|
6276
6276
|
* @category refinements
|
|
6277
6277
|
*/
|
|
6278
|
-
const isList = u => hasProperty(u, TypeId$
|
|
6278
|
+
const isList = u => hasProperty(u, TypeId$5);
|
|
6279
6279
|
/**
|
|
6280
6280
|
* Returns `true` if the specified value is a `List.Nil<A>`, `false` otherwise.
|
|
6281
6281
|
*
|
|
@@ -6312,7 +6312,7 @@ const cons = (head, tail) => makeCons(head, tail);
|
|
|
6312
6312
|
* @since 2.0.0
|
|
6313
6313
|
* @category constructors
|
|
6314
6314
|
*/
|
|
6315
|
-
const empty$
|
|
6315
|
+
const empty$d = nil;
|
|
6316
6316
|
/**
|
|
6317
6317
|
* Constructs a new `List<A>` from the specified value.
|
|
6318
6318
|
*
|
|
@@ -6405,7 +6405,7 @@ const reduce$1 = /*#__PURE__*/dual(3, (self, zero, f) => {
|
|
|
6405
6405
|
* @category elements
|
|
6406
6406
|
*/
|
|
6407
6407
|
const reverse = self => {
|
|
6408
|
-
let result = empty$
|
|
6408
|
+
let result = empty$d();
|
|
6409
6409
|
let these = self;
|
|
6410
6410
|
while (!isNil(these)) {
|
|
6411
6411
|
result = prepend(result, these.head);
|
|
@@ -6447,7 +6447,7 @@ const _empty$2 = /*#__PURE__*/Object.create(EmptyProto$2);
|
|
|
6447
6447
|
/**
|
|
6448
6448
|
* @internal
|
|
6449
6449
|
*/
|
|
6450
|
-
const empty$
|
|
6450
|
+
const empty$c = () => _empty$2;
|
|
6451
6451
|
const AndThenProto$2 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto$2), {
|
|
6452
6452
|
_tag: "AndThen"
|
|
6453
6453
|
});
|
|
@@ -6486,7 +6486,7 @@ const makeUpdateService = (key, update) => {
|
|
|
6486
6486
|
/** @internal */
|
|
6487
6487
|
const diff$6 = (oldValue, newValue) => {
|
|
6488
6488
|
const missingServices = new Map(oldValue.unsafeMap);
|
|
6489
|
-
let patch = empty$
|
|
6489
|
+
let patch = empty$c();
|
|
6490
6490
|
for (const [tag, newService] of newValue.unsafeMap.entries()) {
|
|
6491
6491
|
if (missingServices.has(tag)) {
|
|
6492
6492
|
const old = missingServices.get(tag);
|
|
@@ -6584,7 +6584,7 @@ const EmptyProto$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(Patch
|
|
|
6584
6584
|
});
|
|
6585
6585
|
const _empty$1 = /*#__PURE__*/Object.create(EmptyProto$1);
|
|
6586
6586
|
/** @internal */
|
|
6587
|
-
const empty$
|
|
6587
|
+
const empty$b = () => _empty$1;
|
|
6588
6588
|
const AndThenProto$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto$1), {
|
|
6589
6589
|
_tag: "AndThen"
|
|
6590
6590
|
});
|
|
@@ -6615,9 +6615,9 @@ const makeRemove = value => {
|
|
|
6615
6615
|
};
|
|
6616
6616
|
/** @internal */
|
|
6617
6617
|
const diff$5 = (oldValue, newValue) => {
|
|
6618
|
-
const [removed, patch] = reduce$3([oldValue, empty$
|
|
6618
|
+
const [removed, patch] = reduce$3([oldValue, empty$b()], ([set, patch], value) => {
|
|
6619
6619
|
if (has$1(value)(set)) {
|
|
6620
|
-
return [remove$
|
|
6620
|
+
return [remove$1(value)(set), patch];
|
|
6621
6621
|
}
|
|
6622
6622
|
return [set, combine$3(makeAdd(value))(patch)];
|
|
6623
6623
|
})(newValue);
|
|
@@ -6654,7 +6654,7 @@ const patch$6 = /*#__PURE__*/dual(2, (self, oldValue) => {
|
|
|
6654
6654
|
}
|
|
6655
6655
|
case "Remove":
|
|
6656
6656
|
{
|
|
6657
|
-
set = remove$
|
|
6657
|
+
set = remove$1(head.value)(set);
|
|
6658
6658
|
patches = tail;
|
|
6659
6659
|
}
|
|
6660
6660
|
}
|
|
@@ -6681,7 +6681,7 @@ const _empty = /*#__PURE__*/Object.create(EmptyProto);
|
|
|
6681
6681
|
/**
|
|
6682
6682
|
* @internal
|
|
6683
6683
|
*/
|
|
6684
|
-
const empty$
|
|
6684
|
+
const empty$a = () => _empty;
|
|
6685
6685
|
const AndThenProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {
|
|
6686
6686
|
_tag: "AndThen"
|
|
6687
6687
|
});
|
|
@@ -6720,7 +6720,7 @@ const makeUpdate = (index, patch) => {
|
|
|
6720
6720
|
/** @internal */
|
|
6721
6721
|
const diff$4 = options => {
|
|
6722
6722
|
let i = 0;
|
|
6723
|
-
let patch = empty$
|
|
6723
|
+
let patch = empty$a();
|
|
6724
6724
|
while (i < options.oldValue.length && i < options.newValue.length) {
|
|
6725
6725
|
const oldElement = options.oldValue[i];
|
|
6726
6726
|
const newElement = options.newValue[i];
|
|
@@ -6800,7 +6800,7 @@ const DifferProto = {
|
|
|
6800
6800
|
}
|
|
6801
6801
|
};
|
|
6802
6802
|
/** @internal */
|
|
6803
|
-
const make$
|
|
6803
|
+
const make$h = params => {
|
|
6804
6804
|
const differ = Object.create(DifferProto);
|
|
6805
6805
|
differ.empty = params.empty;
|
|
6806
6806
|
differ.diff = params.diff;
|
|
@@ -6809,22 +6809,22 @@ const make$j = params => {
|
|
|
6809
6809
|
return differ;
|
|
6810
6810
|
};
|
|
6811
6811
|
/** @internal */
|
|
6812
|
-
const environment = () => make$
|
|
6813
|
-
empty: empty$
|
|
6812
|
+
const environment = () => make$h({
|
|
6813
|
+
empty: empty$c(),
|
|
6814
6814
|
combine: (first, second) => combine$4(second)(first),
|
|
6815
6815
|
diff: (oldValue, newValue) => diff$6(oldValue, newValue),
|
|
6816
6816
|
patch: (patch, oldValue) => patch$7(oldValue)(patch)
|
|
6817
6817
|
});
|
|
6818
6818
|
/** @internal */
|
|
6819
|
-
const hashSet = () => make$
|
|
6820
|
-
empty: empty$
|
|
6819
|
+
const hashSet = () => make$h({
|
|
6820
|
+
empty: empty$b(),
|
|
6821
6821
|
combine: (first, second) => combine$3(second)(first),
|
|
6822
6822
|
diff: (oldValue, newValue) => diff$5(oldValue, newValue),
|
|
6823
6823
|
patch: (patch, oldValue) => patch$6(oldValue)(patch)
|
|
6824
6824
|
});
|
|
6825
6825
|
/** @internal */
|
|
6826
|
-
const readonlyArray = differ => make$
|
|
6827
|
-
empty: empty$
|
|
6826
|
+
const readonlyArray = differ => make$h({
|
|
6827
|
+
empty: empty$a(),
|
|
6828
6828
|
combine: (first, second) => combine$2(first, second),
|
|
6829
6829
|
diff: (oldValue, newValue) => diff$4({
|
|
6830
6830
|
oldValue,
|
|
@@ -6836,7 +6836,7 @@ const readonlyArray = differ => make$j({
|
|
|
6836
6836
|
/** @internal */
|
|
6837
6837
|
const update$2 = () => updateWith((_, a) => a);
|
|
6838
6838
|
/** @internal */
|
|
6839
|
-
const updateWith = f => make$
|
|
6839
|
+
const updateWith = f => make$h({
|
|
6840
6840
|
empty: identity,
|
|
6841
6841
|
combine: (first, second) => {
|
|
6842
6842
|
if (first === identity) {
|
|
@@ -6865,15 +6865,15 @@ const active = patch => patch & BIT_MASK;
|
|
|
6865
6865
|
/** @internal */
|
|
6866
6866
|
const enabled = patch => patch >> BIT_SHIFT & BIT_MASK;
|
|
6867
6867
|
/** @internal */
|
|
6868
|
-
const make$
|
|
6868
|
+
const make$g = (active, enabled) => (active & BIT_MASK) + ((enabled & active & BIT_MASK) << BIT_SHIFT);
|
|
6869
6869
|
/** @internal */
|
|
6870
|
-
const empty$
|
|
6870
|
+
const empty$9 = /*#__PURE__*/make$g(0, 0);
|
|
6871
6871
|
/** @internal */
|
|
6872
|
-
const enable$2 = flag => make$
|
|
6872
|
+
const enable$2 = flag => make$g(flag, flag);
|
|
6873
6873
|
/** @internal */
|
|
6874
|
-
const disable$1 = flag => make$
|
|
6874
|
+
const disable$1 = flag => make$g(flag, 0);
|
|
6875
6875
|
/** @internal */
|
|
6876
|
-
const exclude$1 = /*#__PURE__*/dual(2, (self, flag) => make$
|
|
6876
|
+
const exclude$1 = /*#__PURE__*/dual(2, (self, flag) => make$g(active(self) & ~flag, enabled(self)));
|
|
6877
6877
|
/** @internal */
|
|
6878
6878
|
const andThen = /*#__PURE__*/dual(2, (self, that) => self | that);
|
|
6879
6879
|
/** @internal */
|
|
@@ -6902,19 +6902,19 @@ const interruption = self => isEnabled(self, Interruption);
|
|
|
6902
6902
|
/** @internal */
|
|
6903
6903
|
const isEnabled = /*#__PURE__*/dual(2, (self, flag) => (self & flag) !== 0);
|
|
6904
6904
|
/** @internal */
|
|
6905
|
-
const make$
|
|
6905
|
+
const make$f = (...flags) => flags.reduce((a, b) => a | b, 0);
|
|
6906
6906
|
/** @internal */
|
|
6907
|
-
const none$1 = /*#__PURE__*/make$
|
|
6907
|
+
const none$1 = /*#__PURE__*/make$f(None$1);
|
|
6908
6908
|
/** @internal */
|
|
6909
6909
|
const runtimeMetrics = self => isEnabled(self, RuntimeMetrics);
|
|
6910
6910
|
const windDown = self => isEnabled(self, WindDown);
|
|
6911
6911
|
/** @internal */
|
|
6912
|
-
const diff$3 = /*#__PURE__*/dual(2, (self, that) => make$
|
|
6912
|
+
const diff$3 = /*#__PURE__*/dual(2, (self, that) => make$g(self ^ that, that));
|
|
6913
6913
|
/** @internal */
|
|
6914
6914
|
const patch$4 = /*#__PURE__*/dual(2, (self, patch) => self & (invert(active(patch)) | enabled(patch)) | active(patch) & enabled(patch));
|
|
6915
6915
|
/** @internal */
|
|
6916
|
-
const differ$1 = /*#__PURE__*/make$
|
|
6917
|
-
empty: empty$
|
|
6916
|
+
const differ$1 = /*#__PURE__*/make$h({
|
|
6917
|
+
empty: empty$9,
|
|
6918
6918
|
diff: (oldValue, newValue) => diff$3(oldValue, newValue),
|
|
6919
6919
|
combine: (first, second) => andThen(second)(first),
|
|
6920
6920
|
patch: (_patch, oldValue) => patch$4(oldValue, _patch)
|
|
@@ -6976,10 +6976,10 @@ const seq = (self, that) => ({
|
|
|
6976
6976
|
*/
|
|
6977
6977
|
const flatten$2 = self => {
|
|
6978
6978
|
let current = of(self);
|
|
6979
|
-
let updated = empty$
|
|
6979
|
+
let updated = empty$d();
|
|
6980
6980
|
// eslint-disable-next-line no-constant-condition
|
|
6981
6981
|
while (1) {
|
|
6982
|
-
const [parallel, sequential] = reduce$1(current, [parallelCollectionEmpty(), empty$
|
|
6982
|
+
const [parallel, sequential] = reduce$1(current, [parallelCollectionEmpty(), empty$d()], ([parallel, sequential], blockedRequest) => {
|
|
6983
6983
|
const [par, seq] = step$1(blockedRequest);
|
|
6984
6984
|
return [parallelCollectionCombine(parallel, par), appendAll(sequential, seq)];
|
|
6985
6985
|
});
|
|
@@ -7000,8 +7000,8 @@ const flatten$2 = self => {
|
|
|
7000
7000
|
const step$1 = requests => {
|
|
7001
7001
|
let current = requests;
|
|
7002
7002
|
let parallel = parallelCollectionEmpty();
|
|
7003
|
-
let stack = empty$
|
|
7004
|
-
let sequential = empty$
|
|
7003
|
+
let stack = empty$d();
|
|
7004
|
+
let sequential = empty$d();
|
|
7005
7005
|
// eslint-disable-next-line no-constant-condition
|
|
7006
7006
|
while (1) {
|
|
7007
7007
|
switch (current._tag) {
|
|
@@ -7101,20 +7101,20 @@ class ParallelImpl {
|
|
|
7101
7101
|
}
|
|
7102
7102
|
}
|
|
7103
7103
|
/** @internal */
|
|
7104
|
-
const parallelCollectionEmpty = () => new ParallelImpl(empty$
|
|
7104
|
+
const parallelCollectionEmpty = () => new ParallelImpl(empty$e());
|
|
7105
7105
|
/** @internal */
|
|
7106
|
-
const parallelCollectionAdd = (self, blockedRequest) => new ParallelImpl(modifyAt(self.map, blockedRequest.dataSource, _ => orElseSome(map$
|
|
7106
|
+
const parallelCollectionAdd = (self, blockedRequest) => new ParallelImpl(modifyAt(self.map, blockedRequest.dataSource, _ => orElseSome(map$8(_, append(blockedRequest.blockedRequest)), () => of$1(blockedRequest.blockedRequest))));
|
|
7107
7107
|
/** @internal */
|
|
7108
|
-
const parallelCollectionCombine = (self, that) => new ParallelImpl(reduce$2(self.map, that.map, (map, value, key) => set$2(map, key, match$
|
|
7108
|
+
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), {
|
|
7109
7109
|
onNone: () => value,
|
|
7110
7110
|
onSome: other => appendAll$1(value, other)
|
|
7111
7111
|
}))));
|
|
7112
7112
|
/** @internal */
|
|
7113
|
-
const parallelCollectionIsEmpty = self => isEmpty$
|
|
7113
|
+
const parallelCollectionIsEmpty = self => isEmpty$3(self.map);
|
|
7114
7114
|
/** @internal */
|
|
7115
7115
|
const parallelCollectionKeys = self => Array.from(keys(self.map));
|
|
7116
7116
|
/** @internal */
|
|
7117
|
-
const parallelCollectionToSequentialCollection = self => sequentialCollectionMake(map$
|
|
7117
|
+
const parallelCollectionToSequentialCollection = self => sequentialCollectionMake(map$4(self.map, x => of$1(x)));
|
|
7118
7118
|
// TODO
|
|
7119
7119
|
// /** @internal */
|
|
7120
7120
|
// export const parallelCollectionToChunk = <R>(
|
|
@@ -7136,8 +7136,8 @@ class SequentialImpl {
|
|
|
7136
7136
|
/** @internal */
|
|
7137
7137
|
const sequentialCollectionMake = map => new SequentialImpl(map);
|
|
7138
7138
|
/** @internal */
|
|
7139
|
-
const sequentialCollectionCombine = (self, that) => new SequentialImpl(reduce$2(that.map, self.map, (map, value, key) => set$2(map, key, match$
|
|
7140
|
-
onNone: () => empty$
|
|
7139
|
+
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), {
|
|
7140
|
+
onNone: () => empty$i(),
|
|
7141
7141
|
onSome: a => appendAll$1(a, value)
|
|
7142
7142
|
}))));
|
|
7143
7143
|
/** @internal */
|
|
@@ -7227,27 +7227,27 @@ const proto$2 = {
|
|
|
7227
7227
|
// Constructors
|
|
7228
7228
|
// -----------------------------------------------------------------------------
|
|
7229
7229
|
/** @internal */
|
|
7230
|
-
const empty$
|
|
7230
|
+
const empty$8 = /*#__PURE__*/(() => {
|
|
7231
7231
|
const o = /*#__PURE__*/Object.create(proto$2);
|
|
7232
7232
|
o._tag = OP_EMPTY$2;
|
|
7233
7233
|
return o;
|
|
7234
7234
|
})();
|
|
7235
7235
|
/** @internal */
|
|
7236
|
-
const fail$
|
|
7236
|
+
const fail$2 = error => {
|
|
7237
7237
|
const o = Object.create(proto$2);
|
|
7238
7238
|
o._tag = OP_FAIL$1;
|
|
7239
7239
|
o.error = error;
|
|
7240
7240
|
return o;
|
|
7241
7241
|
};
|
|
7242
7242
|
/** @internal */
|
|
7243
|
-
const die$
|
|
7243
|
+
const die$1 = defect => {
|
|
7244
7244
|
const o = Object.create(proto$2);
|
|
7245
7245
|
o._tag = OP_DIE;
|
|
7246
7246
|
o.defect = defect;
|
|
7247
7247
|
return o;
|
|
7248
7248
|
};
|
|
7249
7249
|
/** @internal */
|
|
7250
|
-
const interrupt$
|
|
7250
|
+
const interrupt$2 = fiberId => {
|
|
7251
7251
|
const o = Object.create(proto$2);
|
|
7252
7252
|
o._tag = OP_INTERRUPT;
|
|
7253
7253
|
o.fiberId = fiberId;
|
|
@@ -7279,7 +7279,7 @@ const isEmptyType = self => self._tag === OP_EMPTY$2;
|
|
|
7279
7279
|
/** @internal */
|
|
7280
7280
|
const isDieType = self => self._tag === OP_DIE;
|
|
7281
7281
|
/** @internal */
|
|
7282
|
-
const isEmpty$
|
|
7282
|
+
const isEmpty$2 = self => {
|
|
7283
7283
|
if (self._tag === OP_EMPTY$2) {
|
|
7284
7284
|
return true;
|
|
7285
7285
|
}
|
|
@@ -7307,11 +7307,11 @@ const isInterrupted = self => isSome(interruptOption(self));
|
|
|
7307
7307
|
/** @internal */
|
|
7308
7308
|
const isInterruptedOnly = self => reduceWithContext(undefined, IsInterruptedOnlyCauseReducer)(self);
|
|
7309
7309
|
/** @internal */
|
|
7310
|
-
const failures = self => reverse$1(reduce(self, empty$
|
|
7310
|
+
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()));
|
|
7311
7311
|
/** @internal */
|
|
7312
|
-
const defects = self => reverse$1(reduce(self, empty$
|
|
7312
|
+
const defects = self => reverse$1(reduce(self, empty$i(), (list, cause) => cause._tag === OP_DIE ? some(pipe(list, prepend$1(cause.defect))) : none$4()));
|
|
7313
7313
|
/** @internal */
|
|
7314
|
-
const interruptors = self => reduce(self, empty$
|
|
7314
|
+
const interruptors = self => reduce(self, empty$f(), (set, cause) => cause._tag === OP_INTERRUPT ? some(pipe(set, add(cause.fiberId))) : none$4());
|
|
7315
7315
|
/** @internal */
|
|
7316
7316
|
const failureOption = self => find(self, cause => cause._tag === OP_FAIL$1 ? some(cause.error) : none$4());
|
|
7317
7317
|
/** @internal */
|
|
@@ -7330,54 +7330,54 @@ const failureOrCause = self => {
|
|
|
7330
7330
|
}
|
|
7331
7331
|
};
|
|
7332
7332
|
/** @internal */
|
|
7333
|
-
const flipCauseOption = self => match$
|
|
7334
|
-
onEmpty: some(empty$
|
|
7335
|
-
onFail: map$
|
|
7336
|
-
onDie: defect => some(die$
|
|
7337
|
-
onInterrupt: fiberId => some(interrupt$
|
|
7333
|
+
const flipCauseOption = self => match$3(self, {
|
|
7334
|
+
onEmpty: some(empty$8),
|
|
7335
|
+
onFail: map$8(fail$2),
|
|
7336
|
+
onDie: defect => some(die$1(defect)),
|
|
7337
|
+
onInterrupt: fiberId => some(interrupt$2(fiberId)),
|
|
7338
7338
|
onSequential: mergeWith(sequential$2),
|
|
7339
7339
|
onParallel: mergeWith(parallel$2)
|
|
7340
7340
|
});
|
|
7341
7341
|
/** @internal */
|
|
7342
7342
|
const interruptOption = self => find(self, cause => cause._tag === OP_INTERRUPT ? some(cause.fiberId) : none$4());
|
|
7343
7343
|
/** @internal */
|
|
7344
|
-
const keepDefectsAndElectFailures = self => match$
|
|
7344
|
+
const keepDefectsAndElectFailures = self => match$3(self, {
|
|
7345
7345
|
onEmpty: none$4(),
|
|
7346
|
-
onFail: failure => some(die$
|
|
7347
|
-
onDie: defect => some(die$
|
|
7346
|
+
onFail: failure => some(die$1(failure)),
|
|
7347
|
+
onDie: defect => some(die$1(defect)),
|
|
7348
7348
|
onInterrupt: () => none$4(),
|
|
7349
7349
|
onSequential: mergeWith(sequential$2),
|
|
7350
7350
|
onParallel: mergeWith(parallel$2)
|
|
7351
7351
|
});
|
|
7352
7352
|
/** @internal */
|
|
7353
|
-
const stripFailures = self => match$
|
|
7354
|
-
onEmpty: empty$
|
|
7355
|
-
onFail: () => empty$
|
|
7356
|
-
onDie: die$
|
|
7357
|
-
onInterrupt: interrupt$
|
|
7353
|
+
const stripFailures = self => match$3(self, {
|
|
7354
|
+
onEmpty: empty$8,
|
|
7355
|
+
onFail: () => empty$8,
|
|
7356
|
+
onDie: die$1,
|
|
7357
|
+
onInterrupt: interrupt$2,
|
|
7358
7358
|
onSequential: sequential$2,
|
|
7359
7359
|
onParallel: parallel$2
|
|
7360
7360
|
});
|
|
7361
7361
|
/** @internal */
|
|
7362
|
-
const electFailures = self => match$
|
|
7363
|
-
onEmpty: empty$
|
|
7364
|
-
onFail: die$
|
|
7365
|
-
onDie: die$
|
|
7366
|
-
onInterrupt: interrupt$
|
|
7362
|
+
const electFailures = self => match$3(self, {
|
|
7363
|
+
onEmpty: empty$8,
|
|
7364
|
+
onFail: die$1,
|
|
7365
|
+
onDie: die$1,
|
|
7366
|
+
onInterrupt: interrupt$2,
|
|
7367
7367
|
onSequential: sequential$2,
|
|
7368
7368
|
onParallel: parallel$2
|
|
7369
7369
|
});
|
|
7370
7370
|
/** @internal */
|
|
7371
|
-
const map$
|
|
7371
|
+
const map$3 = /*#__PURE__*/dual(2, (self, f) => flatMap$3(self, e => fail$2(f(e))));
|
|
7372
7372
|
// -----------------------------------------------------------------------------
|
|
7373
7373
|
// Sequencing
|
|
7374
7374
|
// -----------------------------------------------------------------------------
|
|
7375
7375
|
/** @internal */
|
|
7376
|
-
const flatMap$3 = /*#__PURE__*/dual(2, (self, f) => match$
|
|
7377
|
-
onEmpty: empty$
|
|
7376
|
+
const flatMap$3 = /*#__PURE__*/dual(2, (self, f) => match$3(self, {
|
|
7377
|
+
onEmpty: empty$8,
|
|
7378
7378
|
onFail: error => f(error),
|
|
7379
|
-
onDie: defect => die$
|
|
7380
|
-
onInterrupt: fiberId => interrupt$
|
|
7379
|
+
onDie: defect => die$1(defect),
|
|
7380
|
+
onInterrupt: fiberId => interrupt$2(fiberId),
|
|
7381
7381
|
onSequential: (left, right) => sequential$2(left, right),
|
|
7382
7382
|
onParallel: (left, right) => parallel$2(left, right)
|
|
7383
7383
|
}));
|
|
@@ -7386,11 +7386,11 @@ const causeEquals = (left, right) => {
|
|
|
7386
7386
|
let leftStack = of$1(left);
|
|
7387
7387
|
let rightStack = of$1(right);
|
|
7388
7388
|
while (isNonEmpty$2(leftStack) && isNonEmpty$2(rightStack)) {
|
|
7389
|
-
const [leftParallel, leftSequential] = pipe(headNonEmpty(leftStack), reduce([empty$
|
|
7389
|
+
const [leftParallel, leftSequential] = pipe(headNonEmpty(leftStack), reduce([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7390
7390
|
const [par, seq] = evaluateCause(cause);
|
|
7391
7391
|
return some([pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))]);
|
|
7392
7392
|
}));
|
|
7393
|
-
const [rightParallel, rightSequential] = pipe(headNonEmpty(rightStack), reduce([empty$
|
|
7393
|
+
const [rightParallel, rightSequential] = pipe(headNonEmpty(rightStack), reduce([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7394
7394
|
const [par, seq] = evaluateCause(cause);
|
|
7395
7395
|
return some([pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))]);
|
|
7396
7396
|
}));
|
|
@@ -7413,18 +7413,18 @@ const causeEquals = (left, right) => {
|
|
|
7413
7413
|
* @internal
|
|
7414
7414
|
*/
|
|
7415
7415
|
const flattenCause = cause => {
|
|
7416
|
-
return flattenCauseLoop(of$1(cause), empty$
|
|
7416
|
+
return flattenCauseLoop(of$1(cause), empty$i());
|
|
7417
7417
|
};
|
|
7418
7418
|
/** @internal */
|
|
7419
7419
|
const flattenCauseLoop = (causes, flattened) => {
|
|
7420
7420
|
// eslint-disable-next-line no-constant-condition
|
|
7421
7421
|
while (1) {
|
|
7422
|
-
const [parallel, sequential] = pipe(causes, reduce$7([empty$
|
|
7422
|
+
const [parallel, sequential] = pipe(causes, reduce$7([empty$f(), empty$i()], ([parallel, sequential], cause) => {
|
|
7423
7423
|
const [par, seq] = evaluateCause(cause);
|
|
7424
7424
|
return [pipe(parallel, union(par)), pipe(sequential, appendAll$1(seq))];
|
|
7425
7425
|
}));
|
|
7426
7426
|
const updated = size$1(parallel) > 0 ? pipe(flattened, prepend$1(parallel)) : flattened;
|
|
7427
|
-
if (isEmpty$
|
|
7427
|
+
if (isEmpty$5(sequential)) {
|
|
7428
7428
|
return reverse$1(updated);
|
|
7429
7429
|
}
|
|
7430
7430
|
causes = sequential;
|
|
@@ -7475,8 +7475,8 @@ const find = /*#__PURE__*/dual(2, (self, pf) => {
|
|
|
7475
7475
|
const evaluateCause = self => {
|
|
7476
7476
|
let cause = self;
|
|
7477
7477
|
const stack = [];
|
|
7478
|
-
let _parallel = empty$
|
|
7479
|
-
let _sequential = empty$
|
|
7478
|
+
let _parallel = empty$f();
|
|
7479
|
+
let _sequential = empty$i();
|
|
7480
7480
|
while (cause !== undefined) {
|
|
7481
7481
|
switch (cause._tag) {
|
|
7482
7482
|
case OP_EMPTY$2:
|
|
@@ -7489,7 +7489,7 @@ const evaluateCause = self => {
|
|
|
7489
7489
|
}
|
|
7490
7490
|
case OP_FAIL$1:
|
|
7491
7491
|
{
|
|
7492
|
-
_parallel = add(_parallel, make$
|
|
7492
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.error));
|
|
7493
7493
|
if (stack.length === 0) {
|
|
7494
7494
|
return [_parallel, _sequential];
|
|
7495
7495
|
}
|
|
@@ -7498,7 +7498,7 @@ const evaluateCause = self => {
|
|
|
7498
7498
|
}
|
|
7499
7499
|
case OP_DIE:
|
|
7500
7500
|
{
|
|
7501
|
-
_parallel = add(_parallel, make$
|
|
7501
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.defect));
|
|
7502
7502
|
if (stack.length === 0) {
|
|
7503
7503
|
return [_parallel, _sequential];
|
|
7504
7504
|
}
|
|
@@ -7507,7 +7507,7 @@ const evaluateCause = self => {
|
|
|
7507
7507
|
}
|
|
7508
7508
|
case OP_INTERRUPT:
|
|
7509
7509
|
{
|
|
7510
|
-
_parallel = add(_parallel, make$
|
|
7510
|
+
_parallel = add(_parallel, make$n(cause._tag, cause.fiberId));
|
|
7511
7511
|
if (stack.length === 0) {
|
|
7512
7512
|
return [_parallel, _sequential];
|
|
7513
7513
|
}
|
|
@@ -7563,7 +7563,7 @@ const IsInterruptedOnlyCauseReducer = {
|
|
|
7563
7563
|
const OP_SEQUENTIAL_CASE = "SequentialCase";
|
|
7564
7564
|
const OP_PARALLEL_CASE = "ParallelCase";
|
|
7565
7565
|
/** @internal */
|
|
7566
|
-
const match$
|
|
7566
|
+
const match$3 = /*#__PURE__*/dual(2, (self, {
|
|
7567
7567
|
onDie,
|
|
7568
7568
|
onEmpty,
|
|
7569
7569
|
onFail,
|
|
@@ -7874,7 +7874,7 @@ const pending = joiners => {
|
|
|
7874
7874
|
};
|
|
7875
7875
|
};
|
|
7876
7876
|
/** @internal */
|
|
7877
|
-
const done$
|
|
7877
|
+
const done$4 = effect => {
|
|
7878
7878
|
return {
|
|
7879
7879
|
_tag: OP_STATE_DONE,
|
|
7880
7880
|
effect
|
|
@@ -8091,16 +8091,16 @@ const acquireUseRelease$1 = /*#__PURE__*/dual(3, (acquire, use, release) => unin
|
|
|
8091
8091
|
onFailure: cause => {
|
|
8092
8092
|
switch (exit._tag) {
|
|
8093
8093
|
case OP_FAILURE:
|
|
8094
|
-
return failCause$
|
|
8094
|
+
return failCause$2(sequential$2(exit.effect_instruction_i0, cause));
|
|
8095
8095
|
case OP_SUCCESS:
|
|
8096
|
-
return failCause$
|
|
8096
|
+
return failCause$2(cause);
|
|
8097
8097
|
}
|
|
8098
8098
|
},
|
|
8099
8099
|
onSuccess: () => exit
|
|
8100
8100
|
}));
|
|
8101
8101
|
}))));
|
|
8102
8102
|
/* @internal */
|
|
8103
|
-
const as$1 = /*#__PURE__*/dual(2, (self, value) => flatMap$2(self, () => succeed$
|
|
8103
|
+
const as$1 = /*#__PURE__*/dual(2, (self, value) => flatMap$2(self, () => succeed$2(value)));
|
|
8104
8104
|
/* @internal */
|
|
8105
8105
|
const asVoid$1 = self => as$1(self, void 0);
|
|
8106
8106
|
/* @internal */
|
|
@@ -8143,7 +8143,7 @@ const unsafeAsync = (register, blockingOn = none$2) => {
|
|
|
8143
8143
|
cancelerRef = register(resume);
|
|
8144
8144
|
};
|
|
8145
8145
|
effect.effect_instruction_i1 = blockingOn;
|
|
8146
|
-
return onInterrupt(effect, _ => isEffect$1(cancelerRef) ? cancelerRef : void_$
|
|
8146
|
+
return onInterrupt(effect, _ => isEffect$1(cancelerRef) ? cancelerRef : void_$1);
|
|
8147
8147
|
};
|
|
8148
8148
|
/* @internal */
|
|
8149
8149
|
const asyncInterrupt = (register, blockingOn = none$2) => suspend$1(() => unsafeAsync(register, blockingOn));
|
|
@@ -8178,7 +8178,7 @@ const async_ = (resume, blockingOn = none$2) => {
|
|
|
8178
8178
|
if (controllerRef) {
|
|
8179
8179
|
controllerRef.abort();
|
|
8180
8180
|
}
|
|
8181
|
-
return cancelerRef ?? void_$
|
|
8181
|
+
return cancelerRef ?? void_$1;
|
|
8182
8182
|
}) : effect;
|
|
8183
8183
|
});
|
|
8184
8184
|
};
|
|
@@ -8192,7 +8192,7 @@ const catchAllCause$1 = /*#__PURE__*/dual(2, (self, f) => {
|
|
|
8192
8192
|
/* @internal */
|
|
8193
8193
|
const catchAll$1 = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {
|
|
8194
8194
|
onFailure: f,
|
|
8195
|
-
onSuccess: succeed$
|
|
8195
|
+
onSuccess: succeed$2
|
|
8196
8196
|
}));
|
|
8197
8197
|
const originalSymbol = /*#__PURE__*/Symbol.for("effect/OriginalAnnotation");
|
|
8198
8198
|
/* @internal */
|
|
@@ -8217,13 +8217,13 @@ const capture = (obj, span) => {
|
|
|
8217
8217
|
return obj;
|
|
8218
8218
|
};
|
|
8219
8219
|
/* @internal */
|
|
8220
|
-
const die
|
|
8220
|
+
const die = defect => isObject(defect) && !(spanSymbol in defect) ? withFiberRuntime$1(fiber => failCause$2(die$1(capture(defect, currentSpanFromFiber(fiber))))) : failCause$2(die$1(defect));
|
|
8221
8221
|
/* @internal */
|
|
8222
|
-
const dieMessage$1 = message => failCauseSync(() => die$
|
|
8222
|
+
const dieMessage$1 = message => failCauseSync(() => die$1(new RuntimeException(message)));
|
|
8223
8223
|
/* @internal */
|
|
8224
8224
|
const either = self => matchEffect(self, {
|
|
8225
|
-
onFailure: e => succeed$
|
|
8226
|
-
onSuccess: a => succeed$
|
|
8225
|
+
onFailure: e => succeed$2(left(e)),
|
|
8226
|
+
onSuccess: a => succeed$2(right(a))
|
|
8227
8227
|
});
|
|
8228
8228
|
/* @internal */
|
|
8229
8229
|
const exit$1 = self => matchCause$1(self, {
|
|
@@ -8231,19 +8231,19 @@ const exit$1 = self => matchCause$1(self, {
|
|
|
8231
8231
|
onSuccess: exitSucceed$1
|
|
8232
8232
|
});
|
|
8233
8233
|
/* @internal */
|
|
8234
|
-
const fail$
|
|
8234
|
+
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));
|
|
8235
8235
|
/* @internal */
|
|
8236
|
-
const failSync = evaluate => flatMap$2(sync$1(evaluate), fail$
|
|
8236
|
+
const failSync = evaluate => flatMap$2(sync$1(evaluate), fail$1);
|
|
8237
8237
|
/* @internal */
|
|
8238
|
-
const failCause$
|
|
8238
|
+
const failCause$2 = cause => {
|
|
8239
8239
|
const effect = new EffectPrimitiveFailure(OP_FAILURE);
|
|
8240
8240
|
effect.effect_instruction_i0 = cause;
|
|
8241
8241
|
return effect;
|
|
8242
8242
|
};
|
|
8243
8243
|
/* @internal */
|
|
8244
|
-
const failCauseSync = evaluate => flatMap$2(sync$1(evaluate), failCause$
|
|
8244
|
+
const failCauseSync = evaluate => flatMap$2(sync$1(evaluate), failCause$2);
|
|
8245
8245
|
/* @internal */
|
|
8246
|
-
const fiberId = /*#__PURE__*/withFiberRuntime$1(state => succeed$
|
|
8246
|
+
const fiberId = /*#__PURE__*/withFiberRuntime$1(state => succeed$2(state.id()));
|
|
8247
8247
|
/* @internal */
|
|
8248
8248
|
const fiberIdWith$1 = f => withFiberRuntime$1(state => f(state.id()));
|
|
8249
8249
|
/* @internal */
|
|
@@ -8263,8 +8263,8 @@ const step = self => {
|
|
|
8263
8263
|
const flatten$1 = self => flatMap$2(self, identity);
|
|
8264
8264
|
/* @internal */
|
|
8265
8265
|
const matchCause$1 = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect$2(self, {
|
|
8266
|
-
onFailure: cause => succeed$
|
|
8267
|
-
onSuccess: a => succeed$
|
|
8266
|
+
onFailure: cause => succeed$2(options.onFailure(cause)),
|
|
8267
|
+
onSuccess: a => succeed$2(options.onSuccess(a))
|
|
8268
8268
|
}));
|
|
8269
8269
|
/* @internal */
|
|
8270
8270
|
const matchCauseEffect$2 = /*#__PURE__*/dual(2, (self, options) => {
|
|
@@ -8279,13 +8279,13 @@ const matchEffect = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect$2(s
|
|
|
8279
8279
|
onFailure: cause => {
|
|
8280
8280
|
const defects$1 = defects(cause);
|
|
8281
8281
|
if (defects$1.length > 0) {
|
|
8282
|
-
return failCause$
|
|
8282
|
+
return failCause$2(electFailures(cause));
|
|
8283
8283
|
}
|
|
8284
8284
|
const failures$1 = failures(cause);
|
|
8285
8285
|
if (failures$1.length > 0) {
|
|
8286
8286
|
return options.onFailure(unsafeHead(failures$1));
|
|
8287
8287
|
}
|
|
8288
|
-
return failCause$
|
|
8288
|
+
return failCause$2(cause);
|
|
8289
8289
|
},
|
|
8290
8290
|
onSuccess: options.onSuccess
|
|
8291
8291
|
}));
|
|
@@ -8315,9 +8315,9 @@ const forEachSequentialDiscard = /*#__PURE__*/dual(2, (self, f) => suspend$1(()
|
|
|
8315
8315
|
});
|
|
8316
8316
|
}));
|
|
8317
8317
|
/* @internal */
|
|
8318
|
-
const interrupt$
|
|
8318
|
+
const interrupt$1 = /*#__PURE__*/flatMap$2(fiberId, fiberId => interruptWith(fiberId));
|
|
8319
8319
|
/* @internal */
|
|
8320
|
-
const interruptWith = fiberId => failCause$
|
|
8320
|
+
const interruptWith = fiberId => failCause$2(interrupt$2(fiberId));
|
|
8321
8321
|
/* @internal */
|
|
8322
8322
|
const interruptible$2 = self => {
|
|
8323
8323
|
const effect = new EffectPrimitive(OP_UPDATE_RUNTIME_FLAGS);
|
|
@@ -8328,7 +8328,7 @@ const interruptible$2 = self => {
|
|
|
8328
8328
|
/* @internal */
|
|
8329
8329
|
const intoDeferred$1 = /*#__PURE__*/dual(2, (self, deferred) => uninterruptibleMask$2(restore => flatMap$2(exit$1(restore(self)), exit => deferredDone(deferred, exit))));
|
|
8330
8330
|
/* @internal */
|
|
8331
|
-
const map$
|
|
8331
|
+
const map$2 = /*#__PURE__*/dual(2, (self, f) => flatMap$2(self, a => sync$1(() => f(a))));
|
|
8332
8332
|
/* @internal */
|
|
8333
8333
|
const mapBoth = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {
|
|
8334
8334
|
onFailure: e => failSync(() => options.onFailure(e)),
|
|
@@ -8345,11 +8345,11 @@ const mapError$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
|
8345
8345
|
}
|
|
8346
8346
|
case "Right":
|
|
8347
8347
|
{
|
|
8348
|
-
return failCause$
|
|
8348
|
+
return failCause$2(either.right);
|
|
8349
8349
|
}
|
|
8350
8350
|
}
|
|
8351
8351
|
},
|
|
8352
|
-
onSuccess: succeed$
|
|
8352
|
+
onSuccess: succeed$2
|
|
8353
8353
|
}));
|
|
8354
8354
|
/* @internal */
|
|
8355
8355
|
const onExit$1 = /*#__PURE__*/dual(2, (self, cleanup) => uninterruptibleMask$2(restore => matchCauseEffect$2(restore(self), {
|
|
@@ -8362,25 +8362,25 @@ const onExit$1 = /*#__PURE__*/dual(2, (self, cleanup) => uninterruptibleMask$2(r
|
|
|
8362
8362
|
},
|
|
8363
8363
|
onSuccess: success => {
|
|
8364
8364
|
const result = exitSucceed$1(success);
|
|
8365
|
-
return zipRight$
|
|
8365
|
+
return zipRight$1(cleanup(result), result);
|
|
8366
8366
|
}
|
|
8367
8367
|
})));
|
|
8368
8368
|
/* @internal */
|
|
8369
8369
|
const onInterrupt = /*#__PURE__*/dual(2, (self, cleanup) => onExit$1(self, exitMatch({
|
|
8370
|
-
onFailure: cause => isInterruptedOnly(cause) ? asVoid$1(cleanup(interruptors(cause))) : void_$
|
|
8371
|
-
onSuccess: () => void_$
|
|
8370
|
+
onFailure: cause => isInterruptedOnly(cause) ? asVoid$1(cleanup(interruptors(cause))) : void_$1,
|
|
8371
|
+
onSuccess: () => void_$1
|
|
8372
8372
|
})));
|
|
8373
8373
|
/* @internal */
|
|
8374
|
-
const orElse = /*#__PURE__*/dual(2, (self, that) => attemptOrElse(self, that, succeed$
|
|
8374
|
+
const orElse = /*#__PURE__*/dual(2, (self, that) => attemptOrElse(self, that, succeed$2));
|
|
8375
8375
|
/* @internal */
|
|
8376
8376
|
const orDie = self => orDieWith(self, identity);
|
|
8377
8377
|
/* @internal */
|
|
8378
8378
|
const orDieWith = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {
|
|
8379
|
-
onFailure: e => die
|
|
8380
|
-
onSuccess: succeed$
|
|
8379
|
+
onFailure: e => die(f(e)),
|
|
8380
|
+
onSuccess: succeed$2
|
|
8381
8381
|
}));
|
|
8382
8382
|
/* @internal */
|
|
8383
|
-
const succeed$
|
|
8383
|
+
const succeed$2 = value => {
|
|
8384
8384
|
const effect = new EffectPrimitiveSuccess(OP_SUCCESS);
|
|
8385
8385
|
effect.effect_instruction_i0 = value;
|
|
8386
8386
|
return effect;
|
|
@@ -8404,10 +8404,10 @@ const tap$1 = /*#__PURE__*/dual(args => args.length === 3 || args.length === 2 &
|
|
|
8404
8404
|
return as$1(b, a);
|
|
8405
8405
|
} else if (isPromiseLike(b)) {
|
|
8406
8406
|
return unsafeAsync(resume => {
|
|
8407
|
-
b.then(_ => resume(succeed$
|
|
8407
|
+
b.then(_ => resume(succeed$2(a)), e => resume(fail$1(new UnknownException(e, "An unknown error occurred in Effect.tap"))));
|
|
8408
8408
|
});
|
|
8409
8409
|
}
|
|
8410
|
-
return succeed$
|
|
8410
|
+
return succeed$2(a);
|
|
8411
8411
|
}));
|
|
8412
8412
|
/* @internal */
|
|
8413
8413
|
const transplant = f => withFiberRuntime$1(state => {
|
|
@@ -8420,7 +8420,7 @@ const attemptOrElse = /*#__PURE__*/dual(3, (self, that, onSuccess) => matchCause
|
|
|
8420
8420
|
onFailure: cause => {
|
|
8421
8421
|
const defects$1 = defects(cause);
|
|
8422
8422
|
if (defects$1.length > 0) {
|
|
8423
|
-
return failCause$
|
|
8423
|
+
return failCause$2(getOrThrow(keepDefectsAndElectFailures(cause)));
|
|
8424
8424
|
}
|
|
8425
8425
|
return that();
|
|
8426
8426
|
},
|
|
@@ -8440,7 +8440,7 @@ const uninterruptibleMask$2 = f => custom(f, function () {
|
|
|
8440
8440
|
effect.effect_instruction_i1 = oldFlags => interruption(oldFlags) ? internalCall(() => this.effect_instruction_i0(interruptible$2)) : internalCall(() => this.effect_instruction_i0(uninterruptible$1));
|
|
8441
8441
|
return effect;
|
|
8442
8442
|
});
|
|
8443
|
-
const void_$
|
|
8443
|
+
const void_$1 = /*#__PURE__*/succeed$2(void 0);
|
|
8444
8444
|
/* @internal */
|
|
8445
8445
|
const updateRuntimeFlags = patch => {
|
|
8446
8446
|
const effect = new EffectPrimitive(OP_UPDATE_RUNTIME_FLAGS);
|
|
@@ -8451,9 +8451,9 @@ const updateRuntimeFlags = patch => {
|
|
|
8451
8451
|
/* @internal */
|
|
8452
8452
|
const whenEffect = /*#__PURE__*/dual(2, (self, condition) => flatMap$2(condition, b => {
|
|
8453
8453
|
if (b) {
|
|
8454
|
-
return pipe(self, map$
|
|
8454
|
+
return pipe(self, map$2(some));
|
|
8455
8455
|
}
|
|
8456
|
-
return succeed$
|
|
8456
|
+
return succeed$2(none$4());
|
|
8457
8457
|
}));
|
|
8458
8458
|
/* @internal */
|
|
8459
8459
|
const whileLoop = options => {
|
|
@@ -8493,13 +8493,13 @@ const yieldNow$2 = options => {
|
|
|
8493
8493
|
return typeof options?.priority !== "undefined" ? withSchedulingPriority(effect, options.priority) : effect;
|
|
8494
8494
|
};
|
|
8495
8495
|
/* @internal */
|
|
8496
|
-
const zip$
|
|
8496
|
+
const zip$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, a => map$2(that, b => [a, b])));
|
|
8497
8497
|
/* @internal */
|
|
8498
8498
|
const zipLeft$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, a => as$1(that, a)));
|
|
8499
8499
|
/* @internal */
|
|
8500
|
-
const zipRight$
|
|
8500
|
+
const zipRight$1 = /*#__PURE__*/dual(2, (self, that) => flatMap$2(self, () => that));
|
|
8501
8501
|
/* @internal */
|
|
8502
|
-
const zipWith$1 = /*#__PURE__*/dual(3, (self, that, f) => flatMap$2(self, a => map$
|
|
8502
|
+
const zipWith$1 = /*#__PURE__*/dual(3, (self, that, f) => flatMap$2(self, a => map$2(that, b => f(a, b))));
|
|
8503
8503
|
// -----------------------------------------------------------------------------
|
|
8504
8504
|
// Fiber
|
|
8505
8505
|
// -----------------------------------------------------------------------------
|
|
@@ -8611,7 +8611,7 @@ const fiberRefSet = /*#__PURE__*/dual(2, (self, value) => fiberRefModify(self, (
|
|
|
8611
8611
|
const fiberRefModify = /*#__PURE__*/dual(2, (self, f) => withFiberRuntime$1(state => {
|
|
8612
8612
|
const [b, a] = f(state.getFiberRef(self));
|
|
8613
8613
|
state.setFiberRef(self, a);
|
|
8614
|
-
return succeed$
|
|
8614
|
+
return succeed$2(b);
|
|
8615
8615
|
}));
|
|
8616
8616
|
/* @internal */
|
|
8617
8617
|
const fiberRefLocally = /*#__PURE__*/dual(3, (use, self, value) => acquireUseRelease$1(zipLeft$1(fiberRefGet(self), fiberRefSet(self, value)), () => use, oldValue => fiberRefSet(self, oldValue)));
|
|
@@ -8670,17 +8670,17 @@ const fiberRefUnsafeMakeRuntimeFlags = initial => fiberRefUnsafeMakePatch(initia
|
|
|
8670
8670
|
fork: differ$1.empty
|
|
8671
8671
|
});
|
|
8672
8672
|
/** @internal */
|
|
8673
|
-
const currentContext = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentContext"), () => fiberRefUnsafeMakeContext(empty$
|
|
8673
|
+
const currentContext = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentContext"), () => fiberRefUnsafeMakeContext(empty$j()));
|
|
8674
8674
|
/** @internal */
|
|
8675
8675
|
const currentSchedulingPriority = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentSchedulingPriority"), () => fiberRefUnsafeMake(0));
|
|
8676
8676
|
/** @internal */
|
|
8677
8677
|
const currentMaxOpsBeforeYield = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"), () => fiberRefUnsafeMake(2048));
|
|
8678
8678
|
/** @internal */
|
|
8679
|
-
const currentLogAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogAnnotation"), () => fiberRefUnsafeMake(empty$
|
|
8679
|
+
const currentLogAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogAnnotation"), () => fiberRefUnsafeMake(empty$e()));
|
|
8680
8680
|
/** @internal */
|
|
8681
8681
|
const currentLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogLevel"), () => fiberRefUnsafeMake(logLevelInfo));
|
|
8682
8682
|
/** @internal */
|
|
8683
|
-
const currentLogSpan = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogSpan"), () => fiberRefUnsafeMake(empty$
|
|
8683
|
+
const currentLogSpan = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLogSpan"), () => fiberRefUnsafeMake(empty$d()));
|
|
8684
8684
|
/** @internal */
|
|
8685
8685
|
const withSchedulingPriority = /*#__PURE__*/dual(2, (self, scheduler) => fiberRefLocally(self, currentSchedulingPriority, scheduler));
|
|
8686
8686
|
/** @internal */
|
|
@@ -8694,15 +8694,15 @@ const currentUnhandledErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symb
|
|
|
8694
8694
|
/** @internal */
|
|
8695
8695
|
const currentVersionMismatchErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"), () => fiberRefUnsafeMake(some(logLevelWarning)));
|
|
8696
8696
|
/** @internal */
|
|
8697
|
-
const currentMetricLabels = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMetricLabels"), () => fiberRefUnsafeMakeReadonlyArray(empty$
|
|
8697
|
+
const currentMetricLabels = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentMetricLabels"), () => fiberRefUnsafeMakeReadonlyArray(empty$l()));
|
|
8698
8698
|
/** @internal */
|
|
8699
8699
|
const currentForkScopeOverride = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentForkScopeOverride"), () => fiberRefUnsafeMake(none$4(), {
|
|
8700
8700
|
fork: () => none$4(),
|
|
8701
8701
|
join: (parent, _) => parent
|
|
8702
8702
|
}));
|
|
8703
8703
|
/** @internal */
|
|
8704
|
-
const currentInterruptedCause = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentInterruptedCause"), () => fiberRefUnsafeMake(empty$
|
|
8705
|
-
fork: () => empty$
|
|
8704
|
+
const currentInterruptedCause = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentInterruptedCause"), () => fiberRefUnsafeMake(empty$8, {
|
|
8705
|
+
fork: () => empty$8,
|
|
8706
8706
|
join: (parent, _) => parent
|
|
8707
8707
|
}));
|
|
8708
8708
|
// -----------------------------------------------------------------------------
|
|
@@ -8727,7 +8727,7 @@ const scopeFork = (self, strategy) => self.fork(strategy);
|
|
|
8727
8727
|
const YieldableError = /*#__PURE__*/function () {
|
|
8728
8728
|
class YieldableError extends globalThis.Error {
|
|
8729
8729
|
commit() {
|
|
8730
|
-
return fail$
|
|
8730
|
+
return fail$1(this);
|
|
8731
8731
|
}
|
|
8732
8732
|
toJSON() {
|
|
8733
8733
|
const obj = {
|
|
@@ -8741,7 +8741,7 @@ const YieldableError = /*#__PURE__*/function () {
|
|
|
8741
8741
|
if (this.toString !== globalThis.Error.prototype.toString) {
|
|
8742
8742
|
return this.stack ? `${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
8743
8743
|
} else if ("Bun" in globalThis) {
|
|
8744
|
-
return pretty(fail$
|
|
8744
|
+
return pretty(fail$2(this), {
|
|
8745
8745
|
renderErrorCause: true
|
|
8746
8746
|
});
|
|
8747
8747
|
}
|
|
@@ -8823,9 +8823,9 @@ const exitAsVoid = self => exitAs(self, void 0);
|
|
|
8823
8823
|
/** @internal */
|
|
8824
8824
|
const exitCollectAll = (exits, options) => exitCollectAllInternal(exits, options?.parallel ? parallel$2 : sequential$2);
|
|
8825
8825
|
/** @internal */
|
|
8826
|
-
const exitDie$1 = defect => exitFailCause$1(die$
|
|
8826
|
+
const exitDie$1 = defect => exitFailCause$1(die$1(defect));
|
|
8827
8827
|
/** @internal */
|
|
8828
|
-
const exitFail = error => exitFailCause$1(fail$
|
|
8828
|
+
const exitFail = error => exitFailCause$1(fail$2(error));
|
|
8829
8829
|
/** @internal */
|
|
8830
8830
|
const exitFailCause$1 = cause => {
|
|
8831
8831
|
const effect = new EffectPrimitiveFailure(OP_FAILURE);
|
|
@@ -8833,7 +8833,7 @@ const exitFailCause$1 = cause => {
|
|
|
8833
8833
|
return effect;
|
|
8834
8834
|
};
|
|
8835
8835
|
/** @internal */
|
|
8836
|
-
const exitInterrupt$1 = fiberId => exitFailCause$1(interrupt$
|
|
8836
|
+
const exitInterrupt$1 = fiberId => exitFailCause$1(interrupt$2(fiberId));
|
|
8837
8837
|
/** @internal */
|
|
8838
8838
|
const exitMap = /*#__PURE__*/dual(2, (self, f) => {
|
|
8839
8839
|
switch (self._tag) {
|
|
@@ -8931,7 +8931,7 @@ const deferredUnsafeMake = fiberId => {
|
|
|
8931
8931
|
const _deferred = {
|
|
8932
8932
|
...CommitPrototype,
|
|
8933
8933
|
[DeferredTypeId]: deferredVariance,
|
|
8934
|
-
state: make$
|
|
8934
|
+
state: make$i(pending([])),
|
|
8935
8935
|
commit() {
|
|
8936
8936
|
return deferredAwait(this);
|
|
8937
8937
|
},
|
|
@@ -8969,7 +8969,7 @@ const deferredCompleteWith = /*#__PURE__*/dual(2, (self, effect) => sync$1(() =>
|
|
|
8969
8969
|
}
|
|
8970
8970
|
case OP_STATE_PENDING:
|
|
8971
8971
|
{
|
|
8972
|
-
set$3(self.state, done$
|
|
8972
|
+
set$3(self.state, done$4(effect));
|
|
8973
8973
|
for (let i = 0, len = state.joiners.length; i < len; i++) {
|
|
8974
8974
|
state.joiners[i](effect);
|
|
8975
8975
|
}
|
|
@@ -8980,7 +8980,7 @@ const deferredCompleteWith = /*#__PURE__*/dual(2, (self, effect) => sync$1(() =>
|
|
|
8980
8980
|
/* @internal */
|
|
8981
8981
|
const deferredDone = /*#__PURE__*/dual(2, (self, exit) => deferredCompleteWith(self, exit));
|
|
8982
8982
|
/* @internal */
|
|
8983
|
-
const deferredFailCause = /*#__PURE__*/dual(2, (self, cause) => deferredCompleteWith(self, failCause$
|
|
8983
|
+
const deferredFailCause = /*#__PURE__*/dual(2, (self, cause) => deferredCompleteWith(self, failCause$2(cause)));
|
|
8984
8984
|
/* @internal */
|
|
8985
8985
|
const deferredInterrupt = self => flatMap$2(fiberId, fiberId => deferredCompleteWith(self, interruptWith(fiberId)));
|
|
8986
8986
|
/* @internal */
|
|
@@ -8988,12 +8988,12 @@ const deferredInterruptWith = /*#__PURE__*/dual(2, (self, fiberId) => deferredCo
|
|
|
8988
8988
|
/* @internal */
|
|
8989
8989
|
const deferredIsDone = self => sync$1(() => get$4(self.state)._tag === OP_STATE_DONE);
|
|
8990
8990
|
/* @internal */
|
|
8991
|
-
const deferredSucceed = /*#__PURE__*/dual(2, (self, value) => deferredCompleteWith(self, succeed$
|
|
8991
|
+
const deferredSucceed = /*#__PURE__*/dual(2, (self, value) => deferredCompleteWith(self, succeed$2(value)));
|
|
8992
8992
|
/** @internal */
|
|
8993
8993
|
const deferredUnsafeDone = (self, effect) => {
|
|
8994
8994
|
const state = get$4(self.state);
|
|
8995
8995
|
if (state._tag === OP_STATE_PENDING) {
|
|
8996
|
-
set$3(self.state, done$
|
|
8996
|
+
set$3(self.state, done$4(effect));
|
|
8997
8997
|
for (let i = 0, len = state.joiners.length; i < len; i++) {
|
|
8998
8998
|
state.joiners[i](effect);
|
|
8999
8999
|
}
|
|
@@ -9032,147 +9032,9 @@ const currentSpanFromFiber = fiber => {
|
|
|
9032
9032
|
return span !== undefined && span._tag === "Span" ? some(span) : none$4();
|
|
9033
9033
|
};
|
|
9034
9034
|
|
|
9035
|
-
|
|
9036
|
-
* Creates a new `Deferred`.
|
|
9037
|
-
*
|
|
9038
|
-
* @since 2.0.0
|
|
9039
|
-
* @category constructors
|
|
9040
|
-
*/
|
|
9041
|
-
const make$g = deferredMake;
|
|
9042
|
-
const _await$1 = deferredAwait;
|
|
9043
|
-
/**
|
|
9044
|
-
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
9045
|
-
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
9046
|
-
*
|
|
9047
|
-
* @since 2.0.0
|
|
9048
|
-
* @category utils
|
|
9049
|
-
*/
|
|
9050
|
-
const done$4 = deferredDone;
|
|
9051
|
-
/**
|
|
9052
|
-
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
|
|
9053
|
-
* all fibers waiting on the value of the `Deferred`.
|
|
9054
|
-
*
|
|
9055
|
-
* @since 2.0.0
|
|
9056
|
-
* @category utils
|
|
9057
|
-
*/
|
|
9058
|
-
const failCause$3 = deferredFailCause;
|
|
9059
|
-
/**
|
|
9060
|
-
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
9061
|
-
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
9062
|
-
* calling this method.
|
|
9063
|
-
*
|
|
9064
|
-
* @since 2.0.0
|
|
9065
|
-
* @category utils
|
|
9066
|
-
*/
|
|
9067
|
-
const interrupt$1 = deferredInterrupt;
|
|
9068
|
-
/**
|
|
9069
|
-
* Returns `true` if this `Deferred` has already been completed with a value or
|
|
9070
|
-
* an error, `false` otherwise.
|
|
9071
|
-
*
|
|
9072
|
-
* @since 2.0.0
|
|
9073
|
-
* @category getters
|
|
9074
|
-
*/
|
|
9075
|
-
const isDone$4 = deferredIsDone;
|
|
9076
|
-
/**
|
|
9077
|
-
* Completes the `Deferred` with the specified value.
|
|
9078
|
-
*
|
|
9079
|
-
* @since 2.0.0
|
|
9080
|
-
* @category utils
|
|
9081
|
-
*/
|
|
9082
|
-
const succeed$3 = deferredSucceed;
|
|
9083
|
-
/**
|
|
9084
|
-
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
9085
|
-
*
|
|
9086
|
-
* @since 2.0.0
|
|
9087
|
-
* @category unsafe
|
|
9088
|
-
*/
|
|
9089
|
-
const unsafeMake$4 = deferredUnsafeMake;
|
|
9090
|
-
|
|
9091
|
-
/**
|
|
9092
|
-
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
|
9093
|
-
*
|
|
9094
|
-
* @since 2.0.0
|
|
9095
|
-
* @category refinements
|
|
9096
|
-
*/
|
|
9097
|
-
const isFailure = exitIsFailure;
|
|
9098
|
-
/**
|
|
9099
|
-
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
|
9100
|
-
*
|
|
9101
|
-
* @since 2.0.0
|
|
9102
|
-
* @category refinements
|
|
9103
|
-
*/
|
|
9104
|
-
const isSuccess = exitIsSuccess;
|
|
9105
|
-
/**
|
|
9106
|
-
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
|
|
9107
|
-
* the provided iterable contains no elements, `None` will be returned.
|
|
9108
|
-
*
|
|
9109
|
-
* @since 2.0.0
|
|
9110
|
-
* @category constructors
|
|
9111
|
-
*/
|
|
9112
|
-
const all$2 = exitCollectAll;
|
|
9113
|
-
/**
|
|
9114
|
-
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
|
9115
|
-
*
|
|
9116
|
-
* @since 2.0.0
|
|
9117
|
-
* @category constructors
|
|
9118
|
-
*/
|
|
9119
|
-
const die = exitDie$1;
|
|
9120
|
-
/**
|
|
9121
|
-
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
|
9122
|
-
* `E`.
|
|
9123
|
-
*
|
|
9124
|
-
* @since 2.0.0
|
|
9125
|
-
* @category constructors
|
|
9126
|
-
*/
|
|
9127
|
-
const fail$1 = exitFail;
|
|
9128
|
-
/**
|
|
9129
|
-
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
|
9130
|
-
*
|
|
9131
|
-
* @since 2.0.0
|
|
9132
|
-
* @category constructors
|
|
9133
|
-
*/
|
|
9134
|
-
const failCause$2 = exitFailCause$1;
|
|
9135
|
-
/**
|
|
9136
|
-
* Maps over the `Success` value of the specified exit using the provided
|
|
9137
|
-
* function.
|
|
9138
|
-
*
|
|
9139
|
-
* @since 2.0.0
|
|
9140
|
-
* @category mapping
|
|
9141
|
-
*/
|
|
9142
|
-
const map$2 = exitMap;
|
|
9143
|
-
/**
|
|
9144
|
-
* @since 2.0.0
|
|
9145
|
-
* @category folding
|
|
9146
|
-
*/
|
|
9147
|
-
const match$3 = exitMatch;
|
|
9148
|
-
/**
|
|
9149
|
-
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
9150
|
-
*
|
|
9151
|
-
* @since 2.0.0
|
|
9152
|
-
* @category constructors
|
|
9153
|
-
*/
|
|
9154
|
-
const succeed$2 = exitSucceed$1;
|
|
9155
|
-
const void_$1 = exitVoid$1;
|
|
9156
|
-
/**
|
|
9157
|
-
* Sequentially zips the this result with the specified result or else returns
|
|
9158
|
-
* the failed `Cause<E | E2>`.
|
|
9159
|
-
*
|
|
9160
|
-
* @since 2.0.0
|
|
9161
|
-
* @category zipping
|
|
9162
|
-
*/
|
|
9163
|
-
const zip$1 = exitZip;
|
|
9164
|
-
/**
|
|
9165
|
-
* Sequentially zips the this result with the specified result discarding the
|
|
9166
|
-
* first element of the tuple or else returns the failed `Cause<E | E2>`.
|
|
9167
|
-
*
|
|
9168
|
-
* @since 2.0.0
|
|
9169
|
-
* @category zipping
|
|
9170
|
-
*/
|
|
9171
|
-
const zipRight$1 = exitZipRight;
|
|
9172
|
-
|
|
9173
|
-
const TypeId$6 = /*#__PURE__*/Symbol.for("effect/MutableHashMap");
|
|
9035
|
+
const TypeId$4 = /*#__PURE__*/Symbol.for("effect/MutableHashMap");
|
|
9174
9036
|
const MutableHashMapProto = {
|
|
9175
|
-
[TypeId$
|
|
9037
|
+
[TypeId$4]: TypeId$4,
|
|
9176
9038
|
[Symbol.iterator]() {
|
|
9177
9039
|
return new MutableHashMapIterator(this);
|
|
9178
9040
|
},
|
|
@@ -9241,7 +9103,7 @@ class BucketIterator {
|
|
|
9241
9103
|
* @since 2.0.0
|
|
9242
9104
|
* @category constructors
|
|
9243
9105
|
*/
|
|
9244
|
-
const empty$
|
|
9106
|
+
const empty$7 = () => {
|
|
9245
9107
|
const self = Object.create(MutableHashMapProto);
|
|
9246
9108
|
self.referential = new Map();
|
|
9247
9109
|
self.buckets = new Map();
|
|
@@ -9313,7 +9175,7 @@ const removeFromBucket = (self, bucket, key) => {
|
|
|
9313
9175
|
/**
|
|
9314
9176
|
* @since 2.0.0
|
|
9315
9177
|
*/
|
|
9316
|
-
const remove
|
|
9178
|
+
const remove = /*#__PURE__*/dual(2, (self, key) => {
|
|
9317
9179
|
if (isEqual(key) === false) {
|
|
9318
9180
|
self.referential.delete(key);
|
|
9319
9181
|
return self;
|
|
@@ -9337,296 +9199,6 @@ const size = self => {
|
|
|
9337
9199
|
return self.referential.size + self.bucketsSize;
|
|
9338
9200
|
};
|
|
9339
9201
|
|
|
9340
|
-
/**
|
|
9341
|
-
* @since 2.0.0
|
|
9342
|
-
*/
|
|
9343
|
-
const TypeId$5 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
9344
|
-
const MutableListProto = {
|
|
9345
|
-
[TypeId$5]: TypeId$5,
|
|
9346
|
-
[Symbol.iterator]() {
|
|
9347
|
-
let done = false;
|
|
9348
|
-
let head = this.head;
|
|
9349
|
-
return {
|
|
9350
|
-
next() {
|
|
9351
|
-
if (done) {
|
|
9352
|
-
return this.return();
|
|
9353
|
-
}
|
|
9354
|
-
if (head == null) {
|
|
9355
|
-
done = true;
|
|
9356
|
-
return this.return();
|
|
9357
|
-
}
|
|
9358
|
-
const value = head.value;
|
|
9359
|
-
head = head.next;
|
|
9360
|
-
return {
|
|
9361
|
-
done,
|
|
9362
|
-
value
|
|
9363
|
-
};
|
|
9364
|
-
},
|
|
9365
|
-
return(value) {
|
|
9366
|
-
if (!done) {
|
|
9367
|
-
done = true;
|
|
9368
|
-
}
|
|
9369
|
-
return {
|
|
9370
|
-
done: true,
|
|
9371
|
-
value
|
|
9372
|
-
};
|
|
9373
|
-
}
|
|
9374
|
-
};
|
|
9375
|
-
},
|
|
9376
|
-
toString() {
|
|
9377
|
-
return format$2(this.toJSON());
|
|
9378
|
-
},
|
|
9379
|
-
toJSON() {
|
|
9380
|
-
return {
|
|
9381
|
-
_id: "MutableList",
|
|
9382
|
-
values: Array.from(this).map(toJSON)
|
|
9383
|
-
};
|
|
9384
|
-
},
|
|
9385
|
-
[NodeInspectSymbol]() {
|
|
9386
|
-
return this.toJSON();
|
|
9387
|
-
},
|
|
9388
|
-
pipe() {
|
|
9389
|
-
return pipeArguments(this, arguments);
|
|
9390
|
-
}
|
|
9391
|
-
};
|
|
9392
|
-
/** @internal */
|
|
9393
|
-
const makeNode = value => ({
|
|
9394
|
-
value,
|
|
9395
|
-
removed: false,
|
|
9396
|
-
prev: undefined,
|
|
9397
|
-
next: undefined
|
|
9398
|
-
});
|
|
9399
|
-
/**
|
|
9400
|
-
* Creates an empty `MutableList`.
|
|
9401
|
-
*
|
|
9402
|
-
* @since 2.0.0
|
|
9403
|
-
* @category constructors
|
|
9404
|
-
*/
|
|
9405
|
-
const empty$7 = () => {
|
|
9406
|
-
const list = Object.create(MutableListProto);
|
|
9407
|
-
list.head = undefined;
|
|
9408
|
-
list.tail = undefined;
|
|
9409
|
-
list._length = 0;
|
|
9410
|
-
return list;
|
|
9411
|
-
};
|
|
9412
|
-
/**
|
|
9413
|
-
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
9414
|
-
*
|
|
9415
|
-
* @since 2.0.0
|
|
9416
|
-
* @category getters
|
|
9417
|
-
*/
|
|
9418
|
-
const isEmpty$3 = self => length$1(self) === 0;
|
|
9419
|
-
/**
|
|
9420
|
-
* Returns the length of the list.
|
|
9421
|
-
*
|
|
9422
|
-
* @since 2.0.0
|
|
9423
|
-
* @category getters
|
|
9424
|
-
*/
|
|
9425
|
-
const length$1 = self => self._length;
|
|
9426
|
-
/**
|
|
9427
|
-
* Appends the specified element to the end of the `MutableList`.
|
|
9428
|
-
*
|
|
9429
|
-
* @category concatenating
|
|
9430
|
-
* @since 2.0.0
|
|
9431
|
-
*/
|
|
9432
|
-
const append = /*#__PURE__*/dual(2, (self, value) => {
|
|
9433
|
-
const node = makeNode(value);
|
|
9434
|
-
if (self.head === undefined) {
|
|
9435
|
-
self.head = node;
|
|
9436
|
-
}
|
|
9437
|
-
if (self.tail === undefined) {
|
|
9438
|
-
self.tail = node;
|
|
9439
|
-
} else {
|
|
9440
|
-
self.tail.next = node;
|
|
9441
|
-
node.prev = self.tail;
|
|
9442
|
-
self.tail = node;
|
|
9443
|
-
}
|
|
9444
|
-
self._length += 1;
|
|
9445
|
-
return self;
|
|
9446
|
-
});
|
|
9447
|
-
/**
|
|
9448
|
-
* Removes the first value from the list and returns it, if it exists.
|
|
9449
|
-
*
|
|
9450
|
-
* @since 0.0.1
|
|
9451
|
-
*/
|
|
9452
|
-
const shift = self => {
|
|
9453
|
-
const head = self.head;
|
|
9454
|
-
if (head !== undefined) {
|
|
9455
|
-
remove(self, head);
|
|
9456
|
-
return head.value;
|
|
9457
|
-
}
|
|
9458
|
-
return undefined;
|
|
9459
|
-
};
|
|
9460
|
-
const remove = (self, node) => {
|
|
9461
|
-
if (node.removed) {
|
|
9462
|
-
return;
|
|
9463
|
-
}
|
|
9464
|
-
node.removed = true;
|
|
9465
|
-
if (node.prev !== undefined && node.next !== undefined) {
|
|
9466
|
-
node.prev.next = node.next;
|
|
9467
|
-
node.next.prev = node.prev;
|
|
9468
|
-
} else if (node.prev !== undefined) {
|
|
9469
|
-
self.tail = node.prev;
|
|
9470
|
-
node.prev.next = undefined;
|
|
9471
|
-
} else if (node.next !== undefined) {
|
|
9472
|
-
self.head = node.next;
|
|
9473
|
-
node.next.prev = undefined;
|
|
9474
|
-
} else {
|
|
9475
|
-
self.tail = undefined;
|
|
9476
|
-
self.head = undefined;
|
|
9477
|
-
}
|
|
9478
|
-
if (self._length > 0) {
|
|
9479
|
-
self._length -= 1;
|
|
9480
|
-
}
|
|
9481
|
-
};
|
|
9482
|
-
|
|
9483
|
-
/**
|
|
9484
|
-
* @since 2.0.0
|
|
9485
|
-
*/
|
|
9486
|
-
const TypeId$4 = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
9487
|
-
/**
|
|
9488
|
-
* @since 2.0.0
|
|
9489
|
-
* @category symbol
|
|
9490
|
-
*/
|
|
9491
|
-
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
9492
|
-
const MutableQueueProto = {
|
|
9493
|
-
[TypeId$4]: TypeId$4,
|
|
9494
|
-
[Symbol.iterator]() {
|
|
9495
|
-
return Array.from(this.queue)[Symbol.iterator]();
|
|
9496
|
-
},
|
|
9497
|
-
toString() {
|
|
9498
|
-
return format$2(this.toJSON());
|
|
9499
|
-
},
|
|
9500
|
-
toJSON() {
|
|
9501
|
-
return {
|
|
9502
|
-
_id: "MutableQueue",
|
|
9503
|
-
values: Array.from(this).map(toJSON)
|
|
9504
|
-
};
|
|
9505
|
-
},
|
|
9506
|
-
[NodeInspectSymbol]() {
|
|
9507
|
-
return this.toJSON();
|
|
9508
|
-
},
|
|
9509
|
-
pipe() {
|
|
9510
|
-
return pipeArguments(this, arguments);
|
|
9511
|
-
}
|
|
9512
|
-
};
|
|
9513
|
-
const make$f = capacity => {
|
|
9514
|
-
const queue = Object.create(MutableQueueProto);
|
|
9515
|
-
queue.queue = empty$7();
|
|
9516
|
-
queue.capacity = capacity;
|
|
9517
|
-
return queue;
|
|
9518
|
-
};
|
|
9519
|
-
/**
|
|
9520
|
-
* Creates a new bounded `MutableQueue`.
|
|
9521
|
-
*
|
|
9522
|
-
* @since 2.0.0
|
|
9523
|
-
* @category constructors
|
|
9524
|
-
*/
|
|
9525
|
-
const bounded = capacity => make$f(capacity);
|
|
9526
|
-
/**
|
|
9527
|
-
* Creates a new unbounded `MutableQueue`.
|
|
9528
|
-
*
|
|
9529
|
-
* @since 2.0.0
|
|
9530
|
-
* @category constructors
|
|
9531
|
-
*/
|
|
9532
|
-
const unbounded = () => make$f(undefined);
|
|
9533
|
-
/**
|
|
9534
|
-
* Returns the current number of elements in the queue.
|
|
9535
|
-
*
|
|
9536
|
-
* @since 2.0.0
|
|
9537
|
-
* @category getters
|
|
9538
|
-
*/
|
|
9539
|
-
const length = self => length$1(self.queue);
|
|
9540
|
-
/**
|
|
9541
|
-
* Returns `true` if the queue is empty, `false` otherwise.
|
|
9542
|
-
*
|
|
9543
|
-
* @since 2.0.0
|
|
9544
|
-
* @category getters
|
|
9545
|
-
*/
|
|
9546
|
-
const isEmpty$2 = self => isEmpty$3(self.queue);
|
|
9547
|
-
/**
|
|
9548
|
-
* The **maximum** number of elements that a queue can hold.
|
|
9549
|
-
*
|
|
9550
|
-
* **Note**: unbounded queues can still implement this interface with
|
|
9551
|
-
* `capacity = Infinity`.
|
|
9552
|
-
*
|
|
9553
|
-
* @since 2.0.0
|
|
9554
|
-
* @category getters
|
|
9555
|
-
*/
|
|
9556
|
-
const capacity = self => self.capacity === undefined ? Infinity : self.capacity;
|
|
9557
|
-
/**
|
|
9558
|
-
* Offers an element to the queue.
|
|
9559
|
-
*
|
|
9560
|
-
* Returns whether the enqueue was successful or not.
|
|
9561
|
-
*
|
|
9562
|
-
* @since 2.0.0
|
|
9563
|
-
*/
|
|
9564
|
-
const offer = /*#__PURE__*/dual(2, (self, value) => {
|
|
9565
|
-
const queueLength = length$1(self.queue);
|
|
9566
|
-
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
9567
|
-
return false;
|
|
9568
|
-
}
|
|
9569
|
-
append(value)(self.queue);
|
|
9570
|
-
return true;
|
|
9571
|
-
});
|
|
9572
|
-
/**
|
|
9573
|
-
* Enqueues a collection of values into the queue.
|
|
9574
|
-
*
|
|
9575
|
-
* Returns a `Chunk` of the values that were **not** able to be enqueued.
|
|
9576
|
-
*
|
|
9577
|
-
* @since 2.0.0
|
|
9578
|
-
*/
|
|
9579
|
-
const offerAll = /*#__PURE__*/dual(2, (self, values) => {
|
|
9580
|
-
const iterator = values[Symbol.iterator]();
|
|
9581
|
-
let next;
|
|
9582
|
-
let remainder = empty$j();
|
|
9583
|
-
let offering = true;
|
|
9584
|
-
while (offering && (next = iterator.next()) && !next.done) {
|
|
9585
|
-
offering = offer(next.value)(self);
|
|
9586
|
-
}
|
|
9587
|
-
while (next != null && !next.done) {
|
|
9588
|
-
remainder = prepend$1(next.value)(remainder);
|
|
9589
|
-
next = iterator.next();
|
|
9590
|
-
}
|
|
9591
|
-
return reverse$1(remainder);
|
|
9592
|
-
});
|
|
9593
|
-
/**
|
|
9594
|
-
* Dequeues an element from the queue.
|
|
9595
|
-
*
|
|
9596
|
-
* Returns either an element from the queue, or the `def` param.
|
|
9597
|
-
*
|
|
9598
|
-
* **Note**: if there is no meaningful default for your type, you can always
|
|
9599
|
-
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
9600
|
-
*
|
|
9601
|
-
* @since 2.0.0
|
|
9602
|
-
*/
|
|
9603
|
-
const poll = /*#__PURE__*/dual(2, (self, def) => {
|
|
9604
|
-
if (isEmpty$3(self.queue)) {
|
|
9605
|
-
return def;
|
|
9606
|
-
}
|
|
9607
|
-
return shift(self.queue);
|
|
9608
|
-
});
|
|
9609
|
-
/**
|
|
9610
|
-
* Dequeues up to `n` elements from the queue.
|
|
9611
|
-
*
|
|
9612
|
-
* Returns a `List` of up to `n` elements.
|
|
9613
|
-
*
|
|
9614
|
-
* @since 2.0.0
|
|
9615
|
-
*/
|
|
9616
|
-
const pollUpTo = /*#__PURE__*/dual(2, (self, n) => {
|
|
9617
|
-
let result = empty$j();
|
|
9618
|
-
let count = 0;
|
|
9619
|
-
while (count < n) {
|
|
9620
|
-
const element = poll(EmptyMutableQueue)(self);
|
|
9621
|
-
if (element === EmptyMutableQueue) {
|
|
9622
|
-
break;
|
|
9623
|
-
}
|
|
9624
|
-
result = prepend$1(element)(result);
|
|
9625
|
-
count += 1;
|
|
9626
|
-
}
|
|
9627
|
-
return reverse$1(result);
|
|
9628
|
-
});
|
|
9629
|
-
|
|
9630
9202
|
/** @internal */
|
|
9631
9203
|
const ClockSymbolKey = "effect/Clock";
|
|
9632
9204
|
/** @internal */
|
|
@@ -9688,11 +9260,11 @@ class ClockImpl {
|
|
|
9688
9260
|
currentTimeMillis = /*#__PURE__*/sync$1(() => this.unsafeCurrentTimeMillis());
|
|
9689
9261
|
currentTimeNanos = /*#__PURE__*/sync$1(() => this.unsafeCurrentTimeNanos());
|
|
9690
9262
|
scheduler() {
|
|
9691
|
-
return succeed$
|
|
9263
|
+
return succeed$2(globalClockScheduler);
|
|
9692
9264
|
}
|
|
9693
9265
|
sleep(duration) {
|
|
9694
9266
|
return async_(resume => {
|
|
9695
|
-
const canceler = globalClockScheduler.unsafeSchedule(() => resume(void_$
|
|
9267
|
+
const canceler = globalClockScheduler.unsafeSchedule(() => resume(void_$1), duration);
|
|
9696
9268
|
return asVoid$1(sync$1(canceler));
|
|
9697
9269
|
});
|
|
9698
9270
|
}
|
|
@@ -9884,7 +9456,7 @@ const patch$3 = /*#__PURE__*/dual(2, (path, patch) => {
|
|
|
9884
9456
|
}
|
|
9885
9457
|
case "MapName":
|
|
9886
9458
|
{
|
|
9887
|
-
output = map$
|
|
9459
|
+
output = map$7(output, patch.f);
|
|
9888
9460
|
input = input.tail;
|
|
9889
9461
|
break;
|
|
9890
9462
|
}
|
|
@@ -9961,9 +9533,9 @@ const makeFlat = options => ({
|
|
|
9961
9533
|
});
|
|
9962
9534
|
/** @internal */
|
|
9963
9535
|
const fromFlat = flat => make$d({
|
|
9964
|
-
load: config => flatMap$2(fromFlatLoop(flat, empty$
|
|
9965
|
-
onNone: () => fail$
|
|
9966
|
-
onSome: succeed$
|
|
9536
|
+
load: config => flatMap$2(fromFlatLoop(flat, empty$l(), config, false), chunk => match$5(head$1(chunk), {
|
|
9537
|
+
onNone: () => fail$1(MissingData(empty$l(), `Expected a single value having structure: ${config}`)),
|
|
9538
|
+
onSome: succeed$2
|
|
9967
9539
|
})),
|
|
9968
9540
|
flattened: flat
|
|
9969
9541
|
});
|
|
@@ -10031,7 +9603,7 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10031
9603
|
switch (op._tag) {
|
|
10032
9604
|
case OP_CONSTANT:
|
|
10033
9605
|
{
|
|
10034
|
-
return succeed$
|
|
9606
|
+
return succeed$2(of$2(op.value));
|
|
10035
9607
|
}
|
|
10036
9608
|
case OP_DESCRIBED:
|
|
10037
9609
|
{
|
|
@@ -10039,15 +9611,15 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10039
9611
|
}
|
|
10040
9612
|
case OP_FAIL:
|
|
10041
9613
|
{
|
|
10042
|
-
return fail$
|
|
9614
|
+
return fail$1(MissingData(prefix, op.message));
|
|
10043
9615
|
}
|
|
10044
9616
|
case OP_FALLBACK:
|
|
10045
9617
|
{
|
|
10046
9618
|
return pipe(suspend$1(() => fromFlatLoop(flat, prefix, op.first, split)), catchAll$1(error1 => {
|
|
10047
9619
|
if (op.condition(error1)) {
|
|
10048
|
-
return pipe(fromFlatLoop(flat, prefix, op.second, split), catchAll$1(error2 => fail$
|
|
9620
|
+
return pipe(fromFlatLoop(flat, prefix, op.second, split), catchAll$1(error2 => fail$1(Or(error1, error2))));
|
|
10049
9621
|
}
|
|
10050
|
-
return fail$
|
|
9622
|
+
return fail$1(error1);
|
|
10051
9623
|
}));
|
|
10052
9624
|
}
|
|
10053
9625
|
case OP_LAZY:
|
|
@@ -10067,21 +9639,21 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10067
9639
|
return pipe(patch$3(prefix, flat.patch), flatMap$2(prefix => pipe(flat.load(prefix, op, split), flatMap$2(values => {
|
|
10068
9640
|
if (values.length === 0) {
|
|
10069
9641
|
const name = pipe(last(prefix), getOrElse(() => "<n/a>"));
|
|
10070
|
-
return fail$
|
|
9642
|
+
return fail$1(MissingData([], `Expected ${op.description} with name ${name}`));
|
|
10071
9643
|
}
|
|
10072
|
-
return succeed$
|
|
9644
|
+
return succeed$2(values);
|
|
10073
9645
|
}))));
|
|
10074
9646
|
}
|
|
10075
9647
|
case OP_SEQUENCE:
|
|
10076
9648
|
{
|
|
10077
9649
|
return pipe(patch$3(prefix, flat.patch), flatMap$2(patchedPrefix => pipe(flat.enumerateChildren(patchedPrefix), flatMap$2(indicesFrom), flatMap$2(indices => {
|
|
10078
9650
|
if (indices.length === 0) {
|
|
10079
|
-
return suspend$1(() => map$
|
|
9651
|
+
return suspend$1(() => map$2(fromFlatLoop(flat, prefix, op.config, true), of$2));
|
|
10080
9652
|
}
|
|
10081
|
-
return pipe(forEachSequential(indices, index => fromFlatLoop(flat, append$
|
|
9653
|
+
return pipe(forEachSequential(indices, index => fromFlatLoop(flat, append$1(prefix, `[${index}]`), op.config, true)), map$2(chunkChunk => {
|
|
10082
9654
|
const flattened = flatten$3(chunkChunk);
|
|
10083
9655
|
if (flattened.length === 0) {
|
|
10084
|
-
return of$2(empty$
|
|
9656
|
+
return of$2(empty$l());
|
|
10085
9657
|
}
|
|
10086
9658
|
return of$2(flattened);
|
|
10087
9659
|
}));
|
|
@@ -10090,11 +9662,11 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10090
9662
|
case OP_HASHMAP:
|
|
10091
9663
|
{
|
|
10092
9664
|
return suspend$1(() => pipe(patch$3(prefix, flat.patch), flatMap$2(prefix => pipe(flat.enumerateChildren(prefix), flatMap$2(keys => {
|
|
10093
|
-
return pipe(keys, forEachSequential(key => fromFlatLoop(flat, concat(prefix, of$2(key)), op.valueConfig, split)), map$
|
|
9665
|
+
return pipe(keys, forEachSequential(key => fromFlatLoop(flat, concat(prefix, of$2(key)), op.valueConfig, split)), map$2(matrix => {
|
|
10094
9666
|
if (matrix.length === 0) {
|
|
10095
|
-
return of$2(empty$
|
|
9667
|
+
return of$2(empty$e());
|
|
10096
9668
|
}
|
|
10097
|
-
return pipe(transpose(matrix), map$
|
|
9669
|
+
return pipe(transpose(matrix), map$7(values => fromIterable$1(zip$2(fromIterable$6(keys), values))));
|
|
10098
9670
|
}));
|
|
10099
9671
|
})))));
|
|
10100
9672
|
}
|
|
@@ -10102,19 +9674,19 @@ const fromFlatLoop = (flat, prefix, config, split) => {
|
|
|
10102
9674
|
{
|
|
10103
9675
|
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 => {
|
|
10104
9676
|
if (isLeft(left) && isLeft(right$1)) {
|
|
10105
|
-
return fail$
|
|
9677
|
+
return fail$1(And(left.left, right$1.left));
|
|
10106
9678
|
}
|
|
10107
9679
|
if (isLeft(left) && isRight(right$1)) {
|
|
10108
|
-
return fail$
|
|
9680
|
+
return fail$1(left.left);
|
|
10109
9681
|
}
|
|
10110
9682
|
if (isRight(left) && isLeft(right$1)) {
|
|
10111
|
-
return fail$
|
|
9683
|
+
return fail$1(right$1.left);
|
|
10112
9684
|
}
|
|
10113
9685
|
if (isRight(left) && isRight(right$1)) {
|
|
10114
9686
|
const path = pipe(prefix, join$1("."));
|
|
10115
9687
|
const fail = fromFlatLoopFail(prefix, path);
|
|
10116
|
-
const [lefts, rights] = extend$1(fail, fail, pipe(left.right, map$
|
|
10117
|
-
return pipe(lefts, zip$
|
|
9688
|
+
const [lefts, rights] = extend$1(fail, fail, pipe(left.right, map$7(right)), pipe(right$1.right, map$7(right)));
|
|
9689
|
+
return pipe(lefts, zip$2(rights), forEachSequential(([left, right]) => pipe(zip$1(left, right), map$2(([left, right]) => op.zip(left, right)))));
|
|
10118
9690
|
}
|
|
10119
9691
|
throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues");
|
|
10120
9692
|
})))));
|
|
@@ -10139,9 +9711,9 @@ const transpose = array => {
|
|
|
10139
9711
|
return Object.keys(array[0]).map(column => array.map(row => row[column]));
|
|
10140
9712
|
};
|
|
10141
9713
|
const indicesFrom = quotedIndices => pipe(forEachSequential(quotedIndices, parseQuotedIndex), mapBoth({
|
|
10142
|
-
onFailure: () => empty$
|
|
9714
|
+
onFailure: () => empty$l(),
|
|
10143
9715
|
onSuccess: sort(Order$1)
|
|
10144
|
-
}), either, map$
|
|
9716
|
+
}), either, map$2(merge$3));
|
|
10145
9717
|
const QUOTED_INDEX_REGEX = /^(\[(\d+)\])$/;
|
|
10146
9718
|
const parseQuotedIndex = str => {
|
|
10147
9719
|
const match = str.match(QUOTED_INDEX_REGEX);
|
|
@@ -10265,13 +9837,13 @@ class RandomImpl {
|
|
|
10265
9837
|
return sync$1(() => this.PRNG.number());
|
|
10266
9838
|
}
|
|
10267
9839
|
get nextBoolean() {
|
|
10268
|
-
return map$
|
|
9840
|
+
return map$2(this.next, n => n > 0.5);
|
|
10269
9841
|
}
|
|
10270
9842
|
get nextInt() {
|
|
10271
9843
|
return sync$1(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
|
|
10272
9844
|
}
|
|
10273
9845
|
nextRange(min, max) {
|
|
10274
|
-
return map$
|
|
9846
|
+
return map$2(this.next, n => (max - min) * n + min);
|
|
10275
9847
|
}
|
|
10276
9848
|
nextIntBetween(min, max) {
|
|
10277
9849
|
return sync$1(() => this.PRNG.integer(max - min) + min);
|
|
@@ -10286,7 +9858,7 @@ const shuffleWith = (elements, nextIntBounded) => {
|
|
|
10286
9858
|
for (let i = buffer.length; i >= 2; i = i - 1) {
|
|
10287
9859
|
numbers.push(i);
|
|
10288
9860
|
}
|
|
10289
|
-
return pipe(numbers, forEachSequentialDiscard(n => pipe(nextIntBounded(n), map$
|
|
9861
|
+
return pipe(numbers, forEachSequentialDiscard(n => pipe(nextIntBounded(n), map$2(k => swap(buffer, n - 1, k)))), as$1(fromIterable$5(buffer)));
|
|
10290
9862
|
})));
|
|
10291
9863
|
};
|
|
10292
9864
|
const swap = (buffer, index1, index2) => {
|
|
@@ -10378,7 +9950,7 @@ const nativeTracer = /*#__PURE__*/make$b({
|
|
|
10378
9950
|
});
|
|
10379
9951
|
|
|
10380
9952
|
/** @internal */
|
|
10381
|
-
const liveServices = /*#__PURE__*/pipe(/*#__PURE__*/empty$
|
|
9953
|
+
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));
|
|
10382
9954
|
/**
|
|
10383
9955
|
* The `FiberRef` holding the default `Effect` services.
|
|
10384
9956
|
*
|
|
@@ -10754,7 +10326,7 @@ class RefImpl extends Class {
|
|
|
10754
10326
|
}
|
|
10755
10327
|
}
|
|
10756
10328
|
/** @internal */
|
|
10757
|
-
const unsafeMake$2 = value => new RefImpl(make$
|
|
10329
|
+
const unsafeMake$2 = value => new RefImpl(make$i(value));
|
|
10758
10330
|
/** @internal */
|
|
10759
10331
|
const make$a = value => sync$1(() => unsafeMake$2(value));
|
|
10760
10332
|
/** @internal */
|
|
@@ -10902,7 +10474,7 @@ const make$9 = (key, value) => {
|
|
|
10902
10474
|
const isMetricLabel = u => hasProperty(u, MetricLabelTypeId);
|
|
10903
10475
|
|
|
10904
10476
|
/* @internal */
|
|
10905
|
-
const asSome = self => map$
|
|
10477
|
+
const asSome = self => map$2(self, some);
|
|
10906
10478
|
/* @internal */
|
|
10907
10479
|
const try_$1 = arg => {
|
|
10908
10480
|
let evaluate;
|
|
@@ -10915,9 +10487,9 @@ const try_$1 = arg => {
|
|
|
10915
10487
|
}
|
|
10916
10488
|
return suspend$1(() => {
|
|
10917
10489
|
try {
|
|
10918
|
-
return succeed$
|
|
10490
|
+
return succeed$2(internalCall(evaluate));
|
|
10919
10491
|
} catch (error) {
|
|
10920
|
-
return fail$
|
|
10492
|
+
return fail$1(onFailure ? internalCall(() => onFailure(error)) : new UnknownException(error, "An unknown error occurred in Effect.try"));
|
|
10921
10493
|
}
|
|
10922
10494
|
});
|
|
10923
10495
|
};
|
|
@@ -10928,7 +10500,7 @@ const catchSomeCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(se
|
|
|
10928
10500
|
switch (option._tag) {
|
|
10929
10501
|
case "None":
|
|
10930
10502
|
{
|
|
10931
|
-
return failCause$
|
|
10503
|
+
return failCause$2(cause);
|
|
10932
10504
|
}
|
|
10933
10505
|
case "Some":
|
|
10934
10506
|
{
|
|
@@ -10936,7 +10508,7 @@ const catchSomeCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(se
|
|
|
10936
10508
|
}
|
|
10937
10509
|
}
|
|
10938
10510
|
},
|
|
10939
|
-
onSuccess: succeed$
|
|
10511
|
+
onSuccess: succeed$2
|
|
10940
10512
|
}));
|
|
10941
10513
|
/* @internal */
|
|
10942
10514
|
const clockWith = clockWith$1;
|
|
@@ -10944,8 +10516,8 @@ const clockWith = clockWith$1;
|
|
|
10944
10516
|
const diffFiberRefs = self => summarized(self, fiberRefs, diff$2);
|
|
10945
10517
|
/* @internal */
|
|
10946
10518
|
const match$2 = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {
|
|
10947
|
-
onFailure: e => succeed$
|
|
10948
|
-
onSuccess: a => succeed$
|
|
10519
|
+
onFailure: e => succeed$2(options.onFailure(e)),
|
|
10520
|
+
onSuccess: a => succeed$2(options.onSuccess(a))
|
|
10949
10521
|
}));
|
|
10950
10522
|
/* @internal */
|
|
10951
10523
|
const forever$2 = self => {
|
|
@@ -10953,7 +10525,7 @@ const forever$2 = self => {
|
|
|
10953
10525
|
return loop;
|
|
10954
10526
|
};
|
|
10955
10527
|
/* @internal */
|
|
10956
|
-
const fiberRefs = /*#__PURE__*/withFiberRuntime$1(state => succeed$
|
|
10528
|
+
const fiberRefs = /*#__PURE__*/withFiberRuntime$1(state => succeed$2(state.getFiberRefs()));
|
|
10957
10529
|
/* @internal */
|
|
10958
10530
|
const ignore$1 = self => match$2(self, {
|
|
10959
10531
|
onFailure: constVoid,
|
|
@@ -10976,11 +10548,11 @@ const logWithLevel = level => (...message) => {
|
|
|
10976
10548
|
}
|
|
10977
10549
|
}
|
|
10978
10550
|
if (cause === undefined) {
|
|
10979
|
-
cause = empty$
|
|
10551
|
+
cause = empty$8;
|
|
10980
10552
|
}
|
|
10981
10553
|
return withFiberRuntime$1(fiberState => {
|
|
10982
10554
|
fiberState.log(message, cause, levelOption);
|
|
10983
|
-
return void_$
|
|
10555
|
+
return void_$1;
|
|
10984
10556
|
});
|
|
10985
10557
|
};
|
|
10986
10558
|
/** @internal */
|
|
@@ -10990,10 +10562,10 @@ const logError$1 = /*#__PURE__*/logWithLevel(Error$1);
|
|
|
10990
10562
|
/* @internal */
|
|
10991
10563
|
const mapErrorCause = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
10992
10564
|
onFailure: c => failCauseSync(() => f(c)),
|
|
10993
|
-
onSuccess: succeed$
|
|
10565
|
+
onSuccess: succeed$2
|
|
10994
10566
|
}));
|
|
10995
10567
|
/* @internal */
|
|
10996
|
-
const negate = self => map$
|
|
10568
|
+
const negate = self => map$2(self, b => !b);
|
|
10997
10569
|
/* @internal */
|
|
10998
10570
|
const orElseSucceed$1 = /*#__PURE__*/dual(2, (self, evaluate) => orElse(self, () => sync$1(evaluate)));
|
|
10999
10571
|
/* @internal */
|
|
@@ -11001,15 +10573,15 @@ const patchFiberRefs = patch => updateFiberRefs((fiberId, fiberRefs) => pipe(pat
|
|
|
11001
10573
|
/* @internal */
|
|
11002
10574
|
const promise$1 = evaluate => evaluate.length >= 1 ? async_((resolve, signal) => {
|
|
11003
10575
|
try {
|
|
11004
|
-
evaluate(signal).then(a => resolve(succeed$
|
|
10576
|
+
evaluate(signal).then(a => resolve(succeed$2(a)), e => resolve(die(e)));
|
|
11005
10577
|
} catch (e) {
|
|
11006
|
-
resolve(die
|
|
10578
|
+
resolve(die(e));
|
|
11007
10579
|
}
|
|
11008
10580
|
}) : async_(resolve => {
|
|
11009
10581
|
try {
|
|
11010
|
-
evaluate().then(a => resolve(succeed$
|
|
10582
|
+
evaluate().then(a => resolve(succeed$2(a)), e => resolve(die(e)));
|
|
11011
10583
|
} catch (e) {
|
|
11012
|
-
resolve(die
|
|
10584
|
+
resolve(die(e));
|
|
11013
10585
|
}
|
|
11014
10586
|
});
|
|
11015
10587
|
/* @internal */
|
|
@@ -11019,26 +10591,26 @@ const provideServiceEffect = /*#__PURE__*/dual(3, (self, tag, effect) => context
|
|
|
11019
10591
|
/* @internal */
|
|
11020
10592
|
const sleep = sleep$1;
|
|
11021
10593
|
/* @internal */
|
|
11022
|
-
const succeedNone = /*#__PURE__*/succeed$
|
|
10594
|
+
const succeedNone = /*#__PURE__*/succeed$2(/*#__PURE__*/none$4());
|
|
11023
10595
|
/* @internal */
|
|
11024
|
-
const summarized = /*#__PURE__*/dual(3, (self, summary, f) => flatMap$2(summary, start => flatMap$2(self, value => map$
|
|
10596
|
+
const summarized = /*#__PURE__*/dual(3, (self, summary, f) => flatMap$2(summary, start => flatMap$2(self, value => map$2(summary, end => [f(start, end), value]))));
|
|
11025
10597
|
/* @internal */
|
|
11026
10598
|
const tapError$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
11027
10599
|
onFailure: cause => {
|
|
11028
10600
|
const either = failureOrCause(cause);
|
|
11029
10601
|
switch (either._tag) {
|
|
11030
10602
|
case "Left":
|
|
11031
|
-
return zipRight$
|
|
10603
|
+
return zipRight$1(f(either.left), failCause$2(cause));
|
|
11032
10604
|
case "Right":
|
|
11033
|
-
return failCause$
|
|
10605
|
+
return failCause$2(cause);
|
|
11034
10606
|
}
|
|
11035
10607
|
},
|
|
11036
|
-
onSuccess: succeed$
|
|
10608
|
+
onSuccess: succeed$2
|
|
11037
10609
|
}));
|
|
11038
10610
|
/* @internal */
|
|
11039
10611
|
const tapErrorCause$1 = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect$2(self, {
|
|
11040
|
-
onFailure: cause => zipRight$
|
|
11041
|
-
onSuccess: succeed$
|
|
10612
|
+
onFailure: cause => zipRight$1(f(cause), failCause$2(cause)),
|
|
10613
|
+
onSuccess: succeed$2
|
|
11042
10614
|
}));
|
|
11043
10615
|
/* @internal */
|
|
11044
10616
|
const tryPromise$1 = arg => {
|
|
@@ -11050,11 +10622,11 @@ const tryPromise$1 = arg => {
|
|
|
11050
10622
|
evaluate = arg.try;
|
|
11051
10623
|
catcher = arg.catch;
|
|
11052
10624
|
}
|
|
11053
|
-
const fail = e => catcher ? failSync(() => catcher(e)) : fail$
|
|
10625
|
+
const fail = e => catcher ? failSync(() => catcher(e)) : fail$1(new UnknownException(e, "An unknown error occurred in Effect.tryPromise"));
|
|
11054
10626
|
if (evaluate.length >= 1) {
|
|
11055
10627
|
return async_((resolve, signal) => {
|
|
11056
10628
|
try {
|
|
11057
|
-
evaluate(signal).then(a => resolve(succeed$
|
|
10629
|
+
evaluate(signal).then(a => resolve(succeed$2(a)), e => resolve(fail(e)));
|
|
11058
10630
|
} catch (e) {
|
|
11059
10631
|
resolve(fail(e));
|
|
11060
10632
|
}
|
|
@@ -11062,7 +10634,7 @@ const tryPromise$1 = arg => {
|
|
|
11062
10634
|
}
|
|
11063
10635
|
return async_(resolve => {
|
|
11064
10636
|
try {
|
|
11065
|
-
evaluate().then(a => resolve(succeed$
|
|
10637
|
+
evaluate().then(a => resolve(succeed$2(a)), e => resolve(fail(e)));
|
|
11066
10638
|
} catch (e) {
|
|
11067
10639
|
resolve(fail(e));
|
|
11068
10640
|
}
|
|
@@ -11071,10 +10643,10 @@ const tryPromise$1 = arg => {
|
|
|
11071
10643
|
/* @internal */
|
|
11072
10644
|
const updateFiberRefs = f => withFiberRuntime$1(state => {
|
|
11073
10645
|
state.setFiberRefs(f(state.id(), state.getFiberRefs()));
|
|
11074
|
-
return void_$
|
|
10646
|
+
return void_$1;
|
|
11075
10647
|
});
|
|
11076
10648
|
/* @internal */
|
|
11077
|
-
const when$1 = /*#__PURE__*/dual(2, (self, condition) => suspend$1(() => condition() ? map$
|
|
10649
|
+
const when$1 = /*#__PURE__*/dual(2, (self, condition) => suspend$1(() => condition() ? map$2(self, some) : succeed$2(none$4())));
|
|
11078
10650
|
|
|
11079
10651
|
/** @internal */
|
|
11080
10652
|
const OP_SEQUENTIAL = "Sequential";
|
|
@@ -11998,6 +11570,51 @@ class MixedScheduler {
|
|
|
11998
11570
|
* @category schedulers
|
|
11999
11571
|
*/
|
|
12000
11572
|
const defaultScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Scheduler/defaultScheduler"), () => new MixedScheduler(2048));
|
|
11573
|
+
/**
|
|
11574
|
+
* @since 2.0.0
|
|
11575
|
+
* @category constructors
|
|
11576
|
+
*/
|
|
11577
|
+
class SyncScheduler {
|
|
11578
|
+
/**
|
|
11579
|
+
* @since 2.0.0
|
|
11580
|
+
*/
|
|
11581
|
+
tasks = /*#__PURE__*/new PriorityBuckets();
|
|
11582
|
+
/**
|
|
11583
|
+
* @since 2.0.0
|
|
11584
|
+
*/
|
|
11585
|
+
deferred = false;
|
|
11586
|
+
/**
|
|
11587
|
+
* @since 2.0.0
|
|
11588
|
+
*/
|
|
11589
|
+
scheduleTask(task, priority) {
|
|
11590
|
+
if (this.deferred) {
|
|
11591
|
+
defaultScheduler.scheduleTask(task, priority);
|
|
11592
|
+
} else {
|
|
11593
|
+
this.tasks.scheduleTask(task, priority);
|
|
11594
|
+
}
|
|
11595
|
+
}
|
|
11596
|
+
/**
|
|
11597
|
+
* @since 2.0.0
|
|
11598
|
+
*/
|
|
11599
|
+
shouldYield(fiber) {
|
|
11600
|
+
return fiber.currentOpCount > fiber.getFiberRef(currentMaxOpsBeforeYield) ? fiber.getFiberRef(currentSchedulingPriority) : false;
|
|
11601
|
+
}
|
|
11602
|
+
/**
|
|
11603
|
+
* @since 2.0.0
|
|
11604
|
+
*/
|
|
11605
|
+
flush() {
|
|
11606
|
+
while (this.tasks.buckets.length > 0) {
|
|
11607
|
+
const tasks = this.tasks.buckets;
|
|
11608
|
+
this.tasks.buckets = [];
|
|
11609
|
+
for (const [_, toRun] of tasks) {
|
|
11610
|
+
for (let i = 0; i < toRun.length; i++) {
|
|
11611
|
+
toRun[i]();
|
|
11612
|
+
}
|
|
11613
|
+
}
|
|
11614
|
+
}
|
|
11615
|
+
this.deferred = true;
|
|
11616
|
+
}
|
|
11617
|
+
}
|
|
12001
11618
|
/** @internal */
|
|
12002
11619
|
const currentScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentScheduler"), () => fiberRefUnsafeMake(defaultScheduler));
|
|
12003
11620
|
|
|
@@ -12597,7 +12214,7 @@ const histogram$1 = key => {
|
|
|
12597
12214
|
let sum = 0;
|
|
12598
12215
|
let min = Number.MAX_VALUE;
|
|
12599
12216
|
let max = Number.MIN_VALUE;
|
|
12600
|
-
pipe(bounds, sort(Order$1), map$
|
|
12217
|
+
pipe(bounds, sort(Order$1), map$7((n, i) => {
|
|
12601
12218
|
boundaries[i] = n;
|
|
12602
12219
|
}));
|
|
12603
12220
|
// Insert the value into the right bucket with a binary search
|
|
@@ -12727,7 +12344,7 @@ const calculateQuantiles = (error, sortedQuantiles, sortedSamples) => {
|
|
|
12727
12344
|
// The number of samples examined
|
|
12728
12345
|
const sampleCount = sortedSamples.length;
|
|
12729
12346
|
if (!isNonEmptyReadonlyArray(sortedQuantiles)) {
|
|
12730
|
-
return empty$
|
|
12347
|
+
return empty$l();
|
|
12731
12348
|
}
|
|
12732
12349
|
const head = sortedQuantiles[0];
|
|
12733
12350
|
const tail = sortedQuantiles.slice(1);
|
|
@@ -12736,7 +12353,7 @@ const calculateQuantiles = (error, sortedQuantiles, sortedSamples) => {
|
|
|
12736
12353
|
tail.forEach(quantile => {
|
|
12737
12354
|
resolved.push(resolveQuantile(error, sampleCount, resolvedHead.value, resolvedHead.consumed, quantile, resolvedHead.rest));
|
|
12738
12355
|
});
|
|
12739
|
-
return map$
|
|
12356
|
+
return map$7(resolved, rq => [rq.quantile, rq.value]);
|
|
12740
12357
|
};
|
|
12741
12358
|
/** @internal */
|
|
12742
12359
|
const resolveQuantile = (error, sampleCount, current, consumed, quantile, rest) => {
|
|
@@ -12888,7 +12505,7 @@ const MetricRegistryTypeId = /*#__PURE__*/Symbol.for(MetricRegistrySymbolKey);
|
|
|
12888
12505
|
/** @internal */
|
|
12889
12506
|
class MetricRegistryImpl {
|
|
12890
12507
|
[MetricRegistryTypeId] = MetricRegistryTypeId;
|
|
12891
|
-
map = /*#__PURE__*/empty$
|
|
12508
|
+
map = /*#__PURE__*/empty$7();
|
|
12892
12509
|
snapshot() {
|
|
12893
12510
|
const result = [];
|
|
12894
12511
|
for (const [key, hook] of this.map) {
|
|
@@ -13095,7 +12712,7 @@ class ProxySupervisor {
|
|
|
13095
12712
|
this.underlying.onResume(fiber);
|
|
13096
12713
|
}
|
|
13097
12714
|
map(f) {
|
|
13098
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12715
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13099
12716
|
}
|
|
13100
12717
|
zip(right) {
|
|
13101
12718
|
return new Zip(this, right);
|
|
@@ -13112,7 +12729,7 @@ class Zip {
|
|
|
13112
12729
|
this.right = right;
|
|
13113
12730
|
}
|
|
13114
12731
|
get value() {
|
|
13115
|
-
return zip$
|
|
12732
|
+
return zip$1(this.left.value, this.right.value);
|
|
13116
12733
|
}
|
|
13117
12734
|
onStart(context, effect, parent, fiber) {
|
|
13118
12735
|
this.left.onStart(context, effect, parent, fiber);
|
|
@@ -13135,7 +12752,7 @@ class Zip {
|
|
|
13135
12752
|
this.right.onResume(fiber);
|
|
13136
12753
|
}
|
|
13137
12754
|
map(f) {
|
|
13138
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12755
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13139
12756
|
}
|
|
13140
12757
|
zip(right) {
|
|
13141
12758
|
return new Zip(this, right);
|
|
@@ -13169,7 +12786,7 @@ class Const {
|
|
|
13169
12786
|
//
|
|
13170
12787
|
}
|
|
13171
12788
|
map(f) {
|
|
13172
|
-
return new ProxySupervisor(this, pipe(this.value, map$
|
|
12789
|
+
return new ProxySupervisor(this, pipe(this.value, map$2(f)));
|
|
13173
12790
|
}
|
|
13174
12791
|
zip(right) {
|
|
13175
12792
|
return new Zip(this, right);
|
|
@@ -13183,7 +12800,7 @@ const fromEffect = effect => {
|
|
|
13183
12800
|
return new Const(effect);
|
|
13184
12801
|
};
|
|
13185
12802
|
/** @internal */
|
|
13186
|
-
const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect(void_$
|
|
12803
|
+
const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect(void_$1));
|
|
13187
12804
|
|
|
13188
12805
|
/**
|
|
13189
12806
|
* Constructs a new `Differ`.
|
|
@@ -13191,7 +12808,7 @@ const none = /*#__PURE__*/globalValue("effect/Supervisor/none", () => fromEffect
|
|
|
13191
12808
|
* @since 2.0.0
|
|
13192
12809
|
* @category constructors
|
|
13193
12810
|
*/
|
|
13194
|
-
const make$5 = make$
|
|
12811
|
+
const make$5 = make$h;
|
|
13195
12812
|
|
|
13196
12813
|
/** @internal */
|
|
13197
12814
|
const OP_EMPTY = "Empty";
|
|
@@ -13278,12 +12895,12 @@ const removeSupervisor = (self, that) => {
|
|
|
13278
12895
|
/** @internal */
|
|
13279
12896
|
const toSet = self => {
|
|
13280
12897
|
if (equals$1(self, none)) {
|
|
13281
|
-
return empty$
|
|
12898
|
+
return empty$f();
|
|
13282
12899
|
} else {
|
|
13283
12900
|
if (isZip(self)) {
|
|
13284
12901
|
return pipe(toSet(self.left), union(toSet(self.right)));
|
|
13285
12902
|
} else {
|
|
13286
|
-
return make$
|
|
12903
|
+
return make$j(self);
|
|
13287
12904
|
}
|
|
13288
12905
|
}
|
|
13289
12906
|
};
|
|
@@ -13375,7 +12992,7 @@ const contOpSuccess = {
|
|
|
13375
12992
|
self.pushStack(cont);
|
|
13376
12993
|
return internalCall(() => cont.effect_instruction_i1());
|
|
13377
12994
|
} else {
|
|
13378
|
-
return void_$
|
|
12995
|
+
return void_$1;
|
|
13379
12996
|
}
|
|
13380
12997
|
},
|
|
13381
12998
|
[OP_ITERATOR]: (self, cont, value) => {
|
|
@@ -13565,7 +13182,7 @@ class FiberRuntime extends Class {
|
|
|
13565
13182
|
}
|
|
13566
13183
|
get await() {
|
|
13567
13184
|
return async_(resume => {
|
|
13568
|
-
const cb = exit => resume(succeed$
|
|
13185
|
+
const cb = exit => resume(succeed$2(exit));
|
|
13569
13186
|
this.tell(stateful((fiber, _) => {
|
|
13570
13187
|
if (fiber._exitValue !== null) {
|
|
13571
13188
|
cb(this._exitValue);
|
|
@@ -13611,13 +13228,13 @@ class FiberRuntime extends Class {
|
|
|
13611
13228
|
* In the background, interrupts the fiber as if interrupted from the specified fiber.
|
|
13612
13229
|
*/
|
|
13613
13230
|
interruptAsFork(fiberId) {
|
|
13614
|
-
return sync$1(() => this.tell(interruptSignal(interrupt$
|
|
13231
|
+
return sync$1(() => this.tell(interruptSignal(interrupt$2(fiberId))));
|
|
13615
13232
|
}
|
|
13616
13233
|
/**
|
|
13617
13234
|
* In the background, interrupts the fiber as if interrupted from the specified fiber.
|
|
13618
13235
|
*/
|
|
13619
13236
|
unsafeInterruptAsFork(fiberId) {
|
|
13620
|
-
this.tell(interruptSignal(interrupt$
|
|
13237
|
+
this.tell(interruptSignal(interrupt$2(fiberId)));
|
|
13621
13238
|
}
|
|
13622
13239
|
/**
|
|
13623
13240
|
* Adds an observer to the list of observers.
|
|
@@ -13811,7 +13428,7 @@ class FiberRuntime extends Class {
|
|
|
13811
13428
|
* log annotations and log level) may not be up-to-date.
|
|
13812
13429
|
*/
|
|
13813
13430
|
isInterrupted() {
|
|
13814
|
-
return !isEmpty$
|
|
13431
|
+
return !isEmpty$2(this.getFiberRef(currentInterruptedCause));
|
|
13815
13432
|
}
|
|
13816
13433
|
/**
|
|
13817
13434
|
* Adds an interruptor to the set of interruptors that are interrupting this
|
|
@@ -13845,7 +13462,7 @@ class FiberRuntime extends Class {
|
|
|
13845
13462
|
}
|
|
13846
13463
|
let told = false;
|
|
13847
13464
|
for (const child of this._children) {
|
|
13848
|
-
child.tell(interruptSignal(interrupt$
|
|
13465
|
+
child.tell(interruptSignal(interrupt$2(this.id())));
|
|
13849
13466
|
told = true;
|
|
13850
13467
|
}
|
|
13851
13468
|
return told;
|
|
@@ -14112,7 +13729,7 @@ class FiberRuntime extends Class {
|
|
|
14112
13729
|
try {
|
|
14113
13730
|
asyncRegister(callback);
|
|
14114
13731
|
} catch (e) {
|
|
14115
|
-
callback(failCause$
|
|
13732
|
+
callback(failCause$2(die$1(e)));
|
|
14116
13733
|
}
|
|
14117
13734
|
}
|
|
14118
13735
|
pushStack(cont) {
|
|
@@ -14156,10 +13773,10 @@ class FiberRuntime extends Class {
|
|
|
14156
13773
|
return sync$1(() => unsafeGet$1(this.currentContext, op));
|
|
14157
13774
|
}
|
|
14158
13775
|
["Left"](op) {
|
|
14159
|
-
return fail$
|
|
13776
|
+
return fail$1(op.left);
|
|
14160
13777
|
}
|
|
14161
13778
|
["None"](_) {
|
|
14162
|
-
return fail$
|
|
13779
|
+
return fail$1(new NoSuchElementException());
|
|
14163
13780
|
}
|
|
14164
13781
|
["Right"](op) {
|
|
14165
13782
|
return exitSucceed$1(op.right);
|
|
@@ -14178,21 +13795,21 @@ class FiberRuntime extends Class {
|
|
|
14178
13795
|
switch (exit.cause._tag) {
|
|
14179
13796
|
case "Interrupt":
|
|
14180
13797
|
{
|
|
14181
|
-
return resume(exitFailCause$1(interrupt$
|
|
13798
|
+
return resume(exitFailCause$1(interrupt$2(none$2)));
|
|
14182
13799
|
}
|
|
14183
13800
|
case "Fail":
|
|
14184
13801
|
{
|
|
14185
|
-
return resume(fail$
|
|
13802
|
+
return resume(fail$1(exit.cause.error));
|
|
14186
13803
|
}
|
|
14187
13804
|
case "Die":
|
|
14188
13805
|
{
|
|
14189
|
-
return resume(die
|
|
13806
|
+
return resume(die(exit.cause.defect));
|
|
14190
13807
|
}
|
|
14191
13808
|
}
|
|
14192
13809
|
});
|
|
14193
13810
|
return unsafeAsync(abortResume => {
|
|
14194
13811
|
resume = _ => {
|
|
14195
|
-
abortResume(void_$
|
|
13812
|
+
abortResume(void_$1);
|
|
14196
13813
|
};
|
|
14197
13814
|
fiber.unsafeInterrupt();
|
|
14198
13815
|
});
|
|
@@ -14401,7 +14018,7 @@ class FiberRuntime extends Class {
|
|
|
14401
14018
|
const level = this.getFiberRef(currentVersionMismatchErrorLogLevel);
|
|
14402
14019
|
if (level._tag === "Some") {
|
|
14403
14020
|
const effectVersion = cur[EffectTypeId]._V;
|
|
14404
|
-
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$
|
|
14021
|
+
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);
|
|
14405
14022
|
}
|
|
14406
14023
|
}
|
|
14407
14024
|
// @ts-expect-error
|
|
@@ -14413,15 +14030,15 @@ class FiberRuntime extends Class {
|
|
|
14413
14030
|
return YieldedOp;
|
|
14414
14031
|
}
|
|
14415
14032
|
yieldedOpChannel.currentOp = null;
|
|
14416
|
-
return op._op === OP_SUCCESS || op._op === OP_FAILURE ? op : exitFailCause$1(die$
|
|
14033
|
+
return op._op === OP_SUCCESS || op._op === OP_FAILURE ? op : exitFailCause$1(die$1(op));
|
|
14417
14034
|
}
|
|
14418
14035
|
} catch (e) {
|
|
14419
14036
|
if (cur !== YieldedOp && !hasProperty(cur, "_op") || !(cur._op in this)) {
|
|
14420
14037
|
cur = dieMessage$1(`Not a valid effect: ${toStringUnknown(cur)}`);
|
|
14421
14038
|
} else if (isInterruptedException(e)) {
|
|
14422
|
-
cur = exitFailCause$1(sequential$2(die$
|
|
14039
|
+
cur = exitFailCause$1(sequential$2(die$1(e), interrupt$2(none$2)));
|
|
14423
14040
|
} else {
|
|
14424
|
-
cur = die
|
|
14041
|
+
cur = die(e);
|
|
14425
14042
|
}
|
|
14426
14043
|
}
|
|
14427
14044
|
}
|
|
@@ -14468,7 +14085,7 @@ const tracerLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Lo
|
|
|
14468
14085
|
span.value.event(toStringUnknown(Array.isArray(message) && message.length === 1 ? message[0] : message), clockService.unsafeCurrentTimeNanos(), attributes);
|
|
14469
14086
|
}));
|
|
14470
14087
|
/** @internal */
|
|
14471
|
-
const currentLoggers = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLoggers"), () => fiberRefUnsafeMakeHashSet(make$
|
|
14088
|
+
const currentLoggers = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/FiberRef/currentLoggers"), () => fiberRefUnsafeMakeHashSet(make$j(defaultLogger, tracerLogger)));
|
|
14472
14089
|
// === all
|
|
14473
14090
|
const allResolveInput = input => {
|
|
14474
14091
|
if (Array.isArray(input) || isIterable(input)) {
|
|
@@ -14510,11 +14127,11 @@ const allValidate = (effects, reconcile, options) => {
|
|
|
14510
14127
|
}
|
|
14511
14128
|
}
|
|
14512
14129
|
if (errored) {
|
|
14513
|
-
return reconcile._tag === "Some" ? fail$
|
|
14130
|
+
return reconcile._tag === "Some" ? fail$1(reconcile.value(errors)) : fail$1(errors);
|
|
14514
14131
|
} else if (options?.discard) {
|
|
14515
|
-
return void_$
|
|
14132
|
+
return void_$1;
|
|
14516
14133
|
}
|
|
14517
|
-
return reconcile._tag === "Some" ? succeed$
|
|
14134
|
+
return reconcile._tag === "Some" ? succeed$2(reconcile.value(successes)) : succeed$2(successes);
|
|
14518
14135
|
});
|
|
14519
14136
|
};
|
|
14520
14137
|
const allEither = (effects, reconcile, options) => {
|
|
@@ -14530,7 +14147,7 @@ const allEither = (effects, reconcile, options) => {
|
|
|
14530
14147
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
14531
14148
|
});
|
|
14532
14149
|
}
|
|
14533
|
-
return map$
|
|
14150
|
+
return map$2(forEach$1(eitherEffects, identity, {
|
|
14534
14151
|
concurrency: options?.concurrency,
|
|
14535
14152
|
batching: options?.batching,
|
|
14536
14153
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
@@ -14544,7 +14161,7 @@ const all$1 = (arg, options) => {
|
|
|
14544
14161
|
} else if (options?.mode === "either") {
|
|
14545
14162
|
return allEither(effects, reconcile, options);
|
|
14546
14163
|
}
|
|
14547
|
-
return options?.discard !== true && reconcile._tag === "Some" ? map$
|
|
14164
|
+
return options?.discard !== true && reconcile._tag === "Some" ? map$2(forEach$1(effects, identity, options), reconcile.value) : forEach$1(effects, identity, options);
|
|
14548
14165
|
};
|
|
14549
14166
|
/* @internal */
|
|
14550
14167
|
const forEach$1 = /*#__PURE__*/dual(args => isIterable(args[0]), (self, f, options) => withFiberRuntime$1(r => {
|
|
@@ -14559,14 +14176,14 @@ const forEachParUnbounded = (self, f, batching) => suspend$1(() => {
|
|
|
14559
14176
|
const as = fromIterable$6(self);
|
|
14560
14177
|
const array = new Array(as.length);
|
|
14561
14178
|
const fn = (a, i) => flatMap$2(f(a, i), b => sync$1(() => array[i] = b));
|
|
14562
|
-
return zipRight$
|
|
14179
|
+
return zipRight$1(forEachConcurrentDiscard(as, fn, batching, false), succeed$2(array));
|
|
14563
14180
|
});
|
|
14564
14181
|
/** @internal */
|
|
14565
14182
|
const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterruptibleMask$2(restore => transplant(graft => withFiberRuntime$1(parent => {
|
|
14566
14183
|
let todos = Array.from(self).reverse();
|
|
14567
14184
|
let target = todos.length;
|
|
14568
14185
|
if (target === 0) {
|
|
14569
|
-
return void_$
|
|
14186
|
+
return void_$1;
|
|
14570
14187
|
}
|
|
14571
14188
|
let counter = 0;
|
|
14572
14189
|
let interrupted = false;
|
|
@@ -14642,7 +14259,7 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14642
14259
|
return returnNextElement();
|
|
14643
14260
|
}
|
|
14644
14261
|
}
|
|
14645
|
-
return succeed$
|
|
14262
|
+
return succeed$2(res);
|
|
14646
14263
|
};
|
|
14647
14264
|
const todo = flatMap$2(stepOrExit(restore(f(a, index))), onRes);
|
|
14648
14265
|
const fiber = runFiber(todo);
|
|
@@ -14664,13 +14281,13 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14664
14281
|
fibers.delete(fiber);
|
|
14665
14282
|
pushResult(exit, index);
|
|
14666
14283
|
if (results.length === target) {
|
|
14667
|
-
resume(succeed$
|
|
14284
|
+
resume(succeed$2(getOrElse(exitCollectAll(collectExits(), {
|
|
14668
14285
|
parallel: true
|
|
14669
14286
|
}), () => exitVoid$1)));
|
|
14670
14287
|
} else if (residual.length + results.length === target) {
|
|
14671
14288
|
const exits = collectExits();
|
|
14672
14289
|
const requests = residual.map(blocked => blocked.effect_instruction_i0).reduce(par);
|
|
14673
|
-
resume(succeed$
|
|
14290
|
+
resume(succeed$2(blocked(requests, forEachConcurrentDiscard([getOrElse(exitCollectAll(exits, {
|
|
14674
14291
|
parallel: true
|
|
14675
14292
|
}), () => exitVoid$1), ...residual.map(blocked => blocked.effect_instruction_i1)], i => i, batching, true, n))));
|
|
14676
14293
|
} else {
|
|
@@ -14719,8 +14336,8 @@ const forEachConcurrentDiscard = (self, f, batching, processAll, n) => uninterru
|
|
|
14719
14336
|
const forEachParN = (self, n, f, batching) => suspend$1(() => {
|
|
14720
14337
|
const as = fromIterable$6(self);
|
|
14721
14338
|
const array = new Array(as.length);
|
|
14722
|
-
const fn = (a, i) => map$
|
|
14723
|
-
return zipRight$
|
|
14339
|
+
const fn = (a, i) => map$2(f(a, i), b => array[i] = b);
|
|
14340
|
+
return zipRight$1(forEachConcurrentDiscard(as, fn, batching, false, n), succeed$2(array));
|
|
14724
14341
|
});
|
|
14725
14342
|
/* @internal */
|
|
14726
14343
|
const forkDaemon$1 = self => forkWithScopeOverride(self, globalScope);
|
|
@@ -14737,7 +14354,7 @@ const unsafeForkUnstarted = (effect, parentFiber, parentRuntimeFlags, overrideSc
|
|
|
14737
14354
|
};
|
|
14738
14355
|
/** @internal */
|
|
14739
14356
|
const unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
|
|
14740
|
-
const childId = unsafeMake$
|
|
14357
|
+
const childId = unsafeMake$4();
|
|
14741
14358
|
const parentFiberRefs = parentFiber.getFiberRefs();
|
|
14742
14359
|
const childFiberRefs = forkAs(parentFiberRefs, childId);
|
|
14743
14360
|
const childFiber = new FiberRuntime(childId, childFiberRefs, parentRuntimeFlags);
|
|
@@ -14750,9 +14367,9 @@ const unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideS
|
|
|
14750
14367
|
return childFiber;
|
|
14751
14368
|
};
|
|
14752
14369
|
/* @internal */
|
|
14753
|
-
const forkWithScopeOverride = (self, scopeOverride) => withFiberRuntime$1((parentFiber, parentStatus) => succeed$
|
|
14370
|
+
const forkWithScopeOverride = (self, scopeOverride) => withFiberRuntime$1((parentFiber, parentStatus) => succeed$2(unsafeFork$1(self, parentFiber, parentStatus.runtimeFlags, scopeOverride)));
|
|
14754
14371
|
/* @internal */
|
|
14755
|
-
const parallelFinalizers = self => contextWithEffect(context => match$
|
|
14372
|
+
const parallelFinalizers = self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14756
14373
|
onNone: () => self,
|
|
14757
14374
|
onSome: scope => {
|
|
14758
14375
|
switch (scope.strategy._tag) {
|
|
@@ -14765,7 +14382,7 @@ const parallelFinalizers = self => contextWithEffect(context => match$6(getOptio
|
|
|
14765
14382
|
}
|
|
14766
14383
|
}));
|
|
14767
14384
|
/* @internal */
|
|
14768
|
-
const parallelNFinalizers = parallelism => self => contextWithEffect(context => match$
|
|
14385
|
+
const parallelNFinalizers = parallelism => self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14769
14386
|
onNone: () => self,
|
|
14770
14387
|
onSome: scope => {
|
|
14771
14388
|
if (scope.strategy._tag === "ParallelN" && scope.strategy.parallelism === parallelism) {
|
|
@@ -14775,7 +14392,7 @@ const parallelNFinalizers = parallelism => self => contextWithEffect(context =>
|
|
|
14775
14392
|
}
|
|
14776
14393
|
}));
|
|
14777
14394
|
/* @internal */
|
|
14778
|
-
const finalizersMaskInternal = (strategy, concurrentFinalizers) => self => contextWithEffect(context => match$
|
|
14395
|
+
const finalizersMaskInternal = (strategy, concurrentFinalizers) => self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14779
14396
|
onNone: () => self(identity),
|
|
14780
14397
|
onSome: scope => {
|
|
14781
14398
|
if (concurrentFinalizers === true) {
|
|
@@ -14798,7 +14415,7 @@ const scopeWith = f => flatMap$2(scopeTag, f);
|
|
|
14798
14415
|
/** @internal */
|
|
14799
14416
|
const scopedWith$1 = f => flatMap$2(scopeMake(), scope => onExit$1(f(scope), exit => scope.close(exit)));
|
|
14800
14417
|
/* @internal */
|
|
14801
|
-
const sequentialFinalizers = self => contextWithEffect(context => match$
|
|
14418
|
+
const sequentialFinalizers = self => contextWithEffect(context => match$5(getOption(context, scopeTag), {
|
|
14802
14419
|
onNone: () => self,
|
|
14803
14420
|
onSome: scope => {
|
|
14804
14421
|
switch (scope.strategy._tag) {
|
|
@@ -14822,12 +14439,12 @@ const zipLeftOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, tha
|
|
|
14822
14439
|
/** @internal */
|
|
14823
14440
|
const zipRightOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, options) => {
|
|
14824
14441
|
if (options?.concurrent !== true && (options?.batching === undefined || options.batching === false)) {
|
|
14825
|
-
return zipRight$
|
|
14442
|
+
return zipRight$1(self, that);
|
|
14826
14443
|
}
|
|
14827
14444
|
return zipWithOptions(self, that, (_, b) => b, options);
|
|
14828
14445
|
});
|
|
14829
14446
|
/** @internal */
|
|
14830
|
-
const zipWithOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, f, options) => map$
|
|
14447
|
+
const zipWithOptions = /*#__PURE__*/dual(args => isEffect$1(args[1]), (self, that, f, options) => map$2(all$1([self, that], {
|
|
14831
14448
|
concurrency: options?.concurrent ? 2 : 1,
|
|
14832
14449
|
batching: options?.batching,
|
|
14833
14450
|
concurrentFinalizers: options?.concurrentFinalizers
|
|
@@ -14869,7 +14486,7 @@ const ScopeImplProto = {
|
|
|
14869
14486
|
close(exit) {
|
|
14870
14487
|
return suspend$1(() => {
|
|
14871
14488
|
if (this.state._tag === "Closed") {
|
|
14872
|
-
return void_$
|
|
14489
|
+
return void_$1;
|
|
14873
14490
|
}
|
|
14874
14491
|
const finalizers = Array.from(this.state.finalizers.values()).reverse();
|
|
14875
14492
|
this.state = {
|
|
@@ -14877,13 +14494,13 @@ const ScopeImplProto = {
|
|
|
14877
14494
|
exit
|
|
14878
14495
|
};
|
|
14879
14496
|
if (finalizers.length === 0) {
|
|
14880
|
-
return void_$
|
|
14497
|
+
return void_$1;
|
|
14881
14498
|
}
|
|
14882
|
-
return isSequential(this.strategy) ? pipe(forEachSequential(finalizers, fin => exit$1(fin(exit))), flatMap$2(results => pipe(exitCollectAll(results), map$
|
|
14499
|
+
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, {
|
|
14883
14500
|
parallel: true
|
|
14884
|
-
}), map$
|
|
14501
|
+
}), map$8(exitAsVoid), getOrElse(() => exitVoid$1)))) : pipe(forEachParN(finalizers, this.strategy.parallelism, fin => exit$1(fin(exit)), false), flatMap$2(results => pipe(exitCollectAll(results, {
|
|
14885
14502
|
parallel: true
|
|
14886
|
-
}), map$
|
|
14503
|
+
}), map$8(exitAsVoid), getOrElse(() => exitVoid$1))));
|
|
14887
14504
|
});
|
|
14888
14505
|
},
|
|
14889
14506
|
addFinalizer(fin) {
|
|
@@ -14892,7 +14509,7 @@ const ScopeImplProto = {
|
|
|
14892
14509
|
return fin(this.state.exit);
|
|
14893
14510
|
}
|
|
14894
14511
|
this.state.finalizers.set({}, fin);
|
|
14895
|
-
return void_$
|
|
14512
|
+
return void_$1;
|
|
14896
14513
|
});
|
|
14897
14514
|
}
|
|
14898
14515
|
};
|
|
@@ -14910,7 +14527,7 @@ const scopeMake = (strategy = sequential$1) => sync$1(() => scopeUnsafeMake(stra
|
|
|
14910
14527
|
/* @internal */
|
|
14911
14528
|
const scopeExtend = /*#__PURE__*/dual(2, (effect, scope) => mapInputContext(effect,
|
|
14912
14529
|
// @ts-expect-error
|
|
14913
|
-
merge$1(make$
|
|
14530
|
+
merge$1(make$o(scopeTag, scope))));
|
|
14914
14531
|
// circular with Supervisor
|
|
14915
14532
|
/** @internal */
|
|
14916
14533
|
const fiberRefUnsafeMakeSupervisor = initial => fiberRefUnsafeMakePatch(initial, {
|
|
@@ -14965,7 +14582,7 @@ const race$1 = /*#__PURE__*/dual(2, (self, that) => fiberIdWith$1(parentFiberId
|
|
|
14965
14582
|
/** @internal */
|
|
14966
14583
|
const raceFibersWith = /*#__PURE__*/dual(3, (self, other, options) => withFiberRuntime$1((parentFiber, parentStatus) => {
|
|
14967
14584
|
const parentRuntimeFlags = parentStatus.runtimeFlags;
|
|
14968
|
-
const raceIndicator = make$
|
|
14585
|
+
const raceIndicator = make$i(true);
|
|
14969
14586
|
const leftFiber = unsafeMakeChildFiber(self, parentFiber, parentRuntimeFlags, options.selfScope);
|
|
14970
14587
|
const rightFiber = unsafeMakeChildFiber(other, parentFiber, parentRuntimeFlags, options.otherScope);
|
|
14971
14588
|
return async_(cb => {
|
|
@@ -14983,8 +14600,8 @@ const completeRace = (winner, loser, cont, ab, cb) => {
|
|
|
14983
14600
|
/** @internal */
|
|
14984
14601
|
const ensuring$1 = /*#__PURE__*/dual(2, (self, finalizer) => uninterruptibleMask$2(restore => matchCauseEffect$2(restore(self), {
|
|
14985
14602
|
onFailure: cause1 => matchCauseEffect$2(finalizer, {
|
|
14986
|
-
onFailure: cause2 => failCause$
|
|
14987
|
-
onSuccess: () => failCause$
|
|
14603
|
+
onFailure: cause2 => failCause$2(sequential$2(cause1, cause2)),
|
|
14604
|
+
onSuccess: () => failCause$2(cause1)
|
|
14988
14605
|
}),
|
|
14989
14606
|
onSuccess: a => as$1(finalizer, a)
|
|
14990
14607
|
})));
|
|
@@ -15132,7 +14749,7 @@ const make$3 = intervals => {
|
|
|
15132
14749
|
};
|
|
15133
14750
|
};
|
|
15134
14751
|
/** @internal */
|
|
15135
|
-
const intersect$2 = /*#__PURE__*/dual(2, (self, that) => intersectLoop(self.intervals, that.intervals, empty$
|
|
14752
|
+
const intersect$2 = /*#__PURE__*/dual(2, (self, that) => intersectLoop(self.intervals, that.intervals, empty$i()));
|
|
15136
14753
|
/** @internal */
|
|
15137
14754
|
const intersectLoop = (_left, _right, _acc) => {
|
|
15138
14755
|
let left = _left;
|
|
@@ -15345,7 +14962,7 @@ class Semaphore {
|
|
|
15345
14962
|
}
|
|
15346
14963
|
this.waiters.delete(observer);
|
|
15347
14964
|
this.taken += n;
|
|
15348
|
-
resume(succeed$
|
|
14965
|
+
resume(succeed$2(n));
|
|
15349
14966
|
};
|
|
15350
14967
|
this.waiters.add(observer);
|
|
15351
14968
|
return sync$1(() => {
|
|
@@ -15353,7 +14970,7 @@ class Semaphore {
|
|
|
15353
14970
|
});
|
|
15354
14971
|
}
|
|
15355
14972
|
this.taken += n;
|
|
15356
|
-
return resume(succeed$
|
|
14973
|
+
return resume(succeed$2(n));
|
|
15357
14974
|
});
|
|
15358
14975
|
updateTakenUnsafe(fiber, f) {
|
|
15359
14976
|
this.taken = f(this.taken);
|
|
@@ -15367,7 +14984,7 @@ class Semaphore {
|
|
|
15367
14984
|
}
|
|
15368
14985
|
}, fiber.getFiberRef(currentSchedulingPriority));
|
|
15369
14986
|
}
|
|
15370
|
-
return succeed$
|
|
14987
|
+
return succeed$2(this.free);
|
|
15371
14988
|
}
|
|
15372
14989
|
updateTaken(f) {
|
|
15373
14990
|
return withFiberRuntime$1(fiber => this.updateTakenUnsafe(fiber, f));
|
|
@@ -15375,7 +14992,7 @@ class Semaphore {
|
|
|
15375
14992
|
resize = permits => asVoid$1(withFiberRuntime$1(fiber => {
|
|
15376
14993
|
this.permits = permits;
|
|
15377
14994
|
if (this.free < 0) {
|
|
15378
|
-
return void_$
|
|
14995
|
+
return void_$1;
|
|
15379
14996
|
}
|
|
15380
14997
|
return this.updateTakenUnsafe(fiber, taken => taken);
|
|
15381
14998
|
}));
|
|
@@ -15399,7 +15016,7 @@ const forkIn$1 = /*#__PURE__*/dual(2, (self, scope) => withFiberRuntime$1((paren
|
|
|
15399
15016
|
const scopeImpl = scope;
|
|
15400
15017
|
const fiber = unsafeFork$1(self, parent, parentStatus.runtimeFlags, globalScope);
|
|
15401
15018
|
if (scopeImpl.state._tag === "Open") {
|
|
15402
|
-
const finalizer = () => fiberIdWith$1(fiberId => equals$1(fiberId, fiber.id()) ? void_$
|
|
15019
|
+
const finalizer = () => fiberIdWith$1(fiberId => equals$1(fiberId, fiber.id()) ? void_$1 : asVoid$1(interruptFiber(fiber)));
|
|
15403
15020
|
const key = {};
|
|
15404
15021
|
scopeImpl.state.finalizers.set(key, finalizer);
|
|
15405
15022
|
fiber.addObserver(() => {
|
|
@@ -15409,7 +15026,7 @@ const forkIn$1 = /*#__PURE__*/dual(2, (self, scope) => withFiberRuntime$1((paren
|
|
|
15409
15026
|
} else {
|
|
15410
15027
|
fiber.unsafeInterruptAsFork(parent.id());
|
|
15411
15028
|
}
|
|
15412
|
-
return succeed$
|
|
15029
|
+
return succeed$2(fiber);
|
|
15413
15030
|
}));
|
|
15414
15031
|
/** @internal */
|
|
15415
15032
|
const raceFirst$1 = /*#__PURE__*/dual(2, (self, that) => pipe(exit$1(self), race$1(exit$1(that)), effect => flatten$1(effect)));
|
|
@@ -15441,7 +15058,7 @@ class SynchronizedImpl extends Class {
|
|
|
15441
15058
|
return this.get;
|
|
15442
15059
|
}
|
|
15443
15060
|
modify(f) {
|
|
15444
|
-
return this.modifyEffect(a => succeed$
|
|
15061
|
+
return this.modifyEffect(a => succeed$2(f(a)));
|
|
15445
15062
|
}
|
|
15446
15063
|
modifyEffect(f) {
|
|
15447
15064
|
return this.withLock(pipe(flatMap$2(get(this.ref), f), flatMap$2(([b, a]) => as$1(set(this.ref, a), b))));
|
|
@@ -15475,7 +15092,7 @@ const makeDual = f => function () {
|
|
|
15475
15092
|
};
|
|
15476
15093
|
/** @internal */
|
|
15477
15094
|
const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
15478
|
-
const fiberId = unsafeMake$
|
|
15095
|
+
const fiberId = unsafeMake$4();
|
|
15479
15096
|
const fiberRefUpdates = [[currentContext, [[fiberId, runtime.context]]]];
|
|
15480
15097
|
if (options?.scheduler) {
|
|
15481
15098
|
fiberRefUpdates.push([currentScheduler, [[fiberId, options.scheduler]]]);
|
|
@@ -15490,7 +15107,7 @@ const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
|
15490
15107
|
const fiberRuntime = new FiberRuntime(fiberId, fiberRefs, runtime.runtimeFlags);
|
|
15491
15108
|
let effect = self;
|
|
15492
15109
|
if (options?.scope) {
|
|
15493
|
-
effect = flatMap$2(fork(options.scope, sequential$1), closeableScope => zipRight$
|
|
15110
|
+
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))));
|
|
15494
15111
|
}
|
|
15495
15112
|
const supervisor = fiberRuntime.currentSupervisor;
|
|
15496
15113
|
// we can compare by reference here as _supervisor.none is wrapped with globalValue
|
|
@@ -15508,6 +15125,31 @@ const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {
|
|
|
15508
15125
|
return fiberRuntime;
|
|
15509
15126
|
});
|
|
15510
15127
|
/** @internal */
|
|
15128
|
+
const unsafeRunSync = /*#__PURE__*/makeDual((runtime, effect) => {
|
|
15129
|
+
const result = unsafeRunSyncExit(runtime)(effect);
|
|
15130
|
+
if (result._tag === "Failure") {
|
|
15131
|
+
throw fiberFailure(result.effect_instruction_i0);
|
|
15132
|
+
}
|
|
15133
|
+
return result.effect_instruction_i0;
|
|
15134
|
+
});
|
|
15135
|
+
class AsyncFiberExceptionImpl extends Error {
|
|
15136
|
+
fiber;
|
|
15137
|
+
_tag = "AsyncFiberException";
|
|
15138
|
+
constructor(fiber) {
|
|
15139
|
+
super(`Fiber #${fiber.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);
|
|
15140
|
+
this.fiber = fiber;
|
|
15141
|
+
this.name = this._tag;
|
|
15142
|
+
this.stack = this.message;
|
|
15143
|
+
}
|
|
15144
|
+
}
|
|
15145
|
+
const asyncFiberException = fiber => {
|
|
15146
|
+
const limit = Error.stackTraceLimit;
|
|
15147
|
+
Error.stackTraceLimit = 0;
|
|
15148
|
+
const error = new AsyncFiberExceptionImpl(fiber);
|
|
15149
|
+
Error.stackTraceLimit = limit;
|
|
15150
|
+
return error;
|
|
15151
|
+
};
|
|
15152
|
+
/** @internal */
|
|
15511
15153
|
const FiberFailureId = /*#__PURE__*/Symbol.for("effect/Runtime/FiberFailure");
|
|
15512
15154
|
/** @internal */
|
|
15513
15155
|
const FiberFailureCauseId = /*#__PURE__*/Symbol.for("effect/Runtime/FiberFailure/Cause");
|
|
@@ -15576,6 +15218,23 @@ const fastPath = effect => {
|
|
|
15576
15218
|
}
|
|
15577
15219
|
};
|
|
15578
15220
|
/** @internal */
|
|
15221
|
+
const unsafeRunSyncExit = /*#__PURE__*/makeDual((runtime, effect) => {
|
|
15222
|
+
const op = fastPath(effect);
|
|
15223
|
+
if (op) {
|
|
15224
|
+
return op;
|
|
15225
|
+
}
|
|
15226
|
+
const scheduler = new SyncScheduler();
|
|
15227
|
+
const fiberRuntime = unsafeFork(runtime)(effect, {
|
|
15228
|
+
scheduler
|
|
15229
|
+
});
|
|
15230
|
+
scheduler.flush();
|
|
15231
|
+
const result = fiberRuntime.unsafePoll();
|
|
15232
|
+
if (result) {
|
|
15233
|
+
return result;
|
|
15234
|
+
}
|
|
15235
|
+
return exitDie$1(capture(asyncFiberException(fiberRuntime), currentSpanFromFiber(fiberRuntime)));
|
|
15236
|
+
});
|
|
15237
|
+
/** @internal */
|
|
15579
15238
|
const unsafeRunPromise = /*#__PURE__*/makeDual((runtime, effect, options) => unsafeRunPromiseExit(runtime, effect, options).then(result => {
|
|
15580
15239
|
switch (result._tag) {
|
|
15581
15240
|
case OP_SUCCESS:
|
|
@@ -15627,12 +15286,12 @@ class RuntimeImpl {
|
|
|
15627
15286
|
/** @internal */
|
|
15628
15287
|
const make = options => new RuntimeImpl(options.context, options.runtimeFlags, options.fiberRefs);
|
|
15629
15288
|
/** @internal */
|
|
15630
|
-
const runtime$1 = () => withFiberRuntime$1((state, status) => succeed$
|
|
15289
|
+
const runtime$1 = () => withFiberRuntime$1((state, status) => succeed$2(new RuntimeImpl(state.getFiberRef(currentContext), status.runtimeFlags, state.getFiberRefs())));
|
|
15631
15290
|
/** @internal */
|
|
15632
|
-
const defaultRuntimeFlags = /*#__PURE__*/make$
|
|
15291
|
+
const defaultRuntimeFlags = /*#__PURE__*/make$f(Interruption, CooperativeYielding, RuntimeMetrics);
|
|
15633
15292
|
/** @internal */
|
|
15634
15293
|
const defaultRuntime = /*#__PURE__*/make({
|
|
15635
|
-
context: /*#__PURE__*/empty$
|
|
15294
|
+
context: /*#__PURE__*/empty$j(),
|
|
15636
15295
|
runtimeFlags: defaultRuntimeFlags,
|
|
15637
15296
|
fiberRefs: /*#__PURE__*/empty$4()
|
|
15638
15297
|
});
|
|
@@ -15640,6 +15299,8 @@ const defaultRuntime = /*#__PURE__*/make({
|
|
|
15640
15299
|
const unsafeForkEffect = /*#__PURE__*/unsafeFork(defaultRuntime);
|
|
15641
15300
|
/** @internal */
|
|
15642
15301
|
const unsafeRunPromiseEffect = /*#__PURE__*/unsafeRunPromise(defaultRuntime);
|
|
15302
|
+
/** @internal */
|
|
15303
|
+
const unsafeRunSyncEffect = /*#__PURE__*/unsafeRunSync(defaultRuntime);
|
|
15643
15304
|
|
|
15644
15305
|
/** @internal */
|
|
15645
15306
|
const modifyEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(f));
|
|
@@ -15699,26 +15360,26 @@ class MemoMapImpl {
|
|
|
15699
15360
|
if (inMap !== undefined) {
|
|
15700
15361
|
const [acquire, release] = inMap;
|
|
15701
15362
|
const cached = pipe(acquire, flatMap$2(([patch, b]) => pipe(patchFiberRefs(patch), as$1(b))), onExit$1(exitMatch({
|
|
15702
|
-
onFailure: () => void_$
|
|
15363
|
+
onFailure: () => void_$1,
|
|
15703
15364
|
onSuccess: () => scopeAddFinalizerExit(scope, release)
|
|
15704
15365
|
})));
|
|
15705
|
-
return succeed$
|
|
15366
|
+
return succeed$2([cached, map]);
|
|
15706
15367
|
}
|
|
15707
|
-
return pipe(make$a(0), flatMap$2(observers => pipe(deferredMake(), flatMap$2(deferred => pipe(make$a(() => void_$
|
|
15368
|
+
return pipe(make$a(0), flatMap$2(observers => pipe(deferredMake(), flatMap$2(deferred => pipe(make$a(() => void_$1), map$2(finalizerRef => {
|
|
15708
15369
|
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 => {
|
|
15709
15370
|
switch (exit._tag) {
|
|
15710
15371
|
case OP_FAILURE:
|
|
15711
15372
|
{
|
|
15712
|
-
return pipe(deferredFailCause(deferred, exit.effect_instruction_i0), zipRight$
|
|
15373
|
+
return pipe(deferredFailCause(deferred, exit.effect_instruction_i0), zipRight$1(scopeClose(innerScope, exit)), zipRight$1(failCause$2(exit.effect_instruction_i0)));
|
|
15713
15374
|
}
|
|
15714
15375
|
case OP_SUCCESS:
|
|
15715
15376
|
{
|
|
15716
|
-
return pipe(set(finalizerRef, exit => pipe(scopeClose(innerScope, exit), whenEffect(modify(observers, n => [n === 1, n - 1])), asVoid$1)), zipRight$
|
|
15377
|
+
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]));
|
|
15717
15378
|
}
|
|
15718
15379
|
}
|
|
15719
15380
|
})))));
|
|
15720
15381
|
const memoized = [pipe(deferredAwait(deferred), onExit$1(exitMatchEffect({
|
|
15721
|
-
onFailure: () => void_$
|
|
15382
|
+
onFailure: () => void_$1,
|
|
15722
15383
|
onSuccess: () => update$1(observers, n => n + 1)
|
|
15723
15384
|
}))), exit => pipe(get(finalizerRef), flatMap$2(finalizer => finalizer(exit)))];
|
|
15724
15385
|
return [resource, isFresh(layer) ? map : map.set(layer, memoized)];
|
|
@@ -15727,7 +15388,7 @@ class MemoMapImpl {
|
|
|
15727
15388
|
}
|
|
15728
15389
|
}
|
|
15729
15390
|
/** @internal */
|
|
15730
|
-
const makeMemoMap = /*#__PURE__*/suspend$1(() => map$
|
|
15391
|
+
const makeMemoMap = /*#__PURE__*/suspend$1(() => map$2(makeSynchronized(new Map()), ref => new MemoMapImpl(ref)));
|
|
15731
15392
|
/** @internal */
|
|
15732
15393
|
const unsafeMakeMemoMap = () => new MemoMapImpl(unsafeMakeSynchronized(new Map()));
|
|
15733
15394
|
/** @internal */
|
|
@@ -15790,9 +15451,9 @@ const makeBuilder = (self, scope, inMemoMap = false) => {
|
|
|
15790
15451
|
case "MergeAll":
|
|
15791
15452
|
{
|
|
15792
15453
|
const layers = op.layers;
|
|
15793
|
-
return map$
|
|
15454
|
+
return map$2(scopeFork(scope, parallel$1), parallelScope => memoMap => {
|
|
15794
15455
|
const contexts = new Array(layers.length);
|
|
15795
|
-
return map$
|
|
15456
|
+
return map$2(forEachConcurrentDiscard(layers, fnUntraced(function* (layer, i) {
|
|
15796
15457
|
const scope = yield* scopeFork(parallelScope, sequential$1);
|
|
15797
15458
|
const context = yield* memoMap.getOrElseMemoize(layer, scope);
|
|
15798
15459
|
contexts[i] = context;
|
|
@@ -15826,7 +15487,7 @@ const provideSomeRuntime = /*#__PURE__*/dual(2, (self, rt) => {
|
|
|
15826
15487
|
return ensuring$1(provideSomeContext(restore(self), merge$1(oldContext, rt.context)), withFiberRuntime$1(fiber => {
|
|
15827
15488
|
fiber.setFiberRefs(patch$1(fiber.id(), fiber.getFiberRefs())(rollbackRefs));
|
|
15828
15489
|
fiber.currentRuntimeFlags = patch$4(rollbackFlags)(fiber.currentRuntimeFlags);
|
|
15829
|
-
return void_$
|
|
15490
|
+
return void_$1;
|
|
15830
15491
|
}));
|
|
15831
15492
|
}));
|
|
15832
15493
|
});
|
|
@@ -15927,7 +15588,7 @@ class ScheduleDriverImpl {
|
|
|
15927
15588
|
this.ref = ref;
|
|
15928
15589
|
}
|
|
15929
15590
|
get state() {
|
|
15930
|
-
return map$
|
|
15591
|
+
return map$2(get(this.ref), tuple => tuple[1]);
|
|
15931
15592
|
}
|
|
15932
15593
|
get last() {
|
|
15933
15594
|
return flatMap$2(get(this.ref), ([element, _]) => {
|
|
@@ -15938,7 +15599,7 @@ class ScheduleDriverImpl {
|
|
|
15938
15599
|
}
|
|
15939
15600
|
case "Some":
|
|
15940
15601
|
{
|
|
15941
|
-
return succeed$
|
|
15602
|
+
return succeed$2(element.value);
|
|
15942
15603
|
}
|
|
15943
15604
|
}
|
|
15944
15605
|
});
|
|
@@ -15948,17 +15609,17 @@ class ScheduleDriverImpl {
|
|
|
15948
15609
|
return set(this.ref, [none$4(), this.schedule.initial]).pipe(zipLeft$1(set(this.iterationMeta, defaultIterationMetadata)));
|
|
15949
15610
|
}
|
|
15950
15611
|
next(input) {
|
|
15951
|
-
return pipe(map$
|
|
15612
|
+
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]) => {
|
|
15952
15613
|
const setState = set(this.ref, [some(out), state]);
|
|
15953
15614
|
if (isDone(decision)) {
|
|
15954
|
-
return setState.pipe(zipRight$
|
|
15615
|
+
return setState.pipe(zipRight$1(fail$1(none$4())));
|
|
15955
15616
|
}
|
|
15956
15617
|
const millis$1 = start(decision.intervals) - now;
|
|
15957
15618
|
if (millis$1 <= 0) {
|
|
15958
|
-
return setState.pipe(zipRight$
|
|
15619
|
+
return setState.pipe(zipRight$1(updateInfo(this.iterationMeta, now, input, out)), as$1(out));
|
|
15959
15620
|
}
|
|
15960
15621
|
const duration = millis(millis$1);
|
|
15961
|
-
return pipe(setState, zipRight$
|
|
15622
|
+
return pipe(setState, zipRight$1(updateInfo(this.iterationMeta, now, input, out)), zipRight$1(sleep(duration)), as$1(out));
|
|
15962
15623
|
}))))));
|
|
15963
15624
|
}
|
|
15964
15625
|
}
|
|
@@ -15969,12 +15630,12 @@ const check = /*#__PURE__*/dual(2, (self, test) => checkEffect(self, (input, out
|
|
|
15969
15630
|
/** @internal */
|
|
15970
15631
|
const checkEffect = /*#__PURE__*/dual(2, (self, test) => makeWithState(self.initial, (now, input, state) => flatMap$2(self.step(now, input, state), ([state, out, decision]) => {
|
|
15971
15632
|
if (isDone(decision)) {
|
|
15972
|
-
return succeed$
|
|
15633
|
+
return succeed$2([state, out, done]);
|
|
15973
15634
|
}
|
|
15974
|
-
return map$
|
|
15635
|
+
return map$2(test(input, out), cont => cont ? [state, out, decision] : [state, out, done]);
|
|
15975
15636
|
})));
|
|
15976
15637
|
/** @internal */
|
|
15977
|
-
const driver = self => pipe(make$a([none$4(), self.initial]), map$
|
|
15638
|
+
const driver = self => pipe(make$a([none$4(), self.initial]), map$2(ref => new ScheduleDriverImpl(self, ref)));
|
|
15978
15639
|
/** @internal */
|
|
15979
15640
|
const intersect = /*#__PURE__*/dual(2, (self, that) => intersectWith(self, that, intersect$1));
|
|
15980
15641
|
/** @internal */
|
|
@@ -15982,25 +15643,25 @@ const intersectWith = /*#__PURE__*/dual(3, (self, that, f) => makeWithState([sel
|
|
|
15982
15643
|
if (isContinue(lDecision) && isContinue(rDecision)) {
|
|
15983
15644
|
return intersectWithLoop(self, that, input, lState, out, lDecision.intervals, rState, out2, rDecision.intervals, f);
|
|
15984
15645
|
}
|
|
15985
|
-
return succeed$
|
|
15646
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
15986
15647
|
}))));
|
|
15987
15648
|
/** @internal */
|
|
15988
15649
|
const intersectWithLoop = (self, that, input, lState, out, lInterval, rState, out2, rInterval, f) => {
|
|
15989
15650
|
const combined = f(lInterval, rInterval);
|
|
15990
15651
|
if (isNonEmpty(combined)) {
|
|
15991
|
-
return succeed$
|
|
15652
|
+
return succeed$2([[lState, rState], [out, out2], _continue(combined)]);
|
|
15992
15653
|
}
|
|
15993
15654
|
if (pipe(lInterval, lessThan(rInterval))) {
|
|
15994
15655
|
return flatMap$2(self.step(end(lInterval), input, lState), ([lState, out, decision]) => {
|
|
15995
15656
|
if (isDone(decision)) {
|
|
15996
|
-
return succeed$
|
|
15657
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
15997
15658
|
}
|
|
15998
15659
|
return intersectWithLoop(self, that, input, lState, out, decision.intervals, rState, out2, rInterval, f);
|
|
15999
15660
|
});
|
|
16000
15661
|
}
|
|
16001
15662
|
return flatMap$2(that.step(end(rInterval), input, rState), ([rState, out2, decision]) => {
|
|
16002
15663
|
if (isDone(decision)) {
|
|
16003
|
-
return succeed$
|
|
15664
|
+
return succeed$2([[lState, rState], [out, out2], done]);
|
|
16004
15665
|
}
|
|
16005
15666
|
return intersectWithLoop(self, that, input, lState, out, lInterval, rState, out2, decision.intervals, f);
|
|
16006
15667
|
});
|
|
@@ -16008,9 +15669,9 @@ const intersectWithLoop = (self, that, input, lState, out, lInterval, rState, ou
|
|
|
16008
15669
|
/** @internal */
|
|
16009
15670
|
const map$1 = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, out => sync$1(() => f(out))));
|
|
16010
15671
|
/** @internal */
|
|
16011
|
-
const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => flatMap$2(self.step(now, input, state), ([state, out, decision]) => map$
|
|
15672
|
+
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]))));
|
|
16012
15673
|
/** @internal */
|
|
16013
|
-
const passthrough = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), map$
|
|
15674
|
+
const passthrough = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), map$2(([state, _, decision]) => [state, input, decision])));
|
|
16014
15675
|
/** @internal */
|
|
16015
15676
|
const recurs = n => whileOutput(forever$1, out => out < n);
|
|
16016
15677
|
/** @internal */
|
|
@@ -16032,16 +15693,16 @@ class ScheduleDefect {
|
|
|
16032
15693
|
}
|
|
16033
15694
|
}
|
|
16034
15695
|
const isScheduleDefect = u => hasProperty(u, ScheduleDefectTypeId);
|
|
16035
|
-
const scheduleDefectWrap = self => catchAll$1(self, e => die
|
|
15696
|
+
const scheduleDefectWrap = self => catchAll$1(self, e => die(new ScheduleDefect(e)));
|
|
16036
15697
|
/** @internal */
|
|
16037
|
-
const scheduleDefectRefailCause = cause => match$
|
|
15698
|
+
const scheduleDefectRefailCause = cause => match$5(find(cause, _ => isDieType(_) && isScheduleDefect(_.defect) ? some(_.defect) : none$4()), {
|
|
16038
15699
|
onNone: () => cause,
|
|
16039
|
-
onSome: error => fail$
|
|
15700
|
+
onSome: error => fail$2(error.error)
|
|
16040
15701
|
});
|
|
16041
15702
|
/** @internal */
|
|
16042
|
-
const scheduleDefectRefail = effect => catchAllCause$1(effect, cause => failCause$
|
|
15703
|
+
const scheduleDefectRefail = effect => catchAllCause$1(effect, cause => failCause$2(scheduleDefectRefailCause(cause)));
|
|
16043
15704
|
/** @internal */
|
|
16044
|
-
const repeat_Effect = /*#__PURE__*/dual(2, (self, schedule) => repeatOrElse_Effect(self, schedule, (e, _) => fail$
|
|
15705
|
+
const repeat_Effect = /*#__PURE__*/dual(2, (self, schedule) => repeatOrElse_Effect(self, schedule, (e, _) => fail$1(e)));
|
|
16045
15706
|
/** @internal */
|
|
16046
15707
|
const repeat_combined = /*#__PURE__*/dual(2, (self, options) => {
|
|
16047
15708
|
if (isSchedule(options)) {
|
|
@@ -16051,14 +15712,14 @@ const repeat_combined = /*#__PURE__*/dual(2, (self, options) => {
|
|
|
16051
15712
|
const withWhile = options.while ? whileInputEffect(base, a => {
|
|
16052
15713
|
const applied = options.while(a);
|
|
16053
15714
|
if (typeof applied === "boolean") {
|
|
16054
|
-
return succeed$
|
|
15715
|
+
return succeed$2(applied);
|
|
16055
15716
|
}
|
|
16056
15717
|
return scheduleDefectWrap(applied);
|
|
16057
15718
|
}) : base;
|
|
16058
15719
|
const withUntil = options.until ? untilInputEffect(withWhile, a => {
|
|
16059
15720
|
const applied = options.until(a);
|
|
16060
15721
|
if (typeof applied === "boolean") {
|
|
16061
|
-
return succeed$
|
|
15722
|
+
return succeed$2(applied);
|
|
16062
15723
|
}
|
|
16063
15724
|
return scheduleDefectWrap(applied);
|
|
16064
15725
|
}) : withWhile;
|
|
@@ -16542,14 +16203,14 @@ const withFiberRuntime = withFiberRuntime$1;
|
|
|
16542
16203
|
* @since 2.0.0
|
|
16543
16204
|
* @category Creating Effects
|
|
16544
16205
|
*/
|
|
16545
|
-
const fail = fail$
|
|
16206
|
+
const fail = fail$1;
|
|
16546
16207
|
/**
|
|
16547
16208
|
* Creates an `Effect` that fails with the specified `Cause`.
|
|
16548
16209
|
*
|
|
16549
16210
|
* @since 2.0.0
|
|
16550
16211
|
* @category Creating Effects
|
|
16551
16212
|
*/
|
|
16552
|
-
const failCause = failCause$
|
|
16213
|
+
const failCause = failCause$2;
|
|
16553
16214
|
/**
|
|
16554
16215
|
* Creates an effect that terminates a fiber with a `RuntimeException`
|
|
16555
16216
|
* containing the specified message.
|
|
@@ -16720,7 +16381,7 @@ const promise = promise$1;
|
|
|
16720
16381
|
* @since 2.0.0
|
|
16721
16382
|
* @category Creating Effects
|
|
16722
16383
|
*/
|
|
16723
|
-
const succeed = succeed$
|
|
16384
|
+
const succeed = succeed$2;
|
|
16724
16385
|
/**
|
|
16725
16386
|
* Delays the creation of an `Effect` until it is actually needed.
|
|
16726
16387
|
*
|
|
@@ -16858,7 +16519,7 @@ const suspend = suspend$1;
|
|
|
16858
16519
|
* @category Creating Effects
|
|
16859
16520
|
*/
|
|
16860
16521
|
const sync = sync$1;
|
|
16861
|
-
const _void = void_$
|
|
16522
|
+
const _void = void_$1;
|
|
16862
16523
|
/**
|
|
16863
16524
|
* Handles all errors in an effect by providing a fallback effect.
|
|
16864
16525
|
*
|
|
@@ -17108,7 +16769,7 @@ const tryPromise = tryPromise$1;
|
|
|
17108
16769
|
* @since 2.0.0
|
|
17109
16770
|
* @category Interruption
|
|
17110
16771
|
*/
|
|
17111
|
-
const interrupt = interrupt$
|
|
16772
|
+
const interrupt = interrupt$1;
|
|
17112
16773
|
/**
|
|
17113
16774
|
* Marks an effect as interruptible.
|
|
17114
16775
|
*
|
|
@@ -17220,7 +16881,7 @@ const asVoid = asVoid$1;
|
|
|
17220
16881
|
* @since 2.0.0
|
|
17221
16882
|
* @category Mapping
|
|
17222
16883
|
*/
|
|
17223
|
-
const map = map$
|
|
16884
|
+
const map = map$2;
|
|
17224
16885
|
/**
|
|
17225
16886
|
* Transforms or modifies the error produced by an effect without affecting its
|
|
17226
16887
|
* success value.
|
|
@@ -18741,6 +18402,84 @@ const runFork = unsafeForkEffect;
|
|
|
18741
18402
|
* @category Running Effects
|
|
18742
18403
|
*/
|
|
18743
18404
|
const runPromise = unsafeRunPromiseEffect;
|
|
18405
|
+
/**
|
|
18406
|
+
* Executes an effect synchronously, running it immediately and returning the
|
|
18407
|
+
* result.
|
|
18408
|
+
*
|
|
18409
|
+
* **Details**
|
|
18410
|
+
*
|
|
18411
|
+
* This function evaluates the provided effect synchronously, returning its
|
|
18412
|
+
* result directly. It is ideal for effects that do not fail or include
|
|
18413
|
+
* asynchronous operations. If the effect does fail or involves async tasks, it
|
|
18414
|
+
* will throw an error. Execution stops at the point of failure or asynchronous
|
|
18415
|
+
* operation, making it unsuitable for effects that require asynchronous
|
|
18416
|
+
* handling.
|
|
18417
|
+
*
|
|
18418
|
+
* **Important**: Attempting to run effects that involve asynchronous operations
|
|
18419
|
+
* or failures will result in exceptions being thrown, so use this function with
|
|
18420
|
+
* care for purely synchronous and error-free effects.
|
|
18421
|
+
*
|
|
18422
|
+
* **When to Use**
|
|
18423
|
+
*
|
|
18424
|
+
* Use this function when:
|
|
18425
|
+
* - You are sure that the effect will not fail or involve asynchronous
|
|
18426
|
+
* operations.
|
|
18427
|
+
* - You need a direct, synchronous result from the effect.
|
|
18428
|
+
* - You are working within a context where asynchronous effects are not
|
|
18429
|
+
* allowed.
|
|
18430
|
+
*
|
|
18431
|
+
* Avoid using this function for effects that can fail or require asynchronous
|
|
18432
|
+
* handling. For such cases, consider using {@link runPromise} or
|
|
18433
|
+
* {@link runSyncExit}.
|
|
18434
|
+
*
|
|
18435
|
+
* **Example** (Synchronous Logging)
|
|
18436
|
+
*
|
|
18437
|
+
* ```ts
|
|
18438
|
+
* import { Effect } from "effect"
|
|
18439
|
+
*
|
|
18440
|
+
* const program = Effect.sync(() => {
|
|
18441
|
+
* console.log("Hello, World!")
|
|
18442
|
+
* return 1
|
|
18443
|
+
* })
|
|
18444
|
+
*
|
|
18445
|
+
* const result = Effect.runSync(program)
|
|
18446
|
+
* // Output: Hello, World!
|
|
18447
|
+
*
|
|
18448
|
+
* console.log(result)
|
|
18449
|
+
* // Output: 1
|
|
18450
|
+
* ```
|
|
18451
|
+
*
|
|
18452
|
+
* **Example** (Incorrect Usage with Failing or Async Effects)
|
|
18453
|
+
*
|
|
18454
|
+
* ```ts
|
|
18455
|
+
* import { Effect } from "effect"
|
|
18456
|
+
*
|
|
18457
|
+
* try {
|
|
18458
|
+
* // Attempt to run an effect that fails
|
|
18459
|
+
* Effect.runSync(Effect.fail("my error"))
|
|
18460
|
+
* } catch (e) {
|
|
18461
|
+
* console.error(e)
|
|
18462
|
+
* }
|
|
18463
|
+
* // Output:
|
|
18464
|
+
* // (FiberFailure) Error: my error
|
|
18465
|
+
*
|
|
18466
|
+
* try {
|
|
18467
|
+
* // Attempt to run an effect that involves async work
|
|
18468
|
+
* Effect.runSync(Effect.promise(() => Promise.resolve(1)))
|
|
18469
|
+
* } catch (e) {
|
|
18470
|
+
* console.error(e)
|
|
18471
|
+
* }
|
|
18472
|
+
* // Output:
|
|
18473
|
+
* // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work
|
|
18474
|
+
* ```
|
|
18475
|
+
*
|
|
18476
|
+
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
18477
|
+
* throwing an error.
|
|
18478
|
+
*
|
|
18479
|
+
* @since 2.0.0
|
|
18480
|
+
* @category Running Effects
|
|
18481
|
+
*/
|
|
18482
|
+
const runSync = unsafeRunSyncEffect;
|
|
18744
18483
|
/**
|
|
18745
18484
|
* Combines two effects into a single effect, producing a tuple of their
|
|
18746
18485
|
* results.
|
|
@@ -18963,26 +18702,22 @@ const zipRight = zipRightOptions;
|
|
|
18963
18702
|
const zipWith = zipWithOptions;
|
|
18964
18703
|
|
|
18965
18704
|
exports.Class = Class;
|
|
18966
|
-
exports.
|
|
18705
|
+
exports.NodeInspectSymbol = NodeInspectSymbol;
|
|
18967
18706
|
exports.YieldableError = YieldableError;
|
|
18968
|
-
exports._await = _await
|
|
18969
|
-
exports._await$1 = _await;
|
|
18707
|
+
exports._await = _await;
|
|
18970
18708
|
exports._void = _void;
|
|
18971
18709
|
exports.acquireUseRelease = acquireUseRelease;
|
|
18972
18710
|
exports.addFinalizer = addFinalizer;
|
|
18973
18711
|
exports.addFinalizerExit = addFinalizerExit;
|
|
18974
18712
|
exports.all = all$1;
|
|
18975
|
-
exports.all$1 = all
|
|
18976
|
-
exports.
|
|
18977
|
-
exports.append = append$1;
|
|
18713
|
+
exports.all$1 = all;
|
|
18714
|
+
exports.append = append;
|
|
18978
18715
|
exports.appendAll = appendAll$1;
|
|
18979
18716
|
exports.as = as;
|
|
18980
18717
|
exports.asVoid = asVoid$1;
|
|
18981
18718
|
exports.asVoid$1 = asVoid;
|
|
18982
18719
|
exports.async = async;
|
|
18983
|
-
exports.bounded = bounded;
|
|
18984
18720
|
exports.cached = cached;
|
|
18985
|
-
exports.capacity = capacity;
|
|
18986
18721
|
exports.catchAll = catchAll;
|
|
18987
18722
|
exports.catchAll$1 = catchAll$1;
|
|
18988
18723
|
exports.catchAllCause = catchAllCause;
|
|
@@ -18996,30 +18731,41 @@ exports.constVoid = constVoid;
|
|
|
18996
18731
|
exports.context = context;
|
|
18997
18732
|
exports.decode = decode;
|
|
18998
18733
|
exports.deferredAwait = deferredAwait;
|
|
18734
|
+
exports.deferredDone = deferredDone;
|
|
18735
|
+
exports.deferredFailCause = deferredFailCause;
|
|
18736
|
+
exports.deferredInterrupt = deferredInterrupt;
|
|
18999
18737
|
exports.deferredInterruptWith = deferredInterruptWith;
|
|
18738
|
+
exports.deferredIsDone = deferredIsDone;
|
|
19000
18739
|
exports.deferredMake = deferredMake;
|
|
19001
18740
|
exports.deferredSucceed = deferredSucceed;
|
|
19002
18741
|
exports.deferredUnsafeDone = deferredUnsafeDone;
|
|
19003
18742
|
exports.deferredUnsafeMake = deferredUnsafeMake;
|
|
19004
|
-
exports.die = die$
|
|
19005
|
-
exports.die$1 = die;
|
|
18743
|
+
exports.die = die$1;
|
|
19006
18744
|
exports.dieMessage = dieMessage;
|
|
19007
|
-
exports.done = done$4;
|
|
19008
18745
|
exports.dual = dual;
|
|
19009
|
-
exports.empty = empty$
|
|
19010
|
-
exports.empty$1 = empty$
|
|
19011
|
-
exports.empty$2 = empty$
|
|
18746
|
+
exports.empty = empty$7;
|
|
18747
|
+
exports.empty$1 = empty$l;
|
|
18748
|
+
exports.empty$2 = empty$i;
|
|
19012
18749
|
exports.ensuring = ensuring;
|
|
19013
18750
|
exports.equals = equals$1;
|
|
19014
18751
|
exports.exit = exit$1;
|
|
19015
18752
|
exports.exit$1 = exit;
|
|
18753
|
+
exports.exitCollectAll = exitCollectAll;
|
|
18754
|
+
exports.exitDie = exitDie$1;
|
|
18755
|
+
exports.exitFail = exitFail;
|
|
18756
|
+
exports.exitFailCause = exitFailCause$1;
|
|
18757
|
+
exports.exitIsFailure = exitIsFailure;
|
|
18758
|
+
exports.exitIsSuccess = exitIsSuccess;
|
|
18759
|
+
exports.exitMap = exitMap;
|
|
18760
|
+
exports.exitMatch = exitMatch;
|
|
18761
|
+
exports.exitSucceed = exitSucceed$1;
|
|
18762
|
+
exports.exitVoid = exitVoid$1;
|
|
18763
|
+
exports.exitZip = exitZip;
|
|
18764
|
+
exports.exitZipRight = exitZipRight;
|
|
19016
18765
|
exports.extend = extend;
|
|
19017
|
-
exports.fail = fail$
|
|
19018
|
-
exports.fail$1 = fail
|
|
19019
|
-
exports.
|
|
19020
|
-
exports.failCause = failCause$2;
|
|
19021
|
-
exports.failCause$1 = failCause;
|
|
19022
|
-
exports.failCause$2 = failCause$3;
|
|
18766
|
+
exports.fail = fail$2;
|
|
18767
|
+
exports.fail$1 = fail;
|
|
18768
|
+
exports.failCause = failCause;
|
|
19023
18769
|
exports.failureOrCause = failureOrCause;
|
|
19024
18770
|
exports.fiberId = fiberId;
|
|
19025
18771
|
exports.fiberIdWith = fiberIdWith;
|
|
@@ -19035,6 +18781,7 @@ exports.forever = forever;
|
|
|
19035
18781
|
exports.fork = fork;
|
|
19036
18782
|
exports.forkDaemon = forkDaemon;
|
|
19037
18783
|
exports.forkIn = forkIn;
|
|
18784
|
+
exports.format = format$2;
|
|
19038
18785
|
exports.fromIterable = fromIterable$6;
|
|
19039
18786
|
exports.fromIterable$1 = fromIterable$5;
|
|
19040
18787
|
exports.gen = gen;
|
|
@@ -19053,60 +18800,47 @@ exports.identity = identity;
|
|
|
19053
18800
|
exports.ignore = ignore;
|
|
19054
18801
|
exports.infinity = infinity;
|
|
19055
18802
|
exports.inheritAll = inheritAll;
|
|
19056
|
-
exports.interrupt = interrupt$
|
|
19057
|
-
exports.interrupt$1 = interrupt$
|
|
19058
|
-
exports.interrupt$2 = interrupt
|
|
19059
|
-
exports.interrupt$3 = interrupt;
|
|
18803
|
+
exports.interrupt = interrupt$2;
|
|
18804
|
+
exports.interrupt$1 = interrupt$1;
|
|
18805
|
+
exports.interrupt$2 = interrupt;
|
|
19060
18806
|
exports.interruptAsFiber = interruptAsFiber;
|
|
19061
18807
|
exports.interruptFiber = interruptFiber;
|
|
19062
18808
|
exports.interruptible = interruptible;
|
|
19063
18809
|
exports.interruptors = interruptors;
|
|
19064
18810
|
exports.intoDeferred = intoDeferred;
|
|
19065
18811
|
exports.isDieType = isDieType;
|
|
19066
|
-
exports.isDone = isDone$4;
|
|
19067
18812
|
exports.isEffect = isEffect;
|
|
19068
|
-
exports.isEmpty = isEmpty$
|
|
19069
|
-
exports.isEmpty$1 = isEmpty$2;
|
|
19070
|
-
exports.isFailure = isFailure;
|
|
18813
|
+
exports.isEmpty = isEmpty$5;
|
|
19071
18814
|
exports.isInterrupted = isInterrupted;
|
|
19072
18815
|
exports.isInterruptedOnly = isInterruptedOnly;
|
|
19073
18816
|
exports.isRight = isRight;
|
|
19074
18817
|
exports.isSome = isSome;
|
|
19075
|
-
exports.isSuccess = isSuccess;
|
|
19076
18818
|
exports.join = join;
|
|
19077
18819
|
exports.left = left;
|
|
19078
|
-
exports.length = length;
|
|
19079
18820
|
exports.logError = logError;
|
|
19080
18821
|
exports.logWarning = logWarning;
|
|
19081
|
-
exports.make = make$
|
|
18822
|
+
exports.make = make$i;
|
|
19082
18823
|
exports.make$1 = make$a;
|
|
19083
|
-
exports.make$2 = make$
|
|
19084
|
-
exports.make$3 = make$1;
|
|
18824
|
+
exports.make$2 = make$1;
|
|
19085
18825
|
exports.makeSemaphore = makeSemaphore;
|
|
19086
|
-
exports.map = map$
|
|
19087
|
-
exports.map$1 = map$
|
|
18826
|
+
exports.map = map$2;
|
|
18827
|
+
exports.map$1 = map$3;
|
|
19088
18828
|
exports.map$2 = map;
|
|
19089
|
-
exports.map$3 = map$
|
|
19090
|
-
exports.map$4 = map$7;
|
|
18829
|
+
exports.map$3 = map$6;
|
|
19091
18830
|
exports.mapError = mapError;
|
|
19092
|
-
exports.match = match$
|
|
19093
|
-
exports.match$1 = match$
|
|
19094
|
-
exports.match$2 = match
|
|
19095
|
-
exports.match$3 = match;
|
|
18831
|
+
exports.match = match$5;
|
|
18832
|
+
exports.match$1 = match$6;
|
|
18833
|
+
exports.match$2 = match;
|
|
19096
18834
|
exports.matchCause = matchCause;
|
|
19097
18835
|
exports.matchCauseEffect = matchCauseEffect;
|
|
19098
18836
|
exports.merge = merge$3;
|
|
19099
18837
|
exports.modify = modify;
|
|
19100
18838
|
exports.none = none$4;
|
|
19101
18839
|
exports.of = of$1;
|
|
19102
|
-
exports.offer = offer;
|
|
19103
|
-
exports.offerAll = offerAll;
|
|
19104
18840
|
exports.onInterrupt = onInterrupt;
|
|
19105
18841
|
exports.orElseSucceed = orElseSucceed;
|
|
19106
18842
|
exports.pipe = pipe;
|
|
19107
18843
|
exports.pipeArguments = pipeArguments;
|
|
19108
|
-
exports.poll = poll;
|
|
19109
|
-
exports.pollUpTo = pollUpTo;
|
|
19110
18844
|
exports.prepend = prepend$1;
|
|
19111
18845
|
exports.promise = promise;
|
|
19112
18846
|
exports.provide = provide;
|
|
@@ -19115,11 +18849,13 @@ exports.race = race;
|
|
|
19115
18849
|
exports.raceFirst = raceFirst;
|
|
19116
18850
|
exports.raceWith = raceWith;
|
|
19117
18851
|
exports.reduce = reduce$6;
|
|
19118
|
-
exports.remove = remove
|
|
18852
|
+
exports.remove = remove;
|
|
19119
18853
|
exports.repeat = repeat;
|
|
18854
|
+
exports.reverse = reverse$1;
|
|
19120
18855
|
exports.right = right;
|
|
19121
18856
|
exports.runFork = runFork;
|
|
19122
18857
|
exports.runPromise = runPromise;
|
|
18858
|
+
exports.runSync = runSync;
|
|
19123
18859
|
exports.runtime = runtime;
|
|
19124
18860
|
exports.scope = scope;
|
|
19125
18861
|
exports.scopedWith = scopedWith;
|
|
@@ -19133,9 +18869,7 @@ exports.splitAt = splitAt$1;
|
|
|
19133
18869
|
exports.splitWhere = splitWhere;
|
|
19134
18870
|
exports.struct = struct;
|
|
19135
18871
|
exports.succeed = succeed;
|
|
19136
|
-
exports.succeed$1 = succeed$
|
|
19137
|
-
exports.succeed$2 = succeed$2;
|
|
19138
|
-
exports.succeed$3 = succeed$3;
|
|
18872
|
+
exports.succeed$1 = succeed$2;
|
|
19139
18873
|
exports.suspend = suspend$1;
|
|
19140
18874
|
exports.suspend$1 = suspend;
|
|
19141
18875
|
exports.symbol = symbol$1;
|
|
@@ -19145,28 +18879,24 @@ exports.sync$1 = sync;
|
|
|
19145
18879
|
exports.tap = tap;
|
|
19146
18880
|
exports.tapError = tapError;
|
|
19147
18881
|
exports.tapErrorCause = tapErrorCause;
|
|
18882
|
+
exports.toJSON = toJSON;
|
|
19148
18883
|
exports.toMillis = toMillis;
|
|
19149
18884
|
exports.tryPromise = tryPromise;
|
|
19150
18885
|
exports.try_ = try_;
|
|
19151
|
-
exports.unbounded = unbounded;
|
|
19152
18886
|
exports.uninterruptible = uninterruptible$1;
|
|
19153
18887
|
exports.uninterruptible$1 = uninterruptible;
|
|
19154
18888
|
exports.uninterruptibleMask = uninterruptibleMask;
|
|
19155
18889
|
exports.unsafeFromArray = unsafeFromArray;
|
|
19156
18890
|
exports.unsafeGet = unsafeGet;
|
|
19157
|
-
exports.unsafeMake = unsafeMake$4;
|
|
19158
18891
|
exports.update = update$1;
|
|
19159
|
-
exports.void_ = void_$
|
|
19160
|
-
exports.void_$1 = void_$1;
|
|
18892
|
+
exports.void_ = void_$1;
|
|
19161
18893
|
exports.when = when$1;
|
|
19162
18894
|
exports.when$1 = when;
|
|
19163
18895
|
exports.whenEffect = whenEffect;
|
|
19164
18896
|
exports.withFiberRuntime = withFiberRuntime$1;
|
|
19165
18897
|
exports.withFiberRuntime$1 = withFiberRuntime;
|
|
19166
18898
|
exports.zip = zip;
|
|
19167
|
-
exports.zip$1 = zip$1;
|
|
19168
18899
|
exports.zipLeft = zipLeft;
|
|
19169
|
-
exports.zipRight = zipRight$
|
|
19170
|
-
exports.zipRight$1 = zipRight
|
|
19171
|
-
exports.zipRight$2 = zipRight;
|
|
18900
|
+
exports.zipRight = zipRight$1;
|
|
18901
|
+
exports.zipRight$1 = zipRight;
|
|
19172
18902
|
exports.zipWith = zipWith;
|