effect 4.0.0-beta.41 → 4.0.0-beta.42
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/Effect.d.ts +19 -63
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +24 -65
- package/dist/Effect.js.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +3 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +12 -3
- package/dist/Number.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +16 -14
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/TxChunk.d.ts +39 -39
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +3 -3
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +9 -9
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +2 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +59 -59
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +8 -8
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +35 -35
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +7 -7
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +23 -23
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +4 -4
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +14 -14
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +12 -12
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +33 -33
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +29 -44
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +10 -33
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +14 -37
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +36 -42
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +16 -25
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +8 -8
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +10 -10
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +14 -14
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +5 -5
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/unstable/ai/OpenAiStructuredOutput.js +3 -0
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +12 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -4
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +1 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/package.json +1 -1
- package/src/Effect.ts +24 -75
- package/src/MutableList.ts +3 -0
- package/src/Number.ts +13 -3
- package/src/SchemaRepresentation.ts +8 -6
- package/src/TxChunk.ts +53 -62
- package/src/TxDeferred.ts +14 -17
- package/src/TxHashMap.ts +91 -101
- package/src/TxHashSet.ts +68 -70
- package/src/TxPriorityQueue.ts +34 -38
- package/src/TxPubSub.ts +30 -32
- package/src/TxQueue.ts +70 -84
- package/src/TxReentrantLock.ts +30 -54
- package/src/TxRef.ts +53 -65
- package/src/TxSemaphore.ts +23 -24
- package/src/TxSubscriptionRef.ts +25 -27
- package/src/index.ts +3 -3
- package/src/unstable/ai/OpenAiStructuredOutput.ts +3 -0
- package/src/unstable/cli/internal/command.ts +16 -1
- package/src/unstable/cluster/SqlMessageStorage.ts +0 -4
- package/src/unstable/socket/Socket.ts +1 -1
package/src/TxHashSet.ts
CHANGED
|
@@ -66,7 +66,7 @@ const TxHashSetProto = {
|
|
|
66
66
|
* console.log(hasApple) // true
|
|
67
67
|
*
|
|
68
68
|
* // Multi-step atomic operations
|
|
69
|
-
* yield* Effect.
|
|
69
|
+
* yield* Effect.tx(
|
|
70
70
|
* Effect.gen(function*() {
|
|
71
71
|
* const hasCherry = yield* TxHashSet.has(txSet, "cherry")
|
|
72
72
|
* if (hasCherry) {
|
|
@@ -165,7 +165,7 @@ const makeTxHashSet = <V>(ref: TxRef.TxRef<HashSet.HashSet<V>>): TxHashSet<V> =>
|
|
|
165
165
|
* @since 2.0.0
|
|
166
166
|
* @category constructors
|
|
167
167
|
*/
|
|
168
|
-
export const empty = <V = never>(): Effect.Effect<TxHashSet<V
|
|
168
|
+
export const empty = <V = never>(): Effect.Effect<TxHashSet<V>> =>
|
|
169
169
|
Effect.gen(function*() {
|
|
170
170
|
const ref = yield* TxRef.make(HashSet.empty<V>())
|
|
171
171
|
return makeTxHashSet(ref)
|
|
@@ -195,7 +195,7 @@ export const empty = <V = never>(): Effect.Effect<TxHashSet<V>, never, Effect.Tr
|
|
|
195
195
|
*/
|
|
196
196
|
export const make = <Values extends ReadonlyArray<any>>(
|
|
197
197
|
...values: Values
|
|
198
|
-
): Effect.Effect<TxHashSet<Values[number]
|
|
198
|
+
): Effect.Effect<TxHashSet<Values[number]>> =>
|
|
199
199
|
Effect.gen(function*() {
|
|
200
200
|
const hashSet = HashSet.make(...values)
|
|
201
201
|
const ref = yield* TxRef.make(hashSet)
|
|
@@ -225,7 +225,7 @@ export const make = <Values extends ReadonlyArray<any>>(
|
|
|
225
225
|
* @since 2.0.0
|
|
226
226
|
* @category constructors
|
|
227
227
|
*/
|
|
228
|
-
export const fromIterable = <V>(values: Iterable<V>): Effect.Effect<TxHashSet<V
|
|
228
|
+
export const fromIterable = <V>(values: Iterable<V>): Effect.Effect<TxHashSet<V>> =>
|
|
229
229
|
Effect.gen(function*() {
|
|
230
230
|
const hashSet = HashSet.fromIterable(values)
|
|
231
231
|
const ref = yield* TxRef.make(hashSet)
|
|
@@ -257,7 +257,7 @@ export const fromIterable = <V>(values: Iterable<V>): Effect.Effect<TxHashSet<V>
|
|
|
257
257
|
* @since 2.0.0
|
|
258
258
|
* @category constructors
|
|
259
259
|
*/
|
|
260
|
-
export const fromHashSet = <V>(hashSet: HashSet.HashSet<V>): Effect.Effect<TxHashSet<V
|
|
260
|
+
export const fromHashSet = <V>(hashSet: HashSet.HashSet<V>): Effect.Effect<TxHashSet<V>> =>
|
|
261
261
|
Effect.gen(function*() {
|
|
262
262
|
const ref = yield* TxRef.make(hashSet)
|
|
263
263
|
return makeTxHashSet(ref)
|
|
@@ -341,7 +341,7 @@ export const add: {
|
|
|
341
341
|
* @since 2.0.0
|
|
342
342
|
* @category mutations
|
|
343
343
|
*/
|
|
344
|
-
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<void
|
|
344
|
+
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<void>
|
|
345
345
|
/**
|
|
346
346
|
* Adds a value to the TxHashSet. If the value already exists, the operation has no effect.
|
|
347
347
|
*
|
|
@@ -368,7 +368,7 @@ export const add: {
|
|
|
368
368
|
* @since 2.0.0
|
|
369
369
|
* @category mutations
|
|
370
370
|
*/
|
|
371
|
-
<V>(self: TxHashSet<V>, value: V): Effect.Effect<void
|
|
371
|
+
<V>(self: TxHashSet<V>, value: V): Effect.Effect<void>
|
|
372
372
|
} = dual<
|
|
373
373
|
/**
|
|
374
374
|
* Adds a value to the TxHashSet. If the value already exists, the operation has no effect.
|
|
@@ -396,7 +396,7 @@ export const add: {
|
|
|
396
396
|
* @since 2.0.0
|
|
397
397
|
* @category mutations
|
|
398
398
|
*/
|
|
399
|
-
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<void
|
|
399
|
+
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<void>,
|
|
400
400
|
/**
|
|
401
401
|
* Adds a value to the TxHashSet. If the value already exists, the operation has no effect.
|
|
402
402
|
*
|
|
@@ -423,7 +423,7 @@ export const add: {
|
|
|
423
423
|
* @since 2.0.0
|
|
424
424
|
* @category mutations
|
|
425
425
|
*/
|
|
426
|
-
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<void
|
|
426
|
+
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<void>
|
|
427
427
|
>(2, <V>(self: TxHashSet<V>, value: V) => TxRef.update(self.ref, (set) => HashSet.add(set, value)))
|
|
428
428
|
|
|
429
429
|
/**
|
|
@@ -481,7 +481,7 @@ export const remove: {
|
|
|
481
481
|
* @since 2.0.0
|
|
482
482
|
* @category mutations
|
|
483
483
|
*/
|
|
484
|
-
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
484
|
+
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<boolean>
|
|
485
485
|
/**
|
|
486
486
|
* Removes a value from the TxHashSet.
|
|
487
487
|
*
|
|
@@ -509,7 +509,7 @@ export const remove: {
|
|
|
509
509
|
* @since 2.0.0
|
|
510
510
|
* @category mutations
|
|
511
511
|
*/
|
|
512
|
-
<V>(self: TxHashSet<V>, value: V): Effect.Effect<boolean
|
|
512
|
+
<V>(self: TxHashSet<V>, value: V): Effect.Effect<boolean>
|
|
513
513
|
} = dual<
|
|
514
514
|
/**
|
|
515
515
|
* Removes a value from the TxHashSet.
|
|
@@ -538,7 +538,7 @@ export const remove: {
|
|
|
538
538
|
* @since 2.0.0
|
|
539
539
|
* @category mutations
|
|
540
540
|
*/
|
|
541
|
-
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
541
|
+
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<boolean>,
|
|
542
542
|
/**
|
|
543
543
|
* Removes a value from the TxHashSet.
|
|
544
544
|
*
|
|
@@ -566,7 +566,7 @@ export const remove: {
|
|
|
566
566
|
* @since 2.0.0
|
|
567
567
|
* @category mutations
|
|
568
568
|
*/
|
|
569
|
-
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<boolean
|
|
569
|
+
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<boolean>
|
|
570
570
|
>(2, <V>(self: TxHashSet<V>, value: V) =>
|
|
571
571
|
Effect.gen(function*() {
|
|
572
572
|
const currentSet = yield* TxRef.get(self.ref)
|
|
@@ -575,7 +575,7 @@ export const remove: {
|
|
|
575
575
|
yield* TxRef.set(self.ref, HashSet.remove(currentSet, value))
|
|
576
576
|
}
|
|
577
577
|
return existed
|
|
578
|
-
}))
|
|
578
|
+
}).pipe(Effect.tx))
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
581
|
* Checks if the TxHashSet contains the specified value.
|
|
@@ -646,7 +646,7 @@ export const has: {
|
|
|
646
646
|
* @since 2.0.0
|
|
647
647
|
* @category elements
|
|
648
648
|
*/
|
|
649
|
-
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
649
|
+
<V>(value: V): (self: TxHashSet<V>) => Effect.Effect<boolean>
|
|
650
650
|
/**
|
|
651
651
|
* Checks if the TxHashSet contains the specified value.
|
|
652
652
|
*
|
|
@@ -681,7 +681,7 @@ export const has: {
|
|
|
681
681
|
* @since 2.0.0
|
|
682
682
|
* @category elements
|
|
683
683
|
*/
|
|
684
|
-
<V>(self: TxHashSet<V>, value: V): Effect.Effect<boolean
|
|
684
|
+
<V>(self: TxHashSet<V>, value: V): Effect.Effect<boolean>
|
|
685
685
|
} = dual<
|
|
686
686
|
/**
|
|
687
687
|
* Checks if the TxHashSet contains the specified value.
|
|
@@ -717,7 +717,7 @@ export const has: {
|
|
|
717
717
|
* @since 2.0.0
|
|
718
718
|
* @category elements
|
|
719
719
|
*/
|
|
720
|
-
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
720
|
+
<V>(value: V) => (self: TxHashSet<V>) => Effect.Effect<boolean>,
|
|
721
721
|
/**
|
|
722
722
|
* Checks if the TxHashSet contains the specified value.
|
|
723
723
|
*
|
|
@@ -752,7 +752,7 @@ export const has: {
|
|
|
752
752
|
* @since 2.0.0
|
|
753
753
|
* @category elements
|
|
754
754
|
*/
|
|
755
|
-
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<boolean
|
|
755
|
+
<V>(self: TxHashSet<V>, value: V) => Effect.Effect<boolean>
|
|
756
756
|
>(2, <V>(self: TxHashSet<V>, value: V) =>
|
|
757
757
|
Effect.gen(function*() {
|
|
758
758
|
const set = yield* TxRef.get(self.ref)
|
|
@@ -781,7 +781,7 @@ export const has: {
|
|
|
781
781
|
* @since 2.0.0
|
|
782
782
|
* @category getters
|
|
783
783
|
*/
|
|
784
|
-
export const size = <V>(self: TxHashSet<V>): Effect.Effect<number
|
|
784
|
+
export const size = <V>(self: TxHashSet<V>): Effect.Effect<number> =>
|
|
785
785
|
Effect.gen(function*() {
|
|
786
786
|
const set = yield* TxRef.get(self.ref)
|
|
787
787
|
return HashSet.size(set)
|
|
@@ -806,7 +806,7 @@ export const size = <V>(self: TxHashSet<V>): Effect.Effect<number, never, Effect
|
|
|
806
806
|
* @since 2.0.0
|
|
807
807
|
* @category getters
|
|
808
808
|
*/
|
|
809
|
-
export const isEmpty = <V>(self: TxHashSet<V>): Effect.Effect<boolean
|
|
809
|
+
export const isEmpty = <V>(self: TxHashSet<V>): Effect.Effect<boolean> =>
|
|
810
810
|
Effect.gen(function*() {
|
|
811
811
|
const set = yield* TxRef.get(self.ref)
|
|
812
812
|
return HashSet.isEmpty(set)
|
|
@@ -835,8 +835,7 @@ export const isEmpty = <V>(self: TxHashSet<V>): Effect.Effect<boolean, never, Ef
|
|
|
835
835
|
* @since 2.0.0
|
|
836
836
|
* @category mutations
|
|
837
837
|
*/
|
|
838
|
-
export const clear = <V>(self: TxHashSet<V>): Effect.Effect<void
|
|
839
|
-
TxRef.set(self.ref, HashSet.empty<V>())
|
|
838
|
+
export const clear = <V>(self: TxHashSet<V>): Effect.Effect<void> => TxRef.set(self.ref, HashSet.empty<V>())
|
|
840
839
|
|
|
841
840
|
/**
|
|
842
841
|
* Creates the union of two TxHashSets, returning a new TxHashSet.
|
|
@@ -881,7 +880,7 @@ export const union: {
|
|
|
881
880
|
* @since 2.0.0
|
|
882
881
|
* @category combinators
|
|
883
882
|
*/
|
|
884
|
-
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 | V0
|
|
883
|
+
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 | V0>>
|
|
885
884
|
/**
|
|
886
885
|
* Creates the union of two TxHashSets, returning a new TxHashSet.
|
|
887
886
|
*
|
|
@@ -903,7 +902,7 @@ export const union: {
|
|
|
903
902
|
* @since 2.0.0
|
|
904
903
|
* @category combinators
|
|
905
904
|
*/
|
|
906
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0 | V1
|
|
905
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0 | V1>>
|
|
907
906
|
} = dual<
|
|
908
907
|
/**
|
|
909
908
|
* Creates the union of two TxHashSets, returning a new TxHashSet.
|
|
@@ -926,7 +925,7 @@ export const union: {
|
|
|
926
925
|
* @since 2.0.0
|
|
927
926
|
* @category combinators
|
|
928
927
|
*/
|
|
929
|
-
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 | V0
|
|
928
|
+
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 | V0>>,
|
|
930
929
|
/**
|
|
931
930
|
* Creates the union of two TxHashSets, returning a new TxHashSet.
|
|
932
931
|
*
|
|
@@ -948,14 +947,14 @@ export const union: {
|
|
|
948
947
|
* @since 2.0.0
|
|
949
948
|
* @category combinators
|
|
950
949
|
*/
|
|
951
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0 | V1
|
|
950
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0 | V1>>
|
|
952
951
|
>(2, <V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) =>
|
|
953
952
|
Effect.gen(function*() {
|
|
954
953
|
const set1 = yield* TxRef.get(self.ref)
|
|
955
954
|
const set2 = yield* TxRef.get(that.ref)
|
|
956
955
|
const combined = HashSet.union(set1, set2)
|
|
957
956
|
return yield* fromHashSet(combined)
|
|
958
|
-
}))
|
|
957
|
+
}).pipe(Effect.tx))
|
|
959
958
|
|
|
960
959
|
/**
|
|
961
960
|
* Creates the intersection of two TxHashSets, returning a new TxHashSet.
|
|
@@ -1000,7 +999,7 @@ export const intersection: {
|
|
|
1000
999
|
* @since 2.0.0
|
|
1001
1000
|
* @category combinators
|
|
1002
1001
|
*/
|
|
1003
|
-
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 & V0
|
|
1002
|
+
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 & V0>>
|
|
1004
1003
|
/**
|
|
1005
1004
|
* Creates the intersection of two TxHashSets, returning a new TxHashSet.
|
|
1006
1005
|
*
|
|
@@ -1022,7 +1021,7 @@ export const intersection: {
|
|
|
1022
1021
|
* @since 2.0.0
|
|
1023
1022
|
* @category combinators
|
|
1024
1023
|
*/
|
|
1025
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0 & V1
|
|
1024
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0 & V1>>
|
|
1026
1025
|
} = dual<
|
|
1027
1026
|
/**
|
|
1028
1027
|
* Creates the intersection of two TxHashSets, returning a new TxHashSet.
|
|
@@ -1045,7 +1044,7 @@ export const intersection: {
|
|
|
1045
1044
|
* @since 2.0.0
|
|
1046
1045
|
* @category combinators
|
|
1047
1046
|
*/
|
|
1048
|
-
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 & V0
|
|
1047
|
+
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V1 & V0>>,
|
|
1049
1048
|
/**
|
|
1050
1049
|
* Creates the intersection of two TxHashSets, returning a new TxHashSet.
|
|
1051
1050
|
*
|
|
@@ -1067,14 +1066,14 @@ export const intersection: {
|
|
|
1067
1066
|
* @since 2.0.0
|
|
1068
1067
|
* @category combinators
|
|
1069
1068
|
*/
|
|
1070
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0 & V1
|
|
1069
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0 & V1>>
|
|
1071
1070
|
>(2, <V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) =>
|
|
1072
1071
|
Effect.gen(function*() {
|
|
1073
1072
|
const set1 = yield* TxRef.get(self.ref)
|
|
1074
1073
|
const set2 = yield* TxRef.get(that.ref)
|
|
1075
1074
|
const common = HashSet.intersection(set1, set2)
|
|
1076
1075
|
return yield* fromHashSet(common)
|
|
1077
|
-
}))
|
|
1076
|
+
}).pipe(Effect.tx))
|
|
1078
1077
|
|
|
1079
1078
|
/**
|
|
1080
1079
|
* Creates the difference of two TxHashSets (elements in the first set that are not in the second), returning a new TxHashSet.
|
|
@@ -1119,7 +1118,7 @@ export const difference: {
|
|
|
1119
1118
|
* @since 2.0.0
|
|
1120
1119
|
* @category combinators
|
|
1121
1120
|
*/
|
|
1122
|
-
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V0
|
|
1121
|
+
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V0>>
|
|
1123
1122
|
/**
|
|
1124
1123
|
* Creates the difference of two TxHashSets (elements in the first set that are not in the second), returning a new TxHashSet.
|
|
1125
1124
|
*
|
|
@@ -1141,7 +1140,7 @@ export const difference: {
|
|
|
1141
1140
|
* @since 2.0.0
|
|
1142
1141
|
* @category combinators
|
|
1143
1142
|
*/
|
|
1144
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0
|
|
1143
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<TxHashSet<V0>>
|
|
1145
1144
|
} = dual<
|
|
1146
1145
|
/**
|
|
1147
1146
|
* Creates the difference of two TxHashSets (elements in the first set that are not in the second), returning a new TxHashSet.
|
|
@@ -1164,7 +1163,7 @@ export const difference: {
|
|
|
1164
1163
|
* @since 2.0.0
|
|
1165
1164
|
* @category combinators
|
|
1166
1165
|
*/
|
|
1167
|
-
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V0
|
|
1166
|
+
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<TxHashSet<V0>>,
|
|
1168
1167
|
/**
|
|
1169
1168
|
* Creates the difference of two TxHashSets (elements in the first set that are not in the second), returning a new TxHashSet.
|
|
1170
1169
|
*
|
|
@@ -1186,14 +1185,14 @@ export const difference: {
|
|
|
1186
1185
|
* @since 2.0.0
|
|
1187
1186
|
* @category combinators
|
|
1188
1187
|
*/
|
|
1189
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0
|
|
1188
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<TxHashSet<V0>>
|
|
1190
1189
|
>(2, <V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) =>
|
|
1191
1190
|
Effect.gen(function*() {
|
|
1192
1191
|
const set1 = yield* TxRef.get(self.ref)
|
|
1193
1192
|
const set2 = yield* TxRef.get(that.ref)
|
|
1194
1193
|
const diff = HashSet.difference(set1, set2)
|
|
1195
1194
|
return yield* fromHashSet(diff)
|
|
1196
|
-
}))
|
|
1195
|
+
}).pipe(Effect.tx))
|
|
1197
1196
|
|
|
1198
1197
|
/**
|
|
1199
1198
|
* Checks if a TxHashSet is a subset of another TxHashSet.
|
|
@@ -1240,7 +1239,7 @@ export const isSubset: {
|
|
|
1240
1239
|
* @since 2.0.0
|
|
1241
1240
|
* @category elements
|
|
1242
1241
|
*/
|
|
1243
|
-
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<boolean
|
|
1242
|
+
<V1>(that: TxHashSet<V1>): <V0>(self: TxHashSet<V0>) => Effect.Effect<boolean>
|
|
1244
1243
|
/**
|
|
1245
1244
|
* Checks if a TxHashSet is a subset of another TxHashSet.
|
|
1246
1245
|
*
|
|
@@ -1263,7 +1262,7 @@ export const isSubset: {
|
|
|
1263
1262
|
* @since 2.0.0
|
|
1264
1263
|
* @category elements
|
|
1265
1264
|
*/
|
|
1266
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<boolean
|
|
1265
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>): Effect.Effect<boolean>
|
|
1267
1266
|
} = dual<
|
|
1268
1267
|
/**
|
|
1269
1268
|
* Checks if a TxHashSet is a subset of another TxHashSet.
|
|
@@ -1287,7 +1286,7 @@ export const isSubset: {
|
|
|
1287
1286
|
* @since 2.0.0
|
|
1288
1287
|
* @category elements
|
|
1289
1288
|
*/
|
|
1290
|
-
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<boolean
|
|
1289
|
+
<V1>(that: TxHashSet<V1>) => <V0>(self: TxHashSet<V0>) => Effect.Effect<boolean>,
|
|
1291
1290
|
/**
|
|
1292
1291
|
* Checks if a TxHashSet is a subset of another TxHashSet.
|
|
1293
1292
|
*
|
|
@@ -1310,13 +1309,13 @@ export const isSubset: {
|
|
|
1310
1309
|
* @since 2.0.0
|
|
1311
1310
|
* @category elements
|
|
1312
1311
|
*/
|
|
1313
|
-
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<boolean
|
|
1312
|
+
<V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) => Effect.Effect<boolean>
|
|
1314
1313
|
>(2, <V0, V1>(self: TxHashSet<V0>, that: TxHashSet<V1>) =>
|
|
1315
1314
|
Effect.gen(function*() {
|
|
1316
1315
|
const set1 = yield* TxRef.get(self.ref)
|
|
1317
1316
|
const set2 = yield* TxRef.get(that.ref)
|
|
1318
1317
|
return HashSet.isSubset(set1, set2)
|
|
1319
|
-
}))
|
|
1318
|
+
}).pipe(Effect.tx))
|
|
1320
1319
|
|
|
1321
1320
|
/**
|
|
1322
1321
|
* Tests whether at least one value in the TxHashSet satisfies the predicate.
|
|
@@ -1361,7 +1360,7 @@ export const some: {
|
|
|
1361
1360
|
* @since 2.0.0
|
|
1362
1361
|
* @category elements
|
|
1363
1362
|
*/
|
|
1364
|
-
<V>(predicate: Predicate<V>): (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
1363
|
+
<V>(predicate: Predicate<V>): (self: TxHashSet<V>) => Effect.Effect<boolean>
|
|
1365
1364
|
/**
|
|
1366
1365
|
* Tests whether at least one value in the TxHashSet satisfies the predicate.
|
|
1367
1366
|
*
|
|
@@ -1383,7 +1382,7 @@ export const some: {
|
|
|
1383
1382
|
* @since 2.0.0
|
|
1384
1383
|
* @category elements
|
|
1385
1384
|
*/
|
|
1386
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<boolean
|
|
1385
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<boolean>
|
|
1387
1386
|
} = dual<
|
|
1388
1387
|
/**
|
|
1389
1388
|
* Tests whether at least one value in the TxHashSet satisfies the predicate.
|
|
@@ -1406,7 +1405,7 @@ export const some: {
|
|
|
1406
1405
|
* @since 2.0.0
|
|
1407
1406
|
* @category elements
|
|
1408
1407
|
*/
|
|
1409
|
-
<V>(predicate: Predicate<V>) => (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
1408
|
+
<V>(predicate: Predicate<V>) => (self: TxHashSet<V>) => Effect.Effect<boolean>,
|
|
1410
1409
|
/**
|
|
1411
1410
|
* Tests whether at least one value in the TxHashSet satisfies the predicate.
|
|
1412
1411
|
*
|
|
@@ -1428,7 +1427,7 @@ export const some: {
|
|
|
1428
1427
|
* @since 2.0.0
|
|
1429
1428
|
* @category elements
|
|
1430
1429
|
*/
|
|
1431
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>) => Effect.Effect<boolean
|
|
1430
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>) => Effect.Effect<boolean>
|
|
1432
1431
|
>(2, <V>(self: TxHashSet<V>, predicate: Predicate<V>) =>
|
|
1433
1432
|
Effect.gen(function*() {
|
|
1434
1433
|
const set = yield* TxRef.get(self.ref)
|
|
@@ -1478,7 +1477,7 @@ export const every: {
|
|
|
1478
1477
|
* @since 2.0.0
|
|
1479
1478
|
* @category elements
|
|
1480
1479
|
*/
|
|
1481
|
-
<V>(predicate: Predicate<V>): (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
1480
|
+
<V>(predicate: Predicate<V>): (self: TxHashSet<V>) => Effect.Effect<boolean>
|
|
1482
1481
|
/**
|
|
1483
1482
|
* Tests whether all values in the TxHashSet satisfy the predicate.
|
|
1484
1483
|
*
|
|
@@ -1500,7 +1499,7 @@ export const every: {
|
|
|
1500
1499
|
* @since 2.0.0
|
|
1501
1500
|
* @category elements
|
|
1502
1501
|
*/
|
|
1503
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<boolean
|
|
1502
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<boolean>
|
|
1504
1503
|
} = dual<
|
|
1505
1504
|
/**
|
|
1506
1505
|
* Tests whether all values in the TxHashSet satisfy the predicate.
|
|
@@ -1523,7 +1522,7 @@ export const every: {
|
|
|
1523
1522
|
* @since 2.0.0
|
|
1524
1523
|
* @category elements
|
|
1525
1524
|
*/
|
|
1526
|
-
<V>(predicate: Predicate<V>) => (self: TxHashSet<V>) => Effect.Effect<boolean
|
|
1525
|
+
<V>(predicate: Predicate<V>) => (self: TxHashSet<V>) => Effect.Effect<boolean>,
|
|
1527
1526
|
/**
|
|
1528
1527
|
* Tests whether all values in the TxHashSet satisfy the predicate.
|
|
1529
1528
|
*
|
|
@@ -1545,7 +1544,7 @@ export const every: {
|
|
|
1545
1544
|
* @since 2.0.0
|
|
1546
1545
|
* @category elements
|
|
1547
1546
|
*/
|
|
1548
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>) => Effect.Effect<boolean
|
|
1547
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>) => Effect.Effect<boolean>
|
|
1549
1548
|
>(2, <V>(self: TxHashSet<V>, predicate: Predicate<V>) =>
|
|
1550
1549
|
Effect.gen(function*() {
|
|
1551
1550
|
const set = yield* TxRef.get(self.ref)
|
|
@@ -1605,7 +1604,7 @@ export const map: {
|
|
|
1605
1604
|
* @since 2.0.0
|
|
1606
1605
|
* @category mapping
|
|
1607
1606
|
*/
|
|
1608
|
-
<V, U>(f: (value: V) => U): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U
|
|
1607
|
+
<V, U>(f: (value: V) => U): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U>>
|
|
1609
1608
|
/**
|
|
1610
1609
|
* Maps each value in the TxHashSet using the provided function, returning a new TxHashSet.
|
|
1611
1610
|
*
|
|
@@ -1632,7 +1631,7 @@ export const map: {
|
|
|
1632
1631
|
* @since 2.0.0
|
|
1633
1632
|
* @category mapping
|
|
1634
1633
|
*/
|
|
1635
|
-
<V, U>(self: TxHashSet<V>, f: (value: V) => U): Effect.Effect<TxHashSet<U
|
|
1634
|
+
<V, U>(self: TxHashSet<V>, f: (value: V) => U): Effect.Effect<TxHashSet<U>>
|
|
1636
1635
|
} = dual<
|
|
1637
1636
|
/**
|
|
1638
1637
|
* Maps each value in the TxHashSet using the provided function, returning a new TxHashSet.
|
|
@@ -1660,7 +1659,7 @@ export const map: {
|
|
|
1660
1659
|
* @since 2.0.0
|
|
1661
1660
|
* @category mapping
|
|
1662
1661
|
*/
|
|
1663
|
-
<V, U>(f: (value: V) => U) => (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U
|
|
1662
|
+
<V, U>(f: (value: V) => U) => (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U>>,
|
|
1664
1663
|
/**
|
|
1665
1664
|
* Maps each value in the TxHashSet using the provided function, returning a new TxHashSet.
|
|
1666
1665
|
*
|
|
@@ -1687,13 +1686,13 @@ export const map: {
|
|
|
1687
1686
|
* @since 2.0.0
|
|
1688
1687
|
* @category mapping
|
|
1689
1688
|
*/
|
|
1690
|
-
<V, U>(self: TxHashSet<V>, f: (value: V) => U) => Effect.Effect<TxHashSet<U
|
|
1689
|
+
<V, U>(self: TxHashSet<V>, f: (value: V) => U) => Effect.Effect<TxHashSet<U>>
|
|
1691
1690
|
>(2, <V, U>(self: TxHashSet<V>, f: (value: V) => U) =>
|
|
1692
1691
|
Effect.gen(function*() {
|
|
1693
1692
|
const currentSet = yield* TxRef.get(self.ref)
|
|
1694
1693
|
const mappedSet = HashSet.map(currentSet, f)
|
|
1695
1694
|
return yield* fromHashSet(mappedSet)
|
|
1696
|
-
}))
|
|
1695
|
+
}).pipe(Effect.tx))
|
|
1697
1696
|
|
|
1698
1697
|
/**
|
|
1699
1698
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
@@ -1736,7 +1735,7 @@ export const filter: {
|
|
|
1736
1735
|
* @since 2.0.0
|
|
1737
1736
|
* @category filtering
|
|
1738
1737
|
*/
|
|
1739
|
-
<V, U extends V>(refinement: Refinement<NoInfer<V>, U>): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U
|
|
1738
|
+
<V, U extends V>(refinement: Refinement<NoInfer<V>, U>): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U>>
|
|
1740
1739
|
/**
|
|
1741
1740
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
1742
1741
|
*
|
|
@@ -1757,7 +1756,7 @@ export const filter: {
|
|
|
1757
1756
|
* @since 2.0.0
|
|
1758
1757
|
* @category filtering
|
|
1759
1758
|
*/
|
|
1760
|
-
<V>(predicate: Predicate<NoInfer<V>>): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<V
|
|
1759
|
+
<V>(predicate: Predicate<NoInfer<V>>): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<V>>
|
|
1761
1760
|
/**
|
|
1762
1761
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
1763
1762
|
*
|
|
@@ -1778,7 +1777,7 @@ export const filter: {
|
|
|
1778
1777
|
* @since 2.0.0
|
|
1779
1778
|
* @category filtering
|
|
1780
1779
|
*/
|
|
1781
|
-
<V, U extends V>(self: TxHashSet<V>, refinement: Refinement<V, U>): Effect.Effect<TxHashSet<U
|
|
1780
|
+
<V, U extends V>(self: TxHashSet<V>, refinement: Refinement<V, U>): Effect.Effect<TxHashSet<U>>
|
|
1782
1781
|
/**
|
|
1783
1782
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
1784
1783
|
*
|
|
@@ -1799,7 +1798,7 @@ export const filter: {
|
|
|
1799
1798
|
* @since 2.0.0
|
|
1800
1799
|
* @category filtering
|
|
1801
1800
|
*/
|
|
1802
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<TxHashSet<V
|
|
1801
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<TxHashSet<V>>
|
|
1803
1802
|
} = dual<
|
|
1804
1803
|
/**
|
|
1805
1804
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
@@ -1824,10 +1823,10 @@ export const filter: {
|
|
|
1824
1823
|
{
|
|
1825
1824
|
<V, U extends V>(
|
|
1826
1825
|
refinement: Refinement<NoInfer<V>, U>
|
|
1827
|
-
): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U
|
|
1826
|
+
): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<U>>;
|
|
1828
1827
|
<V>(
|
|
1829
1828
|
predicate: Predicate<NoInfer<V>>
|
|
1830
|
-
): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<V
|
|
1829
|
+
): (self: TxHashSet<V>) => Effect.Effect<TxHashSet<V>>;
|
|
1831
1830
|
},
|
|
1832
1831
|
/**
|
|
1833
1832
|
* Filters the TxHashSet keeping only values that satisfy the predicate, returning a new TxHashSet.
|
|
@@ -1853,15 +1852,15 @@ export const filter: {
|
|
|
1853
1852
|
<V, U extends V>(
|
|
1854
1853
|
self: TxHashSet<V>,
|
|
1855
1854
|
refinement: Refinement<V, U>
|
|
1856
|
-
): Effect.Effect<TxHashSet<U
|
|
1857
|
-
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<TxHashSet<V
|
|
1855
|
+
): Effect.Effect<TxHashSet<U>>;
|
|
1856
|
+
<V>(self: TxHashSet<V>, predicate: Predicate<V>): Effect.Effect<TxHashSet<V>>;
|
|
1858
1857
|
}
|
|
1859
1858
|
>(2, <V>(self: TxHashSet<V>, predicate: Predicate<V>) =>
|
|
1860
1859
|
Effect.gen(function*() {
|
|
1861
1860
|
const currentSet = yield* TxRef.get(self.ref)
|
|
1862
1861
|
const filteredSet = HashSet.filter(currentSet, predicate)
|
|
1863
1862
|
return yield* fromHashSet(filteredSet)
|
|
1864
|
-
}))
|
|
1863
|
+
}).pipe(Effect.tx))
|
|
1865
1864
|
|
|
1866
1865
|
/**
|
|
1867
1866
|
* Reduces the TxHashSet to a single value by iterating through the values and applying an accumulator function.
|
|
@@ -1908,7 +1907,7 @@ export const reduce: {
|
|
|
1908
1907
|
* @since 2.0.0
|
|
1909
1908
|
* @category folding
|
|
1910
1909
|
*/
|
|
1911
|
-
<V, U>(zero: U, f: (accumulator: U, value: V) => U): (self: TxHashSet<V>) => Effect.Effect<U
|
|
1910
|
+
<V, U>(zero: U, f: (accumulator: U, value: V) => U): (self: TxHashSet<V>) => Effect.Effect<U>
|
|
1912
1911
|
/**
|
|
1913
1912
|
* Reduces the TxHashSet to a single value by iterating through the values and applying an accumulator function.
|
|
1914
1913
|
*
|
|
@@ -1931,7 +1930,7 @@ export const reduce: {
|
|
|
1931
1930
|
* @since 2.0.0
|
|
1932
1931
|
* @category folding
|
|
1933
1932
|
*/
|
|
1934
|
-
<V, U>(self: TxHashSet<V>, zero: U, f: (accumulator: U, value: V) => U): Effect.Effect<U
|
|
1933
|
+
<V, U>(self: TxHashSet<V>, zero: U, f: (accumulator: U, value: V) => U): Effect.Effect<U>
|
|
1935
1934
|
} = dual<
|
|
1936
1935
|
/**
|
|
1937
1936
|
* Reduces the TxHashSet to a single value by iterating through the values and applying an accumulator function.
|
|
@@ -1955,7 +1954,7 @@ export const reduce: {
|
|
|
1955
1954
|
* @since 2.0.0
|
|
1956
1955
|
* @category folding
|
|
1957
1956
|
*/
|
|
1958
|
-
<V, U>(zero: U, f: (accumulator: U, value: V) => U) => (self: TxHashSet<V>) => Effect.Effect<U
|
|
1957
|
+
<V, U>(zero: U, f: (accumulator: U, value: V) => U) => (self: TxHashSet<V>) => Effect.Effect<U>,
|
|
1959
1958
|
/**
|
|
1960
1959
|
* Reduces the TxHashSet to a single value by iterating through the values and applying an accumulator function.
|
|
1961
1960
|
*
|
|
@@ -1978,7 +1977,7 @@ export const reduce: {
|
|
|
1978
1977
|
* @since 2.0.0
|
|
1979
1978
|
* @category folding
|
|
1980
1979
|
*/
|
|
1981
|
-
<V, U>(self: TxHashSet<V>, zero: U, f: (accumulator: U, value: V) => U) => Effect.Effect<U
|
|
1980
|
+
<V, U>(self: TxHashSet<V>, zero: U, f: (accumulator: U, value: V) => U) => Effect.Effect<U>
|
|
1982
1981
|
>(3, <V, U>(self: TxHashSet<V>, zero: U, f: (accumulator: U, value: V) => U) =>
|
|
1983
1982
|
Effect.gen(function*() {
|
|
1984
1983
|
const set = yield* TxRef.get(self.ref)
|
|
@@ -2010,5 +2009,4 @@ export const reduce: {
|
|
|
2010
2009
|
* @since 2.0.0
|
|
2011
2010
|
* @category conversions
|
|
2012
2011
|
*/
|
|
2013
|
-
export const toHashSet = <V>(self: TxHashSet<V>): Effect.Effect<HashSet.HashSet<V
|
|
2014
|
-
TxRef.get(self.ref)
|
|
2012
|
+
export const toHashSet = <V>(self: TxHashSet<V>): Effect.Effect<HashSet.HashSet<V>> => TxRef.get(self.ref)
|