effect 2.0.0-next.45 → 2.0.0-next.47

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 (382) hide show
  1. package/Bigint/dist/effect-Bigint.cjs.dev.js +125 -1
  2. package/Bigint/dist/effect-Bigint.cjs.mjs +6 -1
  3. package/Bigint/dist/effect-Bigint.cjs.prod.js +125 -1
  4. package/Bigint/dist/effect-Bigint.esm.js +111 -2
  5. package/Boolean/dist/effect-Boolean.cjs.dev.js +1 -1
  6. package/Boolean/dist/effect-Boolean.cjs.prod.js +1 -1
  7. package/Boolean/dist/effect-Boolean.esm.js +1 -1
  8. package/Brand/dist/effect-Brand.cjs.dev.js +3 -3
  9. package/Brand/dist/effect-Brand.cjs.prod.js +3 -3
  10. package/Cache/dist/effect-Cache.cjs.dev.js +30 -30
  11. package/Cache/dist/effect-Cache.cjs.prod.js +30 -30
  12. package/Cause/dist/effect-Cause.cjs.dev.js +8 -8
  13. package/Cause/dist/effect-Cause.cjs.prod.js +8 -8
  14. package/Channel/dist/effect-Channel.cjs.dev.js +38 -38
  15. package/Channel/dist/effect-Channel.cjs.prod.js +38 -38
  16. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.dev.js +34 -34
  17. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.prod.js +34 -34
  18. package/Chunk/dist/effect-Chunk.cjs.dev.js +3 -3
  19. package/Chunk/dist/effect-Chunk.cjs.prod.js +3 -3
  20. package/Clock/dist/effect-Clock.cjs.dev.js +16 -16
  21. package/Clock/dist/effect-Clock.cjs.prod.js +16 -16
  22. package/Config/dist/effect-Config.cjs.dev.js +11 -11
  23. package/Config/dist/effect-Config.cjs.prod.js +11 -11
  24. package/ConfigError/dist/effect-ConfigError.cjs.dev.js +4 -4
  25. package/ConfigError/dist/effect-ConfigError.cjs.prod.js +4 -4
  26. package/ConfigProvider/dist/effect-ConfigProvider.cjs.dev.js +17 -17
  27. package/ConfigProvider/dist/effect-ConfigProvider.cjs.prod.js +17 -17
  28. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.dev.js +5 -5
  29. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.prod.js +5 -5
  30. package/ConfigSecret/dist/effect-ConfigSecret.cjs.dev.js +4 -4
  31. package/ConfigSecret/dist/effect-ConfigSecret.cjs.prod.js +4 -4
  32. package/Console/dist/effect-Console.cjs.dev.js +33 -33
  33. package/Console/dist/effect-Console.cjs.prod.js +33 -33
  34. package/Context/dist/effect-Context.cjs.dev.js +3 -8
  35. package/Context/dist/effect-Context.cjs.prod.js +3 -8
  36. package/Data/dist/effect-Data.cjs.dev.js +141 -54
  37. package/Data/dist/effect-Data.cjs.mjs +2 -0
  38. package/Data/dist/effect-Data.cjs.prod.js +141 -54
  39. package/Data/dist/effect-Data.esm.js +51 -3
  40. package/DefaultServices/dist/effect-DefaultServices.cjs.dev.js +16 -16
  41. package/DefaultServices/dist/effect-DefaultServices.cjs.prod.js +16 -16
  42. package/Deferred/dist/effect-Deferred.cjs.dev.js +8 -8
  43. package/Deferred/dist/effect-Deferred.cjs.prod.js +8 -8
  44. package/Differ/dist/effect-Differ.cjs.dev.js +11 -11
  45. package/Differ/dist/effect-Differ.cjs.prod.js +11 -11
  46. package/Duration/dist/effect-Duration.cjs.dev.js +3 -3
  47. package/Duration/dist/effect-Duration.cjs.prod.js +3 -3
  48. package/Effect/dist/effect-Effect.cjs.dev.js +35 -35
  49. package/Effect/dist/effect-Effect.cjs.prod.js +35 -35
  50. package/Effectable/dist/effect-Effectable.cjs.dev.js +1 -2
  51. package/Effectable/dist/effect-Effectable.cjs.prod.js +1 -2
  52. package/Either/dist/effect-Either.cjs.dev.js +3 -3
  53. package/Either/dist/effect-Either.cjs.prod.js +3 -3
  54. package/Encoding/dist/effect-Encoding.cjs.dev.js +3 -3
  55. package/Encoding/dist/effect-Encoding.cjs.prod.js +3 -3
  56. package/Exit/dist/effect-Exit.cjs.dev.js +8 -8
  57. package/Exit/dist/effect-Exit.cjs.prod.js +8 -8
  58. package/Fiber/dist/effect-Fiber.cjs.dev.js +27 -27
  59. package/Fiber/dist/effect-Fiber.cjs.prod.js +27 -27
  60. package/FiberId/dist/effect-FiberId.cjs.dev.js +5 -5
  61. package/FiberId/dist/effect-FiberId.cjs.prod.js +5 -5
  62. package/FiberRef/dist/effect-FiberRef.cjs.dev.js +27 -27
  63. package/FiberRef/dist/effect-FiberRef.cjs.prod.js +27 -27
  64. package/FiberRefs/dist/effect-FiberRefs.cjs.dev.js +9 -9
  65. package/FiberRefs/dist/effect-FiberRefs.cjs.prod.js +9 -9
  66. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.dev.js +10 -10
  67. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.prod.js +10 -10
  68. package/GroupBy/dist/effect-GroupBy.cjs.dev.js +39 -39
  69. package/GroupBy/dist/effect-GroupBy.cjs.prod.js +39 -39
  70. package/HashMap/dist/effect-HashMap.cjs.dev.js +4 -4
  71. package/HashMap/dist/effect-HashMap.cjs.prod.js +4 -4
  72. package/HashSet/dist/effect-HashSet.cjs.dev.js +4 -4
  73. package/HashSet/dist/effect-HashSet.cjs.prod.js +4 -4
  74. package/KeyedPool/dist/effect-KeyedPool.cjs.dev.js +27 -27
  75. package/KeyedPool/dist/effect-KeyedPool.cjs.prod.js +27 -27
  76. package/Layer/dist/effect-Layer.cjs.dev.js +30 -30
  77. package/Layer/dist/effect-Layer.cjs.prod.js +30 -30
  78. package/List/dist/effect-List.cjs.dev.js +3 -3
  79. package/List/dist/effect-List.cjs.prod.js +3 -3
  80. package/LogLevel/dist/effect-LogLevel.cjs.dev.js +8 -8
  81. package/LogLevel/dist/effect-LogLevel.cjs.prod.js +8 -8
  82. package/Logger/dist/effect-Logger.cjs.dev.js +31 -31
  83. package/Logger/dist/effect-Logger.cjs.prod.js +31 -31
  84. package/Metric/dist/effect-Metric.cjs.dev.js +25 -25
  85. package/Metric/dist/effect-Metric.cjs.prod.js +25 -25
  86. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.dev.js +4 -4
  87. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.prod.js +4 -4
  88. package/MetricHook/dist/effect-MetricHook.cjs.dev.js +5 -5
  89. package/MetricHook/dist/effect-MetricHook.cjs.prod.js +5 -5
  90. package/MetricKey/dist/effect-MetricKey.cjs.dev.js +6 -6
  91. package/MetricKey/dist/effect-MetricKey.cjs.prod.js +6 -6
  92. package/MetricKeyType/dist/effect-MetricKeyType.cjs.dev.js +4 -4
  93. package/MetricKeyType/dist/effect-MetricKeyType.cjs.prod.js +4 -4
  94. package/MetricPolling/dist/effect-MetricPolling.cjs.dev.js +27 -27
  95. package/MetricPolling/dist/effect-MetricPolling.cjs.prod.js +27 -27
  96. package/MetricRegistry/dist/effect-MetricRegistry.cjs.dev.js +7 -7
  97. package/MetricRegistry/dist/effect-MetricRegistry.cjs.prod.js +7 -7
  98. package/MutableHashMap/dist/effect-MutableHashMap.cjs.dev.js +4 -4
  99. package/MutableHashMap/dist/effect-MutableHashMap.cjs.prod.js +4 -4
  100. package/MutableHashSet/dist/effect-MutableHashSet.cjs.dev.js +4 -4
  101. package/MutableHashSet/dist/effect-MutableHashSet.cjs.prod.js +4 -4
  102. package/MutableQueue/dist/effect-MutableQueue.cjs.dev.js +3 -3
  103. package/MutableQueue/dist/effect-MutableQueue.cjs.prod.js +3 -3
  104. package/Number/dist/effect-Number.cjs.dev.js +1 -1
  105. package/Number/dist/effect-Number.cjs.prod.js +1 -1
  106. package/Number/dist/effect-Number.esm.js +1 -1
  107. package/Option/dist/effect-Option.cjs.dev.js +9 -9
  108. package/Option/dist/effect-Option.cjs.prod.js +9 -9
  109. package/Pool/dist/effect-Pool.cjs.dev.js +29 -29
  110. package/Pool/dist/effect-Pool.cjs.prod.js +29 -29
  111. package/PubSub/dist/effect-PubSub.cjs.dev.js +26 -26
  112. package/PubSub/dist/effect-PubSub.cjs.prod.js +26 -26
  113. package/Queue/dist/effect-Queue.cjs.dev.js +26 -26
  114. package/Queue/dist/effect-Queue.cjs.prod.js +26 -26
  115. package/README.md +5 -5
  116. package/Random/dist/effect-Random.cjs.dev.js +16 -16
  117. package/Random/dist/effect-Random.cjs.prod.js +16 -16
  118. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.dev.js +3 -3
  119. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.prod.js +3 -3
  120. package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.dev.js +3 -3
  121. package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.prod.js +3 -3
  122. package/RedBlackTree/dist/effect-RedBlackTree.cjs.dev.js +4 -4
  123. package/RedBlackTree/dist/effect-RedBlackTree.cjs.prod.js +4 -4
  124. package/Ref/dist/effect-Ref.cjs.dev.js +9 -9
  125. package/Ref/dist/effect-Ref.cjs.prod.js +9 -9
  126. package/Reloadable/dist/effect-Reloadable.cjs.dev.js +34 -34
  127. package/Reloadable/dist/effect-Reloadable.cjs.prod.js +34 -34
  128. package/Request/dist/effect-Request.cjs.dev.js +26 -26
  129. package/Request/dist/effect-Request.cjs.prod.js +26 -26
  130. package/RequestBlock/dist/effect-RequestBlock.cjs.dev.js +34 -34
  131. package/RequestBlock/dist/effect-RequestBlock.cjs.prod.js +34 -34
  132. package/RequestResolver/dist/effect-RequestResolver.cjs.dev.js +36 -36
  133. package/RequestResolver/dist/effect-RequestResolver.cjs.prod.js +36 -36
  134. package/Resource/dist/effect-Resource.cjs.dev.js +29 -29
  135. package/Resource/dist/effect-Resource.cjs.prod.js +29 -29
  136. package/Runtime/dist/effect-Runtime.cjs.dev.js +32 -32
  137. package/Runtime/dist/effect-Runtime.cjs.prod.js +32 -32
  138. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.dev.js +31 -31
  139. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.prod.js +31 -31
  140. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.dev.js +6 -6
  141. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.prod.js +6 -6
  142. package/STM/dist/effect-STM.cjs.dev.js +45 -45
  143. package/STM/dist/effect-STM.cjs.prod.js +45 -45
  144. package/Schedule/dist/effect-Schedule.cjs.dev.js +19 -19
  145. package/Schedule/dist/effect-Schedule.cjs.prod.js +19 -19
  146. package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.dev.js +3 -3
  147. package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.prod.js +3 -3
  148. package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.dev.js +3 -3
  149. package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.prod.js +3 -3
  150. package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.dev.js +3 -3
  151. package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.prod.js +3 -3
  152. package/Scheduler/dist/effect-Scheduler.cjs.dev.js +8 -8
  153. package/Scheduler/dist/effect-Scheduler.cjs.prod.js +8 -8
  154. package/Scope/dist/effect-Scope.cjs.dev.js +25 -25
  155. package/Scope/dist/effect-Scope.cjs.prod.js +25 -25
  156. package/ScopedCache/dist/effect-ScopedCache.cjs.dev.js +57 -40
  157. package/ScopedCache/dist/effect-ScopedCache.cjs.prod.js +57 -40
  158. package/ScopedRef/dist/effect-ScopedRef.cjs.dev.js +32 -32
  159. package/ScopedRef/dist/effect-ScopedRef.cjs.prod.js +32 -32
  160. package/Sink/dist/effect-Sink.cjs.dev.js +36 -36
  161. package/Sink/dist/effect-Sink.cjs.prod.js +36 -36
  162. package/SortedMap/dist/effect-SortedMap.cjs.dev.js +3 -3
  163. package/SortedMap/dist/effect-SortedMap.cjs.prod.js +3 -3
  164. package/SortedSet/dist/effect-SortedSet.cjs.dev.js +3 -3
  165. package/SortedSet/dist/effect-SortedSet.cjs.prod.js +3 -3
  166. package/Stream/dist/effect-Stream.cjs.dev.js +39 -39
  167. package/Stream/dist/effect-Stream.cjs.prod.js +39 -39
  168. package/Streamable/dist/effect-Streamable.cjs.dev.js +39 -39
  169. package/Streamable/dist/effect-Streamable.cjs.prod.js +39 -39
  170. package/String/dist/effect-String.cjs.dev.js +4 -4
  171. package/String/dist/effect-String.cjs.prod.js +4 -4
  172. package/String/dist/effect-String.esm.js +1 -1
  173. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.dev.js +39 -39
  174. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.prod.js +39 -39
  175. package/Supervisor/dist/effect-Supervisor.cjs.dev.js +31 -31
  176. package/Supervisor/dist/effect-Supervisor.cjs.prod.js +31 -31
  177. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.dev.js +28 -28
  178. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.prod.js +28 -28
  179. package/TArray/dist/effect-TArray.cjs.dev.js +43 -43
  180. package/TArray/dist/effect-TArray.cjs.prod.js +43 -43
  181. package/TDeferred/dist/effect-TDeferred.cjs.dev.js +42 -42
  182. package/TDeferred/dist/effect-TDeferred.cjs.prod.js +42 -42
  183. package/TMap/dist/effect-TMap.cjs.dev.js +44 -44
  184. package/TMap/dist/effect-TMap.cjs.prod.js +44 -44
  185. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.dev.js +41 -41
  186. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.prod.js +41 -41
  187. package/TPubSub/dist/effect-TPubSub.cjs.dev.js +45 -45
  188. package/TPubSub/dist/effect-TPubSub.cjs.prod.js +45 -45
  189. package/TQueue/dist/effect-TQueue.cjs.dev.js +43 -43
  190. package/TQueue/dist/effect-TQueue.cjs.prod.js +43 -43
  191. package/TRandom/dist/effect-TRandom.cjs.dev.js +47 -47
  192. package/TRandom/dist/effect-TRandom.cjs.prod.js +47 -47
  193. package/TReentrantLock/dist/effect-TReentrantLock.cjs.dev.js +43 -43
  194. package/TReentrantLock/dist/effect-TReentrantLock.cjs.prod.js +43 -43
  195. package/TRef/dist/effect-TRef.cjs.dev.js +41 -41
  196. package/TRef/dist/effect-TRef.cjs.prod.js +41 -41
  197. package/TSemaphore/dist/effect-TSemaphore.cjs.dev.js +42 -42
  198. package/TSemaphore/dist/effect-TSemaphore.cjs.prod.js +42 -42
  199. package/TSet/dist/effect-TSet.cjs.dev.js +44 -44
  200. package/TSet/dist/effect-TSet.cjs.prod.js +44 -44
  201. package/Take/dist/effect-Take.cjs.dev.js +34 -34
  202. package/Take/dist/effect-Take.cjs.prod.js +34 -34
  203. package/TestAnnotation/dist/effect-TestAnnotation.cjs.dev.js +8 -8
  204. package/TestAnnotation/dist/effect-TestAnnotation.cjs.prod.js +8 -8
  205. package/TestAnnotations/dist/effect-TestAnnotations.cjs.dev.js +22 -22
  206. package/TestAnnotations/dist/effect-TestAnnotations.cjs.prod.js +22 -22
  207. package/TestClock/dist/effect-TestClock.cjs.dev.js +30 -30
  208. package/TestClock/dist/effect-TestClock.cjs.prod.js +30 -30
  209. package/TestConfig/dist/effect-TestConfig.cjs.dev.js +3 -8
  210. package/TestConfig/dist/effect-TestConfig.cjs.prod.js +3 -8
  211. package/TestContext/dist/effect-TestContext.cjs.dev.js +35 -35
  212. package/TestContext/dist/effect-TestContext.cjs.prod.js +35 -35
  213. package/TestLive/dist/effect-TestLive.cjs.dev.js +17 -17
  214. package/TestLive/dist/effect-TestLive.cjs.prod.js +17 -17
  215. package/TestServices/dist/effect-TestServices.cjs.dev.js +36 -36
  216. package/TestServices/dist/effect-TestServices.cjs.prod.js +36 -36
  217. package/TestSized/dist/effect-TestSized.cjs.dev.js +11 -11
  218. package/TestSized/dist/effect-TestSized.cjs.prod.js +11 -11
  219. package/Tracer/dist/effect-Tracer.cjs.dev.js +16 -16
  220. package/Tracer/dist/effect-Tracer.cjs.prod.js +16 -16
  221. package/dist/{Context-0b0d0e29.cjs.prod.js → Context-9fe5eb16.cjs.prod.js} +4 -4
  222. package/dist/{Context-1f857844.cjs.dev.js → Context-da73ddfa.cjs.dev.js} +4 -4
  223. package/dist/{Effectable-07258ce9.cjs.dev.js → Effectable-7314aed8.cjs.dev.js} +53 -2
  224. package/dist/{Effectable-c2cd2b50.cjs.prod.js → Effectable-c4c14a2b.cjs.prod.js} +53 -2
  225. package/dist/{Either-a974e241.cjs.prod.js → Either-d43f082c.cjs.prod.js} +5 -78
  226. package/dist/{Either-d49a9926.cjs.dev.js → Either-fa0ef1d9.cjs.dev.js} +5 -78
  227. package/dist/Option-463b42e6.cjs.dev.js +81 -0
  228. package/dist/Option-935e5d7c.cjs.prod.js +81 -0
  229. package/dist/{Ref-590d873e.cjs.prod.js → Ref-4014b526.cjs.prod.js} +1 -1
  230. package/dist/{Ref-4009db78.cjs.dev.js → Ref-acdee7ef.cjs.dev.js} +1 -1
  231. package/dist/{cache-8a5a4a2d.cjs.prod.js → cache-5c7d77e4.cjs.prod.js} +8 -8
  232. package/dist/{cache-fe0cd2f2.cjs.dev.js → cache-7eed9d33.cjs.dev.js} +8 -8
  233. package/dist/{circular-ccfbed47.cjs.prod.js → circular-1f481ffb.cjs.prod.js} +7 -7
  234. package/dist/{circular-2d1d95bc.cjs.prod.js → circular-9e10a5a7.cjs.prod.js} +4 -4
  235. package/dist/{circular-95bf2834.cjs.dev.js → circular-c2dbce1a.cjs.dev.js} +7 -7
  236. package/dist/{circular-325c6904.cjs.dev.js → circular-c8b65bdb.cjs.dev.js} +4 -4
  237. package/dist/{config-e4643c63.cjs.dev.js → config-3b7935a3.cjs.dev.js} +3 -3
  238. package/dist/{config-a72429ce.cjs.prod.js → config-5ba54da1.cjs.prod.js} +3 -3
  239. package/dist/{configProvider-16bc7ff6.cjs.prod.js → configProvider-b6b20998.cjs.prod.js} +4 -4
  240. package/dist/{configProvider-3cdbe5f3.cjs.dev.js → configProvider-f34a82f1.cjs.dev.js} +4 -4
  241. package/dist/{core-c87f1ac0.cjs.prod.js → core-07202cc0.cjs.prod.js} +4 -19
  242. package/dist/{core-ce4f24fc.cjs.prod.js → core-84e608f0.cjs.prod.js} +3 -3
  243. package/dist/{core-efee9c5a.cjs.dev.js → core-b7401357.cjs.dev.js} +4 -19
  244. package/dist/{core-44c23eaf.cjs.dev.js → core-c01fd1d8.cjs.dev.js} +3 -3
  245. package/dist/{core-effect-f99b558c.cjs.dev.js → core-effect-1c564d42.cjs.dev.js} +8 -8
  246. package/dist/{core-effect-867f1514.cjs.prod.js → core-effect-9201ea63.cjs.prod.js} +8 -8
  247. package/dist/{dataSource-642004b6.cjs.dev.js → dataSource-b5eda714.cjs.dev.js} +2 -2
  248. package/dist/{dataSource-2fe48092.cjs.prod.js → dataSource-b83bc277.cjs.prod.js} +2 -2
  249. package/dist/declarations/src/Bigint.d.ts +92 -1
  250. package/dist/declarations/src/Bigint.d.ts.map +1 -1
  251. package/dist/declarations/src/Boolean.d.ts +1 -1
  252. package/dist/declarations/src/Data.d.ts +30 -0
  253. package/dist/declarations/src/Data.d.ts.map +1 -1
  254. package/dist/declarations/src/Number.d.ts +1 -1
  255. package/dist/declarations/src/Queue.d.ts +5 -0
  256. package/dist/declarations/src/Queue.d.ts.map +1 -1
  257. package/dist/declarations/src/String.d.ts +1 -1
  258. package/dist/declarations/src/index.d.ts +4 -8
  259. package/dist/declarations/src/index.d.ts.map +1 -1
  260. package/dist/{defaultServices-eb04fba1.cjs.dev.js → defaultServices-755d5b46.cjs.dev.js} +2 -2
  261. package/dist/{defaultServices-7e943cae.cjs.prod.js → defaultServices-9d7ce86f.cjs.prod.js} +2 -2
  262. package/dist/effect.cjs.dev.js +0 -3
  263. package/dist/effect.cjs.mjs +0 -1
  264. package/dist/effect.cjs.prod.js +0 -3
  265. package/dist/effect.esm.js +0 -2
  266. package/dist/{fiber-4d2acba3.cjs.dev.js → fiber-5156eff2.cjs.dev.js} +3 -3
  267. package/dist/{fiber-588d28c2.cjs.prod.js → fiber-9519d109.cjs.prod.js} +3 -3
  268. package/dist/{fiberRefs-51f2a630.cjs.prod.js → fiberRefs-558c17e6.cjs.prod.js} +1 -1
  269. package/dist/{fiberRefs-e08092fb.cjs.dev.js → fiberRefs-98b71233.cjs.dev.js} +1 -1
  270. package/dist/{fiberRuntime-7287c284.cjs.prod.js → fiberRuntime-31ae011f.cjs.prod.js} +17 -18
  271. package/dist/{fiberRuntime-6e93adff.cjs.dev.js → fiberRuntime-d3872282.cjs.dev.js} +17 -18
  272. package/dist/{groupBy-6d5815f3.cjs.prod.js → groupBy-5fb5d639.cjs.prod.js} +4 -4
  273. package/dist/{groupBy-1e05ffd4.cjs.dev.js → groupBy-70c6dc0d.cjs.dev.js} +4 -4
  274. package/dist/{key-6d9b350e.cjs.dev.js → key-198b6670.cjs.dev.js} +1 -1
  275. package/dist/{key-66f61406.cjs.prod.js → key-eb8a12b2.cjs.prod.js} +1 -1
  276. package/dist/{layer-e3745d23.cjs.dev.js → layer-29574350.cjs.dev.js} +10 -10
  277. package/dist/{layer-f8cd3f83.cjs.prod.js → layer-51ff4846.cjs.prod.js} +10 -10
  278. package/dist/{patch-b051ae7e.cjs.dev.js → patch-0220a642.cjs.dev.js} +1 -1
  279. package/dist/{patch-b8d22fb3.cjs.prod.js → patch-7c559bb2.cjs.prod.js} +1 -1
  280. package/dist/{pathPatch-bdcb0e3f.cjs.prod.js → pathPatch-b56a4da2.cjs.prod.js} +1 -1
  281. package/dist/{pathPatch-fc0ba157.cjs.dev.js → pathPatch-fab016f1.cjs.dev.js} +1 -1
  282. package/dist/{pool-6c034854.cjs.prod.js → pool-042cc42b.cjs.prod.js} +5 -5
  283. package/dist/{pool-a52582b9.cjs.dev.js → pool-59df8b4d.cjs.dev.js} +5 -5
  284. package/dist/{query-59d346d8.cjs.prod.js → query-a52b25f0.cjs.prod.js} +3 -3
  285. package/dist/{query-ab3d963c.cjs.dev.js → query-c36decd5.cjs.dev.js} +3 -3
  286. package/dist/{queue-fcd6126f.cjs.prod.js → queue-425b92f6.cjs.prod.js} +23 -13
  287. package/dist/{queue-50c41726.cjs.dev.js → queue-e4c59627.cjs.dev.js} +23 -13
  288. package/dist/{registry-fc4cef7b.cjs.dev.js → registry-62ff192e.cjs.dev.js} +2 -2
  289. package/dist/{registry-3809a602.cjs.prod.js → registry-d5258dff.cjs.prod.js} +2 -2
  290. package/dist/{runtime-aa083fe4.cjs.prod.js → runtime-005f8a9b.cjs.prod.js} +6 -6
  291. package/dist/{runtime-9047860e.cjs.dev.js → runtime-57c8ddf8.cjs.dev.js} +6 -6
  292. package/dist/{schedule-4ca6941d.cjs.prod.js → schedule-8cdf6bf1.cjs.prod.js} +3 -3
  293. package/dist/{schedule-fd323904.cjs.dev.js → schedule-e7a9f93f.cjs.dev.js} +3 -3
  294. package/dist/{scopedRef-0fc8943d.cjs.prod.js → scopedRef-789d7fef.cjs.prod.js} +6 -6
  295. package/dist/{scopedRef-dc386056.cjs.dev.js → scopedRef-eb19c7a6.cjs.dev.js} +6 -6
  296. package/dist/{singleProducerAsyncInput-54b43c1b.cjs.dev.js → singleProducerAsyncInput-9ff8389b.cjs.dev.js} +1 -1
  297. package/dist/{singleProducerAsyncInput-61ffe143.cjs.prod.js → singleProducerAsyncInput-f9b258b1.cjs.prod.js} +1 -1
  298. package/dist/{sink-0445fb11.cjs.dev.js → sink-17e02d40.cjs.dev.js} +2 -2
  299. package/dist/{sink-ade4fdbe.cjs.prod.js → sink-b2fcb569.cjs.prod.js} +2 -2
  300. package/dist/{stm-e9d8effb.cjs.dev.js → stm-5264610b.cjs.dev.js} +3 -3
  301. package/dist/{stm-8d082310.cjs.prod.js → stm-9dd6be88.cjs.prod.js} +3 -3
  302. package/dist/{stream-e220a3b2.cjs.dev.js → stream-5e2ed3a9.cjs.dev.js} +4 -4
  303. package/dist/{stream-97061dd9.cjs.prod.js → stream-c9c522f2.cjs.prod.js} +4 -4
  304. package/dist/{synchronizedRef-1f28b27f.cjs.dev.js → synchronizedRef-a12fd967.cjs.dev.js} +1 -1
  305. package/dist/{synchronizedRef-ff0ddebf.cjs.prod.js → synchronizedRef-ed8aa6ac.cjs.prod.js} +1 -1
  306. package/dist/{tArray-59a819a0.cjs.dev.js → tArray-77a2ae3c.cjs.dev.js} +3 -3
  307. package/dist/{tArray-437f6510.cjs.prod.js → tArray-cac66af4.cjs.prod.js} +3 -3
  308. package/dist/{tMap-ca06b00f.cjs.prod.js → tMap-5ac8ec9c.cjs.prod.js} +4 -4
  309. package/dist/{tMap-d6376d13.cjs.dev.js → tMap-73bbf062.cjs.dev.js} +4 -4
  310. package/dist/{tQueue-7b931af8.cjs.dev.js → tQueue-2b1cd0c4.cjs.dev.js} +3 -3
  311. package/dist/{tQueue-bf3716af.cjs.prod.js → tQueue-dded9b2d.cjs.prod.js} +3 -3
  312. package/dist/{tRef-bb143111.cjs.prod.js → tRef-73c3549e.cjs.prod.js} +1 -1
  313. package/dist/{tRef-5b159626.cjs.dev.js → tRef-90f0872b.cjs.dev.js} +1 -1
  314. package/internal/Context.esm.js +2 -2
  315. package/internal/Data.esm.js +4 -1
  316. package/internal/Differ/ChunkPatch.esm.js +1 -1
  317. package/internal/Differ/ContextPatch.esm.js +1 -1
  318. package/internal/Differ/HashMapPatch.esm.js +1 -1
  319. package/internal/Differ/HashSetPatch.esm.js +1 -1
  320. package/internal/Differ/OrPatch.esm.js +1 -1
  321. package/internal/Effectable.esm.js +1 -1
  322. package/internal/cache.esm.js +1 -1
  323. package/internal/cause.esm.js +1 -16
  324. package/internal/core-effect.esm.js +3 -3
  325. package/internal/fiberRuntime.esm.js +3 -3
  326. package/internal/layer.esm.js +1 -1
  327. package/internal/queue.esm.js +24 -14
  328. package/internal/request.esm.js +1 -1
  329. package/package.json +5 -9
  330. package/src/Bigint.ts +117 -1
  331. package/src/Boolean.ts +1 -1
  332. package/src/Data.ts +74 -2
  333. package/src/Number.ts +1 -1
  334. package/src/Queue.ts +8 -0
  335. package/src/String.ts +1 -1
  336. package/src/index.ts +4 -9
  337. package/src/internal/Context.ts +2 -2
  338. package/src/internal/Data.ts +4 -0
  339. package/src/internal/Differ/ChunkPatch.ts +1 -1
  340. package/src/internal/Differ/ContextPatch.ts +1 -1
  341. package/src/internal/Differ/HashMapPatch.ts +1 -1
  342. package/src/internal/Differ/HashSetPatch.ts +1 -1
  343. package/src/internal/Differ/OrPatch.ts +1 -1
  344. package/src/internal/Effectable.ts +1 -1
  345. package/src/internal/cache.ts +1 -1
  346. package/src/internal/cause.ts +1 -16
  347. package/src/internal/core-effect.ts +2 -2
  348. package/src/internal/fiberRuntime.ts +2 -2
  349. package/src/internal/layer.ts +1 -1
  350. package/src/internal/queue.ts +26 -11
  351. package/src/internal/request.ts +1 -1
  352. package/Error/dist/effect-Error.cjs.d.mts +0 -2
  353. package/Error/dist/effect-Error.cjs.d.mts.map +0 -1
  354. package/Error/dist/effect-Error.cjs.d.ts +0 -2
  355. package/Error/dist/effect-Error.cjs.d.ts.map +0 -1
  356. package/Error/dist/effect-Error.cjs.dev.js +0 -140
  357. package/Error/dist/effect-Error.cjs.js +0 -7
  358. package/Error/dist/effect-Error.cjs.mjs +0 -4
  359. package/Error/dist/effect-Error.cjs.prod.js +0 -140
  360. package/Error/dist/effect-Error.esm.js +0 -47
  361. package/Error/package.json +0 -4
  362. package/dist/declarations/src/Error.d.ts +0 -37
  363. package/dist/declarations/src/Error.d.ts.map +0 -1
  364. package/src/Error.ts +0 -69
  365. /package/dist/{FiberId-fd1b9201.cjs.prod.js → FiberId-1d7ac632.cjs.prod.js} +0 -0
  366. /package/dist/{FiberId-9c555b91.cjs.dev.js → FiberId-d88ddce6.cjs.dev.js} +0 -0
  367. /package/dist/{HashSet-606682d1.cjs.dev.js → HashSet-5963ad6b.cjs.dev.js} +0 -0
  368. /package/dist/{HashSet-0ffa0e48.cjs.prod.js → HashSet-ac02a3e1.cjs.prod.js} +0 -0
  369. /package/dist/{RuntimeFlagsPatch-197be4f3.cjs.dev.js → RuntimeFlagsPatch-69102b03.cjs.dev.js} +0 -0
  370. /package/dist/{RuntimeFlagsPatch-7f853fa5.cjs.prod.js → RuntimeFlagsPatch-866fa259.cjs.prod.js} +0 -0
  371. /package/dist/{boundaries-73dd633f.cjs.prod.js → boundaries-9af538e3.cjs.prod.js} +0 -0
  372. /package/dist/{boundaries-60c435b8.cjs.dev.js → boundaries-f212e414.cjs.dev.js} +0 -0
  373. /package/dist/{configError-d2914327.cjs.prod.js → configError-b43723af.cjs.prod.js} +0 -0
  374. /package/dist/{configError-623ccb8d.cjs.dev.js → configError-d5efe9c0.cjs.dev.js} +0 -0
  375. /package/dist/{configSecret-baa8839f.cjs.dev.js → configSecret-3e8ae336.cjs.dev.js} +0 -0
  376. /package/dist/{configSecret-c08c317d.cjs.prod.js → configSecret-e2faa181.cjs.prod.js} +0 -0
  377. /package/dist/{hook-f9a9b660.cjs.dev.js → hook-8cefc909.cjs.dev.js} +0 -0
  378. /package/dist/{hook-39ebe8b3.cjs.prod.js → hook-98ce30e4.cjs.prod.js} +0 -0
  379. /package/dist/{keyType-8ff33fde.cjs.prod.js → keyType-0c5e6178.cjs.prod.js} +0 -0
  380. /package/dist/{keyType-22634b88.cjs.dev.js → keyType-7c164b82.cjs.dev.js} +0 -0
  381. /package/dist/{take-c7b73760.cjs.prod.js → take-85daaf79.cjs.prod.js} +0 -0
  382. /package/dist/{take-05b33c5b.cjs.dev.js → take-f9ef9e2e.cjs.dev.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { head, prepend, filter, isEmpty as isEmpty$1, fromIterable as fromIterable$1, appendAll, append, empty as empty$1 } from '../Chunk/dist/effect-Chunk.esm.js';
1
+ import { head, prepend, filter, isEmpty as isEmpty$2, fromIterable as fromIterable$1, appendAll, append, empty as empty$1 } from '../Chunk/dist/effect-Chunk.esm.js';
2
2
  import { pipe, dual } from '../Function/dist/effect-Function.esm.js';
3
3
  import { flatMap, sync, map, deferredMake, fiberId, withFiberRuntime, unit, succeed, deferredUnsafeDone, deferredInterruptWith, asUnit, deferredUnsafeMake, onInterrupt, suspend, interrupt, deferredAwait, catchAll, uninterruptible, whenEffect, deferredSucceed, zipRight } from './core.esm.js';
4
4
  import { forEachParUnboundedDiscard } from './fiberRuntime.esm.js';
5
- import { bounded as bounded$1, unbounded as unbounded$1, length, poll as poll$1, EmptyMutableQueue, offer as offer$1, offerAll as offerAll$1, pollUpTo, capacity as capacity$1 } from '../MutableQueue/dist/effect-MutableQueue.esm.js';
5
+ import { bounded as bounded$1, unbounded as unbounded$1, length, isEmpty as isEmpty$1, poll as poll$1, EmptyMutableQueue, offer as offer$1, offerAll as offerAll$1, pollUpTo, capacity as capacity$1 } from '../MutableQueue/dist/effect-MutableQueue.esm.js';
6
6
  import { make as make$1, get, set } from '../MutableRef/dist/effect-MutableRef.esm.js';
7
7
  import { none, some } from '../Option/dist/effect-Option.esm.js';
8
8
  import { pipeArguments } from '../Pipeable/dist/effect-Pipeable.esm.js';
@@ -162,7 +162,7 @@ class QueueImpl {
162
162
  // Not enough takers, offer to the queue
163
163
  const surplus = this.queue.offerAll(remaining);
164
164
  unsafeCompleteTakers(this.strategy, this.queue, this.takers);
165
- return isEmpty$1(surplus) ? succeed(true) : this.strategy.handleSurplus(surplus, this.queue, this.takers, this.shutdownFlag);
165
+ return isEmpty$2(surplus) ? succeed(true) : this.strategy.handleSurplus(surplus, this.queue, this.takers, this.shutdownFlag);
166
166
  });
167
167
  }
168
168
  take() {
@@ -353,6 +353,16 @@ class BackPressureStrategy {
353
353
  surplusSize() {
354
354
  return length(this.putters);
355
355
  }
356
+ onCompleteTakersWithEmptyQueue(takers) {
357
+ while (!isEmpty$1(this.putters) && !isEmpty$1(takers)) {
358
+ const taker = poll$1(takers, void 0);
359
+ const putter = poll$1(this.putters, void 0);
360
+ if (putter[2]) {
361
+ unsafeCompleteDeferred(putter[1], true);
362
+ }
363
+ unsafeCompleteDeferred(taker, putter[0]);
364
+ }
365
+ }
356
366
  shutdown() {
357
367
  return pipe(fiberId, flatMap(fiberId => pipe(sync(() => unsafePollAll(this.putters)), flatMap(putters => forEachParUnboundedDiscard(putters, ([_, deferred, isLastItem]) => isLastItem ? pipe(deferredInterruptWith(deferred, fiberId), asUnit) : unit, false)))));
358
368
  }
@@ -385,17 +395,12 @@ class BackPressureStrategy {
385
395
  }
386
396
  }
387
397
  unsafeOffer(iterable, deferred) {
388
- const iterator = iterable[Symbol.iterator]();
389
- let next = iterator.next();
390
- if (!next.done) {
391
- // eslint-disable-next-line no-constant-condition
392
- while (1) {
393
- const value = next.value;
394
- next = iterator.next();
395
- if (next.done) {
396
- pipe(this.putters, offer$1([value, deferred, true]));
397
- break;
398
- }
398
+ const stuff = Array.from(iterable);
399
+ for (let i = 0; i < stuff.length; i++) {
400
+ const value = stuff[i];
401
+ if (i === stuff.length - 1) {
402
+ pipe(this.putters, offer$1([value, deferred, true]));
403
+ } else {
399
404
  pipe(this.putters, offer$1([value, deferred, false]));
400
405
  }
401
406
  }
@@ -414,6 +419,7 @@ class DroppingStrategy {
414
419
  shutdown() {
415
420
  return unit;
416
421
  }
422
+ onCompleteTakersWithEmptyQueue() {}
417
423
  handleSurplus(_iterable, _queue, _takers, _isShutdown) {
418
424
  return succeed(false);
419
425
  }
@@ -431,6 +437,7 @@ class SlidingStrategy {
431
437
  shutdown() {
432
438
  return unit;
433
439
  }
440
+ onCompleteTakersWithEmptyQueue() {}
434
441
  handleSurplus(iterable, queue, takers, _isShutdown) {
435
442
  return sync(() => {
436
443
  this.unsafeOffer(queue, iterable);
@@ -500,6 +507,9 @@ const unsafeCompleteTakers = (strategy, queue, takers) => {
500
507
  keepPolling = false;
501
508
  }
502
509
  }
510
+ if (keepPolling && queue.length() === 0 && !isEmpty$1(takers)) {
511
+ strategy.onCompleteTakersWithEmptyQueue(takers);
512
+ }
503
513
  };
504
514
 
505
515
  export { BackingQueueFromMutableQueue, DequeueTypeId, EnqueueTypeId, QueueStrategyTypeId, awaitShutdown, backPressureStrategy, backingQueueFromMutableQueue, bounded, capacity, dequeueVariance, dropping, droppingStrategy, enqueueVariance, isDequeue, isEmpty, isEnqueue, isFull, isQueue, isShutdown, make, offer, offerAll, poll, shutdown, size, sliding, slidingStrategy, take, takeAll, takeBetween, takeN, takeUpTo, unbounded, unsafeCompleteTakers, unsafeOffer, unsafeRemove };
@@ -1,7 +1,7 @@
1
- import { struct } from '../Data/dist/effect-Data.esm.js';
2
1
  import { dual } from '../Function/dist/effect-Function.esm.js';
3
2
  import { currentRequestMap } from './completedRequestMap.esm.js';
4
3
  import { fiberRefGetWith, sync, deferredUnsafeDone, matchEffect, exitFail, exitSucceed } from './core.esm.js';
4
+ import { struct } from './Data.esm.js';
5
5
 
6
6
  /** @internal */
7
7
  const RequestSymbolKey = "effect/Request";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect",
3
- "version": "2.0.0-next.45",
3
+ "version": "2.0.0-next.47",
4
4
  "packageManager": "pnpm@8.7.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -67,7 +67,6 @@
67
67
  "Encoding",
68
68
  "Equal",
69
69
  "Equivalence",
70
- "Error",
71
70
  "ExecutionStrategy",
72
71
  "Exit",
73
72
  "Fiber",
@@ -385,12 +384,6 @@
385
384
  "import": "./Equivalence/dist/effect-Equivalence.cjs.mjs",
386
385
  "default": "./Equivalence/dist/effect-Equivalence.cjs.js"
387
386
  },
388
- "./Error": {
389
- "types": "./dist/declarations/src/Error.d.ts",
390
- "module": "./Error/dist/effect-Error.esm.js",
391
- "import": "./Error/dist/effect-Error.cjs.mjs",
392
- "default": "./Error/dist/effect-Error.cjs.js"
393
- },
394
387
  "./ExecutionStrategy": {
395
388
  "types": "./dist/declarations/src/ExecutionStrategy.d.ts",
396
389
  "module": "./ExecutionStrategy/dist/effect-ExecutionStrategy.esm.js",
@@ -1055,6 +1048,7 @@
1055
1048
  "@babel/preset-typescript": "^7.23.0",
1056
1049
  "@changesets/changelog-github": "^0.4.8",
1057
1050
  "@changesets/cli": "^2.26.2",
1051
+ "@definitelytyped/dtslint": "^0.0.182",
1058
1052
  "@effect/build-utils": "^0.1.5",
1059
1053
  "@effect/docgen": "^0.1.8",
1060
1054
  "@effect/eslint-plugin": "^0.1.2",
@@ -1066,6 +1060,7 @@
1066
1060
  "@typescript-eslint/parser": "^6.7.4",
1067
1061
  "@vitejs/plugin-react": "^4.1.0",
1068
1062
  "@vitest/coverage-v8": "^0.34.6",
1063
+ "@vitest/expect": "^0.34.6",
1069
1064
  "babel-plugin-annotate-pure-calls": "^0.4.0",
1070
1065
  "eslint": "^8.50.0",
1071
1066
  "eslint-import-resolver-typescript": "^3.6.1",
@@ -1093,6 +1088,7 @@
1093
1088
  "update-version": "changeset version && pnpm install --no-frozen-lockfile",
1094
1089
  "lint": "eslint src test",
1095
1090
  "fix": "preconstruct fix",
1096
- "docgen": "docgen"
1091
+ "docgen": "docgen",
1092
+ "dtslint": "dtslint --expectOnly dtslint"
1097
1093
  }
1098
1094
  }
package/src/Bigint.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * This module provides utility functions and type class instances for working with the `bigint` type in TypeScript.
3
3
  * It includes functions for basic arithmetic operations, as well as type class instances for
4
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
4
+ * `Equivalence` and `Order`.
5
5
  *
6
6
  * @since 2.0.0
7
7
  */
8
8
 
9
9
  import * as equivalence from "./Equivalence"
10
10
  import { dual } from "./Function"
11
+ import * as Option from "./Option"
11
12
  import * as order from "./Order"
12
13
  import type { Ordering } from "./Ordering"
13
14
  import * as predicate from "./Predicate"
@@ -335,6 +336,121 @@ export const max: {
335
336
  */
336
337
  export const sign = (n: bigint): Ordering => Order(n, 0n)
337
338
 
339
+ /**
340
+ * Determines the absolute value of a given `bigint`.
341
+ *
342
+ * @param n - The `bigint` to determine the absolute value of.
343
+ *
344
+ * @example
345
+ * import { abs } from 'effect/Bigint'
346
+ *
347
+ * assert.deepStrictEqual(abs(-5n), 5n)
348
+ * assert.deepStrictEqual(abs(0n), 0n)
349
+ * assert.deepStrictEqual(abs(5n), 5n)
350
+ *
351
+ * @category math
352
+ * @since 2.0.0
353
+ */
354
+ export const abs = (n: bigint): bigint => (n < 0n ? -n : n)
355
+
356
+ /**
357
+ * Determines the greatest common divisor of two `bigint`s.
358
+ *
359
+ * @param a - The first `bigint`.
360
+ * @param b - The second `bigint`.
361
+ *
362
+ * @example
363
+ * import { gcd } from 'effect/Bigint'
364
+ *
365
+ * assert.deepStrictEqual(gcd(2n, 3n), 1n)
366
+ * assert.deepStrictEqual(gcd(2n, 4n), 2n)
367
+ * assert.deepStrictEqual(gcd(16n, 24n), 8n)
368
+ *
369
+ * @category math
370
+ * @since 2.0.0
371
+ */
372
+ export const gcd: {
373
+ (that: bigint): (self: bigint) => bigint
374
+ (self: bigint, that: bigint): bigint
375
+ } = dual(2, (self: bigint, that: bigint): bigint => {
376
+ while (that !== 0n) {
377
+ const t = that
378
+ that = self % that
379
+ self = t
380
+ }
381
+ return self
382
+ })
383
+
384
+ /**
385
+ * Determines the least common multiple of two `bigint`s.
386
+ *
387
+ * @param a - The first `bigint`.
388
+ * @param b - The second `bigint`.
389
+ *
390
+ * @example
391
+ * import { lcm } from 'effect/Bigint'
392
+ *
393
+ * assert.deepStrictEqual(lcm(2n, 3n), 6n)
394
+ * assert.deepStrictEqual(lcm(2n, 4n), 4n)
395
+ * assert.deepStrictEqual(lcm(16n, 24n), 48n)
396
+ *
397
+ * @category math
398
+ * @since 2.0.0
399
+ */
400
+ export const lcm: {
401
+ (that: bigint): (self: bigint) => bigint
402
+ (self: bigint, that: bigint): bigint
403
+ } = dual(2, (self: bigint, that: bigint): bigint => (self * that) / gcd(self, that))
404
+
405
+ /**
406
+ * Determines the square root of a given `bigint` unsafely. Throws if the given `bigint` is negative.
407
+ *
408
+ * @param n - The `bigint` to determine the square root of.
409
+ *
410
+ * @example
411
+ * import { unsafeSqrt } from 'effect/Bigint'
412
+ *
413
+ * assert.deepStrictEqual(unsafeSqrt(4n), 2n)
414
+ * assert.deepStrictEqual(unsafeSqrt(9n), 3n)
415
+ * assert.deepStrictEqual(unsafeSqrt(16n), 4n)
416
+ *
417
+ * @category math
418
+ * @since 2.0.0
419
+ */
420
+ export const unsafeSqrt = (n: bigint): bigint => {
421
+ if (n < 0n) {
422
+ throw new RangeError("Cannot take the square root of a negative number")
423
+ }
424
+ if (n < 2n) {
425
+ return n
426
+ }
427
+ let x = n / 2n
428
+ while (x * x > n) {
429
+ x = ((n / x) + x) / 2n
430
+ }
431
+ return x
432
+ }
433
+
434
+ /**
435
+ * Determines the square root of a given `bigint` safely. Returns `none` if the given `bigint` is negative.
436
+ *
437
+ * @param n - The `bigint` to determine the square root of.
438
+ *
439
+ * @example
440
+ * import { sqrt } from 'effect/Bigint'
441
+ * import * as Option from 'effect/Option'
442
+ *
443
+ * assert.deepStrictEqual(sqrt(4n), Option.some(2n))
444
+ * assert.deepStrictEqual(sqrt(9n), Option.some(3n))
445
+ * assert.deepStrictEqual(sqrt(16n), Option.some(4n))
446
+ * assert.deepStrictEqual(sqrt(-1n), Option.none())
447
+ *
448
+ * @category math
449
+ * @since 2.0.0
450
+ */
451
+ export const sqrt = (n: bigint): Option.Option<bigint> =>
452
+ greaterThanOrEqualTo(n, 0n) ? Option.some(unsafeSqrt(n)) : Option.none<bigint>()
453
+
338
454
  /**
339
455
  * Takes an `Iterable` of `bigint`s and returns their sum as a single `bigint
340
456
  *
package/src/Boolean.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This module provides utility functions and type class instances for working with the `boolean` type in TypeScript.
3
3
  * It includes functions for basic boolean operations, as well as type class instances for
4
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
4
+ * `Equivalence` and `Order`.
5
5
  *
6
6
  * @since 2.0.0
7
7
  */
package/src/Data.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  /**
2
2
  * @since 2.0.0
3
3
  */
4
+ import type * as Channel from "./Channel"
5
+ import * as Effect from "./Effect"
6
+ import * as Effectable from "./Effectable"
4
7
  import type * as Equal from "./Equal"
8
+ import type * as Inspectable from "./Inspectable"
5
9
  import * as internal from "./internal/Data"
10
+ import { type Pipeable } from "./Pipeable"
11
+ import type * as Sink from "./Sink"
6
12
  import type * as Types from "./Types"
7
13
 
8
14
  /**
@@ -40,8 +46,7 @@ export declare namespace Case {
40
46
  * @category constructors
41
47
  * @since 2.0.0
42
48
  */
43
- export const struct = <As extends Readonly<Record<string, any>>>(as: As): Data<As> =>
44
- Object.assign(Object.create(internal.StructProto), as)
49
+ export const struct: <As extends Readonly<Record<string, any>>>(as: As) => Data<As> = internal.struct
45
50
 
46
51
  /**
47
52
  * @category constructors
@@ -293,3 +298,70 @@ export const taggedEnum: {
293
298
  tag: K
294
299
  ) => Case.Constructor<Extract<A, { readonly _tag: K }>, "_tag">
295
300
  } = () => tagged as any
301
+
302
+ /**
303
+ * @since 2.0.0
304
+ * @category models
305
+ */
306
+ export interface YieldableError extends Case, Pipeable, Inspectable.Inspectable {
307
+ readonly [Effectable.EffectTypeId]: Effect.Effect.VarianceStruct<never, this, never>
308
+ readonly [Effectable.StreamTypeId]: Effect.Effect.VarianceStruct<never, this, never>
309
+ readonly [Effectable.SinkTypeId]: Sink.Sink.VarianceStruct<never, this, unknown, never, never>
310
+ readonly [Effectable.ChannelTypeId]: Channel.Channel.VarianceStruct<
311
+ never,
312
+ unknown,
313
+ unknown,
314
+ unknown,
315
+ this,
316
+ never,
317
+ never
318
+ >
319
+ }
320
+
321
+ const YieldableErrorProto = Object.setPrototypeOf(
322
+ {
323
+ ...Effectable.StructuralCommitPrototype,
324
+ toString() {
325
+ return `${this.name}: ${this.message}`
326
+ },
327
+ get message() {
328
+ return JSON.stringify(this)
329
+ },
330
+ commit() {
331
+ return Effect.fail(this)
332
+ }
333
+ },
334
+ globalThis.Error.prototype
335
+ )
336
+
337
+ /**
338
+ * Provides a constructor for a Case Class.
339
+ *
340
+ * @since 2.0.0
341
+ * @category constructors
342
+ */
343
+ export const Error: new<A extends Record<string, any>>(
344
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
345
+ ) => YieldableError & A = (function() {
346
+ function Base(this: any, args: any) {
347
+ if (args) {
348
+ Object.assign(this, args)
349
+ }
350
+ globalThis.Error.captureStackTrace(this, this.constructor)
351
+ }
352
+ Base.prototype = YieldableErrorProto
353
+ return Base as any
354
+ })()
355
+
356
+ /**
357
+ * @since 2.0.0
358
+ * @category constructors
359
+ */
360
+ export const TaggedError = <Tag extends string>(tag: Tag): new<A extends Record<string, any>>(
361
+ args: Types.Equals<Omit<A, keyof Equal.Equal>, {}> extends true ? void : Omit<A, keyof Equal.Equal>
362
+ ) => YieldableError & { readonly _tag: Tag } & A => {
363
+ class Base extends Error<{}> {
364
+ readonly _tag = tag
365
+ }
366
+ return Base as any
367
+ }
package/src/Number.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This module provides utility functions and type class instances for working with the `number` type in TypeScript.
3
3
  * It includes functions for basic arithmetic operations, as well as type class instances for
4
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
4
+ * `Equivalence` and `Order`.
5
5
  *
6
6
  * @since 2.0.0
7
7
  */
package/src/Queue.ts CHANGED
@@ -216,6 +216,14 @@ export interface Strategy<A> extends Queue.StrategyVariance<A> {
216
216
  isShutdown: MutableRef.MutableRef<boolean>
217
217
  ): Effect.Effect<never, never, boolean>
218
218
 
219
+ /**
220
+ * It is called when the backing queue is empty but there are some
221
+ * takers that can be completed
222
+ */
223
+ onCompleteTakersWithEmptyQueue(
224
+ takers: MutableQueue.MutableQueue<Deferred.Deferred<never, A>>
225
+ ): void
226
+
219
227
  /**
220
228
  * Determines the behavior of the `Queue.Strategy` when the `Queue` has empty
221
229
  * slots following a `take` operation.
package/src/String.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This module provides utility functions and type class instances for working with the `string` type in TypeScript.
3
3
  * It includes functions for basic string manipulation, as well as type class instances for
4
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
4
+ * `Equivalence` and `Order`.
5
5
  *
6
6
  * @since 2.0.0
7
7
  */
package/src/index.ts CHANGED
@@ -32,7 +32,7 @@ export {
32
32
  /**
33
33
  * This module provides utility functions and type class instances for working with the `bigint` type in TypeScript.
34
34
  * It includes functions for basic arithmetic operations, as well as type class instances for
35
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
35
+ * `Equivalence` and `Order`.
36
36
  *
37
37
  * @since 2.0.0
38
38
  */
@@ -41,7 +41,7 @@ export * as Bigint from "effect/Bigint"
41
41
  /**
42
42
  * This module provides utility functions and type class instances for working with the `boolean` type in TypeScript.
43
43
  * It includes functions for basic boolean operations, as well as type class instances for
44
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
44
+ * `Equivalence` and `Order`.
45
45
  *
46
46
  * @since 2.0.0
47
47
  */
@@ -253,11 +253,6 @@ export * as Equal from "effect/Equal"
253
253
  */
254
254
  export * as Equivalence from "effect/Equivalence"
255
255
 
256
- /**
257
- * @since 2.0.0
258
- */
259
- export * as Error from "effect/Error"
260
-
261
256
  /**
262
257
  * @since 2.0.0
263
258
  */
@@ -476,7 +471,7 @@ export * as NonEmptyIterable from "effect/NonEmptyIterable"
476
471
  /**
477
472
  * This module provides utility functions and type class instances for working with the `number` type in TypeScript.
478
473
  * It includes functions for basic arithmetic operations, as well as type class instances for
479
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
474
+ * `Equivalence` and `Order`.
480
475
  *
481
476
  * @since 2.0.0
482
477
  */
@@ -674,7 +669,7 @@ export * as Streamable from "effect/Streamable"
674
669
  /**
675
670
  * This module provides utility functions and type class instances for working with the `string` type in TypeScript.
676
671
  * It includes functions for basic string manipulation, as well as type class instances for
677
- * `Equivalence`, `Order`, `Semigroup`, and `Monoid`.
672
+ * `Equivalence` and `Order`.
678
673
  *
679
674
  * @since 2.0.0
680
675
  */
@@ -5,10 +5,10 @@ import { globalValue } from "../GlobalValue"
5
5
  import * as Hash from "../Hash"
6
6
  import { NodeInspectSymbol, toJSON, toString } from "../Inspectable"
7
7
  import type * as O from "../Option"
8
- import * as option from "../Option"
9
8
  import { pipeArguments } from "../Pipeable"
10
9
  import type * as STM from "../STM"
11
10
  import { EffectPrototype, effectVariance } from "./Effectable"
11
+ import * as option from "./Option"
12
12
 
13
13
  /** @internal */
14
14
  export const TagTypeId: C.TagTypeId = Symbol.for("effect/Context/Tag") as C.TagTypeId
@@ -205,7 +205,7 @@ export const getOption = dual<
205
205
  <Services, S, I>(self: C.Context<Services>, tag: C.Tag<I, S>) => O.Option<S>
206
206
  >(2, (self, tag) => {
207
207
  if (!self.unsafeMap.has(tag)) {
208
- return option.none()
208
+ return option.none
209
209
  }
210
210
  return option.some(self.unsafeMap.get(tag)! as any)
211
211
  })
@@ -49,3 +49,7 @@ export const Structural: new<A>(
49
49
  Structural.prototype = StructProto
50
50
  return Structural as any
51
51
  })()
52
+
53
+ /** @internal */
54
+ export const struct = <As extends Readonly<Record<string, any>>>(as: As): Data.Data<As> =>
55
+ Object.assign(Object.create(StructProto), as)
@@ -1,6 +1,6 @@
1
1
  import * as Chunk from "../../Chunk"
2
- import * as Data from "../../Data"
3
2
  import type * as Differ from "../../Differ"
3
+ import * as Data from "../Data"
4
4
 
5
5
  import * as Equal from "../../Equal"
6
6
  import * as Dual from "../../Function"
@@ -1,10 +1,10 @@
1
1
  import * as Chunk from "../../Chunk"
2
2
  import type { Context, Tag } from "../../Context"
3
- import { Structural } from "../../Data"
4
3
  import type { Differ } from "../../Differ"
5
4
  import * as Equal from "../../Equal"
6
5
  import * as Dual from "../../Function"
7
6
  import { makeContext } from "../../internal/Context"
7
+ import { Structural } from "../Data"
8
8
 
9
9
  /** @internal */
10
10
  export const ContextPatchTypeId: Differ.Context.TypeId = Symbol.for(
@@ -1,9 +1,9 @@
1
1
  import * as Chunk from "../../Chunk"
2
- import { Structural } from "../../Data"
3
2
  import type * as Differ from "../../Differ"
4
3
  import * as Equal from "../../Equal"
5
4
  import * as Dual from "../../Function"
6
5
  import * as HashMap from "../../HashMap"
6
+ import { Structural } from "../Data"
7
7
 
8
8
  /** @internal */
9
9
  export const HashMapPatchTypeId: Differ.Differ.HashMap.TypeId = Symbol.for(
@@ -1,5 +1,5 @@
1
1
  import * as Chunk from "../../Chunk"
2
- import { Structural } from "../../Data"
2
+ import { Structural } from "../Data"
3
3
 
4
4
  import type { Differ } from "../../Differ"
5
5
  import * as Dual from "../../Function"
@@ -1,10 +1,10 @@
1
1
  import * as Chunk from "../../Chunk"
2
- import { Structural } from "../../Data"
3
2
  import type { Differ } from "../../Differ"
4
3
  import type { Either } from "../../Either"
5
4
  import * as E from "../../Either"
6
5
  import * as Equal from "../../Equal"
7
6
  import * as Dual from "../../Function"
7
+ import { Structural } from "../Data"
8
8
 
9
9
  /** @internal */
10
10
  export const OrPatchTypeId: Differ.Or.TypeId = Symbol.for("effect/DifferOrPatch") as Differ.Or.TypeId
@@ -1,5 +1,4 @@
1
1
  import type * as Channel from "../Channel"
2
- import * as Data from "../Data"
3
2
  import type * as Effect from "../Effect"
4
3
  import type * as Effectable from "../Effectable"
5
4
  import * as Equal from "../Equal"
@@ -7,6 +6,7 @@ import * as Hash from "../Hash"
7
6
  import { pipeArguments } from "../Pipeable"
8
7
  import type * as Sink from "../Sink"
9
8
  import type * as Stream from "../Stream"
9
+ import * as Data from "./Data"
10
10
  import * as OpCodes from "./opCodes/effect"
11
11
 
12
12
  /** @internal */
@@ -1,7 +1,6 @@
1
1
  import type * as Cache from "../Cache"
2
2
  import type * as Clock from "../Clock"
3
3
  import * as Context from "../Context"
4
- import * as Data from "../Data"
5
4
  import * as Deferred from "../Deferred"
6
5
  import * as Duration from "../Duration"
7
6
  import type * as Effect from "../Effect"
@@ -17,6 +16,7 @@ import * as MutableRef from "../MutableRef"
17
16
  import * as Option from "../Option"
18
17
  import * as core from "./core"
19
18
  import * as effect from "./core-effect"
19
+ import * as Data from "./Data"
20
20
  import { none } from "./fiberId"
21
21
  import * as fiberRuntime from "./fiberRuntime"
22
22
 
@@ -1172,21 +1172,6 @@ export const prettyErrorMessage = (u: unknown): string => {
1172
1172
  return u["toString"]()
1173
1173
  }
1174
1174
  // 3)
1175
- if (typeof u === "object" && u !== null) {
1176
- if ("message" in u && typeof u["message"] === "string") {
1177
- const raw = JSON.parse(JSON.stringify(u))
1178
- const keys = new Set(Object.keys(raw))
1179
- keys.delete("name")
1180
- keys.delete("message")
1181
- keys.delete("_tag")
1182
- if (keys.size === 0) {
1183
- const name = "name" in u && typeof u.name === "string" ? u.name : "Error"
1184
- const tag = "_tag" in u && typeof u["_tag"] === "string" ? `(${u._tag})` : ``
1185
- return `${name}${tag}: ${u.message}`
1186
- }
1187
- }
1188
- }
1189
- // 4)
1190
1175
  return `Error: ${JSON.stringify(u)}`
1191
1176
  }
1192
1177
 
@@ -1197,7 +1182,7 @@ const defaultRenderError = (error: unknown): PrettyError => {
1197
1182
  if (typeof error === "object" && error !== null && error instanceof Error) {
1198
1183
  return new PrettyError(
1199
1184
  prettyErrorMessage(error),
1200
- error.stack?.split("\n").filter((_) => !_.startsWith("Error")).join("\n"),
1185
+ error.stack?.split("\n").filter((_) => _.match(/at (.*)/)).join("\n"),
1201
1186
  span
1202
1187
  )
1203
1188
  }
@@ -1631,7 +1631,7 @@ export const tryPromise: {
1631
1631
  promise
1632
1632
  .then((a) => resolve(core.exitSucceed(a)))
1633
1633
  .catch((e) =>
1634
- resolve(core.exitFail(
1634
+ resolve(core.fail(
1635
1635
  catcher ? catcher(e) : e
1636
1636
  ))
1637
1637
  )
@@ -1652,7 +1652,7 @@ export const tryPromise: {
1652
1652
  promise
1653
1653
  .then((a) => resolve(core.exitSucceed(a)))
1654
1654
  .catch((e) =>
1655
- resolve(core.exitFail(
1655
+ resolve(core.fail(
1656
1656
  catcher ? catcher(e) : e
1657
1657
  ))
1658
1658
  )
@@ -1038,11 +1038,11 @@ export class FiberRuntime<E, A> implements Fiber.RuntimeFiber<E, A> {
1038
1038
  }
1039
1039
 
1040
1040
  ["Left"](op: core.Primitive & { _op: "Left" }) {
1041
- return core.exitFail(op.left)
1041
+ return core.fail(op.left)
1042
1042
  }
1043
1043
 
1044
1044
  ["None"](_: core.Primitive & { _op: "None" }) {
1045
- return core.exitFail(internalCause.NoSuchElementException())
1045
+ return core.fail(internalCause.NoSuchElementException())
1046
1046
  }
1047
1047
 
1048
1048
  ["Right"](op: core.Primitive & { _op: "Right" }) {
@@ -1135,7 +1135,7 @@ export const withSpan = dual<
1135
1135
  readonly root?: boolean
1136
1136
  readonly context?: Context.Context<never>
1137
1137
  }) => Layer.Layer<R, E, A>
1138
- >(2, (self, name, options) =>
1138
+ >((args) => isLayer(args[0]), (self, name, options) =>
1139
1139
  unwrapScoped(
1140
1140
  core.map(
1141
1141
  fiberRuntime.useSpanScoped(name, options),