effect 2.0.0-next.49 → 2.0.0-next.50

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 (361) hide show
  1. package/BigInt/dist/effect-BigInt.cjs.dev.js +45 -18
  2. package/BigInt/dist/effect-BigInt.cjs.mjs +1 -0
  3. package/BigInt/dist/effect-BigInt.cjs.prod.js +45 -18
  4. package/BigInt/dist/effect-BigInt.esm.js +46 -19
  5. package/Brand/dist/effect-Brand.cjs.dev.js +0 -1
  6. package/Brand/dist/effect-Brand.cjs.prod.js +0 -1
  7. package/Cache/dist/effect-Cache.cjs.dev.js +23 -23
  8. package/Cache/dist/effect-Cache.cjs.prod.js +23 -23
  9. package/Cause/dist/effect-Cause.cjs.dev.js +4 -5
  10. package/Cause/dist/effect-Cause.cjs.prod.js +4 -5
  11. package/Channel/dist/effect-Channel.cjs.dev.js +35 -35
  12. package/Channel/dist/effect-Channel.cjs.prod.js +35 -35
  13. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.dev.js +30 -30
  14. package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.prod.js +30 -30
  15. package/Chunk/dist/effect-Chunk.cjs.dev.js +0 -1
  16. package/Chunk/dist/effect-Chunk.cjs.prod.js +0 -1
  17. package/Clock/dist/effect-Clock.cjs.dev.js +11 -11
  18. package/Clock/dist/effect-Clock.cjs.prod.js +11 -11
  19. package/Config/dist/effect-Config.cjs.dev.js +7 -8
  20. package/Config/dist/effect-Config.cjs.prod.js +7 -8
  21. package/ConfigError/dist/effect-ConfigError.cjs.dev.js +1 -2
  22. package/ConfigError/dist/effect-ConfigError.cjs.prod.js +1 -2
  23. package/ConfigProvider/dist/effect-ConfigProvider.cjs.dev.js +10 -10
  24. package/ConfigProvider/dist/effect-ConfigProvider.cjs.prod.js +10 -10
  25. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.dev.js +2 -3
  26. package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.prod.js +2 -3
  27. package/ConfigSecret/dist/effect-ConfigSecret.cjs.dev.js +1 -2
  28. package/ConfigSecret/dist/effect-ConfigSecret.cjs.prod.js +1 -2
  29. package/Console/dist/effect-Console.cjs.dev.js +27 -27
  30. package/Console/dist/effect-Console.cjs.prod.js +27 -27
  31. package/Data/dist/effect-Data.cjs.dev.js +36 -36
  32. package/Data/dist/effect-Data.cjs.prod.js +36 -36
  33. package/DefaultServices/dist/effect-DefaultServices.cjs.dev.js +11 -11
  34. package/DefaultServices/dist/effect-DefaultServices.cjs.prod.js +11 -11
  35. package/Deferred/dist/effect-Deferred.cjs.dev.js +4 -5
  36. package/Deferred/dist/effect-Deferred.cjs.prod.js +4 -5
  37. package/Differ/dist/effect-Differ.cjs.dev.js +1 -2
  38. package/Differ/dist/effect-Differ.cjs.prod.js +1 -2
  39. package/Duration/dist/effect-Duration.cjs.dev.js +0 -1
  40. package/Duration/dist/effect-Duration.cjs.prod.js +0 -1
  41. package/Effect/dist/effect-Effect.cjs.dev.js +37 -57
  42. package/Effect/dist/effect-Effect.cjs.mjs +0 -2
  43. package/Effect/dist/effect-Effect.cjs.prod.js +37 -57
  44. package/Effect/dist/effect-Effect.esm.js +4 -23
  45. package/Either/dist/effect-Either.cjs.dev.js +1 -1
  46. package/Either/dist/effect-Either.cjs.prod.js +1 -1
  47. package/Either/dist/effect-Either.esm.js +1 -1
  48. package/Exit/dist/effect-Exit.cjs.dev.js +4 -5
  49. package/Exit/dist/effect-Exit.cjs.prod.js +4 -5
  50. package/Fiber/dist/effect-Fiber.cjs.dev.js +24 -24
  51. package/Fiber/dist/effect-Fiber.cjs.prod.js +24 -24
  52. package/FiberId/dist/effect-FiberId.cjs.dev.js +2 -3
  53. package/FiberId/dist/effect-FiberId.cjs.prod.js +2 -3
  54. package/FiberRef/dist/effect-FiberRef.cjs.dev.js +24 -31
  55. package/FiberRef/dist/effect-FiberRef.cjs.mjs +0 -1
  56. package/FiberRef/dist/effect-FiberRef.cjs.prod.js +24 -31
  57. package/FiberRef/dist/effect-FiberRef.esm.js +2 -8
  58. package/FiberRefs/dist/effect-FiberRefs.cjs.dev.js +5 -6
  59. package/FiberRefs/dist/effect-FiberRefs.cjs.prod.js +5 -6
  60. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.dev.js +6 -7
  61. package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.prod.js +6 -7
  62. package/GroupBy/dist/effect-GroupBy.cjs.dev.js +36 -36
  63. package/GroupBy/dist/effect-GroupBy.cjs.prod.js +36 -36
  64. package/HashMap/dist/effect-HashMap.cjs.dev.js +1 -2
  65. package/HashMap/dist/effect-HashMap.cjs.prod.js +1 -2
  66. package/HashSet/dist/effect-HashSet.cjs.dev.js +1 -2
  67. package/HashSet/dist/effect-HashSet.cjs.prod.js +1 -2
  68. package/KeyedPool/dist/effect-KeyedPool.cjs.dev.js +24 -24
  69. package/KeyedPool/dist/effect-KeyedPool.cjs.prod.js +24 -24
  70. package/Layer/dist/effect-Layer.cjs.dev.js +35 -35
  71. package/Layer/dist/effect-Layer.cjs.mjs +2 -2
  72. package/Layer/dist/effect-Layer.cjs.prod.js +35 -35
  73. package/Layer/dist/effect-Layer.esm.js +4 -4
  74. package/List/dist/effect-List.cjs.dev.js +0 -1
  75. package/List/dist/effect-List.cjs.prod.js +0 -1
  76. package/LogLevel/dist/effect-LogLevel.cjs.dev.js +4 -4
  77. package/LogLevel/dist/effect-LogLevel.cjs.prod.js +4 -4
  78. package/Logger/dist/effect-Logger.cjs.dev.js +28 -28
  79. package/Logger/dist/effect-Logger.cjs.prod.js +28 -28
  80. package/Match/dist/effect-Match.cjs.dev.js +0 -1
  81. package/Match/dist/effect-Match.cjs.prod.js +0 -1
  82. package/Metric/dist/effect-Metric.cjs.dev.js +22 -22
  83. package/Metric/dist/effect-Metric.cjs.prod.js +22 -22
  84. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.dev.js +1 -2
  85. package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.prod.js +1 -2
  86. package/MetricHook/dist/effect-MetricHook.cjs.dev.js +3 -3
  87. package/MetricHook/dist/effect-MetricHook.cjs.prod.js +3 -3
  88. package/MetricKey/dist/effect-MetricKey.cjs.dev.js +3 -4
  89. package/MetricKey/dist/effect-MetricKey.cjs.prod.js +3 -4
  90. package/MetricKeyType/dist/effect-MetricKeyType.cjs.dev.js +1 -2
  91. package/MetricKeyType/dist/effect-MetricKeyType.cjs.prod.js +1 -2
  92. package/MetricPolling/dist/effect-MetricPolling.cjs.dev.js +24 -24
  93. package/MetricPolling/dist/effect-MetricPolling.cjs.prod.js +24 -24
  94. package/MetricRegistry/dist/effect-MetricRegistry.cjs.dev.js +5 -5
  95. package/MetricRegistry/dist/effect-MetricRegistry.cjs.prod.js +5 -5
  96. package/MutableHashMap/dist/effect-MutableHashMap.cjs.dev.js +1 -2
  97. package/MutableHashMap/dist/effect-MutableHashMap.cjs.prod.js +1 -2
  98. package/MutableHashSet/dist/effect-MutableHashSet.cjs.dev.js +1 -2
  99. package/MutableHashSet/dist/effect-MutableHashSet.cjs.prod.js +1 -2
  100. package/MutableQueue/dist/effect-MutableQueue.cjs.dev.js +0 -1
  101. package/MutableQueue/dist/effect-MutableQueue.cjs.prod.js +0 -1
  102. package/Number/dist/effect-Number.cjs.dev.js +31 -2
  103. package/Number/dist/effect-Number.cjs.mjs +2 -1
  104. package/Number/dist/effect-Number.cjs.prod.js +31 -2
  105. package/Number/dist/effect-Number.esm.js +24 -3
  106. package/Option/dist/effect-Option.cjs.dev.js +1 -88
  107. package/Option/dist/effect-Option.cjs.mjs +0 -6
  108. package/Option/dist/effect-Option.cjs.prod.js +1 -88
  109. package/Option/dist/effect-Option.esm.js +2 -83
  110. package/Pool/dist/effect-Pool.cjs.dev.js +24 -24
  111. package/Pool/dist/effect-Pool.cjs.prod.js +24 -24
  112. package/PubSub/dist/effect-PubSub.cjs.dev.js +23 -23
  113. package/PubSub/dist/effect-PubSub.cjs.prod.js +23 -23
  114. package/Queue/dist/effect-Queue.cjs.dev.js +23 -23
  115. package/Queue/dist/effect-Queue.cjs.prod.js +23 -23
  116. package/Random/dist/effect-Random.cjs.dev.js +11 -11
  117. package/Random/dist/effect-Random.cjs.prod.js +11 -11
  118. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.dev.js +0 -1
  119. package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.prod.js +0 -1
  120. package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.dev.js +332 -90
  121. package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.mjs +15 -2
  122. package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.prod.js +332 -90
  123. package/ReadonlyRecord/dist/effect-ReadonlyRecord.esm.js +323 -92
  124. package/RedBlackTree/dist/effect-RedBlackTree.cjs.dev.js +0 -1
  125. package/RedBlackTree/dist/effect-RedBlackTree.cjs.prod.js +0 -1
  126. package/Ref/dist/effect-Ref.cjs.dev.js +5 -6
  127. package/Ref/dist/effect-Ref.cjs.prod.js +5 -6
  128. package/Reloadable/dist/effect-Reloadable.cjs.dev.js +28 -28
  129. package/Reloadable/dist/effect-Reloadable.cjs.prod.js +28 -28
  130. package/Request/dist/effect-Request.cjs.dev.js +23 -23
  131. package/Request/dist/effect-Request.cjs.prod.js +23 -23
  132. package/RequestBlock/dist/effect-RequestBlock.cjs.dev.js +30 -30
  133. package/RequestBlock/dist/effect-RequestBlock.cjs.prod.js +30 -30
  134. package/RequestResolver/dist/effect-RequestResolver.cjs.dev.js +31 -31
  135. package/RequestResolver/dist/effect-RequestResolver.cjs.prod.js +31 -31
  136. package/Resource/dist/effect-Resource.cjs.dev.js +26 -26
  137. package/Resource/dist/effect-Resource.cjs.prod.js +26 -26
  138. package/Runtime/dist/effect-Runtime.cjs.dev.js +25 -25
  139. package/Runtime/dist/effect-Runtime.cjs.prod.js +25 -25
  140. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.dev.js +35 -35
  141. package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.prod.js +35 -35
  142. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.dev.js +2 -3
  143. package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.prod.js +2 -3
  144. package/STM/dist/effect-STM.cjs.dev.js +38 -38
  145. package/STM/dist/effect-STM.cjs.prod.js +38 -38
  146. package/Schedule/dist/effect-Schedule.cjs.dev.js +16 -16
  147. package/Schedule/dist/effect-Schedule.cjs.prod.js +16 -16
  148. package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.dev.js +0 -1
  149. package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.prod.js +0 -1
  150. package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.dev.js +0 -1
  151. package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.prod.js +0 -1
  152. package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.dev.js +0 -1
  153. package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.prod.js +0 -1
  154. package/Scheduler/dist/effect-Scheduler.cjs.dev.js +4 -5
  155. package/Scheduler/dist/effect-Scheduler.cjs.prod.js +4 -5
  156. package/Scope/dist/effect-Scope.cjs.dev.js +22 -22
  157. package/Scope/dist/effect-Scope.cjs.prod.js +22 -22
  158. package/ScopedCache/dist/effect-ScopedCache.cjs.dev.js +29 -29
  159. package/ScopedCache/dist/effect-ScopedCache.cjs.prod.js +29 -29
  160. package/ScopedRef/dist/effect-ScopedRef.cjs.dev.js +26 -26
  161. package/ScopedRef/dist/effect-ScopedRef.cjs.prod.js +26 -26
  162. package/Sink/dist/effect-Sink.cjs.dev.js +33 -33
  163. package/Sink/dist/effect-Sink.cjs.prod.js +33 -33
  164. package/SortedMap/dist/effect-SortedMap.cjs.dev.js +0 -1
  165. package/SortedMap/dist/effect-SortedMap.cjs.prod.js +0 -1
  166. package/SortedSet/dist/effect-SortedSet.cjs.dev.js +0 -1
  167. package/SortedSet/dist/effect-SortedSet.cjs.prod.js +0 -1
  168. package/Stream/dist/effect-Stream.cjs.dev.js +36 -36
  169. package/Stream/dist/effect-Stream.cjs.prod.js +36 -36
  170. package/Streamable/dist/effect-Streamable.cjs.dev.js +36 -36
  171. package/Streamable/dist/effect-Streamable.cjs.prod.js +36 -36
  172. package/String/dist/effect-String.cjs.dev.js +2 -2
  173. package/String/dist/effect-String.cjs.prod.js +2 -2
  174. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.dev.js +41 -41
  175. package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.prod.js +41 -41
  176. package/Supervisor/dist/effect-Supervisor.cjs.dev.js +28 -28
  177. package/Supervisor/dist/effect-Supervisor.cjs.prod.js +28 -28
  178. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.dev.js +25 -25
  179. package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.prod.js +25 -25
  180. package/TArray/dist/effect-TArray.cjs.dev.js +40 -40
  181. package/TArray/dist/effect-TArray.cjs.prod.js +40 -40
  182. package/TDeferred/dist/effect-TDeferred.cjs.dev.js +39 -39
  183. package/TDeferred/dist/effect-TDeferred.cjs.prod.js +39 -39
  184. package/TMap/dist/effect-TMap.cjs.dev.js +41 -41
  185. package/TMap/dist/effect-TMap.cjs.prod.js +41 -41
  186. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.dev.js +38 -38
  187. package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.prod.js +38 -38
  188. package/TPubSub/dist/effect-TPubSub.cjs.dev.js +47 -47
  189. package/TPubSub/dist/effect-TPubSub.cjs.prod.js +47 -47
  190. package/TQueue/dist/effect-TQueue.cjs.dev.js +40 -40
  191. package/TQueue/dist/effect-TQueue.cjs.prod.js +40 -40
  192. package/TRandom/dist/effect-TRandom.cjs.dev.js +40 -40
  193. package/TRandom/dist/effect-TRandom.cjs.prod.js +40 -40
  194. package/TReentrantLock/dist/effect-TReentrantLock.cjs.dev.js +46 -46
  195. package/TReentrantLock/dist/effect-TReentrantLock.cjs.prod.js +46 -46
  196. package/TRef/dist/effect-TRef.cjs.dev.js +38 -38
  197. package/TRef/dist/effect-TRef.cjs.prod.js +38 -38
  198. package/TSemaphore/dist/effect-TSemaphore.cjs.dev.js +39 -39
  199. package/TSemaphore/dist/effect-TSemaphore.cjs.prod.js +39 -39
  200. package/TSet/dist/effect-TSet.cjs.dev.js +41 -41
  201. package/TSet/dist/effect-TSet.cjs.prod.js +41 -41
  202. package/Take/dist/effect-Take.cjs.dev.js +30 -30
  203. package/Take/dist/effect-Take.cjs.prod.js +30 -30
  204. package/TestAnnotation/dist/effect-TestAnnotation.cjs.dev.js +2 -3
  205. package/TestAnnotation/dist/effect-TestAnnotation.cjs.prod.js +2 -3
  206. package/TestAnnotations/dist/effect-TestAnnotations.cjs.dev.js +16 -16
  207. package/TestAnnotations/dist/effect-TestAnnotations.cjs.prod.js +16 -16
  208. package/TestClock/dist/effect-TestClock.cjs.dev.js +27 -27
  209. package/TestClock/dist/effect-TestClock.cjs.prod.js +27 -27
  210. package/TestContext/dist/effect-TestContext.cjs.dev.js +29 -29
  211. package/TestContext/dist/effect-TestContext.cjs.prod.js +29 -29
  212. package/TestLive/dist/effect-TestLive.cjs.dev.js +11 -11
  213. package/TestLive/dist/effect-TestLive.cjs.prod.js +11 -11
  214. package/TestServices/dist/effect-TestServices.cjs.dev.js +29 -29
  215. package/TestServices/dist/effect-TestServices.cjs.prod.js +29 -29
  216. package/TestSized/dist/effect-TestSized.cjs.dev.js +4 -5
  217. package/TestSized/dist/effect-TestSized.cjs.prod.js +4 -5
  218. package/Tracer/dist/effect-Tracer.cjs.dev.js +28 -21
  219. package/Tracer/dist/effect-Tracer.cjs.mjs +1 -0
  220. package/Tracer/dist/effect-Tracer.cjs.prod.js +28 -21
  221. package/Tracer/dist/effect-Tracer.esm.js +8 -2
  222. package/dist/{Ref-23b67ad9.cjs.prod.js → Ref-00103de4.cjs.prod.js} +1 -1
  223. package/dist/{Ref-c75b5362.cjs.dev.js → Ref-f990026b.cjs.dev.js} +1 -1
  224. package/dist/{cache-7b144c1f.cjs.prod.js → cache-0b148e42.cjs.prod.js} +4 -4
  225. package/dist/{cache-e3d6cc01.cjs.dev.js → cache-d709d5cb.cjs.dev.js} +4 -4
  226. package/dist/{circular-105d525c.cjs.prod.js → circular-5b6f6504.cjs.prod.js} +10 -8
  227. package/dist/{circular-cbfc1699.cjs.dev.js → circular-6d2bb353.cjs.dev.js} +10 -8
  228. package/dist/{circular-3761aff7.cjs.prod.js → circular-952618e5.cjs.prod.js} +7 -7
  229. package/dist/{circular-8baf0205.cjs.dev.js → circular-aa705e70.cjs.dev.js} +7 -7
  230. package/dist/{config-887520b4.cjs.dev.js → config-8a7bf1ae.cjs.dev.js} +3 -3
  231. package/dist/{config-6a5f97fe.cjs.prod.js → config-f0bd27af.cjs.prod.js} +3 -3
  232. package/dist/{configProvider-8567470d.cjs.dev.js → configProvider-3d85d4ef.cjs.dev.js} +4 -4
  233. package/dist/{configProvider-098f7113.cjs.prod.js → configProvider-ae007b10.cjs.prod.js} +4 -4
  234. package/dist/{core-84667e8d.cjs.prod.js → core-473934ce.cjs.prod.js} +125 -41
  235. package/dist/{core-6815193e.cjs.dev.js → core-b4bf44d3.cjs.dev.js} +125 -41
  236. package/dist/{core-8072a539.cjs.prod.js → core-d3f4e713.cjs.prod.js} +2 -2
  237. package/dist/{core-e6f9fdbe.cjs.dev.js → core-dd1edd7a.cjs.dev.js} +2 -2
  238. package/dist/{core-effect-520abd3d.cjs.prod.js → core-effect-6666f2dc.cjs.prod.js} +20 -13
  239. package/dist/{core-effect-5700daea.cjs.dev.js → core-effect-f4b1aad8.cjs.dev.js} +20 -13
  240. package/dist/{dataSource-0ca8ef42.cjs.dev.js → dataSource-9f78e828.cjs.dev.js} +2 -2
  241. package/dist/{dataSource-17adc342.cjs.prod.js → dataSource-d5d7f338.cjs.prod.js} +2 -2
  242. package/dist/declarations/src/BigInt.d.ts +29 -3
  243. package/dist/declarations/src/BigInt.d.ts.map +1 -1
  244. package/dist/declarations/src/Channel.d.ts +0 -2
  245. package/dist/declarations/src/Channel.d.ts.map +1 -1
  246. package/dist/declarations/src/Effect.d.ts +7 -37
  247. package/dist/declarations/src/Effect.d.ts.map +1 -1
  248. package/dist/declarations/src/FiberRef.d.ts +0 -5
  249. package/dist/declarations/src/FiberRef.d.ts.map +1 -1
  250. package/dist/declarations/src/HashMap.d.ts +1 -1
  251. package/dist/declarations/src/Layer.d.ts +7 -10
  252. package/dist/declarations/src/Layer.d.ts.map +1 -1
  253. package/dist/declarations/src/Number.d.ts +24 -1
  254. package/dist/declarations/src/Number.d.ts.map +1 -1
  255. package/dist/declarations/src/Option.d.ts +0 -62
  256. package/dist/declarations/src/Option.d.ts.map +1 -1
  257. package/dist/declarations/src/ReadonlyRecord.d.ts +239 -79
  258. package/dist/declarations/src/ReadonlyRecord.d.ts.map +1 -1
  259. package/dist/declarations/src/Stream.d.ts +0 -2
  260. package/dist/declarations/src/Stream.d.ts.map +1 -1
  261. package/dist/declarations/src/Tracer.d.ts +6 -1
  262. package/dist/declarations/src/Tracer.d.ts.map +1 -1
  263. package/dist/{defaultServices-193b11dc.cjs.dev.js → defaultServices-6a9a2d2b.cjs.dev.js} +8 -79
  264. package/dist/{defaultServices-4c3bf140.cjs.prod.js → defaultServices-8ea5e664.cjs.prod.js} +8 -79
  265. package/dist/{fiber-cbdeec72.cjs.dev.js → fiber-3d944398.cjs.dev.js} +3 -3
  266. package/dist/{fiber-a1a5e429.cjs.prod.js → fiber-cbd0613f.cjs.prod.js} +3 -3
  267. package/dist/{fiberRefs-f631451c.cjs.prod.js → fiberRefs-99808a27.cjs.prod.js} +1 -1
  268. package/dist/{fiberRefs-8d2401f9.cjs.dev.js → fiberRefs-ccc37f30.cjs.dev.js} +1 -1
  269. package/dist/{fiberRuntime-7cb6cd44.cjs.dev.js → fiberRuntime-0c1e7478.cjs.dev.js} +17 -25
  270. package/dist/{fiberRuntime-4691f31b.cjs.prod.js → fiberRuntime-f1e80ca7.cjs.prod.js} +17 -25
  271. package/dist/{groupBy-5174c302.cjs.prod.js → groupBy-30f6e9ba.cjs.prod.js} +4 -4
  272. package/dist/{groupBy-239a6e6e.cjs.dev.js → groupBy-8ae74e3b.cjs.dev.js} +4 -4
  273. package/dist/{key-9b2f3322.cjs.prod.js → key-9c7368c8.cjs.prod.js} +1 -1
  274. package/dist/{key-2d4efb00.cjs.dev.js → key-e3189bbd.cjs.dev.js} +1 -1
  275. package/dist/{layer-d1c204db.cjs.prod.js → layer-bfb9802a.cjs.prod.js} +9 -10
  276. package/dist/{layer-961b15ae.cjs.dev.js → layer-c284cf0d.cjs.dev.js} +9 -10
  277. package/dist/{patch-1771b466.cjs.prod.js → patch-256bc574.cjs.prod.js} +1 -1
  278. package/dist/{patch-32cc7202.cjs.dev.js → patch-cda9b6c8.cjs.dev.js} +1 -1
  279. package/dist/{pathPatch-45b09159.cjs.dev.js → pathPatch-31ce8101.cjs.dev.js} +1 -1
  280. package/dist/{pathPatch-312bd492.cjs.prod.js → pathPatch-40b92af6.cjs.prod.js} +1 -1
  281. package/dist/{pool-f178fcc7.cjs.prod.js → pool-122f0fad.cjs.prod.js} +5 -5
  282. package/dist/{pool-3890e6ce.cjs.dev.js → pool-f6ca2038.cjs.dev.js} +5 -5
  283. package/dist/{query-a6b58e39.cjs.prod.js → query-5cc0ddf8.cjs.prod.js} +3 -3
  284. package/dist/{query-39c40fa6.cjs.dev.js → query-7bffa3c3.cjs.dev.js} +3 -3
  285. package/dist/{queue-4c4bdc04.cjs.dev.js → queue-4166cfdb.cjs.dev.js} +2 -2
  286. package/dist/{queue-5342a8d5.cjs.prod.js → queue-e326fd89.cjs.prod.js} +2 -2
  287. package/dist/{registry-6fbdb4e3.cjs.prod.js → registry-081e18a3.cjs.prod.js} +2 -2
  288. package/dist/{registry-ec8b84a2.cjs.dev.js → registry-377855a9.cjs.dev.js} +2 -2
  289. package/dist/{runtime-3295bc3c.cjs.prod.js → runtime-4078f059.cjs.prod.js} +5 -5
  290. package/dist/{runtime-43b9e2bb.cjs.dev.js → runtime-d4514ab5.cjs.dev.js} +5 -5
  291. package/dist/{schedule-a4be407d.cjs.dev.js → schedule-31e38871.cjs.dev.js} +3 -3
  292. package/dist/{schedule-6431754b.cjs.prod.js → schedule-f036b254.cjs.prod.js} +3 -3
  293. package/dist/{scopedRef-9032002a.cjs.dev.js → scopedRef-5ecf6468.cjs.dev.js} +6 -6
  294. package/dist/{scopedRef-7c2bf3f3.cjs.prod.js → scopedRef-8ce21228.cjs.prod.js} +6 -6
  295. package/dist/{singleProducerAsyncInput-879852ad.cjs.prod.js → singleProducerAsyncInput-8879d87c.cjs.prod.js} +1 -1
  296. package/dist/{singleProducerAsyncInput-82e5c80c.cjs.dev.js → singleProducerAsyncInput-ece7387b.cjs.dev.js} +1 -1
  297. package/dist/{sink-e4280f95.cjs.dev.js → sink-1794329b.cjs.dev.js} +4 -3
  298. package/dist/{sink-95371737.cjs.prod.js → sink-9208df8d.cjs.prod.js} +4 -3
  299. package/dist/{stm-f792171c.cjs.prod.js → stm-6ad7b384.cjs.prod.js} +3 -3
  300. package/dist/{stm-4bf1a928.cjs.dev.js → stm-b080be31.cjs.dev.js} +3 -3
  301. package/dist/{stream-c498ce8a.cjs.dev.js → stream-09aeeac3.cjs.dev.js} +5 -5
  302. package/dist/{stream-254329d0.cjs.prod.js → stream-e19805ca.cjs.prod.js} +5 -5
  303. package/dist/{synchronizedRef-cfe99d53.cjs.dev.js → synchronizedRef-8fa16866.cjs.dev.js} +1 -1
  304. package/dist/{synchronizedRef-5420532c.cjs.prod.js → synchronizedRef-cc04ecbd.cjs.prod.js} +1 -1
  305. package/dist/{tArray-7f227674.cjs.prod.js → tArray-5e42c290.cjs.prod.js} +3 -3
  306. package/dist/{tArray-996f4aba.cjs.dev.js → tArray-7d470ed7.cjs.dev.js} +3 -3
  307. package/dist/{tMap-811797bf.cjs.prod.js → tMap-a2cfde88.cjs.prod.js} +4 -4
  308. package/dist/{tMap-b9665a82.cjs.dev.js → tMap-f0df0ea0.cjs.dev.js} +4 -4
  309. package/dist/{tQueue-0c15312e.cjs.dev.js → tQueue-085f70b5.cjs.dev.js} +3 -3
  310. package/dist/{tQueue-8a6a0244.cjs.prod.js → tQueue-b80e940e.cjs.prod.js} +3 -3
  311. package/dist/{tRef-44d17d07.cjs.dev.js → tRef-2e495254.cjs.dev.js} +1 -1
  312. package/dist/{tRef-2892ee02.cjs.prod.js → tRef-42a212cb.cjs.prod.js} +1 -1
  313. package/internal/cache.esm.js +1 -1
  314. package/internal/channel.esm.js +3 -2
  315. package/internal/core-effect.esm.js +18 -11
  316. package/internal/core.esm.js +52 -41
  317. package/internal/fiberRuntime.esm.js +7 -14
  318. package/internal/layer/circular.esm.js +9 -6
  319. package/internal/layer.esm.js +3 -3
  320. package/internal/sink.esm.js +1 -1
  321. package/internal/stream.esm.js +6 -6
  322. package/internal/tracer.esm.js +7 -4
  323. package/package.json +1 -1
  324. package/src/BigInt.ts +51 -17
  325. package/src/Channel.ts +0 -2
  326. package/src/Effect.ts +9 -44
  327. package/src/Either.ts +1 -1
  328. package/src/FiberRef.ts +0 -6
  329. package/src/HashMap.ts +1 -1
  330. package/src/Layer.ts +7 -10
  331. package/src/Number.ts +29 -1
  332. package/src/Option.ts +1 -94
  333. package/src/ReadonlyRecord.ts +383 -110
  334. package/src/Stream.ts +0 -2
  335. package/src/Tracer.ts +6 -1
  336. package/src/internal/channel.ts +14 -5
  337. package/src/internal/core-effect.ts +34 -24
  338. package/src/internal/core.ts +83 -70
  339. package/src/internal/fiberRuntime.ts +4 -29
  340. package/src/internal/layer/circular.ts +10 -13
  341. package/src/internal/layer.ts +8 -8
  342. package/src/internal/stream.ts +3 -5
  343. package/src/internal/tracer.ts +7 -3
  344. /package/dist/{FiberId-54d8bd67.cjs.prod.js → FiberId-0f0b7779.cjs.prod.js} +0 -0
  345. /package/dist/{FiberId-6708cdca.cjs.dev.js → FiberId-6595cf4c.cjs.dev.js} +0 -0
  346. /package/dist/{HashSet-86613304.cjs.prod.js → HashSet-251c8294.cjs.prod.js} +0 -0
  347. /package/dist/{HashSet-dd020cb0.cjs.dev.js → HashSet-c12c037b.cjs.dev.js} +0 -0
  348. /package/dist/{RuntimeFlagsPatch-35ed8dee.cjs.prod.js → RuntimeFlagsPatch-3890e860.cjs.prod.js} +0 -0
  349. /package/dist/{RuntimeFlagsPatch-9cbc441d.cjs.dev.js → RuntimeFlagsPatch-7d62915d.cjs.dev.js} +0 -0
  350. /package/dist/{boundaries-6eea221f.cjs.dev.js → boundaries-8dfe50cb.cjs.dev.js} +0 -0
  351. /package/dist/{boundaries-26f0dc82.cjs.prod.js → boundaries-ebe66d32.cjs.prod.js} +0 -0
  352. /package/dist/{configError-a824b415.cjs.dev.js → configError-0c09b93c.cjs.dev.js} +0 -0
  353. /package/dist/{configError-856c7153.cjs.prod.js → configError-9021016b.cjs.prod.js} +0 -0
  354. /package/dist/{configSecret-663cfb59.cjs.prod.js → configSecret-0bdfadd8.cjs.prod.js} +0 -0
  355. /package/dist/{configSecret-23cf1a3f.cjs.dev.js → configSecret-938818ad.cjs.dev.js} +0 -0
  356. /package/dist/{hook-8e8bee6a.cjs.dev.js → hook-ad5af092.cjs.dev.js} +0 -0
  357. /package/dist/{hook-c2815d51.cjs.prod.js → hook-cab99f9e.cjs.prod.js} +0 -0
  358. /package/dist/{keyType-4ec0b247.cjs.prod.js → keyType-2ae6a00e.cjs.prod.js} +0 -0
  359. /package/dist/{keyType-f30c9fa4.cjs.dev.js → keyType-36962f62.cjs.dev.js} +0 -0
  360. /package/dist/{take-981a87eb.cjs.prod.js → take-114476e5.cjs.prod.js} +0 -0
  361. /package/dist/{take-bfd0a3ed.cjs.dev.js → take-d4fa1beb.cjs.dev.js} +0 -0
@@ -6,14 +6,11 @@
6
6
 
7
7
  import type { Either } from "./Either"
8
8
  import * as E from "./Either"
9
+ import * as Equal from "./Equal"
10
+ import type { Equivalence } from "./Equivalence"
9
11
  import { dual, identity } from "./Function"
10
12
  import type { TypeLambda } from "./HKT"
11
- import type { Option } from "./Option"
12
- import * as O from "./Option"
13
-
14
- // -------------------------------------------------------------------------------------
15
- // models
16
- // -------------------------------------------------------------------------------------
13
+ import * as Option from "./Option"
17
14
 
18
15
  /**
19
16
  * @category models
@@ -31,10 +28,6 @@ export interface ReadonlyRecordTypeLambda extends TypeLambda {
31
28
  readonly type: ReadonlyRecord<this["Target"]>
32
29
  }
33
30
 
34
- // -------------------------------------------------------------------------------------
35
- // constructors
36
- // -------------------------------------------------------------------------------------
37
-
38
31
  /**
39
32
  * Creates a new, empty record.
40
33
  *
@@ -43,14 +36,10 @@ export interface ReadonlyRecordTypeLambda extends TypeLambda {
43
36
  */
44
37
  export const empty = <A>(): Record<string, A> => ({})
45
38
 
46
- // -------------------------------------------------------------------------------------
47
- // guards
48
- // -------------------------------------------------------------------------------------
49
-
50
39
  /**
51
- * Determine if a `Record` is empty.
40
+ * Determine if a record is empty.
52
41
  *
53
- * @param self - `Record` to test for emptiness.
42
+ * @param self - record to test for emptiness.
54
43
  *
55
44
  * @example
56
45
  * import { isEmptyRecord } from "effect/ReadonlyRecord"
@@ -71,9 +60,9 @@ export const isEmptyRecord = <A>(self: Record<string, A>): self is Record<string
71
60
  }
72
61
 
73
62
  /**
74
- * Determine if a `ReadonlyRecord` is empty.
63
+ * Determine if a record is empty.
75
64
  *
76
- * @param self - `ReadonlyRecord` to test for emptiness.
65
+ * @param self - record to test for emptiness.
77
66
  *
78
67
  * @example
79
68
  * import { isEmptyReadonlyRecord } from "effect/ReadonlyRecord"
@@ -86,10 +75,6 @@ export const isEmptyRecord = <A>(self: Record<string, A>): self is Record<string
86
75
  */
87
76
  export const isEmptyReadonlyRecord: <A>(self: ReadonlyRecord<A>) => self is ReadonlyRecord<never> = isEmptyRecord
88
77
 
89
- // -------------------------------------------------------------------------------------
90
- // conversions
91
- // -------------------------------------------------------------------------------------
92
-
93
78
  /**
94
79
  * Takes an iterable and a projection function and returns a record.
95
80
  * The projection function maps each value of the iterable to a tuple of a key and a value, which is then added to the resulting record.
@@ -98,7 +83,7 @@ export const isEmptyReadonlyRecord: <A>(self: ReadonlyRecord<A>) => self is Read
98
83
  * @param f - A projection function that maps values of the iterable to a tuple of a key and a value.
99
84
  *
100
85
  * @example
101
- * import { fromIterable } from 'effect/ReadonlyRecord'
86
+ * import { fromIterable } from "effect/ReadonlyRecord"
102
87
  *
103
88
  * const input = [1, 2, 3, 4]
104
89
  *
@@ -131,7 +116,7 @@ export const fromIterable: {
131
116
  * @param self - The iterable of key-value pairs.
132
117
  *
133
118
  * @example
134
- * import { fromEntries } from 'effect/ReadonlyRecord'
119
+ * import { fromEntries } from "effect/ReadonlyRecord"
135
120
  *
136
121
  * const input: Array<[string, number]> = [["a", 1], ["b", 2]]
137
122
  *
@@ -143,10 +128,10 @@ export const fromIterable: {
143
128
  export const fromEntries: <A>(self: Iterable<readonly [string, A]>) => Record<string, A> = fromIterable(identity)
144
129
 
145
130
  /**
146
- * Transforms the values of a `ReadonlyRecord` into an `Array` with a custom mapping function.
131
+ * Transforms the values of a record into an `Array` with a custom mapping function.
147
132
  *
148
- * @param self - The `ReadonlyRecord` to transform.
149
- * @param f - The custom mapping function to apply to each key/value of the `ReadonlyRecord`.
133
+ * @param self - The record to transform.
134
+ * @param f - The custom mapping function to apply to each key/value of the record.
150
135
  *
151
136
  * @example
152
137
  * import { collect } from "effect/ReadonlyRecord"
@@ -191,31 +176,9 @@ export const toEntries: <K extends string, A>(self: Record<K, A>) => Array<[K, A
191
176
  ) => [key, value])
192
177
 
193
178
  /**
194
- * Takes a record and returns an array of tuples containing its keys and values.
179
+ * Returns the number of key/value pairs in a record.
195
180
  *
196
- * Alias of {@link toEntries}.
197
- *
198
- * @param self - The record to transform.
199
- *
200
- * @example
201
- * import { toArray } from "effect/ReadonlyRecord"
202
- *
203
- * const x = { a: 1, b: 2, c: 3 }
204
- * assert.deepStrictEqual(toArray(x), [["a", 1], ["b", 2], ["c", 3]])
205
- *
206
- * @category conversions
207
- * @since 2.0.0
208
- */
209
- export const toArray: <K extends string, A>(self: Record<K, A>) => Array<[K, A]> = toEntries
210
-
211
- // -------------------------------------------------------------------------------------
212
- // utils
213
- // -------------------------------------------------------------------------------------
214
-
215
- /**
216
- * Returns the number of key/value pairs in a `ReadonlyRecord`.
217
- *
218
- * @param self - A `ReadonlyRecord` to calculate the number of key/value pairs in.
181
+ * @param self - A record to calculate the number of key/value pairs in.
219
182
  *
220
183
  * @example
221
184
  * import { size } from "effect/ReadonlyRecord";
@@ -227,13 +190,13 @@ export const toArray: <K extends string, A>(self: Record<K, A>) => Array<[K, A]>
227
190
  export const size = <A>(self: ReadonlyRecord<A>): number => Object.keys(self).length
228
191
 
229
192
  /**
230
- * Check if a given `key` exists in a `ReadonlyRecord`.
193
+ * Check if a given `key` exists in a record.
231
194
  *
232
- * @param self - the `ReadonlyRecord` to look in.
233
- * @param key - the key to look for in the `ReadonlyRecord`.
195
+ * @param self - the record to look in.
196
+ * @param key - the key to look for in the record.
234
197
  *
235
198
  * @example
236
- * import { has } from 'effect/ReadonlyRecord'
199
+ * import { has } from "effect/ReadonlyRecord"
237
200
  *
238
201
  * assert.deepStrictEqual(has({ a: 1, b: 2 }, "a"), true);
239
202
  * assert.deepStrictEqual(has({ a: 1, b: 2 }, "c"), false);
@@ -249,10 +212,10 @@ export const has: {
249
212
  )
250
213
 
251
214
  /**
252
- * Retrieve a value at a particular key from a `ReadonlyRecord`, returning it wrapped in an `Option`.
215
+ * Retrieve a value at a particular key from a record, returning it wrapped in an `Option`.
253
216
  *
254
- * @param self - The `ReadonlyRecord` to retrieve value from.
255
- * @param key - Key to retrieve from `ReadonlyRecord`.
217
+ * @param self - The record to retrieve value from.
218
+ * @param key - Key to retrieve from record.
256
219
  *
257
220
  * @example
258
221
  * import { get } from "effect/ReadonlyRecord"
@@ -266,18 +229,18 @@ export const has: {
266
229
  * @since 2.0.0
267
230
  */
268
231
  export const get: {
269
- (key: string): <A>(self: ReadonlyRecord<A>) => Option<A>
270
- <A>(self: ReadonlyRecord<A>, key: string): Option<A>
232
+ (key: string): <A>(self: ReadonlyRecord<A>) => Option.Option<A>
233
+ <A>(self: ReadonlyRecord<A>, key: string): Option.Option<A>
271
234
  } = dual(
272
235
  2,
273
- <A>(self: ReadonlyRecord<A>, key: string): Option<A> => has(self, key) ? O.some(self[key]) : O.none()
236
+ <A>(self: ReadonlyRecord<A>, key: string): Option.Option<A> => has(self, key) ? Option.some(self[key]) : Option.none()
274
237
  )
275
238
 
276
239
  /**
277
240
  * Apply a function to the element at the specified key, creating a new record,
278
241
  * or return `None` if the key doesn't exist.
279
242
  *
280
- * @param self - The `ReadonlyRecord` to be updated.
243
+ * @param self - The record to be updated.
281
244
  * @param key - The key of the element to modify.
282
245
  * @param f - The function to apply to the element.
283
246
  *
@@ -299,24 +262,24 @@ export const get: {
299
262
  * @since 2.0.0
300
263
  */
301
264
  export const modifyOption: {
302
- <A, B>(key: string, f: (a: A) => B): (self: ReadonlyRecord<A>) => Option<Record<string, A | B>>
303
- <A, B>(self: ReadonlyRecord<A>, key: string, f: (a: A) => B): Option<Record<string, A | B>>
265
+ <A, B>(key: string, f: (a: A) => B): (self: ReadonlyRecord<A>) => Option.Option<Record<string, A | B>>
266
+ <A, B>(self: ReadonlyRecord<A>, key: string, f: (a: A) => B): Option.Option<Record<string, A | B>>
304
267
  } = dual(
305
268
  3,
306
- <A, B>(self: ReadonlyRecord<A>, key: string, f: (a: A) => B): Option<Record<string, A | B>> => {
269
+ <A, B>(self: ReadonlyRecord<A>, key: string, f: (a: A) => B): Option.Option<Record<string, A | B>> => {
307
270
  if (!has(self, key)) {
308
- return O.none()
271
+ return Option.none()
309
272
  }
310
273
  const out: Record<string, A | B> = { ...self }
311
274
  out[key] = f(self[key])
312
- return O.some(out)
275
+ return Option.some(out)
313
276
  }
314
277
  )
315
278
 
316
279
  /**
317
280
  * Replaces a value in the record with the new value passed as parameter.
318
281
  *
319
- * @param self - The `ReadonlyRecord` to be updated.
282
+ * @param self - The record to be updated.
320
283
  * @param key - The key to search for in the record.
321
284
  * @param b - The new value to replace the existing value with.
322
285
  *
@@ -333,21 +296,22 @@ export const modifyOption: {
333
296
  * @since 2.0.0
334
297
  */
335
298
  export const replaceOption: {
336
- <B>(key: string, b: B): <A>(self: ReadonlyRecord<A>) => Option<Record<string, B | A>>
337
- <A, B>(self: ReadonlyRecord<A>, key: string, b: B): Option<Record<string, A | B>>
299
+ <B>(key: string, b: B): <A>(self: ReadonlyRecord<A>) => Option.Option<Record<string, A | B>>
300
+ <A, B>(self: ReadonlyRecord<A>, key: string, b: B): Option.Option<Record<string, A | B>>
338
301
  } = dual(
339
302
  3,
340
- <A, B>(self: ReadonlyRecord<A>, key: string, b: B): Option<Record<string, A | B>> => modifyOption(self, key, () => b)
303
+ <A, B>(self: ReadonlyRecord<A>, key: string, b: B): Option.Option<Record<string, A | B>> =>
304
+ modifyOption(self, key, () => b)
341
305
  )
342
306
 
343
307
  /**
344
- * Removes a key from a `ReadonlyRecord` and returns a new `Record`
308
+ * Removes a key from a record and returns a new record
345
309
  *
346
- * @param self - the `ReadonlyRecord` to remove the key from.
347
- * @param key - the key to remove from the `ReadonlyRecord`.
310
+ * @param self - the record to remove the key from.
311
+ * @param key - the key to remove from the record.
348
312
  *
349
313
  * @example
350
- * import { remove } from 'effect/ReadonlyRecord'
314
+ * import { remove } from "effect/ReadonlyRecord"
351
315
  *
352
316
  * assert.deepStrictEqual(remove({ a: 1, b: 2 }, "a"), { b: 2 })
353
317
  *
@@ -357,21 +321,21 @@ export const remove: {
357
321
  (key: string): <A>(self: ReadonlyRecord<A>) => Record<string, A>
358
322
  <A>(self: ReadonlyRecord<A>, key: string): Record<string, A>
359
323
  } = dual(2, <A>(self: ReadonlyRecord<A>, key: string): Record<string, A> => {
360
- const out: Record<string, A> = { ...self }
324
+ const out = { ...self }
361
325
  delete out[key]
362
326
  return out
363
327
  })
364
328
 
365
329
  /**
366
- * Retrieves the value of the property with the given `key` from a `ReadonlyRecord` and returns an `Option`
367
- * of a tuple with the value and the `ReadonlyRecord` with the removed property.
330
+ * Retrieves the value of the property with the given `key` from a record and returns an `Option`
331
+ * of a tuple with the value and the record with the removed property.
368
332
  * If the key is not present, returns `O.none`.
369
333
  *
370
- * @param self - The input `ReadonlyRecord`.
334
+ * @param self - The input record.
371
335
  * @param key - The key of the property to retrieve.
372
336
  *
373
337
  * @example
374
- * import { pop } from 'effect/ReadonlyRecord'
338
+ * import { pop } from "effect/ReadonlyRecord"
375
339
  * import { some, none } from 'effect/Option'
376
340
  *
377
341
  * assert.deepStrictEqual(pop({ a: 1, b: 2 }, "a"), some([1, { b: 2 }]))
@@ -381,18 +345,19 @@ export const remove: {
381
345
  * @since 2.0.0
382
346
  */
383
347
  export const pop: {
384
- (key: string): <A>(self: ReadonlyRecord<A>) => Option<readonly [A, ReadonlyRecord<A>]>
385
- <A>(self: ReadonlyRecord<A>, key: string): Option<readonly [A, ReadonlyRecord<A>]>
348
+ (key: string): <A>(self: ReadonlyRecord<A>) => Option.Option<[A, Record<string, A>]>
349
+ <A>(self: ReadonlyRecord<A>, key: string): Option.Option<[A, Record<string, A>]>
386
350
  } = dual(2, <A>(
387
351
  self: ReadonlyRecord<A>,
388
352
  key: string
389
- ): Option<readonly [A, ReadonlyRecord<A>]> => has(self, key) ? O.some([self[key], remove(self, key)]) : O.none())
353
+ ): Option.Option<[A, Record<string, A>]> =>
354
+ has(self, key) ? Option.some([self[key], remove(self, key)]) : Option.none())
390
355
 
391
356
  /**
392
- * Maps a `ReadonlyRecord` into another `Record` by applying a transformation function to each of its values.
357
+ * Maps a record into another record by applying a transformation function to each of its values.
393
358
  *
394
- * @param self - The `ReadonlyRecord` to be mapped.
395
- * @param f - A transformation function that will be applied to each of the values in the `ReadonlyRecord`.
359
+ * @param self - The record to be mapped.
360
+ * @param f - A transformation function that will be applied to each of the values in the record.
396
361
  *
397
362
  * @example
398
363
  * import { map } from "effect/ReadonlyRecord"
@@ -422,14 +387,14 @@ export const map: {
422
387
  )
423
388
 
424
389
  /**
425
- * Transforms a `ReadonlyRecord` into a `Record` by applying the function `f` to each key and value in the original `ReadonlyRecord`.
426
- * If the function returns `Some`, the key-value pair is included in the output `Record`.
390
+ * Transforms a record into a record by applying the function `f` to each key and value in the original record.
391
+ * If the function returns `Some`, the key-value pair is included in the output record.
427
392
  *
428
- * @param self - The input `ReadonlyRecord`.
393
+ * @param self - The input record.
429
394
  * @param f - The transformation function.
430
395
  *
431
396
  * @example
432
- * import { filterMap } from 'effect/ReadonlyRecord'
397
+ * import { filterMap } from "effect/ReadonlyRecord"
433
398
  * import { some, none } from 'effect/Option'
434
399
  *
435
400
  * const x = { a: 1, b: 2, c: 3 }
@@ -439,16 +404,16 @@ export const map: {
439
404
  * @since 2.0.0
440
405
  */
441
406
  export const filterMap: {
442
- <K extends string, A, B>(f: (a: A, key: K) => Option<B>): (self: Record<K, A>) => Record<string, B>
443
- <K extends string, A, B>(self: Record<K, A>, f: (a: A, key: K) => Option<B>): Record<string, B>
407
+ <K extends string, A, B>(f: (a: A, key: K) => Option.Option<B>): (self: Record<K, A>) => Record<string, B>
408
+ <K extends string, A, B>(self: Record<K, A>, f: (a: A, key: K) => Option.Option<B>): Record<string, B>
444
409
  } = dual(2, <A, B>(
445
410
  self: Record<string, A>,
446
- f: (a: A, key: string) => Option<B>
411
+ f: (a: A, key: string) => Option.Option<B>
447
412
  ): Record<string, B> => {
448
413
  const out: Record<string, B> = {}
449
414
  for (const key of Object.keys(self)) {
450
415
  const o = f(self[key], key)
451
- if (O.isSome(o)) {
416
+ if (Option.isSome(o)) {
452
417
  out[key] = o.value
453
418
  }
454
419
  }
@@ -458,11 +423,11 @@ export const filterMap: {
458
423
  /**
459
424
  * Selects properties from a record whose values match the given predicate.
460
425
  *
461
- * @param self - The `ReadonlyRecord` to filter.
426
+ * @param self - The record to filter.
462
427
  * @param predicate - A function that returns a `boolean` value to determine if the entry should be included in the new record.
463
428
  *
464
429
  * @example
465
- * import { filter } from 'effect/ReadonlyRecord'
430
+ * import { filter } from "effect/ReadonlyRecord"
466
431
  *
467
432
  * const x = { a: 1, b: 2, c: 3, d: 4 }
468
433
  * assert.deepStrictEqual(filter(x, (n) => n > 2), { c: 3, d: 4 })
@@ -502,12 +467,12 @@ export const filter: {
502
467
  )
503
468
 
504
469
  /**
505
- * Given a `ReadonlyRecord` with `Option` values, returns a `Record` with only the `Some` values, with the same keys.
470
+ * Given a record with `Option` values, returns a record with only the `Some` values, with the same keys.
506
471
  *
507
- * @param self - A `ReadonlyRecord` with `Option` values.
472
+ * @param self - A record with `Option` values.
508
473
  *
509
474
  * @example
510
- * import { compact } from 'effect/ReadonlyRecord'
475
+ * import { compact } from "effect/ReadonlyRecord"
511
476
  * import { some, none } from 'effect/Option'
512
477
  *
513
478
  * assert.deepStrictEqual(
@@ -518,18 +483,18 @@ export const filter: {
518
483
  * @category filtering
519
484
  * @since 2.0.0
520
485
  */
521
- export const compact: <A>(self: ReadonlyRecord<Option<A>>) => Record<string, A> = filterMap(
486
+ export const compact: <A>(self: ReadonlyRecord<Option.Option<A>>) => Record<string, A> = filterMap(
522
487
  identity
523
488
  )
524
489
 
525
490
  /**
526
- * Partitions the elements of a `ReadonlyRecord` into two groups: those that match a predicate, and those that don't.
491
+ * Partitions the elements of a record into two groups: those that match a predicate, and those that don't.
527
492
  *
528
- * @param self - The `ReadonlyRecord` to partition.
493
+ * @param self - The record to partition.
529
494
  * @param f - The predicate function to apply to each element.
530
495
  *
531
496
  * @example
532
- * import { partitionMap } from 'effect/ReadonlyRecord'
497
+ * import { partitionMap } from "effect/ReadonlyRecord"
533
498
  * import { left, right } from 'effect/Either'
534
499
  *
535
500
  * const x = { a: 1, b: 2, c: 3 }
@@ -568,13 +533,13 @@ export const partitionMap: {
568
533
  )
569
534
 
570
535
  /**
571
- * Partitions a `ReadonlyRecord` of `Either` values into two separate records,
536
+ * Partitions a record of `Either` values into two separate records,
572
537
  * one with the `Left` values and one with the `Right` values.
573
538
  *
574
- * @param self - the `ReadonlyRecord` to partition.
539
+ * @param self - the record to partition.
575
540
  *
576
541
  * @example
577
- * import { separate } from 'effect/ReadonlyRecord'
542
+ * import { separate } from "effect/ReadonlyRecord"
578
543
  * import { left, right } from 'effect/Either'
579
544
  *
580
545
  * assert.deepStrictEqual(
@@ -590,13 +555,13 @@ export const separate: <A, B>(
590
555
  ) => [Record<string, A>, Record<string, B>] = partitionMap(identity)
591
556
 
592
557
  /**
593
- * Partitions a `ReadonlyRecord` into two separate `Record`s based on the result of a predicate function.
558
+ * Partitions a record into two separate records based on the result of a predicate function.
594
559
  *
595
- * @param self - The input `ReadonlyRecord` to partition.
596
- * @param predicate - The partitioning function to determine the partitioning of each value of the `ReadonlyRecord`.
560
+ * @param self - The input record to partition.
561
+ * @param predicate - The partitioning function to determine the partitioning of each value of the record.
597
562
  *
598
563
  * @example
599
- * import { partition } from 'effect/ReadonlyRecord'
564
+ * import { partition } from "effect/ReadonlyRecord"
600
565
  *
601
566
  * assert.deepStrictEqual(
602
567
  * partition({ a: 1, b: 3 }, (n) => n > 2),
@@ -639,3 +604,311 @@ export const partition: {
639
604
  return [left, right]
640
605
  }
641
606
  )
607
+
608
+ /**
609
+ * Retrieve the keys of a given record as an array.
610
+ *
611
+ * @param self - The object for which you want to get the keys.
612
+ *
613
+ * @since 2.0.0
614
+ */
615
+ export const keys = <A>(self: ReadonlyRecord<A>): Array<string> => Object.keys(self)
616
+
617
+ /**
618
+ * Retrieve the values of a given record as an array.
619
+ *
620
+ * @param self - The object for which you want to get the values.
621
+ *
622
+ * @since 2.0.0
623
+ */
624
+ export const values = <A>(self: ReadonlyRecord<A>): Array<A> => collect(self, (_, a) => a)
625
+
626
+ /**
627
+ * Add a new key-value pair or update an existing key's value in a record.
628
+ *
629
+ * @param self - The record to which you want to add or update a key-value pair.
630
+ * @param key - The key you want to add or update.
631
+ * @param values - The value you want to associate with the key.
632
+ *
633
+ * @example
634
+ * import { upsert } from "effect/ReadonlyRecord"
635
+ *
636
+ * assert.deepStrictEqual(upsert("a", 5)({ a: 1, b: 2 }), { a: 5, b: 2 });
637
+ * assert.deepStrictEqual(upsert("c", 5)({ a: 1, b: 2 }), { a: 1, b: 2, c: 5 });
638
+ *
639
+ * @since 2.0.0
640
+ */
641
+ export const upsert: {
642
+ <B>(key: string, value: B): <A>(self: ReadonlyRecord<A>) => Record<string, A | B>
643
+ <A, B>(self: ReadonlyRecord<A>, key: string, value: B): Record<string, A | B>
644
+ } = dual(3, <A, B>(self: ReadonlyRecord<A>, key: string, value: B): Record<string, A | B> => {
645
+ const out: Record<string, A | B> = { ...self }
646
+ out[key] = value
647
+ return out
648
+ })
649
+
650
+ /**
651
+ * Replace a key's value in a record and return the updated record.
652
+ *
653
+ * @param self - The original record.
654
+ * @param key - The key to replace.
655
+ * @param value - The new value to associate with the key.
656
+ *
657
+ * @example
658
+ * import { update } from "effect/ReadonlyRecord"
659
+ * import { some, none } from "effect/Option"
660
+ *
661
+ * assert.deepStrictEqual(update("a", 3)({ a: 1, b: 2 }), { a: 3, b: 2 });
662
+ * assert.deepStrictEqual(update("c", 3)({ a: 1, b: 2 }), { a: 1, b: 2 });
663
+ *
664
+ * @since 2.0.0
665
+ */
666
+ export const update: {
667
+ <B>(key: string, value: B): <A>(self: ReadonlyRecord<A>) => Record<string, A | B>
668
+ <A, B>(self: ReadonlyRecord<A>, key: string, value: B): Record<string, A | B>
669
+ } = dual(3, <A, B>(self: ReadonlyRecord<A>, key: string, value: B): Record<string, A | B> => {
670
+ const out: Record<string, A | B> = { ...self }
671
+ if (has(self, key)) {
672
+ out[key] = value
673
+ }
674
+ return out
675
+ })
676
+
677
+ /**
678
+ * Check if all the keys and values in one record are also found in another record.
679
+ *
680
+ * @param self - The first record to check.
681
+ * @param that - The second record to compare against.
682
+ * @param equivalence - A function to compare values.
683
+ *
684
+ * @since 2.0.0
685
+ */
686
+ export const isSubrecordBy = <A>(equivalence: Equivalence<A>): {
687
+ (that: ReadonlyRecord<A>): (self: ReadonlyRecord<A>) => boolean
688
+ (self: ReadonlyRecord<A>, that: ReadonlyRecord<A>): boolean
689
+ } =>
690
+ dual(2, (self: ReadonlyRecord<A>, that: ReadonlyRecord<A>): boolean => {
691
+ for (const key in self) {
692
+ if (!has(that, key) || !equivalence(self[key], that[key])) {
693
+ return false
694
+ }
695
+ }
696
+ return true
697
+ })
698
+
699
+ /**
700
+ * Check if one record is a subrecord of another, meaning it contains all the keys and values found in the second record.
701
+ * This comparison uses default equality checks (`Equal.equivalence()`).
702
+ *
703
+ * @param self - The first record to check.
704
+ * @param that - The second record to compare against.
705
+ *
706
+ * @since 2.0.0
707
+ */
708
+ export const isSubrecord: {
709
+ <A>(that: ReadonlyRecord<A>): (self: ReadonlyRecord<A>) => boolean
710
+ <A>(self: ReadonlyRecord<A>, that: ReadonlyRecord<A>): boolean
711
+ } = isSubrecordBy(Equal.equivalence())
712
+
713
+ /**
714
+ * Reduce a record to a single value by combining its entries with a specified function.
715
+ *
716
+ * @param self - The record to reduce.
717
+ * @param zero - The initial value of the accumulator.
718
+ * @param f - The function to combine entries (accumulator, value, key).
719
+ *
720
+ * @category folding
721
+ * @since 2.0.0
722
+ */
723
+ export const reduce: {
724
+ <Z, V, K extends string>(zero: Z, f: (accumulator: Z, value: V, key: K) => Z): (self: Record<K, V>) => Z
725
+ <K extends string, V, Z>(self: Record<K, V>, zero: Z, f: (accumulator: Z, value: V, key: K) => Z): Z
726
+ } = dual(3, <V, Z>(self: Record<string, V>, zero: Z, f: (accumulator: Z, value: V, key: string) => Z): Z => {
727
+ let out: Z = zero
728
+ for (const key in self) {
729
+ out = f(out, self[key], key)
730
+ }
731
+ return out
732
+ })
733
+
734
+ /**
735
+ * Check if all entries in a record meet a specific condition.
736
+ *
737
+ * @param self - The record to check.
738
+ * @param predicate - The condition to test entries (value, key).
739
+ *
740
+ * @since 2.0.0
741
+ */
742
+ export const every: {
743
+ <A, K extends string>(predicate: (value: A, key: K) => boolean): (self: Record<K, A>) => boolean
744
+ <K extends string, A>(self: Record<K, A>, predicate: (value: A, key: K) => boolean): boolean
745
+ } = dual(2, <K extends string, A>(self: Record<K, A>, predicate: (value: A, key: K) => boolean): boolean => {
746
+ for (const key in self) {
747
+ if (!predicate(self[key], key)) {
748
+ return false
749
+ }
750
+ }
751
+ return true
752
+ })
753
+
754
+ /**
755
+ * Check if any entry in a record meets a specific condition.
756
+ *
757
+ * @param self - The record to check.
758
+ * @param predicate - The condition to test entries (value, key).
759
+ *
760
+ * @since 2.0.0
761
+ */
762
+ export const some: {
763
+ <A, K extends string>(predicate: (value: A, key: K) => boolean): (self: Record<K, A>) => boolean
764
+ <K extends string, A>(self: Record<K, A>, predicate: (value: A, key: K) => boolean): boolean
765
+ } = dual(2, <K extends string, A>(self: Record<K, A>, predicate: (value: A, key: K) => boolean): boolean => {
766
+ for (const key in self) {
767
+ if (predicate(self[key], key)) {
768
+ return true
769
+ }
770
+ }
771
+ return false
772
+ })
773
+
774
+ /**
775
+ * Merge two records, preserving entries that exist in either of the records.
776
+ *
777
+ * @param self - The first record.
778
+ * @param that - The second record to combine with the first.
779
+ * @param combine - A function to specify how to merge entries with the same key.
780
+ *
781
+ * @since 2.0.0
782
+ */
783
+ export const union: {
784
+ <K1 extends string, V0, V1>(
785
+ that: Record<K1, V1>,
786
+ combine: (selfValue: V0, thatValue: V1) => V0 | V1
787
+ ): <K0 extends string>(self: Record<K0, V0>) => Record<K0 | K1, V0 | V1>
788
+ <K0 extends string, V0, K1 extends string, V1>(
789
+ self: Record<K0, V0>,
790
+ that: Record<K1, V1>,
791
+ combine: (selfValue: V0, thatValue: V1) => V0 | V1
792
+ ): Record<K0 | K1, V0 | V1>
793
+ } = dual(
794
+ 3,
795
+ <A>(
796
+ self: Record<string, A>,
797
+ that: Record<string, A>,
798
+ combine: (selfValue: A, thatValue: A) => A
799
+ ): Record<string, A> => {
800
+ if (isEmptyRecord(self)) {
801
+ return { ...that }
802
+ }
803
+ if (isEmptyRecord(that)) {
804
+ return { ...self }
805
+ }
806
+ const out: Record<string, A> = {}
807
+ for (const key in self) {
808
+ if (has(that, key)) {
809
+ out[key] = combine(self[key], that[key])
810
+ } else {
811
+ out[key] = self[key]
812
+ }
813
+ }
814
+ for (const key in that) {
815
+ if (!has(out, key)) {
816
+ out[key] = that[key]
817
+ }
818
+ }
819
+ return out
820
+ }
821
+ )
822
+
823
+ /**
824
+ * Merge two records, retaining only the entries that exist in both records.
825
+ *
826
+ * @param self - The first record.
827
+ * @param that - The second record to merge with the first.
828
+ * @param combine - A function to specify how to merge entries with the same key.
829
+ *
830
+ * @since 2.0.0
831
+ */
832
+ export const intersection: {
833
+ <A>(
834
+ that: ReadonlyRecord<A>,
835
+ combine: (selfValue: A, thatValue: A) => A
836
+ ): (self: ReadonlyRecord<A>) => Record<string, A>
837
+ <A>(self: ReadonlyRecord<A>, that: ReadonlyRecord<A>, combine: (selfValue: A, thatValue: A) => A): Record<string, A>
838
+ } = dual(
839
+ 3,
840
+ <A>(
841
+ self: ReadonlyRecord<A>,
842
+ that: ReadonlyRecord<A>,
843
+ combine: (selfValue: A, thatValue: A) => A
844
+ ): Record<string, A> => {
845
+ if (isEmptyRecord(self) || isEmptyRecord(that)) {
846
+ return empty()
847
+ }
848
+ const out: Record<string, A> = {}
849
+ for (const key in self) {
850
+ if (has(that, key)) {
851
+ out[key] = combine(self[key], that[key])
852
+ }
853
+ }
854
+ return out
855
+ }
856
+ )
857
+
858
+ /**
859
+ * Merge two records, preserving only the entries that are unique to each record.
860
+ *
861
+ * @param self - The first record.
862
+ * @param that - The second record to compare with the first.
863
+ *
864
+ * @since 2.0.0
865
+ */
866
+ export const difference: {
867
+ <A>(
868
+ that: ReadonlyRecord<A>
869
+ ): (self: ReadonlyRecord<A>) => Record<string, A>
870
+ <A>(self: ReadonlyRecord<A>, that: ReadonlyRecord<A>): Record<string, A>
871
+ } = dual(2, <A>(self: ReadonlyRecord<A>, that: ReadonlyRecord<A>): Record<string, A> => {
872
+ if (isEmptyRecord(self)) {
873
+ return { ...that }
874
+ }
875
+ if (isEmptyRecord(that)) {
876
+ return { ...self }
877
+ }
878
+ const out: Record<string, A> = {}
879
+ for (const key in self) {
880
+ if (!has(that, key)) {
881
+ out[key] = self[key]
882
+ }
883
+ }
884
+ for (const key in that) {
885
+ if (!has(self, key)) {
886
+ out[key] = that[key]
887
+ }
888
+ }
889
+ return out
890
+ })
891
+
892
+ /**
893
+ * Create an `Equivalence` for records using the provided `Equivalence` for values.
894
+ *
895
+ * @param equivalence - An `Equivalence` for the values contained in the records.
896
+ *
897
+ * @category instances
898
+ * @since 2.0.0
899
+ */
900
+ export const getEquivalence = <A>(equivalence: Equivalence<A>): Equivalence<ReadonlyRecord<A>> => {
901
+ const is = isSubrecordBy(equivalence)
902
+ return (self, that) => is(self, that) && is(that, self)
903
+ }
904
+
905
+ /**
906
+ * Create a non-empty record from a single element.
907
+ *
908
+ * @param key - The key for the element.
909
+ * @param value - The value associated with the key.
910
+ *
911
+ * @category constructors
912
+ * @since 2.0.0
913
+ */
914
+ export const singleton = <K extends string, A>(key: K, value: A): Record<K, A> => ({ [key]: value }) as Record<K, A>