effect 4.0.0-beta.17 → 4.0.0-beta.19

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.
Files changed (164) hide show
  1. package/dist/Array.d.ts +127 -299
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +102 -62
  4. package/dist/Array.js.map +1 -1
  5. package/dist/Cache.d.ts.map +1 -1
  6. package/dist/Cache.js +5 -4
  7. package/dist/Cache.js.map +1 -1
  8. package/dist/Channel.d.ts +97 -11
  9. package/dist/Channel.d.ts.map +1 -1
  10. package/dist/Channel.js +72 -29
  11. package/dist/Channel.js.map +1 -1
  12. package/dist/Chunk.d.ts +54 -247
  13. package/dist/Chunk.d.ts.map +1 -1
  14. package/dist/Chunk.js +36 -67
  15. package/dist/Chunk.js.map +1 -1
  16. package/dist/Effect.d.ts +337 -437
  17. package/dist/Effect.d.ts.map +1 -1
  18. package/dist/Effect.js +118 -134
  19. package/dist/Effect.js.map +1 -1
  20. package/dist/Filter.d.ts +0 -33
  21. package/dist/Filter.d.ts.map +1 -1
  22. package/dist/Filter.js +0 -13
  23. package/dist/Filter.js.map +1 -1
  24. package/dist/HashMap.d.ts +15 -14
  25. package/dist/HashMap.d.ts.map +1 -1
  26. package/dist/HashMap.js +4 -4
  27. package/dist/HashMap.js.map +1 -1
  28. package/dist/Iterable.d.ts +40 -39
  29. package/dist/Iterable.d.ts.map +1 -1
  30. package/dist/Iterable.js +94 -22
  31. package/dist/Iterable.js.map +1 -1
  32. package/dist/Option.d.ts +22 -15
  33. package/dist/Option.d.ts.map +1 -1
  34. package/dist/Option.js +14 -7
  35. package/dist/Option.js.map +1 -1
  36. package/dist/Pull.d.ts.map +1 -1
  37. package/dist/Pull.js +1 -1
  38. package/dist/Pull.js.map +1 -1
  39. package/dist/Record.d.ts +24 -120
  40. package/dist/Record.d.ts.map +1 -1
  41. package/dist/Record.js +21 -41
  42. package/dist/Record.js.map +1 -1
  43. package/dist/Sink.d.ts +11 -11
  44. package/dist/Sink.d.ts.map +1 -1
  45. package/dist/Sink.js +53 -6
  46. package/dist/Sink.js.map +1 -1
  47. package/dist/Stream.d.ts +198 -386
  48. package/dist/Stream.d.ts.map +1 -1
  49. package/dist/Stream.js +103 -59
  50. package/dist/Stream.js.map +1 -1
  51. package/dist/Trie.d.ts +18 -17
  52. package/dist/Trie.d.ts.map +1 -1
  53. package/dist/Trie.js +5 -5
  54. package/dist/Trie.js.map +1 -1
  55. package/dist/TxChunk.d.ts +37 -37
  56. package/dist/TxChunk.d.ts.map +1 -1
  57. package/dist/TxChunk.js +3 -3
  58. package/dist/TxChunk.js.map +1 -1
  59. package/dist/TxDeferred.d.ts +328 -0
  60. package/dist/TxDeferred.d.ts.map +1 -0
  61. package/dist/TxDeferred.js +196 -0
  62. package/dist/TxDeferred.js.map +1 -0
  63. package/dist/TxHashMap.d.ts +84 -83
  64. package/dist/TxHashMap.d.ts.map +1 -1
  65. package/dist/TxHashMap.js +24 -24
  66. package/dist/TxHashMap.js.map +1 -1
  67. package/dist/TxHashSet.d.ts +35 -35
  68. package/dist/TxHashSet.d.ts.map +1 -1
  69. package/dist/TxHashSet.js +14 -14
  70. package/dist/TxHashSet.js.map +1 -1
  71. package/dist/TxPriorityQueue.d.ts +609 -0
  72. package/dist/TxPriorityQueue.d.ts.map +1 -0
  73. package/dist/TxPriorityQueue.js +415 -0
  74. package/dist/TxPriorityQueue.js.map +1 -0
  75. package/dist/TxPubSub.d.ts +585 -0
  76. package/dist/TxPubSub.d.ts.map +1 -0
  77. package/dist/TxPubSub.js +521 -0
  78. package/dist/TxPubSub.js.map +1 -0
  79. package/dist/TxQueue.d.ts +32 -32
  80. package/dist/TxQueue.d.ts.map +1 -1
  81. package/dist/TxQueue.js +26 -26
  82. package/dist/TxQueue.js.map +1 -1
  83. package/dist/TxReentrantLock.d.ts +523 -0
  84. package/dist/TxReentrantLock.d.ts.map +1 -0
  85. package/dist/TxReentrantLock.js +504 -0
  86. package/dist/TxReentrantLock.js.map +1 -0
  87. package/dist/TxRef.d.ts +34 -34
  88. package/dist/TxRef.d.ts.map +1 -1
  89. package/dist/TxRef.js +21 -14
  90. package/dist/TxRef.js.map +1 -1
  91. package/dist/TxSemaphore.d.ts +8 -8
  92. package/dist/TxSemaphore.d.ts.map +1 -1
  93. package/dist/TxSemaphore.js +7 -7
  94. package/dist/TxSemaphore.js.map +1 -1
  95. package/dist/TxSubscriptionRef.d.ts +508 -0
  96. package/dist/TxSubscriptionRef.d.ts.map +1 -0
  97. package/dist/TxSubscriptionRef.js +293 -0
  98. package/dist/TxSubscriptionRef.js.map +1 -0
  99. package/dist/index.d.ts +40 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +40 -0
  102. package/dist/index.js.map +1 -1
  103. package/dist/internal/effect.js +99 -42
  104. package/dist/internal/effect.js.map +1 -1
  105. package/dist/internal/hashMap.js +3 -2
  106. package/dist/internal/hashMap.js.map +1 -1
  107. package/dist/internal/trie.js +5 -4
  108. package/dist/internal/trie.js.map +1 -1
  109. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  110. package/dist/unstable/ai/Tool.js +0 -9
  111. package/dist/unstable/ai/Tool.js.map +1 -1
  112. package/dist/unstable/cli/Command.d.ts +1 -1
  113. package/dist/unstable/cli/Command.d.ts.map +1 -1
  114. package/dist/unstable/cli/Command.js +1 -1
  115. package/dist/unstable/cli/Command.js.map +1 -1
  116. package/dist/unstable/cluster/K8sHttpClient.js +4 -4
  117. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  118. package/dist/unstable/cluster/Sharding.js +1 -1
  119. package/dist/unstable/cluster/Sharding.js.map +1 -1
  120. package/dist/unstable/encoding/Sse.js +1 -1
  121. package/dist/unstable/encoding/Sse.js.map +1 -1
  122. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  123. package/dist/unstable/rpc/RpcServer.js +1 -2
  124. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  125. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  126. package/dist/unstable/socket/Socket.js +3 -3
  127. package/dist/unstable/socket/Socket.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/Array.ts +190 -342
  130. package/src/Cache.ts +6 -5
  131. package/src/Channel.ts +506 -102
  132. package/src/Chunk.ts +81 -268
  133. package/src/Effect.ts +437 -518
  134. package/src/Filter.ts +0 -57
  135. package/src/HashMap.ts +15 -14
  136. package/src/Iterable.ts +105 -50
  137. package/src/Option.ts +30 -20
  138. package/src/Pull.ts +1 -1
  139. package/src/Record.ts +43 -152
  140. package/src/Sink.ts +75 -23
  141. package/src/Stream.ts +442 -502
  142. package/src/Trie.ts +18 -17
  143. package/src/TxChunk.ts +72 -53
  144. package/src/TxDeferred.ts +394 -0
  145. package/src/TxHashMap.ts +332 -285
  146. package/src/TxHashSet.ts +111 -116
  147. package/src/TxPriorityQueue.ts +767 -0
  148. package/src/TxPubSub.ts +789 -0
  149. package/src/TxQueue.ts +241 -251
  150. package/src/TxReentrantLock.ts +753 -0
  151. package/src/TxRef.ts +50 -38
  152. package/src/TxSemaphore.ts +29 -32
  153. package/src/TxSubscriptionRef.ts +639 -0
  154. package/src/index.ts +45 -0
  155. package/src/internal/effect.ts +368 -163
  156. package/src/internal/hashMap.ts +7 -5
  157. package/src/internal/trie.ts +16 -9
  158. package/src/unstable/ai/Tool.ts +0 -9
  159. package/src/unstable/cli/Command.ts +6 -4
  160. package/src/unstable/cluster/K8sHttpClient.ts +4 -4
  161. package/src/unstable/cluster/Sharding.ts +1 -1
  162. package/src/unstable/encoding/Sse.ts +1 -1
  163. package/src/unstable/rpc/RpcServer.ts +1 -7
  164. package/src/unstable/socket/Socket.ts +9 -11
package/src/Trie.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  * @since 2.0.0
17
17
  */
18
18
  import type { Equal } from "./Equal.ts"
19
+ import type * as Filter from "./Filter.ts"
19
20
  import type { Inspectable } from "./Inspectable.ts"
20
21
  import * as TR from "./internal/trie.ts"
21
22
  import type { Option } from "./Option.ts"
@@ -1488,13 +1489,13 @@ export const filter: {
1488
1489
  } = TR.filter
1489
1490
 
1490
1491
  /**
1491
- * Maps over the entries of the `Trie` using the specified partial function
1492
- * and filters out `None` values.
1492
+ * Maps over the entries of the `Trie` using the specified filter and keeps
1493
+ * only successful results.
1493
1494
  *
1494
1495
  * @example
1495
1496
  * ```ts
1496
1497
  * import * as Equal from "effect/Equal"
1497
- * import * as Option from "effect/Option"
1498
+ * import * as Result from "effect/Result"
1498
1499
  * import * as Trie from "effect/Trie"
1499
1500
  * import * as assert from "node:assert"
1500
1501
  *
@@ -1515,7 +1516,7 @@ export const filter: {
1515
1516
  *
1516
1517
  * assert.equal(
1517
1518
  * Equal.equals(
1518
- * Trie.filterMap(trie, (v) => v > 1 ? Option.some(v) : Option.none()),
1519
+ * Trie.filterMap(trie, (v) => v > 1 ? Result.succeed(v) : Result.failVoid),
1519
1520
  * trieMapV
1520
1521
  * ),
1521
1522
  * true
@@ -1524,7 +1525,7 @@ export const filter: {
1524
1525
  * Equal.equals(
1525
1526
  * Trie.filterMap(
1526
1527
  * trie,
1527
- * (v, k) => k.length > 3 ? Option.some(v) : Option.none()
1528
+ * (v, k) => k.length > 3 ? Result.succeed(v) : Result.failVoid
1528
1529
  * ),
1529
1530
  * trieMapK
1530
1531
  * ),
@@ -1537,13 +1538,13 @@ export const filter: {
1537
1538
  */
1538
1539
  export const filterMap: {
1539
1540
  /**
1540
- * Maps over the entries of the `Trie` using the specified partial function
1541
- * and filters out `None` values.
1541
+ * Maps over the entries of the `Trie` using the specified filter and keeps
1542
+ * only successful results.
1542
1543
  *
1543
1544
  * @example
1544
1545
  * ```ts
1545
1546
  * import * as Equal from "effect/Equal"
1546
- * import * as Option from "effect/Option"
1547
+ * import * as Result from "effect/Result"
1547
1548
  * import * as Trie from "effect/Trie"
1548
1549
  * import * as assert from "node:assert"
1549
1550
  *
@@ -1564,7 +1565,7 @@ export const filterMap: {
1564
1565
  *
1565
1566
  * assert.equal(
1566
1567
  * Equal.equals(
1567
- * Trie.filterMap(trie, (v) => v > 1 ? Option.some(v) : Option.none()),
1568
+ * Trie.filterMap(trie, (v) => v > 1 ? Result.succeed(v) : Result.failVoid),
1568
1569
  * trieMapV
1569
1570
  * ),
1570
1571
  * true
@@ -1573,7 +1574,7 @@ export const filterMap: {
1573
1574
  * Equal.equals(
1574
1575
  * Trie.filterMap(
1575
1576
  * trie,
1576
- * (v, k) => k.length > 3 ? Option.some(v) : Option.none()
1577
+ * (v, k) => k.length > 3 ? Result.succeed(v) : Result.failVoid
1577
1578
  * ),
1578
1579
  * trieMapK
1579
1580
  * ),
@@ -1584,15 +1585,15 @@ export const filterMap: {
1584
1585
  * @since 2.0.0
1585
1586
  * @category filtering
1586
1587
  */
1587
- <A, B>(f: (value: A, key: string) => Option<B>): (self: Trie<A>) => Trie<B>
1588
+ <A, B, X>(f: Filter.Filter<A, B, X, [key: string]>): (self: Trie<A>) => Trie<B>
1588
1589
  /**
1589
- * Maps over the entries of the `Trie` using the specified partial function
1590
- * and filters out `None` values.
1590
+ * Maps over the entries of the `Trie` using the specified filter and keeps
1591
+ * only successful results.
1591
1592
  *
1592
1593
  * @example
1593
1594
  * ```ts
1594
1595
  * import * as Equal from "effect/Equal"
1595
- * import * as Option from "effect/Option"
1596
+ * import * as Result from "effect/Result"
1596
1597
  * import * as Trie from "effect/Trie"
1597
1598
  * import * as assert from "node:assert"
1598
1599
  *
@@ -1613,7 +1614,7 @@ export const filterMap: {
1613
1614
  *
1614
1615
  * assert.equal(
1615
1616
  * Equal.equals(
1616
- * Trie.filterMap(trie, (v) => v > 1 ? Option.some(v) : Option.none()),
1617
+ * Trie.filterMap(trie, (v) => v > 1 ? Result.succeed(v) : Result.failVoid),
1617
1618
  * trieMapV
1618
1619
  * ),
1619
1620
  * true
@@ -1622,7 +1623,7 @@ export const filterMap: {
1622
1623
  * Equal.equals(
1623
1624
  * Trie.filterMap(
1624
1625
  * trie,
1625
- * (v, k) => k.length > 3 ? Option.some(v) : Option.none()
1626
+ * (v, k) => k.length > 3 ? Result.succeed(v) : Result.failVoid
1626
1627
  * ),
1627
1628
  * trieMapK
1628
1629
  * ),
@@ -1633,7 +1634,7 @@ export const filterMap: {
1633
1634
  * @since 2.0.0
1634
1635
  * @category filtering
1635
1636
  */
1636
- <A, B>(self: Trie<A>, f: (value: A, key: string) => Option<B>): Trie<B>
1637
+ <A, B, X>(self: Trie<A>, f: Filter.Filter<A, B, X, [key: string]>): Trie<B>
1637
1638
  } = TR.filterMap
1638
1639
 
1639
1640
  /**
package/src/TxChunk.ts CHANGED
@@ -48,7 +48,7 @@ const TypeId = "~effect/transactions/TxChunk"
48
48
  * console.log(Chunk.toReadonlyArray(result)) // [1, 2, 3, 4]
49
49
  *
50
50
  * // Multi-step atomic operation - use explicit transaction
51
- * yield* Effect.atomic(
51
+ * yield* Effect.transaction(
52
52
  * Effect.gen(function*() {
53
53
  * yield* TxChunk.prepend(txChunk, 0)
54
54
  * yield* TxChunk.append(txChunk, 5)
@@ -109,7 +109,7 @@ const TxChunkProto = {
109
109
  * })
110
110
  * ```
111
111
  */
112
- export const make = <A>(initial: Chunk.Chunk<A>): Effect.Effect<TxChunk<A>> =>
112
+ export const make = <A>(initial: Chunk.Chunk<A>): Effect.Effect<TxChunk<A>, never, Effect.Transaction> =>
113
113
  Effect.map(TxRef.make(initial), (ref) => makeUnsafe(ref))
114
114
 
115
115
  /**
@@ -140,7 +140,7 @@ export const make = <A>(initial: Chunk.Chunk<A>): Effect.Effect<TxChunk<A>> =>
140
140
  * })
141
141
  * ```
142
142
  */
143
- export const empty = <A = never>(): Effect.Effect<TxChunk<A>> =>
143
+ export const empty = <A = never>(): Effect.Effect<TxChunk<A>, never, Effect.Transaction> =>
144
144
  Effect.map(TxRef.make(Chunk.empty<A>()), (ref) => makeUnsafe(ref))
145
145
 
146
146
  /**
@@ -164,7 +164,7 @@ export const empty = <A = never>(): Effect.Effect<TxChunk<A>> =>
164
164
  * console.log(Chunk.toReadonlyArray(chunk)) // [1, 2, 3, 4, 5]
165
165
  *
166
166
  * // Multi-step atomic modification - use explicit transaction
167
- * yield* Effect.atomic(
167
+ * yield* Effect.transaction(
168
168
  * Effect.gen(function*() {
169
169
  * yield* TxChunk.append(txChunk, 6)
170
170
  * yield* TxChunk.prepend(txChunk, 0)
@@ -176,7 +176,7 @@ export const empty = <A = never>(): Effect.Effect<TxChunk<A>> =>
176
176
  * })
177
177
  * ```
178
178
  */
179
- export const fromIterable = <A>(iterable: Iterable<A>): Effect.Effect<TxChunk<A>> =>
179
+ export const fromIterable = <A>(iterable: Iterable<A>): Effect.Effect<TxChunk<A>, never, Effect.Transaction> =>
180
180
  Effect.map(TxRef.make(Chunk.fromIterable(iterable)), (ref) => makeUnsafe(ref))
181
181
 
182
182
  /**
@@ -265,7 +265,7 @@ export const modify: {
265
265
  f: (current: Chunk.Chunk<NoInfer<A>>) => [returnValue: R, newValue: Chunk.Chunk<A>]
266
266
  ): (
267
267
  self: TxChunk<A>
268
- ) => Effect.Effect<R>
268
+ ) => Effect.Effect<R, never, Effect.Transaction>
269
269
  /**
270
270
  * Modifies the value of the `TxChunk` using the provided function.
271
271
  *
@@ -297,13 +297,13 @@ export const modify: {
297
297
  <A, R>(
298
298
  self: TxChunk<A>,
299
299
  f: (current: Chunk.Chunk<A>) => [returnValue: R, newValue: Chunk.Chunk<A>]
300
- ): Effect.Effect<R>
300
+ ): Effect.Effect<R, never, Effect.Transaction>
301
301
  } = dual(
302
302
  2,
303
303
  <A, R>(
304
304
  self: TxChunk<A>,
305
305
  f: (current: Chunk.Chunk<A>) => [returnValue: R, newValue: Chunk.Chunk<A>]
306
- ): Effect.Effect<R> => TxRef.modify(self.ref, f)
306
+ ): Effect.Effect<R, never, Effect.Transaction> => TxRef.modify(self.ref, f)
307
307
  )
308
308
 
309
309
  /**
@@ -357,7 +357,7 @@ export const update: {
357
357
  * @since 4.0.0
358
358
  * @category combinators
359
359
  */
360
- <A>(f: (current: Chunk.Chunk<NoInfer<A>>) => Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void>
360
+ <A>(f: (current: Chunk.Chunk<NoInfer<A>>) => Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
361
361
  /**
362
362
  * Updates the value of the `TxChunk` using the provided function.
363
363
  *
@@ -383,11 +383,13 @@ export const update: {
383
383
  * @since 4.0.0
384
384
  * @category combinators
385
385
  */
386
- <A>(self: TxChunk<A>, f: (current: Chunk.Chunk<A>) => Chunk.Chunk<A>): Effect.Effect<void>
386
+ <A>(self: TxChunk<A>, f: (current: Chunk.Chunk<A>) => Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction>
387
387
  } = dual(
388
388
  2,
389
- <A>(self: TxChunk<A>, f: (current: Chunk.Chunk<A>) => Chunk.Chunk<A>): Effect.Effect<void> =>
390
- TxRef.update(self.ref, f)
389
+ <A>(
390
+ self: TxChunk<A>,
391
+ f: (current: Chunk.Chunk<A>) => Chunk.Chunk<A>
392
+ ): Effect.Effect<void, never, Effect.Transaction> => TxRef.update(self.ref, f)
391
393
  )
392
394
 
393
395
  /**
@@ -413,7 +415,8 @@ export const update: {
413
415
  * @since 4.0.0
414
416
  * @category combinators
415
417
  */
416
- export const get = <A>(self: TxChunk<A>): Effect.Effect<Chunk.Chunk<A>> => TxRef.get(self.ref)
418
+ export const get = <A>(self: TxChunk<A>): Effect.Effect<Chunk.Chunk<A>, never, Effect.Transaction> =>
419
+ TxRef.get(self.ref)
417
420
 
418
421
  /**
419
422
  * Sets the value of the `TxChunk`.
@@ -466,7 +469,7 @@ export const set: {
466
469
  * @since 4.0.0
467
470
  * @category combinators
468
471
  */
469
- <A>(chunk: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void>
472
+ <A>(chunk: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
470
473
  /**
471
474
  * Sets the value of the `TxChunk`.
472
475
  *
@@ -492,8 +495,12 @@ export const set: {
492
495
  * @since 4.0.0
493
496
  * @category combinators
494
497
  */
495
- <A>(self: TxChunk<A>, chunk: Chunk.Chunk<A>): Effect.Effect<void>
496
- } = dual(2, <A>(self: TxChunk<A>, chunk: Chunk.Chunk<A>): Effect.Effect<void> => TxRef.set(self.ref, chunk))
498
+ <A>(self: TxChunk<A>, chunk: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction>
499
+ } = dual(
500
+ 2,
501
+ <A>(self: TxChunk<A>, chunk: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction> =>
502
+ TxRef.set(self.ref, chunk)
503
+ )
497
504
 
498
505
  /**
499
506
  * Appends an element to the end of the `TxChunk`.
@@ -544,7 +551,7 @@ export const append: {
544
551
  * @since 4.0.0
545
552
  * @category combinators
546
553
  */
547
- <A>(element: A): (self: TxChunk<A>) => Effect.Effect<void>
554
+ <A>(element: A): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
548
555
  /**
549
556
  * Appends an element to the end of the `TxChunk`.
550
557
  *
@@ -569,10 +576,11 @@ export const append: {
569
576
  * @since 4.0.0
570
577
  * @category combinators
571
578
  */
572
- <A>(self: TxChunk<A>, element: A): Effect.Effect<void>
579
+ <A>(self: TxChunk<A>, element: A): Effect.Effect<void, never, Effect.Transaction>
573
580
  } = dual(
574
581
  2,
575
- <A>(self: TxChunk<A>, element: A): Effect.Effect<void> => update(self, (current) => Chunk.append(current, element))
582
+ <A>(self: TxChunk<A>, element: A): Effect.Effect<void, never, Effect.Transaction> =>
583
+ update(self, (current) => Chunk.append(current, element))
576
584
  )
577
585
 
578
586
  /**
@@ -624,7 +632,7 @@ export const prepend: {
624
632
  * @since 4.0.0
625
633
  * @category combinators
626
634
  */
627
- <A>(element: A): (self: TxChunk<A>) => Effect.Effect<void>
635
+ <A>(element: A): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
628
636
  /**
629
637
  * Prepends an element to the beginning of the `TxChunk`.
630
638
  *
@@ -649,10 +657,11 @@ export const prepend: {
649
657
  * @since 4.0.0
650
658
  * @category combinators
651
659
  */
652
- <A>(self: TxChunk<A>, element: A): Effect.Effect<void>
660
+ <A>(self: TxChunk<A>, element: A): Effect.Effect<void, never, Effect.Transaction>
653
661
  } = dual(
654
662
  2,
655
- <A>(self: TxChunk<A>, element: A): Effect.Effect<void> => update(self, (current) => Chunk.prepend(current, element))
663
+ <A>(self: TxChunk<A>, element: A): Effect.Effect<void, never, Effect.Transaction> =>
664
+ update(self, (current) => Chunk.prepend(current, element))
656
665
  )
657
666
 
658
667
  /**
@@ -679,7 +688,7 @@ export const prepend: {
679
688
  * @since 4.0.0
680
689
  * @category combinators
681
690
  */
682
- export const size = <A>(self: TxChunk<A>): Effect.Effect<number> =>
691
+ export const size = <A>(self: TxChunk<A>): Effect.Effect<number, never, Effect.Transaction> =>
683
692
  modify(self, (current) => [Chunk.size(current), current])
684
693
 
685
694
  /**
@@ -705,7 +714,7 @@ export const size = <A>(self: TxChunk<A>): Effect.Effect<number> =>
705
714
  * @since 4.0.0
706
715
  * @category combinators
707
716
  */
708
- export const isEmpty = <A>(self: TxChunk<A>): Effect.Effect<boolean> =>
717
+ export const isEmpty = <A>(self: TxChunk<A>): Effect.Effect<boolean, never, Effect.Transaction> =>
709
718
  modify(self, (current) => [Chunk.isEmpty(current), current])
710
719
 
711
720
  /**
@@ -731,7 +740,7 @@ export const isEmpty = <A>(self: TxChunk<A>): Effect.Effect<boolean> =>
731
740
  * @since 4.0.0
732
741
  * @category combinators
733
742
  */
734
- export const isNonEmpty = <A>(self: TxChunk<A>): Effect.Effect<boolean> =>
743
+ export const isNonEmpty = <A>(self: TxChunk<A>): Effect.Effect<boolean, never, Effect.Transaction> =>
735
744
  modify(self, (current) => [Chunk.isNonEmpty(current), current])
736
745
 
737
746
  /**
@@ -783,7 +792,7 @@ export const take: {
783
792
  * @since 4.0.0
784
793
  * @category combinators
785
794
  */
786
- (n: number): <A>(self: TxChunk<A>) => Effect.Effect<void>
795
+ (n: number): <A>(self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
787
796
  /**
788
797
  * Takes the first `n` elements from the `TxChunk`.
789
798
  *
@@ -808,8 +817,12 @@ export const take: {
808
817
  * @since 4.0.0
809
818
  * @category combinators
810
819
  */
811
- <A>(self: TxChunk<A>, n: number): Effect.Effect<void>
812
- } = dual(2, <A>(self: TxChunk<A>, n: number): Effect.Effect<void> => update(self, (current) => Chunk.take(current, n)))
820
+ <A>(self: TxChunk<A>, n: number): Effect.Effect<void, never, Effect.Transaction>
821
+ } = dual(
822
+ 2,
823
+ <A>(self: TxChunk<A>, n: number): Effect.Effect<void, never, Effect.Transaction> =>
824
+ update(self, (current) => Chunk.take(current, n))
825
+ )
813
826
 
814
827
  /**
815
828
  * Drops the first `n` elements from the `TxChunk`.
@@ -860,7 +873,7 @@ export const drop: {
860
873
  * @since 4.0.0
861
874
  * @category combinators
862
875
  */
863
- (n: number): <A>(self: TxChunk<A>) => Effect.Effect<void>
876
+ (n: number): <A>(self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
864
877
  /**
865
878
  * Drops the first `n` elements from the `TxChunk`.
866
879
  *
@@ -885,8 +898,12 @@ export const drop: {
885
898
  * @since 4.0.0
886
899
  * @category combinators
887
900
  */
888
- <A>(self: TxChunk<A>, n: number): Effect.Effect<void>
889
- } = dual(2, <A>(self: TxChunk<A>, n: number): Effect.Effect<void> => update(self, (current) => Chunk.drop(current, n)))
901
+ <A>(self: TxChunk<A>, n: number): Effect.Effect<void, never, Effect.Transaction>
902
+ } = dual(
903
+ 2,
904
+ <A>(self: TxChunk<A>, n: number): Effect.Effect<void, never, Effect.Transaction> =>
905
+ update(self, (current) => Chunk.drop(current, n))
906
+ )
890
907
 
891
908
  /**
892
909
  * Takes a slice of the `TxChunk` from `start` to `end` (exclusive).
@@ -937,7 +954,7 @@ export const slice: {
937
954
  * @since 4.0.0
938
955
  * @category combinators
939
956
  */
940
- (start: number, end: number): <A>(self: TxChunk<A>) => Effect.Effect<void>
957
+ (start: number, end: number): <A>(self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
941
958
  /**
942
959
  * Takes a slice of the `TxChunk` from `start` to `end` (exclusive).
943
960
  *
@@ -962,10 +979,10 @@ export const slice: {
962
979
  * @since 4.0.0
963
980
  * @category combinators
964
981
  */
965
- <A>(self: TxChunk<A>, start: number, end: number): Effect.Effect<void>
982
+ <A>(self: TxChunk<A>, start: number, end: number): Effect.Effect<void, never, Effect.Transaction>
966
983
  } = dual(
967
984
  3,
968
- <A>(self: TxChunk<A>, start: number, end: number): Effect.Effect<void> =>
985
+ <A>(self: TxChunk<A>, start: number, end: number): Effect.Effect<void, never, Effect.Transaction> =>
969
986
  update(self, (current) => Chunk.take(Chunk.drop(current, start), end - start))
970
987
  )
971
988
 
@@ -1022,7 +1039,7 @@ export const map: {
1022
1039
  * @since 4.0.0
1023
1040
  * @category combinators
1024
1041
  */
1025
- <A>(f: (a: NoInfer<A>) => A): (self: TxChunk<A>) => Effect.Effect<void>
1042
+ <A>(f: (a: NoInfer<A>) => A): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1026
1043
  /**
1027
1044
  * Maps each element of the `TxChunk` using the provided function.
1028
1045
  * Note: This only works when the mapped type B is assignable to A.
@@ -1049,10 +1066,11 @@ export const map: {
1049
1066
  * @since 4.0.0
1050
1067
  * @category combinators
1051
1068
  */
1052
- <A>(self: TxChunk<A>, f: (a: A) => A): Effect.Effect<void>
1069
+ <A>(self: TxChunk<A>, f: (a: A) => A): Effect.Effect<void, never, Effect.Transaction>
1053
1070
  } = dual(
1054
1071
  2,
1055
- <A>(self: TxChunk<A>, f: (a: A) => A): Effect.Effect<void> => update(self, (current) => Chunk.map(current, f))
1072
+ <A>(self: TxChunk<A>, f: (a: A) => A): Effect.Effect<void, never, Effect.Transaction> =>
1073
+ update(self, (current) => Chunk.map(current, f))
1056
1074
  )
1057
1075
 
1058
1076
  /**
@@ -1106,7 +1124,7 @@ export const filter: {
1106
1124
  * @since 4.0.0
1107
1125
  * @category combinators
1108
1126
  */
1109
- <A, B extends A>(refinement: (a: A) => a is B): (self: TxChunk<A>) => Effect.Effect<void>
1127
+ <A, B extends A>(refinement: (a: A) => a is B): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1110
1128
  /**
1111
1129
  * Filters the `TxChunk` keeping only elements that satisfy the predicate.
1112
1130
  *
@@ -1132,7 +1150,7 @@ export const filter: {
1132
1150
  * @since 4.0.0
1133
1151
  * @category combinators
1134
1152
  */
1135
- <A>(predicate: (a: A) => boolean): (self: TxChunk<A>) => Effect.Effect<void>
1153
+ <A>(predicate: (a: A) => boolean): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1136
1154
  /**
1137
1155
  * Filters the `TxChunk` keeping only elements that satisfy the predicate.
1138
1156
  *
@@ -1158,7 +1176,7 @@ export const filter: {
1158
1176
  * @since 4.0.0
1159
1177
  * @category combinators
1160
1178
  */
1161
- <A, B extends A>(self: TxChunk<A>, refinement: (a: A) => a is B): Effect.Effect<void>
1179
+ <A, B extends A>(self: TxChunk<A>, refinement: (a: A) => a is B): Effect.Effect<void, never, Effect.Transaction>
1162
1180
  /**
1163
1181
  * Filters the `TxChunk` keeping only elements that satisfy the predicate.
1164
1182
  *
@@ -1184,10 +1202,10 @@ export const filter: {
1184
1202
  * @since 4.0.0
1185
1203
  * @category combinators
1186
1204
  */
1187
- <A>(self: TxChunk<A>, predicate: (a: A) => boolean): Effect.Effect<void>
1205
+ <A>(self: TxChunk<A>, predicate: (a: A) => boolean): Effect.Effect<void, never, Effect.Transaction>
1188
1206
  } = dual(
1189
1207
  2,
1190
- <A>(self: TxChunk<A>, predicate: (a: A) => boolean): Effect.Effect<void> =>
1208
+ <A>(self: TxChunk<A>, predicate: (a: A) => boolean): Effect.Effect<void, never, Effect.Transaction> =>
1191
1209
  update(self, (current) => Chunk.filter(current, predicate))
1192
1210
  )
1193
1211
 
@@ -1244,7 +1262,7 @@ export const appendAll: {
1244
1262
  * @since 4.0.0
1245
1263
  * @category combinators
1246
1264
  */
1247
- <A>(other: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void>
1265
+ <A>(other: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1248
1266
  /**
1249
1267
  * Concatenates another chunk to the end of the `TxChunk`.
1250
1268
  *
@@ -1271,10 +1289,10 @@ export const appendAll: {
1271
1289
  * @since 4.0.0
1272
1290
  * @category combinators
1273
1291
  */
1274
- <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void>
1292
+ <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction>
1275
1293
  } = dual(
1276
1294
  2,
1277
- <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void> =>
1295
+ <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction> =>
1278
1296
  update(self, (current) => Chunk.appendAll(current, other))
1279
1297
  )
1280
1298
 
@@ -1331,7 +1349,7 @@ export const prependAll: {
1331
1349
  * @since 4.0.0
1332
1350
  * @category combinators
1333
1351
  */
1334
- <A>(other: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void>
1352
+ <A>(other: Chunk.Chunk<A>): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1335
1353
  /**
1336
1354
  * Concatenates another chunk to the beginning of the `TxChunk`.
1337
1355
  *
@@ -1358,10 +1376,10 @@ export const prependAll: {
1358
1376
  * @since 4.0.0
1359
1377
  * @category combinators
1360
1378
  */
1361
- <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void>
1379
+ <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction>
1362
1380
  } = dual(
1363
1381
  2,
1364
- <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void> =>
1382
+ <A>(self: TxChunk<A>, other: Chunk.Chunk<A>): Effect.Effect<void, never, Effect.Transaction> =>
1365
1383
  update(self, (current) => Chunk.prependAll(current, other))
1366
1384
  )
1367
1385
 
@@ -1422,7 +1440,7 @@ export const concat: {
1422
1440
  * })
1423
1441
  * ```
1424
1442
  */
1425
- <A>(other: TxChunk<A>): (self: TxChunk<A>) => Effect.Effect<void>
1443
+ <A>(other: TxChunk<A>): (self: TxChunk<A>) => Effect.Effect<void, never, Effect.Transaction>
1426
1444
  /**
1427
1445
  * Concatenates another `TxChunk` to the end of this `TxChunk`.
1428
1446
  *
@@ -1451,11 +1469,12 @@ export const concat: {
1451
1469
  * })
1452
1470
  * ```
1453
1471
  */
1454
- <A>(self: TxChunk<A>, other: TxChunk<A>): Effect.Effect<void>
1455
- } = dual(2, <A>(self: TxChunk<A>, other: TxChunk<A>): Effect.Effect<void> =>
1456
- Effect.atomic(
1472
+ <A>(self: TxChunk<A>, other: TxChunk<A>): Effect.Effect<void, never, Effect.Transaction>
1473
+ } = dual(
1474
+ 2,
1475
+ <A>(self: TxChunk<A>, other: TxChunk<A>): Effect.Effect<void, never, Effect.Transaction> =>
1457
1476
  Effect.gen(function*() {
1458
1477
  const otherChunk = yield* get(other)
1459
1478
  yield* appendAll(self, otherChunk)
1460
1479
  })
1461
- ))
1480
+ )