effect 2.0.0-next.50 → 2.0.0-next.51

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 (318) hide show
  1. package/BigDecimal/dist/effect-BigDecimal.cjs.d.mts +2 -0
  2. package/BigDecimal/dist/effect-BigDecimal.cjs.d.mts.map +1 -0
  3. package/BigDecimal/dist/effect-BigDecimal.cjs.d.ts +2 -0
  4. package/BigDecimal/dist/effect-BigDecimal.cjs.d.ts.map +1 -0
  5. package/BigDecimal/dist/effect-BigDecimal.cjs.dev.js +914 -0
  6. package/BigDecimal/dist/effect-BigDecimal.cjs.js +7 -0
  7. package/BigDecimal/dist/effect-BigDecimal.cjs.mjs +38 -0
  8. package/BigDecimal/dist/effect-BigDecimal.cjs.prod.js +914 -0
  9. package/BigDecimal/dist/effect-BigDecimal.esm.js +869 -0
  10. package/BigDecimal/package.json +4 -0
  11. package/Cache/dist/effect-Cache.cjs.dev.js +21 -21
  12. package/Cache/dist/effect-Cache.cjs.prod.js +21 -21
  13. package/Cause/dist/effect-Cause.cjs.dev.js +4 -4
  14. package/Cause/dist/effect-Cause.cjs.prod.js +4 -4
  15. package/Channel/dist/effect-Channel.cjs.dev.js +33 -33
  16. package/Channel/dist/effect-Channel.cjs.prod.js +33 -33
  17. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.dev.js +28 -28
  18. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.prod.js +28 -28
  19. package/Chunk/dist/effect-Chunk.cjs.dev.js +2 -7
  20. package/Chunk/dist/effect-Chunk.cjs.mjs +0 -1
  21. package/Chunk/dist/effect-Chunk.cjs.prod.js +2 -7
  22. package/Chunk/dist/effect-Chunk.esm.js +3 -7
  23. package/Clock/dist/effect-Clock.cjs.dev.js +10 -10
  24. package/Clock/dist/effect-Clock.cjs.prod.js +10 -10
  25. package/Config/dist/effect-Config.cjs.dev.js +7 -7
  26. package/Config/dist/effect-Config.cjs.prod.js +7 -7
  27. package/ConfigError/dist/effect-ConfigError.cjs.dev.js +1 -1
  28. package/ConfigError/dist/effect-ConfigError.cjs.prod.js +1 -1
  29. package/ConfigProvider/dist/effect-ConfigProvider.cjs.dev.js +9 -9
  30. package/ConfigProvider/dist/effect-ConfigProvider.cjs.prod.js +9 -9
  31. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.dev.js +2 -2
  32. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.prod.js +2 -2
  33. package/ConfigSecret/dist/effect-ConfigSecret.cjs.dev.js +1 -1
  34. package/ConfigSecret/dist/effect-ConfigSecret.cjs.prod.js +1 -1
  35. package/Console/dist/effect-Console.cjs.dev.js +25 -25
  36. package/Console/dist/effect-Console.cjs.prod.js +25 -25
  37. package/Data/dist/effect-Data.cjs.dev.js +148 -58
  38. package/Data/dist/effect-Data.cjs.prod.js +148 -58
  39. package/Data/dist/effect-Data.esm.js +121 -31
  40. package/DefaultServices/dist/effect-DefaultServices.cjs.dev.js +10 -10
  41. package/DefaultServices/dist/effect-DefaultServices.cjs.prod.js +10 -10
  42. package/Deferred/dist/effect-Deferred.cjs.dev.js +4 -4
  43. package/Deferred/dist/effect-Deferred.cjs.prod.js +4 -4
  44. package/Differ/dist/effect-Differ.cjs.dev.js +1 -1
  45. package/Differ/dist/effect-Differ.cjs.prod.js +1 -1
  46. package/Effect/dist/effect-Effect.cjs.dev.js +27 -27
  47. package/Effect/dist/effect-Effect.cjs.prod.js +27 -27
  48. package/Exit/dist/effect-Exit.cjs.dev.js +4 -4
  49. package/Exit/dist/effect-Exit.cjs.prod.js +4 -4
  50. package/Fiber/dist/effect-Fiber.cjs.dev.js +22 -22
  51. package/Fiber/dist/effect-Fiber.cjs.prod.js +22 -22
  52. package/FiberId/dist/effect-FiberId.cjs.dev.js +2 -2
  53. package/FiberId/dist/effect-FiberId.cjs.prod.js +2 -2
  54. package/FiberRef/dist/effect-FiberRef.cjs.dev.js +22 -22
  55. package/FiberRef/dist/effect-FiberRef.cjs.prod.js +22 -22
  56. package/FiberRefs/dist/effect-FiberRefs.cjs.dev.js +5 -5
  57. package/FiberRefs/dist/effect-FiberRefs.cjs.prod.js +5 -5
  58. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.dev.js +6 -6
  59. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.prod.js +6 -6
  60. package/GroupBy/dist/effect-GroupBy.cjs.dev.js +34 -34
  61. package/GroupBy/dist/effect-GroupBy.cjs.prod.js +34 -34
  62. package/HashMap/dist/effect-HashMap.cjs.dev.js +1 -1
  63. package/HashMap/dist/effect-HashMap.cjs.prod.js +1 -1
  64. package/HashSet/dist/effect-HashSet.cjs.dev.js +1 -1
  65. package/HashSet/dist/effect-HashSet.cjs.prod.js +1 -1
  66. package/KeyedPool/dist/effect-KeyedPool.cjs.dev.js +22 -22
  67. package/KeyedPool/dist/effect-KeyedPool.cjs.prod.js +22 -22
  68. package/Layer/dist/effect-Layer.cjs.dev.js +28 -28
  69. package/Layer/dist/effect-Layer.cjs.prod.js +28 -28
  70. package/List/dist/effect-List.cjs.dev.js +4 -7
  71. package/List/dist/effect-List.cjs.mjs +0 -1
  72. package/List/dist/effect-List.cjs.prod.js +4 -7
  73. package/List/dist/effect-List.esm.js +5 -7
  74. package/LogLevel/dist/effect-LogLevel.cjs.dev.js +4 -4
  75. package/LogLevel/dist/effect-LogLevel.cjs.prod.js +4 -4
  76. package/Logger/dist/effect-Logger.cjs.dev.js +26 -26
  77. package/Logger/dist/effect-Logger.cjs.prod.js +26 -26
  78. package/Match/dist/effect-Match.cjs.dev.js +1 -1
  79. package/Match/dist/effect-Match.cjs.prod.js +1 -1
  80. package/Match/dist/effect-Match.esm.js +1 -1
  81. package/Metric/dist/effect-Metric.cjs.dev.js +20 -20
  82. package/Metric/dist/effect-Metric.cjs.prod.js +20 -20
  83. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.dev.js +1 -1
  84. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.prod.js +1 -1
  85. package/MetricHook/dist/effect-MetricHook.cjs.dev.js +2 -2
  86. package/MetricHook/dist/effect-MetricHook.cjs.prod.js +2 -2
  87. package/MetricKey/dist/effect-MetricKey.cjs.dev.js +2 -2
  88. package/MetricKey/dist/effect-MetricKey.cjs.prod.js +2 -2
  89. package/MetricPolling/dist/effect-MetricPolling.cjs.dev.js +22 -22
  90. package/MetricPolling/dist/effect-MetricPolling.cjs.prod.js +22 -22
  91. package/MetricRegistry/dist/effect-MetricRegistry.cjs.dev.js +3 -3
  92. package/MetricRegistry/dist/effect-MetricRegistry.cjs.prod.js +3 -3
  93. package/MutableHashMap/dist/effect-MutableHashMap.cjs.dev.js +1 -1
  94. package/MutableHashMap/dist/effect-MutableHashMap.cjs.prod.js +1 -1
  95. package/MutableHashSet/dist/effect-MutableHashSet.cjs.dev.js +1 -1
  96. package/MutableHashSet/dist/effect-MutableHashSet.cjs.prod.js +1 -1
  97. package/Pool/dist/effect-Pool.cjs.dev.js +22 -22
  98. package/Pool/dist/effect-Pool.cjs.prod.js +22 -22
  99. package/PubSub/dist/effect-PubSub.cjs.dev.js +21 -21
  100. package/PubSub/dist/effect-PubSub.cjs.prod.js +21 -21
  101. package/Queue/dist/effect-Queue.cjs.dev.js +21 -21
  102. package/Queue/dist/effect-Queue.cjs.prod.js +21 -21
  103. package/Random/dist/effect-Random.cjs.dev.js +10 -10
  104. package/Random/dist/effect-Random.cjs.prod.js +10 -10
  105. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.dev.js +1 -4
  106. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.mjs +0 -1
  107. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.prod.js +1 -4
  108. package/ReadonlyArray/dist/effect-ReadonlyArray.esm.js +2 -4
  109. package/Ref/dist/effect-Ref.cjs.dev.js +5 -5
  110. package/Ref/dist/effect-Ref.cjs.prod.js +5 -5
  111. package/Reloadable/dist/effect-Reloadable.cjs.dev.js +26 -26
  112. package/Reloadable/dist/effect-Reloadable.cjs.prod.js +26 -26
  113. package/Request/dist/effect-Request.cjs.dev.js +21 -21
  114. package/Request/dist/effect-Request.cjs.prod.js +21 -21
  115. package/RequestBlock/dist/effect-RequestBlock.cjs.dev.js +28 -28
  116. package/RequestBlock/dist/effect-RequestBlock.cjs.prod.js +28 -28
  117. package/RequestResolver/dist/effect-RequestResolver.cjs.dev.js +28 -28
  118. package/RequestResolver/dist/effect-RequestResolver.cjs.prod.js +28 -28
  119. package/Resource/dist/effect-Resource.cjs.dev.js +24 -24
  120. package/Resource/dist/effect-Resource.cjs.prod.js +24 -24
  121. package/Runtime/dist/effect-Runtime.cjs.dev.js +23 -23
  122. package/Runtime/dist/effect-Runtime.cjs.prod.js +23 -23
  123. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.dev.js +26 -26
  124. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.prod.js +26 -26
  125. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.dev.js +2 -2
  126. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.prod.js +2 -2
  127. package/STM/dist/effect-STM.cjs.dev.js +36 -36
  128. package/STM/dist/effect-STM.cjs.prod.js +36 -36
  129. package/Schedule/dist/effect-Schedule.cjs.dev.js +15 -15
  130. package/Schedule/dist/effect-Schedule.cjs.prod.js +15 -15
  131. package/Scheduler/dist/effect-Scheduler.cjs.dev.js +4 -4
  132. package/Scheduler/dist/effect-Scheduler.cjs.prod.js +4 -4
  133. package/Scope/dist/effect-Scope.cjs.dev.js +20 -20
  134. package/Scope/dist/effect-Scope.cjs.prod.js +20 -20
  135. package/ScopedCache/dist/effect-ScopedCache.cjs.dev.js +27 -27
  136. package/ScopedCache/dist/effect-ScopedCache.cjs.prod.js +27 -27
  137. package/ScopedRef/dist/effect-ScopedRef.cjs.dev.js +24 -24
  138. package/ScopedRef/dist/effect-ScopedRef.cjs.prod.js +24 -24
  139. package/Sink/dist/effect-Sink.cjs.dev.js +31 -31
  140. package/Sink/dist/effect-Sink.cjs.prod.js +31 -31
  141. package/Stream/dist/effect-Stream.cjs.dev.js +34 -34
  142. package/Stream/dist/effect-Stream.cjs.prod.js +34 -34
  143. package/Streamable/dist/effect-Streamable.cjs.dev.js +34 -34
  144. package/Streamable/dist/effect-Streamable.cjs.prod.js +34 -34
  145. package/Struct/dist/effect-Struct.cjs.dev.js +0 -1
  146. package/Struct/dist/effect-Struct.cjs.prod.js +0 -1
  147. package/Struct/dist/effect-Struct.esm.js +0 -1
  148. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.dev.js +33 -33
  149. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.prod.js +33 -33
  150. package/Supervisor/dist/effect-Supervisor.cjs.dev.js +26 -26
  151. package/Supervisor/dist/effect-Supervisor.cjs.prod.js +26 -26
  152. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.dev.js +23 -23
  153. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.prod.js +23 -23
  154. package/TArray/dist/effect-TArray.cjs.dev.js +38 -38
  155. package/TArray/dist/effect-TArray.cjs.prod.js +38 -38
  156. package/TDeferred/dist/effect-TDeferred.cjs.dev.js +37 -37
  157. package/TDeferred/dist/effect-TDeferred.cjs.prod.js +37 -37
  158. package/TMap/dist/effect-TMap.cjs.dev.js +39 -39
  159. package/TMap/dist/effect-TMap.cjs.prod.js +39 -39
  160. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.dev.js +36 -36
  161. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.prod.js +36 -36
  162. package/TPubSub/dist/effect-TPubSub.cjs.dev.js +38 -38
  163. package/TPubSub/dist/effect-TPubSub.cjs.prod.js +38 -38
  164. package/TQueue/dist/effect-TQueue.cjs.dev.js +38 -38
  165. package/TQueue/dist/effect-TQueue.cjs.prod.js +38 -38
  166. package/TRandom/dist/effect-TRandom.cjs.dev.js +38 -38
  167. package/TRandom/dist/effect-TRandom.cjs.prod.js +38 -38
  168. package/TReentrantLock/dist/effect-TReentrantLock.cjs.dev.js +36 -36
  169. package/TReentrantLock/dist/effect-TReentrantLock.cjs.prod.js +36 -36
  170. package/TRef/dist/effect-TRef.cjs.dev.js +36 -36
  171. package/TRef/dist/effect-TRef.cjs.prod.js +36 -36
  172. package/TSemaphore/dist/effect-TSemaphore.cjs.dev.js +37 -37
  173. package/TSemaphore/dist/effect-TSemaphore.cjs.prod.js +37 -37
  174. package/TSet/dist/effect-TSet.cjs.dev.js +39 -39
  175. package/TSet/dist/effect-TSet.cjs.prod.js +39 -39
  176. package/Take/dist/effect-Take.cjs.dev.js +28 -28
  177. package/Take/dist/effect-Take.cjs.prod.js +28 -28
  178. package/TestAnnotation/dist/effect-TestAnnotation.cjs.dev.js +1 -1
  179. package/TestAnnotation/dist/effect-TestAnnotation.cjs.prod.js +1 -1
  180. package/TestAnnotations/dist/effect-TestAnnotations.cjs.dev.js +15 -15
  181. package/TestAnnotations/dist/effect-TestAnnotations.cjs.prod.js +15 -15
  182. package/TestClock/dist/effect-TestClock.cjs.dev.js +25 -25
  183. package/TestClock/dist/effect-TestClock.cjs.prod.js +25 -25
  184. package/TestContext/dist/effect-TestContext.cjs.dev.js +27 -27
  185. package/TestContext/dist/effect-TestContext.cjs.prod.js +27 -27
  186. package/TestLive/dist/effect-TestLive.cjs.dev.js +10 -10
  187. package/TestLive/dist/effect-TestLive.cjs.prod.js +10 -10
  188. package/TestServices/dist/effect-TestServices.cjs.dev.js +27 -27
  189. package/TestServices/dist/effect-TestServices.cjs.prod.js +27 -27
  190. package/TestSized/dist/effect-TestSized.cjs.dev.js +4 -4
  191. package/TestSized/dist/effect-TestSized.cjs.prod.js +4 -4
  192. package/Tracer/dist/effect-Tracer.cjs.dev.js +10 -10
  193. package/Tracer/dist/effect-Tracer.cjs.prod.js +10 -10
  194. package/dist/{HashSet-251c8294.cjs.prod.js → HashSet-09ade044.cjs.prod.js} +1 -1
  195. package/dist/{HashSet-c12c037b.cjs.dev.js → HashSet-e9659fd4.cjs.dev.js} +1 -1
  196. package/dist/{Ref-00103de4.cjs.prod.js → Ref-50f14c13.cjs.prod.js} +1 -1
  197. package/dist/{Ref-f990026b.cjs.dev.js → Ref-d3a3826b.cjs.dev.js} +1 -1
  198. package/dist/{cache-d709d5cb.cjs.dev.js → cache-2a5d8381.cjs.dev.js} +4 -4
  199. package/dist/{cache-0b148e42.cjs.prod.js → cache-8f0c08cb.cjs.prod.js} +4 -4
  200. package/dist/{circular-6d2bb353.cjs.dev.js → circular-2effda94.cjs.dev.js} +4 -4
  201. package/dist/{circular-aa705e70.cjs.dev.js → circular-39e86dc8.cjs.dev.js} +7 -7
  202. package/dist/{circular-5b6f6504.cjs.prod.js → circular-4f03acf3.cjs.prod.js} +4 -4
  203. package/dist/{circular-952618e5.cjs.prod.js → circular-acb40239.cjs.prod.js} +7 -7
  204. package/dist/{config-f0bd27af.cjs.prod.js → config-00e6170c.cjs.prod.js} +3 -3
  205. package/dist/{config-8a7bf1ae.cjs.dev.js → config-beaa306c.cjs.dev.js} +3 -3
  206. package/dist/{configProvider-ae007b10.cjs.prod.js → configProvider-290d13e7.cjs.prod.js} +4 -4
  207. package/dist/{configProvider-3d85d4ef.cjs.dev.js → configProvider-aef50f41.cjs.dev.js} +4 -4
  208. package/dist/{core-d3f4e713.cjs.prod.js → core-279496f0.cjs.prod.js} +2 -2
  209. package/dist/{core-473934ce.cjs.prod.js → core-35439f06.cjs.prod.js} +2 -2
  210. package/dist/{core-dd1edd7a.cjs.dev.js → core-7445bfd4.cjs.dev.js} +2 -2
  211. package/dist/{core-b4bf44d3.cjs.dev.js → core-a0828fef.cjs.dev.js} +2 -2
  212. package/dist/{core-effect-f4b1aad8.cjs.dev.js → core-effect-02a7f1d7.cjs.dev.js} +6 -6
  213. package/dist/{core-effect-6666f2dc.cjs.prod.js → core-effect-460f968a.cjs.prod.js} +6 -6
  214. package/dist/{dataSource-d5d7f338.cjs.prod.js → dataSource-94fb44f9.cjs.prod.js} +2 -2
  215. package/dist/{dataSource-9f78e828.cjs.dev.js → dataSource-da4a602c.cjs.dev.js} +2 -2
  216. package/dist/declarations/src/BigDecimal.d.ts +622 -0
  217. package/dist/declarations/src/BigDecimal.d.ts.map +1 -0
  218. package/dist/declarations/src/Chunk.d.ts +14 -11
  219. package/dist/declarations/src/Chunk.d.ts.map +1 -1
  220. package/dist/declarations/src/Data.d.ts +192 -45
  221. package/dist/declarations/src/Data.d.ts.map +1 -1
  222. package/dist/declarations/src/List.d.ts +15 -10
  223. package/dist/declarations/src/List.d.ts.map +1 -1
  224. package/dist/declarations/src/Match.d.ts.map +1 -1
  225. package/dist/declarations/src/ReadonlyArray.d.ts +13 -8
  226. package/dist/declarations/src/ReadonlyArray.d.ts.map +1 -1
  227. package/dist/declarations/src/Struct.d.ts +3 -2
  228. package/dist/declarations/src/Struct.d.ts.map +1 -1
  229. package/dist/declarations/src/index.d.ts +16 -0
  230. package/dist/declarations/src/index.d.ts.map +1 -1
  231. package/dist/{defaultServices-8ea5e664.cjs.prod.js → defaultServices-61911fd4.cjs.prod.js} +2 -2
  232. package/dist/{defaultServices-6a9a2d2b.cjs.dev.js → defaultServices-f3f93337.cjs.dev.js} +2 -2
  233. package/dist/effect.cjs.dev.js +3 -0
  234. package/dist/effect.cjs.mjs +1 -0
  235. package/dist/effect.cjs.prod.js +3 -0
  236. package/dist/effect.esm.js +2 -0
  237. package/dist/{fiber-3d944398.cjs.dev.js → fiber-cac583ce.cjs.dev.js} +3 -3
  238. package/dist/{fiber-cbd0613f.cjs.prod.js → fiber-f67dca7d.cjs.prod.js} +3 -3
  239. package/dist/{fiberRefs-99808a27.cjs.prod.js → fiberRefs-59b59378.cjs.prod.js} +1 -1
  240. package/dist/{fiberRefs-ccc37f30.cjs.dev.js → fiberRefs-6bd9745e.cjs.dev.js} +1 -1
  241. package/dist/{fiberRuntime-f1e80ca7.cjs.prod.js → fiberRuntime-26f406c3.cjs.prod.js} +27 -23
  242. package/dist/{fiberRuntime-0c1e7478.cjs.dev.js → fiberRuntime-976a3e6f.cjs.dev.js} +27 -23
  243. package/dist/{groupBy-8ae74e3b.cjs.dev.js → groupBy-7fc93bc9.cjs.dev.js} +4 -4
  244. package/dist/{groupBy-30f6e9ba.cjs.prod.js → groupBy-8977b420.cjs.prod.js} +4 -4
  245. package/dist/{layer-bfb9802a.cjs.prod.js → layer-abbc91aa.cjs.prod.js} +8 -8
  246. package/dist/{layer-c284cf0d.cjs.dev.js → layer-c197624f.cjs.dev.js} +8 -8
  247. package/dist/{patch-cda9b6c8.cjs.dev.js → patch-2d425849.cjs.dev.js} +1 -1
  248. package/dist/{patch-256bc574.cjs.prod.js → patch-b7689042.cjs.prod.js} +1 -1
  249. package/dist/{pathPatch-31ce8101.cjs.dev.js → pathPatch-18fa425e.cjs.dev.js} +1 -1
  250. package/dist/{pathPatch-40b92af6.cjs.prod.js → pathPatch-b6020485.cjs.prod.js} +1 -1
  251. package/dist/{pool-f6ca2038.cjs.dev.js → pool-810c2214.cjs.dev.js} +5 -5
  252. package/dist/{pool-122f0fad.cjs.prod.js → pool-868dfa39.cjs.prod.js} +5 -5
  253. package/dist/{query-5cc0ddf8.cjs.prod.js → query-927b504e.cjs.prod.js} +5 -5
  254. package/dist/{query-7bffa3c3.cjs.dev.js → query-c6684e39.cjs.dev.js} +5 -5
  255. package/dist/{queue-e326fd89.cjs.prod.js → queue-062806c7.cjs.prod.js} +2 -2
  256. package/dist/{queue-4166cfdb.cjs.dev.js → queue-a0fc274d.cjs.dev.js} +2 -2
  257. package/dist/{registry-081e18a3.cjs.prod.js → registry-9268ec7c.cjs.prod.js} +1 -1
  258. package/dist/{registry-377855a9.cjs.dev.js → registry-e5ad2d74.cjs.dev.js} +1 -1
  259. package/dist/{runtime-d4514ab5.cjs.dev.js → runtime-340bd70b.cjs.dev.js} +5 -5
  260. package/dist/{runtime-4078f059.cjs.prod.js → runtime-ce0ad0ed.cjs.prod.js} +5 -5
  261. package/dist/{schedule-f036b254.cjs.prod.js → schedule-04b40c50.cjs.prod.js} +3 -3
  262. package/dist/{schedule-31e38871.cjs.dev.js → schedule-74c6207a.cjs.dev.js} +3 -3
  263. package/dist/{scopedRef-5ecf6468.cjs.dev.js → scopedRef-4f0dd122.cjs.dev.js} +6 -6
  264. package/dist/{scopedRef-8ce21228.cjs.prod.js → scopedRef-d429ec83.cjs.prod.js} +6 -6
  265. package/dist/{singleProducerAsyncInput-8879d87c.cjs.prod.js → singleProducerAsyncInput-06a9076a.cjs.prod.js} +1 -1
  266. package/dist/{singleProducerAsyncInput-ece7387b.cjs.dev.js → singleProducerAsyncInput-72c05452.cjs.dev.js} +1 -1
  267. package/dist/{sink-1794329b.cjs.dev.js → sink-301d2bb4.cjs.dev.js} +3 -3
  268. package/dist/{sink-9208df8d.cjs.prod.js → sink-46df55d3.cjs.prod.js} +3 -3
  269. package/dist/{stm-b080be31.cjs.dev.js → stm-0b50e3c1.cjs.dev.js} +3 -3
  270. package/dist/{stm-6ad7b384.cjs.prod.js → stm-c0489b43.cjs.prod.js} +3 -3
  271. package/dist/{stream-e19805ca.cjs.prod.js → stream-0c3160ef.cjs.prod.js} +4 -4
  272. package/dist/{stream-09aeeac3.cjs.dev.js → stream-44cdd7cb.cjs.dev.js} +4 -4
  273. package/dist/{synchronizedRef-cc04ecbd.cjs.prod.js → synchronizedRef-2f71b820.cjs.prod.js} +1 -1
  274. package/dist/{synchronizedRef-8fa16866.cjs.dev.js → synchronizedRef-78797507.cjs.dev.js} +1 -1
  275. package/dist/{tArray-5e42c290.cjs.prod.js → tArray-006f45b0.cjs.prod.js} +3 -3
  276. package/dist/{tArray-7d470ed7.cjs.dev.js → tArray-556355cd.cjs.dev.js} +3 -3
  277. package/dist/{tMap-f0df0ea0.cjs.dev.js → tMap-52d00ffb.cjs.dev.js} +4 -4
  278. package/dist/{tMap-a2cfde88.cjs.prod.js → tMap-9680b82b.cjs.prod.js} +4 -4
  279. package/dist/{tQueue-b80e940e.cjs.prod.js → tQueue-51cf109e.cjs.prod.js} +3 -3
  280. package/dist/{tQueue-085f70b5.cjs.dev.js → tQueue-ca56a2a8.cjs.dev.js} +3 -3
  281. package/dist/{tRef-42a212cb.cjs.prod.js → tRef-4a2a9689.cjs.prod.js} +1 -1
  282. package/dist/{tRef-2e495254.cjs.dev.js → tRef-b98e2e2a.cjs.dev.js} +1 -1
  283. package/internal/HashMap/node.esm.js +1 -1
  284. package/internal/fiberRuntime.esm.js +9 -8
  285. package/internal/query.esm.js +2 -2
  286. package/internal/supervisor/patch.esm.js +3 -3
  287. package/internal/supervisor.esm.js +5 -1
  288. package/package.json +10 -5
  289. package/src/BigDecimal.ts +977 -0
  290. package/src/Chunk.ts +17 -13
  291. package/src/Data.ts +219 -92
  292. package/src/List.ts +17 -11
  293. package/src/Match.ts +2 -2
  294. package/src/ReadonlyArray.ts +18 -9
  295. package/src/Struct.ts +3 -2
  296. package/src/index.ts +17 -0
  297. package/src/internal/HashMap/node.ts +1 -1
  298. package/src/internal/fiberRuntime.ts +56 -45
  299. package/src/internal/query.ts +12 -8
  300. package/src/internal/supervisor/patch.ts +2 -2
  301. package/src/internal/supervisor.ts +5 -0
  302. package/src/tsconfig.json +0 -1
  303. /package/dist/{FiberId-0f0b7779.cjs.prod.js → FiberId-88cc0067.cjs.prod.js} +0 -0
  304. /package/dist/{FiberId-6595cf4c.cjs.dev.js → FiberId-f329d0e3.cjs.dev.js} +0 -0
  305. /package/dist/{RuntimeFlagsPatch-7d62915d.cjs.dev.js → RuntimeFlagsPatch-063c5864.cjs.dev.js} +0 -0
  306. /package/dist/{RuntimeFlagsPatch-3890e860.cjs.prod.js → RuntimeFlagsPatch-233ac7d7.cjs.prod.js} +0 -0
  307. /package/dist/{boundaries-ebe66d32.cjs.prod.js → boundaries-0e5ddf7b.cjs.prod.js} +0 -0
  308. /package/dist/{boundaries-8dfe50cb.cjs.dev.js → boundaries-ce70e4e4.cjs.dev.js} +0 -0
  309. /package/dist/{configError-9021016b.cjs.prod.js → configError-72f57cd6.cjs.prod.js} +0 -0
  310. /package/dist/{configError-0c09b93c.cjs.dev.js → configError-834bedc1.cjs.dev.js} +0 -0
  311. /package/dist/{configSecret-0bdfadd8.cjs.prod.js → configSecret-80d3e36b.cjs.prod.js} +0 -0
  312. /package/dist/{configSecret-938818ad.cjs.dev.js → configSecret-abf643d8.cjs.dev.js} +0 -0
  313. /package/dist/{hook-ad5af092.cjs.dev.js → hook-13f4db1e.cjs.dev.js} +0 -0
  314. /package/dist/{hook-cab99f9e.cjs.prod.js → hook-8a020c3f.cjs.prod.js} +0 -0
  315. /package/dist/{key-9c7368c8.cjs.prod.js → key-2cf383a2.cjs.prod.js} +0 -0
  316. /package/dist/{key-e3189bbd.cjs.dev.js → key-4b5f6a7d.cjs.dev.js} +0 -0
  317. /package/dist/{take-114476e5.cjs.prod.js → take-07165139.cjs.prod.js} +0 -0
  318. /package/dist/{take-d4fa1beb.cjs.dev.js → take-689a29d5.cjs.dev.js} +0 -0
package/src/Chunk.ts CHANGED
@@ -822,6 +822,21 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
822
822
  */
823
823
  export const unsafeLast = <A>(self: Chunk<A>): A => unsafeGet(self, self.length - 1)
824
824
 
825
+ /**
826
+ * @since 2.0.0
827
+ */
828
+ export declare namespace Chunk {
829
+ /**
830
+ * @since 2.0.0
831
+ */
832
+ export type Infer<T extends Chunk<any>> = T extends Chunk<infer A> ? A : never
833
+
834
+ /**
835
+ * @since 2.0.0
836
+ */
837
+ export type With<T extends Chunk<any>, A> = T extends NonEmptyChunk<any> ? NonEmptyChunk<A> : Chunk<A>
838
+ }
839
+
825
840
  /**
826
841
  * Returns a chunk with the elements mapped by the specified f function.
827
842
  *
@@ -829,24 +844,13 @@ export const unsafeLast = <A>(self: Chunk<A>): A => unsafeGet(self, self.length
829
844
  * @category mapping
830
845
  */
831
846
  export const map: {
832
- <A, B>(f: (a: A, i: number) => B): (self: Chunk<A>) => Chunk<B>
833
- <A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B>
847
+ <T extends Chunk<any>, B>(f: (a: Chunk.Infer<T>, i: number) => B): (self: T) => Chunk.With<T, B>
848
+ <T extends Chunk<any>, B>(self: T, f: (a: Chunk.Infer<T>, i: number) => B): Chunk.With<T, B>
834
849
  } = dual(2, <A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B> =>
835
850
  self.backing._tag === "ISingleton" ?
836
851
  of(f(self.backing.a, 0)) :
837
852
  unsafeFromArray(pipe(toReadonlyArray(self), RA.map((a, i) => f(a, i)))))
838
853
 
839
- /**
840
- * Returns a non empty chunk with the elements mapped by the specified f function.
841
- *
842
- * @since 2.0.0
843
- * @category mapping
844
- */
845
- export const mapNonEmpty: {
846
- <A, B>(f: (a: A, i: number) => B): (self: NonEmptyChunk<A>) => NonEmptyChunk<B>
847
- <A, B>(self: NonEmptyChunk<A>, f: (a: A, i: number) => B): NonEmptyChunk<B>
848
- } = map as any
849
-
850
854
  /**
851
855
  * Statefully maps over the chunk, producing new elements of type `B`.
852
856
  *
package/src/Data.ts CHANGED
@@ -14,8 +14,8 @@ import type * as Types from "./Types"
14
14
  * @category models
15
15
  * @since 2.0.0
16
16
  */
17
- export type Data<A extends Readonly<Record<string, any>> | ReadonlyArray<any>> =
18
- & Readonly<A>
17
+ export type Data<A> =
18
+ & { readonly [P in keyof A]: A[P] }
19
19
  & Equal.Equal
20
20
 
21
21
  /**
@@ -36,41 +36,93 @@ export declare namespace Case {
36
36
  * @since 2.0.0
37
37
  * @category models
38
38
  */
39
- export interface Constructor<A extends Case, T extends keyof A = never> {
40
- (args: Omit<A, T | keyof Equal.Equal> extends Record<PropertyKey, never> ? void : Omit<A, T | keyof Equal.Equal>): A
39
+ export interface Constructor<A extends Case, Tag extends keyof A = never> {
40
+ (
41
+ args: Types.Equals<Omit<A, Tag | keyof Equal.Equal>, {}> extends true ? void
42
+ : { readonly [P in keyof A as P extends Tag | keyof Equal.Equal ? never : P]: A[P] }
43
+ ): A
41
44
  }
42
45
  }
43
46
 
44
47
  /**
48
+ * @example
49
+ * import * as Data from "effect/Data"
50
+ * import * as Equal from "effect/Equal"
51
+ *
52
+ * const alice = Data.struct({ name: "Alice", age: 30 })
53
+ *
54
+ * const bob = Data.struct({ name: "Bob", age: 40 })
55
+ *
56
+ * assert.deepStrictEqual(Equal.equals(alice, alice), true)
57
+ * assert.deepStrictEqual(Equal.equals(alice, Data.struct({ name: "Alice", age: 30 })), true)
58
+ *
59
+ * assert.deepStrictEqual(Equal.equals(alice, { name: "Alice", age: 30 }), false)
60
+ * assert.deepStrictEqual(Equal.equals(alice, bob), false)
61
+ *
45
62
  * @category constructors
46
63
  * @since 2.0.0
47
64
  */
48
- export const struct: <As extends Readonly<Record<string, any>>>(as: As) => Data<As> = internal.struct
65
+ export const struct: <A extends Record<string, any>>(a: A) => Data<{ readonly [P in keyof A]: A[P] }> = internal.struct
49
66
 
50
67
  /**
51
68
  * @category constructors
52
69
  * @since 2.0.0
53
70
  */
54
- export const unsafeStruct = <As extends Readonly<Record<string, any>>>(as: As): Data<As> =>
71
+ export const unsafeStruct = <A extends Record<string, any>>(as: A): Data<{ readonly [P in keyof A]: A[P] }> =>
55
72
  Object.setPrototypeOf(as, internal.StructProto)
56
73
 
57
74
  /**
75
+ * @example
76
+ * import * as Data from "effect/Data"
77
+ * import * as Equal from "effect/Equal"
78
+ *
79
+ * const alice = Data.tuple("Alice", 30)
80
+ *
81
+ * const bob = Data.tuple("Bob", 40)
82
+ *
83
+ * assert.deepStrictEqual(Equal.equals(alice, alice), true)
84
+ * assert.deepStrictEqual(Equal.equals(alice, Data.tuple("Alice", 30)), true)
85
+ *
86
+ * assert.deepStrictEqual(Equal.equals(alice, ["Alice", 30]), false)
87
+ * assert.deepStrictEqual(Equal.equals(alice, bob), false)
88
+ *
58
89
  * @category constructors
59
90
  * @since 2.0.0
60
91
  */
61
- export const tuple = <As extends ReadonlyArray<any>>(...as: As): Data<As> => unsafeArray(as)
92
+ export const tuple = <As extends ReadonlyArray<any>>(...as: As): Data<Readonly<As>> => unsafeArray(as)
62
93
 
63
94
  /**
95
+ * @example
96
+ * import * as Data from "effect/Data"
97
+ * import * as Equal from "effect/Equal"
98
+ *
99
+ * const alice = Data.struct({ name: "Alice", age: 30 })
100
+ * const bob = Data.struct({ name: "Bob", age: 40 })
101
+ *
102
+ * const persons = Data.array([alice, bob])
103
+ *
104
+ * assert.deepStrictEqual(
105
+ * Equal.equals(
106
+ * persons,
107
+ * Data.array([
108
+ * Data.struct({ name: "Alice", age: 30 }),
109
+ * Data.struct({ name: "Bob", age: 40 })
110
+ * ])
111
+ * ),
112
+ * true
113
+ * )
114
+ *
64
115
  * @category constructors
65
116
  * @since 2.0.0
66
117
  */
67
- export const array = <As extends ReadonlyArray<any>>(as: As): Data<As> => unsafeArray(as.slice(0) as unknown as As)
118
+ export const array = <As extends ReadonlyArray<any>>(as: As): Data<Readonly<As>> =>
119
+ unsafeArray(as.slice(0) as unknown as As)
68
120
 
69
121
  /**
70
122
  * @category constructors
71
123
  * @since 2.0.0
72
124
  */
73
- export const unsafeArray = <As extends ReadonlyArray<any>>(as: As): Data<As> =>
125
+ export const unsafeArray = <As extends ReadonlyArray<any>>(as: As): Data<Readonly<As>> =>
74
126
  Object.setPrototypeOf(as, internal.ArrayProto)
75
127
 
76
128
  const _case = <A extends Case>(): Case.Constructor<A> => (args) =>
@@ -80,6 +132,27 @@ export {
80
132
  /**
81
133
  * Provides a constructor for the specified `Case`.
82
134
  *
135
+ * @example
136
+ * import * as Data from "effect/Data"
137
+ * import * as Equal from "effect/Equal"
138
+ *
139
+ * // Extending Data.Case to implement Equal
140
+ * interface Person extends Data.Case {
141
+ * readonly name: string
142
+ * }
143
+ *
144
+ * // Creating a constructor for the specified Case
145
+ * const Person = Data.case<Person>()
146
+ *
147
+ * // Creating instances of Person
148
+ * const mike1 = Person({ name: "Mike" })
149
+ * const mike2 = Person({ name: "Mike" })
150
+ * const john = Person({ name: "John" })
151
+ *
152
+ * // Checking equality
153
+ * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
154
+ * assert.deepStrictEqual(Equal.equals(mike1, john), false)
155
+ *
83
156
  * @since 2.0.0
84
157
  * @category constructors
85
158
  */
@@ -89,10 +162,24 @@ export {
89
162
  /**
90
163
  * Provides a tagged constructor for the specified `Case`.
91
164
  *
165
+ * @example
166
+ * import * as Data from "effect/Data"
167
+ *
168
+ * interface Person extends Data.Case {
169
+ * readonly _tag: "Person" // the tag
170
+ * readonly name: string
171
+ * }
172
+ *
173
+ * const Person = Data.tagged<Person>("Person")
174
+ *
175
+ * const mike = Person({ name: "Mike" })
176
+ *
177
+ * assert.deepEqual(mike, { _tag: "Person", name: "Mike" })
178
+ *
92
179
  * @since 2.0.0
93
180
  * @category constructors
94
181
  */
95
- export const tagged = <A extends Case & { _tag: string }>(
182
+ export const tagged = <A extends Case & { readonly _tag: string }>(
96
183
  tag: A["_tag"]
97
184
  ): Case.Constructor<A, "_tag"> =>
98
185
  (args) => {
@@ -101,33 +188,67 @@ export const tagged = <A extends Case & { _tag: string }>(
101
188
  return value
102
189
  }
103
190
 
191
+ /**
192
+ * Provides a constructor for a Case Class.
193
+ *
194
+ * @example
195
+ * import * as Data from "effect/Data"
196
+ * import * as Equal from "effect/Equal"
197
+ *
198
+ * class Person extends Data.Class<{ readonly name: string }> {}
199
+ *
200
+ * // Creating instances of Person
201
+ * const mike1 = new Person({ name: "Mike" })
202
+ * const mike2 = new Person({ name: "Mike" })
203
+ * const john = new Person({ name: "John" })
204
+ *
205
+ * // Checking equality
206
+ * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
207
+ * assert.deepStrictEqual(Equal.equals(mike1, john), false)
208
+ *
209
+ * @since 2.0.0
210
+ * @category constructors
211
+ */
212
+ export const Class: new<A extends Record<string, any>>(
213
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void
214
+ : { readonly [P in Exclude<keyof A, keyof Equal.Equal>]: A[P] }
215
+ ) => Data<Readonly<A>> = internal.Structural as any
216
+
104
217
  /**
105
218
  * Provides a Tagged constructor for a Case Class.
106
219
  *
220
+ * @example
221
+ * import * as Data from "effect/Data"
222
+ * import * as Equal from "effect/Equal"
223
+ *
224
+ * class Person extends Data.TaggedClass("Person")<{ readonly name: string }> {}
225
+ *
226
+ * // Creating instances of Person
227
+ * const mike1 = new Person({ name: "Mike" })
228
+ * const mike2 = new Person({ name: "Mike" })
229
+ * const john = new Person({ name: "John" })
230
+ *
231
+ * // Checking equality
232
+ * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
233
+ * assert.deepStrictEqual(Equal.equals(mike1, john), false)
234
+ *
235
+ * assert.deepStrictEqual(mike1._tag, "Person")
236
+ *
107
237
  * @since 2.0.0
108
238
  * @category constructors
109
239
  */
110
240
  export const TaggedClass = <Tag extends string>(
111
241
  tag: Tag
112
242
  ): new<A extends Record<string, any>>(
113
- args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
114
- ) => Data<A & { readonly _tag: Tag }> => {
243
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void
244
+ : { readonly [P in Exclude<keyof A, keyof Equal.Equal>]: A[P] }
245
+ ) => Data<Readonly<A> & { readonly _tag: Tag }> => {
115
246
  class Base extends Class<any> {
116
247
  readonly _tag = tag
117
248
  }
118
249
  return Base as any
119
250
  }
120
251
 
121
- /**
122
- * Provides a constructor for a Case Class.
123
- *
124
- * @since 2.0.0
125
- * @category constructors
126
- */
127
- export const Class: new<A extends Record<string, any>>(
128
- args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
129
- ) => Data<A> = internal.Structural as any
130
-
131
252
  /**
132
253
  * @since 2.0.0
133
254
  * @category constructors
@@ -143,8 +264,8 @@ export const Structural: new<A>(
143
264
  * import * as Data from "effect/Data"
144
265
  *
145
266
  * type HttpError = Data.TaggedEnum<{
146
- * BadRequest: { status: 400, message: string }
147
- * NotFound: { status: 404, message: string }
267
+ * BadRequest: { readonly status: 400, readonly message: string }
268
+ * NotFound: { readonly status: 404, readonly message: string }
148
269
  * }>
149
270
  *
150
271
  * // Equivalent to:
@@ -166,8 +287,9 @@ export const Structural: new<A>(
166
287
  */
167
288
  export type TaggedEnum<
168
289
  A extends Record<string, Record<string, any>> & UntaggedChildren<A>
169
- > = keyof A extends infer Tag
170
- ? Tag extends keyof A ? Data<{ readonly [K in `_tag` | keyof A[Tag]]: K extends `_tag` ? Tag : A[Tag][K] }>
290
+ > = keyof A extends infer Tag ? Tag extends keyof A ? Data<
291
+ Types.Simplify<{ readonly _tag: Tag } & { readonly [K in keyof A[Tag]]: A[Tag][K] }>
292
+ >
171
293
  : never
172
294
  : never
173
295
 
@@ -219,20 +341,18 @@ export declare namespace TaggedEnum {
219
341
  * @since 2.0.0
220
342
  */
221
343
  export type Args<
222
- A extends Data<{ readonly _tag: string }>,
223
- K extends A["_tag"]
224
- > = Omit<
225
- Extract<A, { readonly _tag: K }>,
226
- "_tag" | keyof Case
227
- > extends infer T ? {} extends T ? void
228
- : T
344
+ A extends { readonly _tag: string } & Equal.Equal,
345
+ K extends A["_tag"],
346
+ E = Extract<A, { readonly _tag: K }>
347
+ > = { readonly [K in keyof E as K extends "_tag" | keyof Case ? never : K]: E[K] } extends infer T ?
348
+ {} extends T ? void : T
229
349
  : never
230
350
 
231
351
  /**
232
352
  * @since 2.0.0
233
353
  */
234
354
  export type Value<
235
- A extends Data<{ readonly _tag: string }>,
355
+ A extends { readonly _tag: string } & Equal.Equal,
236
356
  K extends A["_tag"]
237
357
  > = Extract<A, { readonly _tag: K }>
238
358
  }
@@ -246,73 +366,86 @@ export declare namespace TaggedEnum {
246
366
  * @example
247
367
  * import * as Data from "effect/Data"
248
368
  *
249
- * const HttpError = Data.taggedEnum<
250
- * | Data.Data<{ _tag: "BadRequest"; status: 400; message: string }>
251
- * | Data.Data<{ _tag: "NotFound"; status: 404; message: string }>
369
+ * const { BadRequest, NotFound } = Data.taggedEnum<
370
+ * | Data.Data<{ readonly _tag: "BadRequest"; readonly status: 400; readonly message: string }>
371
+ * | Data.Data<{ readonly _tag: "NotFound"; readonly status: 404; readonly message: string }>
252
372
  * >()
253
373
  *
254
- * const notFound = HttpError("NotFound")({ status: 404, message: "Not Found" })
374
+ * const notFound = NotFound({ status: 404, message: "Not Found" })
255
375
  *
256
376
  * @example
257
377
  * import * as Data from "effect/Data"
258
378
  *
259
379
  * type MyResult<E, A> = Data.TaggedEnum<{
260
- * Failure: { error: E }
261
- * Success: { value: A }
380
+ * Failure: { readonly error: E }
381
+ * Success: { readonly value: A }
262
382
  * }>
263
383
  * interface MyResultDefinition extends Data.TaggedEnum.WithGenerics<2> {
264
384
  * readonly taggedEnum: MyResult<this["A"], this["B"]>
265
385
  * }
266
- * const MyResult = Data.taggedEnum<MyResultDefinition>()
386
+ * const { Failure, Success } = Data.taggedEnum<MyResultDefinition>()
267
387
  *
268
- * const success = MyResult("Success")({ value: 1 })
388
+ * const success = Success({ value: 1 })
269
389
  *
270
390
  * @category constructors
271
391
  * @since 2.0.0
272
392
  */
273
393
  export const taggedEnum: {
274
- <Z extends TaggedEnum.WithGenerics<1>>(): <
275
- K extends Z["taggedEnum"]["_tag"]
276
- >(
277
- tag: K
278
- ) => <A>(
279
- args: TaggedEnum.Args<TaggedEnum.Kind<Z, A>, K>
280
- ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A>, K>
394
+ <Z extends TaggedEnum.WithGenerics<1>>(): {
395
+ readonly [Tag in Z["taggedEnum"]["_tag"]]: <A>(
396
+ args: TaggedEnum.Args<
397
+ TaggedEnum.Kind<Z, A>,
398
+ Tag,
399
+ Extract<TaggedEnum.Kind<Z, A>, { readonly _tag: Tag }>
400
+ >
401
+ ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A>, Tag>
402
+ }
281
403
 
282
- <Z extends TaggedEnum.WithGenerics<2>>(): <
283
- K extends Z["taggedEnum"]["_tag"]
284
- >(
285
- tag: K
286
- ) => <A, B>(
287
- args: TaggedEnum.Args<TaggedEnum.Kind<Z, A, B>, K>
288
- ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B>, K>
404
+ <Z extends TaggedEnum.WithGenerics<2>>(): {
405
+ readonly [Tag in Z["taggedEnum"]["_tag"]]: <A, B>(
406
+ args: TaggedEnum.Args<
407
+ TaggedEnum.Kind<Z, A, B>,
408
+ Tag,
409
+ Extract<TaggedEnum.Kind<Z, A, B>, { readonly _tag: Tag }>
410
+ >
411
+ ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B>, Tag>
412
+ }
289
413
 
290
- <Z extends TaggedEnum.WithGenerics<3>>(): <
291
- K extends Z["taggedEnum"]["_tag"]
292
- >(
293
- tag: K
294
- ) => <A, B, C>(
295
- args: TaggedEnum.Args<TaggedEnum.Kind<Z, A, B, C>, K>
296
- ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B, C>, K>
414
+ <Z extends TaggedEnum.WithGenerics<3>>(): {
415
+ readonly [Tag in Z["taggedEnum"]["_tag"]]: <A, B, C>(
416
+ args: TaggedEnum.Args<
417
+ TaggedEnum.Kind<Z, A, B, C>,
418
+ Tag,
419
+ Extract<TaggedEnum.Kind<Z, A, B, C>, { readonly _tag: Tag }>
420
+ >
421
+ ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B, C>, Tag>
422
+ }
297
423
 
298
- <Z extends TaggedEnum.WithGenerics<4>>(): <
299
- K extends Z["taggedEnum"]["_tag"]
300
- >(
301
- tag: K
302
- ) => <A, B, C, D>(
303
- args: TaggedEnum.Args<TaggedEnum.Kind<Z, A, B, C, D>, K>
304
- ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B, C, D>, K>
424
+ <Z extends TaggedEnum.WithGenerics<4>>(): {
425
+ readonly [Tag in Z["taggedEnum"]["_tag"]]: <A, B, C, D>(
426
+ args: TaggedEnum.Args<
427
+ TaggedEnum.Kind<Z, A, B, C, D>,
428
+ Tag,
429
+ Extract<TaggedEnum.Kind<Z, A, B, C, D>, { readonly _tag: Tag }>
430
+ >
431
+ ) => TaggedEnum.Value<TaggedEnum.Kind<Z, A, B, C, D>, Tag>
432
+ }
305
433
 
306
- <A extends Data<{ readonly _tag: string }>>(): <K extends A["_tag"]>(
307
- tag: K
308
- ) => Case.Constructor<Extract<A, { readonly _tag: K }>, "_tag">
309
- } = () => tagged as any
434
+ <A extends { readonly _tag: string } & Equal.Equal>(): {
435
+ readonly [Tag in A["_tag"]]: Case.Constructor<Extract<A, { readonly _tag: Tag }>, "_tag">
436
+ }
437
+ } = () =>
438
+ new Proxy({}, {
439
+ get(_target, tag, _receiver) {
440
+ return tagged(tag as string)
441
+ }
442
+ }) as any
310
443
 
311
444
  /**
312
445
  * @since 2.0.0
313
446
  * @category models
314
447
  */
315
- export interface YieldableError extends Case, Pipeable, Error {
448
+ export interface YieldableError extends Case, Pipeable, Readonly<Error> {
316
449
  readonly [Effectable.EffectTypeId]: Effect.Effect.VarianceStruct<never, this, never>
317
450
  readonly [Effectable.StreamTypeId]: Effect.Effect.VarianceStruct<never, this, never>
318
451
  readonly [Effectable.SinkTypeId]: Sink.Sink.VarianceStruct<never, this, unknown, never, never>
@@ -327,21 +460,13 @@ export interface YieldableError extends Case, Pipeable, Error {
327
460
  >
328
461
  }
329
462
 
330
- const YieldableErrorMessage = Symbol.for("effect/Data/YieldableError/message")
331
463
  const YieldableErrorProto = {
332
464
  ...Effectable.StructuralCommitPrototype,
333
- __proto__: globalThis.Error.prototype,
334
465
  commit() {
335
466
  return Effect.fail(this)
336
467
  },
337
468
  toString(this: globalThis.Error) {
338
469
  return `${this.name}: ${this.message}`
339
- },
340
- get message() {
341
- return (this as any)[YieldableErrorMessage] ?? JSON.stringify(this)
342
- },
343
- set message(value: string) {
344
- ;(this as any)[YieldableErrorMessage] = value
345
470
  }
346
471
  }
347
472
 
@@ -352,15 +477,16 @@ const YieldableErrorProto = {
352
477
  * @category constructors
353
478
  */
354
479
  export const Error: new<A extends Record<string, any>>(
355
- args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
356
- ) => YieldableError & A = (function() {
357
- function Base(this: any, args: any) {
358
- if (args) {
480
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void
481
+ : { readonly [P in Exclude<keyof A, keyof Equal.Equal>]: A[P] }
482
+ ) => YieldableError & Readonly<A> = (function() {
483
+ class Base extends globalThis.Error {
484
+ constructor(args: any) {
485
+ super()
359
486
  Object.assign(this, args)
360
487
  }
361
- globalThis.Error.captureStackTrace(this, this.constructor)
362
488
  }
363
- Base.prototype = YieldableErrorProto
489
+ Object.assign(Base.prototype, YieldableErrorProto)
364
490
  return Base as any
365
491
  })()
366
492
 
@@ -369,11 +495,12 @@ export const Error: new<A extends Record<string, any>>(
369
495
  * @category constructors
370
496
  */
371
497
  export const TaggedError = <Tag extends string>(tag: Tag): new<A extends Record<string, any>>(
372
- args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
373
- ) => YieldableError & { readonly _tag: Tag } & A => {
498
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void
499
+ : { readonly [P in Exclude<keyof A, keyof Equal.Equal>]: A[P] }
500
+ ) => YieldableError & { readonly _tag: Tag } & Readonly<A> => {
374
501
  class Base extends Error<{}> {
375
502
  readonly _tag = tag
376
503
  }
377
- Base.prototype.name = tag
504
+ ;(Base.prototype as any).name = tag
378
505
  return Base as any
379
506
  }
package/src/List.ts CHANGED
@@ -710,6 +710,21 @@ export const head = <A>(self: List<A>): Option.Option<A> => isNil(self) ? Option
710
710
  */
711
711
  export const last = <A>(self: List<A>): Option.Option<A> => isNil(self) ? Option.none() : Option.some(unsafeLast(self)!)
712
712
 
713
+ /**
714
+ * @since 2.0.0
715
+ */
716
+ export declare namespace List {
717
+ /**
718
+ * @since 2.0.0
719
+ */
720
+ export type Infer<T extends List<any>> = T extends List<infer A> ? A : never
721
+
722
+ /**
723
+ * @since 2.0.0
724
+ */
725
+ export type With<T extends List<any>, A> = T extends Cons<any> ? Cons<A> : List<A>
726
+ }
727
+
713
728
  /**
714
729
  * Applies the specified mapping function to each element of the list.
715
730
  *
@@ -717,8 +732,8 @@ export const last = <A>(self: List<A>): Option.Option<A> => isNil(self) ? Option
717
732
  * @category combinators
718
733
  */
719
734
  export const map: {
720
- <A, B>(f: (a: A) => B): (self: List<A>) => List<B>
721
- <A, B>(self: List<A>, f: (a: A) => B): List<B>
735
+ <T extends List<any>, B>(f: (a: List.Infer<T>, i: number) => B): (self: T) => List.With<T, B>
736
+ <T extends List<any>, B>(self: T, f: (a: List.Infer<T>, i: number) => B): List.With<T, B>
722
737
  } = dual(2, <A, B>(self: List<A>, f: (a: A) => B): List<B> => {
723
738
  if (isNil(self)) {
724
739
  return self as unknown as List<B>
@@ -736,15 +751,6 @@ export const map: {
736
751
  }
737
752
  })
738
753
 
739
- /**
740
- * @since 2.0.0
741
- * @category combinators
742
- */
743
- export const mapNonEmpty: {
744
- <A, B>(f: (a: A) => B): (self: Cons<A>) => Cons<B>
745
- <A, B>(self: Cons<A>, f: (a: A) => B): Cons<B>
746
- } = map as any
747
-
748
754
  /**
749
755
  * Partition a list into two lists, where the first list contains all elements
750
756
  * that did not satisfy the specified predicate, and the second list contains
package/src/Match.ts CHANGED
@@ -538,7 +538,7 @@ export const exhaustive: <I, F, A, Pr>(
538
538
  * @since 1.0.0
539
539
  * @category type ids
540
540
  */
541
- export const SafeRefinementId = Symbol.for("./SafeRefinement")
541
+ export const SafeRefinementId = Symbol.for("effect/SafeRefinement")
542
542
 
543
543
  /**
544
544
  * @since 1.0.0
@@ -554,7 +554,7 @@ export interface SafeRefinement<A, R = A> {
554
554
  readonly [SafeRefinementId]: (a: A) => R
555
555
  }
556
556
 
557
- const Fail = Symbol.for("./Fail")
557
+ const Fail = Symbol.for("effect/Fail")
558
558
  type Fail = typeof Fail
559
559
 
560
560
  /**
@@ -1508,22 +1508,31 @@ export const empty: <A = never>() => Array<A> = () => []
1508
1508
  export const of = <A>(a: A): NonEmptyArray<A> => [a]
1509
1509
 
1510
1510
  /**
1511
- * @category mapping
1512
1511
  * @since 2.0.0
1513
1512
  */
1514
- export const map: {
1515
- <A, B>(f: (a: A, i: number) => B): (self: ReadonlyArray<A>) => Array<B>
1516
- <A, B>(self: ReadonlyArray<A>, f: (a: A, i: number) => B): Array<B>
1517
- } = dual(2, <A, B>(self: ReadonlyArray<A>, f: (a: A, i: number) => B): Array<B> => self.map(f))
1513
+ export declare namespace ReadonlyArray {
1514
+ /**
1515
+ * @since 2.0.0
1516
+ */
1517
+ export type Infer<T extends ReadonlyArray<any>> = T[number]
1518
+
1519
+ /**
1520
+ * @since 2.0.0
1521
+ */
1522
+ export type With<T extends ReadonlyArray<any>, A> = T extends NonEmptyReadonlyArray<any> ? NonEmptyArray<A>
1523
+ : Array<A>
1524
+ }
1518
1525
 
1519
1526
  /**
1520
1527
  * @category mapping
1521
1528
  * @since 2.0.0
1522
1529
  */
1523
- export const mapNonEmpty: {
1524
- <A, B>(f: (a: A, i: number) => B): (self: readonly [A, ...Array<A>]) => [B, ...Array<B>]
1525
- <A, B>(self: readonly [A, ...Array<A>], f: (a: A, i: number) => B): [B, ...Array<B>]
1526
- } = map as any
1530
+ export const map: {
1531
+ <T extends ReadonlyArray<any>, B>(
1532
+ f: (a: ReadonlyArray.Infer<T>, i: number) => B
1533
+ ): (self: T) => ReadonlyArray.With<T, B>
1534
+ <T extends ReadonlyArray<any>, B>(self: T, f: (a: ReadonlyArray.Infer<T>, i: number) => B): ReadonlyArray.With<T, B>
1535
+ } = dual(2, <A, B>(self: ReadonlyArray<A>, f: (a: A, i: number) => B): Array<B> => self.map(f))
1527
1536
 
1528
1537
  /**
1529
1538
  * @category sequencing
package/src/Struct.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  import * as Equivalence from "./Equivalence"
8
8
  import { dual } from "./Function"
9
9
  import * as order from "./Order"
10
+ import type { Simplify } from "./Types"
10
11
 
11
12
  /**
12
13
  * Create a new object by picking properties of an existing object.
@@ -22,7 +23,7 @@ import * as order from "./Order"
22
23
  export const pick = <S, Keys extends readonly [keyof S, ...Array<keyof S>]>(
23
24
  ...keys: Keys
24
25
  ) =>
25
- (s: S): { [K in Keys[number]]: S[K] } => {
26
+ (s: S): Simplify<Pick<S, Keys[number]>> => {
26
27
  const out: any = {}
27
28
  for (const k of keys) {
28
29
  out[k] = s[k]
@@ -44,7 +45,7 @@ export const pick = <S, Keys extends readonly [keyof S, ...Array<keyof S>]>(
44
45
  export const omit = <S, Keys extends readonly [keyof S, ...Array<keyof S>]>(
45
46
  ...keys: Keys
46
47
  ) =>
47
- (s: S): { [K in Exclude<keyof S, Keys[number]>]: S[K] } => {
48
+ (s: S): Simplify<Omit<S, Keys[number]>> => {
48
49
  const out: any = { ...s }
49
50
  for (const k of keys) {
50
51
  delete out[k]