effect 3.8.4 → 3.9.0

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 (757) hide show
  1. package/dist/cjs/Array.js +24 -3
  2. package/dist/cjs/Array.js.map +1 -1
  3. package/dist/cjs/BigDecimal.js +5 -3
  4. package/dist/cjs/BigDecimal.js.map +1 -1
  5. package/dist/cjs/BigInt.js.map +1 -1
  6. package/dist/cjs/Boolean.js.map +1 -1
  7. package/dist/cjs/Cause.js.map +1 -1
  8. package/dist/cjs/Channel.js.map +1 -1
  9. package/dist/cjs/ChildExecutorDecision.js.map +1 -1
  10. package/dist/cjs/Chunk.js +3 -0
  11. package/dist/cjs/Chunk.js.map +1 -1
  12. package/dist/cjs/Config.js.map +1 -1
  13. package/dist/cjs/ConfigError.js.map +1 -1
  14. package/dist/cjs/ConfigProvider.js.map +1 -1
  15. package/dist/cjs/ConfigProviderPathPatch.js.map +1 -1
  16. package/dist/cjs/Console.js.map +1 -1
  17. package/dist/cjs/Context.js.map +1 -1
  18. package/dist/cjs/Cron.js +3 -0
  19. package/dist/cjs/Cron.js.map +1 -1
  20. package/dist/cjs/Data.js.map +1 -1
  21. package/dist/cjs/DateTime.js +6 -0
  22. package/dist/cjs/DateTime.js.map +1 -1
  23. package/dist/cjs/Deferred.js.map +1 -1
  24. package/dist/cjs/Differ.js.map +1 -1
  25. package/dist/cjs/Duration.js +3 -0
  26. package/dist/cjs/Duration.js.map +1 -1
  27. package/dist/cjs/Effect.js +122 -35
  28. package/dist/cjs/Effect.js.map +1 -1
  29. package/dist/cjs/Either.js.map +1 -1
  30. package/dist/cjs/Equivalence.js.map +1 -1
  31. package/dist/cjs/ExecutionStrategy.js.map +1 -1
  32. package/dist/cjs/Exit.js.map +1 -1
  33. package/dist/cjs/Fiber.js.map +1 -1
  34. package/dist/cjs/FiberHandle.js +3 -0
  35. package/dist/cjs/FiberHandle.js.map +1 -1
  36. package/dist/cjs/FiberId.js.map +1 -1
  37. package/dist/cjs/FiberMap.js +3 -0
  38. package/dist/cjs/FiberMap.js.map +1 -1
  39. package/dist/cjs/FiberRef.js.map +1 -1
  40. package/dist/cjs/FiberRefs.js.map +1 -1
  41. package/dist/cjs/FiberRefsPatch.js.map +1 -1
  42. package/dist/cjs/FiberSet.js +3 -0
  43. package/dist/cjs/FiberSet.js.map +1 -1
  44. package/dist/cjs/Function.js.map +1 -1
  45. package/dist/cjs/GroupBy.js.map +1 -1
  46. package/dist/cjs/Hash.js.map +1 -1
  47. package/dist/cjs/HashMap.js.map +1 -1
  48. package/dist/cjs/HashSet.js.map +1 -1
  49. package/dist/cjs/Inspectable.js +15 -1
  50. package/dist/cjs/Inspectable.js.map +1 -1
  51. package/dist/cjs/Iterable.js.map +1 -1
  52. package/dist/cjs/KeyedPool.js.map +1 -1
  53. package/dist/cjs/Layer.js.map +1 -1
  54. package/dist/cjs/List.js +6 -0
  55. package/dist/cjs/List.js.map +1 -1
  56. package/dist/cjs/LogLevel.js.map +1 -1
  57. package/dist/cjs/Logger.js.map +1 -1
  58. package/dist/cjs/Mailbox.js.map +1 -1
  59. package/dist/cjs/ManagedRuntime.js +16 -1
  60. package/dist/cjs/ManagedRuntime.js.map +1 -1
  61. package/dist/cjs/MergeDecision.js.map +1 -1
  62. package/dist/cjs/MergeState.js.map +1 -1
  63. package/dist/cjs/MergeStrategy.js.map +1 -1
  64. package/dist/cjs/Metric.js.map +1 -1
  65. package/dist/cjs/MetricHook.js.map +1 -1
  66. package/dist/cjs/MetricKey.js.map +1 -1
  67. package/dist/cjs/MetricPolling.js.map +1 -1
  68. package/dist/cjs/MetricState.js.map +1 -1
  69. package/dist/cjs/Micro.js +6 -0
  70. package/dist/cjs/Micro.js.map +1 -1
  71. package/dist/cjs/MutableHashMap.js +3 -0
  72. package/dist/cjs/MutableHashMap.js.map +1 -1
  73. package/dist/cjs/MutableHashSet.js +3 -0
  74. package/dist/cjs/MutableHashSet.js.map +1 -1
  75. package/dist/cjs/MutableList.js +3 -0
  76. package/dist/cjs/MutableList.js.map +1 -1
  77. package/dist/cjs/MutableQueue.js +3 -0
  78. package/dist/cjs/MutableQueue.js.map +1 -1
  79. package/dist/cjs/MutableRef.js +3 -0
  80. package/dist/cjs/MutableRef.js.map +1 -1
  81. package/dist/cjs/Number.js.map +1 -1
  82. package/dist/cjs/Option.js.map +1 -1
  83. package/dist/cjs/Order.js.map +1 -1
  84. package/dist/cjs/Ordering.js.map +1 -1
  85. package/dist/cjs/Pipeable.js.map +1 -1
  86. package/dist/cjs/Pool.js.map +1 -1
  87. package/dist/cjs/Predicate.js +18 -2
  88. package/dist/cjs/Predicate.js.map +1 -1
  89. package/dist/cjs/PubSub.js.map +1 -1
  90. package/dist/cjs/Queue.js.map +1 -1
  91. package/dist/cjs/RcMap.js.map +1 -1
  92. package/dist/cjs/Readable.js.map +1 -1
  93. package/dist/cjs/Record.js.map +1 -1
  94. package/dist/cjs/RedBlackTree.js.map +1 -1
  95. package/dist/cjs/Ref.js.map +1 -1
  96. package/dist/cjs/RegExp.js +20 -1
  97. package/dist/cjs/RegExp.js.map +1 -1
  98. package/dist/cjs/Request.js.map +1 -1
  99. package/dist/cjs/RequestResolver.js.map +1 -1
  100. package/dist/cjs/Resource.js.map +1 -1
  101. package/dist/cjs/Runtime.js.map +1 -1
  102. package/dist/cjs/RuntimeFlags.js.map +1 -1
  103. package/dist/cjs/RuntimeFlagsPatch.js.map +1 -1
  104. package/dist/cjs/STM.js.map +1 -1
  105. package/dist/cjs/Schedule.js.map +1 -1
  106. package/dist/cjs/ScheduleInterval.js.map +1 -1
  107. package/dist/cjs/ScheduleIntervals.js.map +1 -1
  108. package/dist/cjs/Scheduler.js.map +1 -1
  109. package/dist/cjs/Scope.js.map +1 -1
  110. package/dist/cjs/ScopedRef.js.map +1 -1
  111. package/dist/cjs/Sink.js.map +1 -1
  112. package/dist/cjs/SortedMap.js +3 -0
  113. package/dist/cjs/SortedMap.js.map +1 -1
  114. package/dist/cjs/SortedSet.js +3 -0
  115. package/dist/cjs/SortedSet.js.map +1 -1
  116. package/dist/cjs/Stream.js +17 -3
  117. package/dist/cjs/Stream.js.map +1 -1
  118. package/dist/cjs/StreamHaltStrategy.js.map +1 -1
  119. package/dist/cjs/String.js.map +1 -1
  120. package/dist/cjs/Struct.js.map +1 -1
  121. package/dist/cjs/Subscribable.js.map +1 -1
  122. package/dist/cjs/SubscriptionRef.js.map +1 -1
  123. package/dist/cjs/SynchronizedRef.js.map +1 -1
  124. package/dist/cjs/TArray.js.map +1 -1
  125. package/dist/cjs/TDeferred.js.map +1 -1
  126. package/dist/cjs/TMap.js.map +1 -1
  127. package/dist/cjs/TPriorityQueue.js.map +1 -1
  128. package/dist/cjs/TPubSub.js.map +1 -1
  129. package/dist/cjs/TQueue.js.map +1 -1
  130. package/dist/cjs/TReentrantLock.js.map +1 -1
  131. package/dist/cjs/TRef.js.map +1 -1
  132. package/dist/cjs/TSemaphore.js.map +1 -1
  133. package/dist/cjs/TSet.js.map +1 -1
  134. package/dist/cjs/Take.js.map +1 -1
  135. package/dist/cjs/TestAnnotationMap.js.map +1 -1
  136. package/dist/cjs/TestClock.js.map +1 -1
  137. package/dist/cjs/TestServices.js.map +1 -1
  138. package/dist/cjs/Trie.js.map +1 -1
  139. package/dist/cjs/Tuple.js +21 -2
  140. package/dist/cjs/Tuple.js.map +1 -1
  141. package/dist/cjs/Unify.js.map +1 -1
  142. package/dist/cjs/UpstreamPullRequest.js.map +1 -1
  143. package/dist/cjs/UpstreamPullStrategy.js.map +1 -1
  144. package/dist/cjs/Utils.js +1 -14
  145. package/dist/cjs/Utils.js.map +1 -1
  146. package/dist/cjs/internal/cause.js +3 -0
  147. package/dist/cjs/internal/cause.js.map +1 -1
  148. package/dist/cjs/internal/context.js +6 -1
  149. package/dist/cjs/internal/context.js.map +1 -1
  150. package/dist/cjs/internal/core-effect.js.map +1 -1
  151. package/dist/cjs/internal/core.js +16 -3
  152. package/dist/cjs/internal/core.js.map +1 -1
  153. package/dist/cjs/internal/effect/circular.js +5 -1
  154. package/dist/cjs/internal/effect/circular.js.map +1 -1
  155. package/dist/cjs/internal/fiberId.js +9 -0
  156. package/dist/cjs/internal/fiberId.js.map +1 -1
  157. package/dist/cjs/internal/hashMap.js +3 -0
  158. package/dist/cjs/internal/hashMap.js.map +1 -1
  159. package/dist/cjs/internal/hashSet.js +3 -0
  160. package/dist/cjs/internal/hashSet.js.map +1 -1
  161. package/dist/cjs/internal/layer.js +33 -19
  162. package/dist/cjs/internal/layer.js.map +1 -1
  163. package/dist/cjs/internal/mailbox.js +3 -0
  164. package/dist/cjs/internal/mailbox.js.map +1 -1
  165. package/dist/cjs/internal/managedRuntime/circular.js +10 -0
  166. package/dist/cjs/internal/managedRuntime/circular.js.map +1 -0
  167. package/dist/cjs/internal/managedRuntime.js +23 -9
  168. package/dist/cjs/internal/managedRuntime.js.map +1 -1
  169. package/dist/cjs/internal/option.js +3 -0
  170. package/dist/cjs/internal/option.js.map +1 -1
  171. package/dist/cjs/internal/pool.js +6 -1
  172. package/dist/cjs/internal/pool.js.map +1 -1
  173. package/dist/cjs/internal/redBlackTree.js +3 -0
  174. package/dist/cjs/internal/redBlackTree.js.map +1 -1
  175. package/dist/cjs/internal/resource.js +15 -5
  176. package/dist/cjs/internal/resource.js.map +1 -1
  177. package/dist/cjs/internal/runtime.js +4 -1
  178. package/dist/cjs/internal/runtime.js.map +1 -1
  179. package/dist/cjs/internal/scopedRef.js +11 -8
  180. package/dist/cjs/internal/scopedRef.js.map +1 -1
  181. package/dist/cjs/internal/stm/core.js +1 -2
  182. package/dist/cjs/internal/stm/core.js.map +1 -1
  183. package/dist/cjs/internal/stream.js +12 -3
  184. package/dist/cjs/internal/stream.js.map +1 -1
  185. package/dist/cjs/internal/trie.js +3 -0
  186. package/dist/cjs/internal/trie.js.map +1 -1
  187. package/dist/cjs/internal/version.js +1 -1
  188. package/dist/dts/Array.d.ts +2735 -2
  189. package/dist/dts/Array.d.ts.map +1 -1
  190. package/dist/dts/BigDecimal.d.ts +558 -1
  191. package/dist/dts/BigDecimal.d.ts.map +1 -1
  192. package/dist/dts/BigInt.d.ts +490 -0
  193. package/dist/dts/BigInt.d.ts.map +1 -1
  194. package/dist/dts/Boolean.d.ts +228 -0
  195. package/dist/dts/Boolean.d.ts.map +1 -1
  196. package/dist/dts/Cause.d.ts +172 -0
  197. package/dist/dts/Cause.d.ts.map +1 -1
  198. package/dist/dts/Channel.d.ts +750 -0
  199. package/dist/dts/Channel.d.ts.map +1 -1
  200. package/dist/dts/ChildExecutorDecision.d.ts +12 -0
  201. package/dist/dts/ChildExecutorDecision.d.ts.map +1 -1
  202. package/dist/dts/Chunk.d.ts +791 -0
  203. package/dist/dts/Chunk.d.ts.map +1 -1
  204. package/dist/dts/Config.d.ts +174 -0
  205. package/dist/dts/Config.d.ts.map +1 -1
  206. package/dist/dts/ConfigError.d.ts +16 -0
  207. package/dist/dts/ConfigError.d.ts.map +1 -1
  208. package/dist/dts/ConfigProvider.d.ts +84 -0
  209. package/dist/dts/ConfigProvider.d.ts.map +1 -1
  210. package/dist/dts/ConfigProviderPathPatch.d.ts +32 -0
  211. package/dist/dts/ConfigProviderPathPatch.d.ts.map +1 -1
  212. package/dist/dts/Console.d.ts +24 -0
  213. package/dist/dts/Console.d.ts.map +1 -1
  214. package/dist/dts/Context.d.ts +234 -3
  215. package/dist/dts/Context.d.ts.map +1 -1
  216. package/dist/dts/Cron.d.ts +12 -0
  217. package/dist/dts/Cron.d.ts.map +1 -1
  218. package/dist/dts/Data.d.ts +165 -0
  219. package/dist/dts/Data.d.ts.map +1 -1
  220. package/dist/dts/DateTime.d.ts +878 -0
  221. package/dist/dts/DateTime.d.ts.map +1 -1
  222. package/dist/dts/Deferred.d.ts +171 -1
  223. package/dist/dts/Deferred.d.ts.map +1 -1
  224. package/dist/dts/Differ.d.ts +78 -0
  225. package/dist/dts/Differ.d.ts.map +1 -1
  226. package/dist/dts/Duration.d.ts +130 -0
  227. package/dist/dts/Duration.d.ts.map +1 -1
  228. package/dist/dts/Effect.d.ts +4350 -13
  229. package/dist/dts/Effect.d.ts.map +1 -1
  230. package/dist/dts/Either.d.ts +620 -0
  231. package/dist/dts/Either.d.ts.map +1 -1
  232. package/dist/dts/Equivalence.d.ts +24 -0
  233. package/dist/dts/Equivalence.d.ts.map +1 -1
  234. package/dist/dts/ExecutionStrategy.d.ts +14 -0
  235. package/dist/dts/ExecutionStrategy.d.ts.map +1 -1
  236. package/dist/dts/Exit.d.ts +252 -0
  237. package/dist/dts/Exit.d.ts.map +1 -1
  238. package/dist/dts/Fiber.d.ts +182 -0
  239. package/dist/dts/Fiber.d.ts.map +1 -1
  240. package/dist/dts/FiberHandle.d.ts +42 -0
  241. package/dist/dts/FiberHandle.d.ts.map +1 -1
  242. package/dist/dts/FiberId.d.ts +24 -0
  243. package/dist/dts/FiberId.d.ts.map +1 -1
  244. package/dist/dts/FiberMap.d.ts +102 -0
  245. package/dist/dts/FiberMap.d.ts.map +1 -1
  246. package/dist/dts/FiberRef.d.ts +80 -0
  247. package/dist/dts/FiberRef.d.ts.map +1 -1
  248. package/dist/dts/FiberRefs.d.ts +84 -0
  249. package/dist/dts/FiberRefs.d.ts.map +1 -1
  250. package/dist/dts/FiberRefsPatch.d.ts +30 -0
  251. package/dist/dts/FiberRefsPatch.d.ts.map +1 -1
  252. package/dist/dts/FiberSet.d.ts +38 -0
  253. package/dist/dts/FiberSet.d.ts.map +1 -1
  254. package/dist/dts/Function.d.ts +144 -28
  255. package/dist/dts/Function.d.ts.map +1 -1
  256. package/dist/dts/GroupBy.d.ts +38 -0
  257. package/dist/dts/GroupBy.d.ts.map +1 -1
  258. package/dist/dts/Hash.d.ts +8 -0
  259. package/dist/dts/Hash.d.ts.map +1 -1
  260. package/dist/dts/HashMap.d.ts +315 -0
  261. package/dist/dts/HashMap.d.ts.map +1 -1
  262. package/dist/dts/HashSet.d.ts +284 -0
  263. package/dist/dts/HashSet.d.ts.map +1 -1
  264. package/dist/dts/Inspectable.d.ts +15 -0
  265. package/dist/dts/Inspectable.d.ts.map +1 -1
  266. package/dist/dts/Iterable.d.ts +454 -0
  267. package/dist/dts/Iterable.d.ts.map +1 -1
  268. package/dist/dts/KeyedPool.d.ts +34 -0
  269. package/dist/dts/KeyedPool.d.ts.map +1 -1
  270. package/dist/dts/Layer.d.ts +460 -5
  271. package/dist/dts/Layer.d.ts.map +1 -1
  272. package/dist/dts/List.d.ts +430 -0
  273. package/dist/dts/List.d.ts.map +1 -1
  274. package/dist/dts/LogLevel.d.ts +46 -0
  275. package/dist/dts/LogLevel.d.ts.map +1 -1
  276. package/dist/dts/Logger.d.ts +194 -0
  277. package/dist/dts/Logger.d.ts.map +1 -1
  278. package/dist/dts/Mailbox.d.ts +16 -0
  279. package/dist/dts/Mailbox.d.ts.map +1 -1
  280. package/dist/dts/ManagedRuntime.d.ts +41 -2
  281. package/dist/dts/ManagedRuntime.d.ts.map +1 -1
  282. package/dist/dts/MergeDecision.d.ts +8 -0
  283. package/dist/dts/MergeDecision.d.ts.map +1 -1
  284. package/dist/dts/MergeState.d.ts +8 -0
  285. package/dist/dts/MergeState.d.ts.map +1 -1
  286. package/dist/dts/MergeStrategy.d.ts +12 -0
  287. package/dist/dts/MergeStrategy.d.ts.map +1 -1
  288. package/dist/dts/Metric.d.ts +410 -0
  289. package/dist/dts/Metric.d.ts.map +1 -1
  290. package/dist/dts/MetricHook.d.ts +24 -0
  291. package/dist/dts/MetricHook.d.ts.map +1 -1
  292. package/dist/dts/MetricKey.d.ts +48 -0
  293. package/dist/dts/MetricKey.d.ts.map +1 -1
  294. package/dist/dts/MetricPolling.d.ts +40 -0
  295. package/dist/dts/MetricPolling.d.ts.map +1 -1
  296. package/dist/dts/MetricState.d.ts +16 -0
  297. package/dist/dts/MetricState.d.ts.map +1 -1
  298. package/dist/dts/Micro.d.ts +1110 -0
  299. package/dist/dts/Micro.d.ts.map +1 -1
  300. package/dist/dts/MutableHashMap.d.ts +50 -0
  301. package/dist/dts/MutableHashMap.d.ts.map +1 -1
  302. package/dist/dts/MutableHashSet.d.ts +24 -0
  303. package/dist/dts/MutableHashSet.d.ts.map +1 -1
  304. package/dist/dts/MutableList.d.ts +36 -0
  305. package/dist/dts/MutableList.d.ts.map +1 -1
  306. package/dist/dts/MutableQueue.d.ts +62 -0
  307. package/dist/dts/MutableQueue.d.ts.map +1 -1
  308. package/dist/dts/MutableRef.d.ts +56 -0
  309. package/dist/dts/MutableRef.d.ts.map +1 -1
  310. package/dist/dts/Number.d.ts +474 -0
  311. package/dist/dts/Number.d.ts.map +1 -1
  312. package/dist/dts/Option.d.ts +1019 -0
  313. package/dist/dts/Option.d.ts.map +1 -1
  314. package/dist/dts/Order.d.ts +24 -0
  315. package/dist/dts/Order.d.ts.map +1 -1
  316. package/dist/dts/Ordering.d.ts +66 -0
  317. package/dist/dts/Ordering.d.ts.map +1 -1
  318. package/dist/dts/Pipeable.d.ts +21 -21
  319. package/dist/dts/Pipeable.d.ts.map +1 -1
  320. package/dist/dts/Pool.d.ts +37 -1
  321. package/dist/dts/Pool.d.ts.map +1 -1
  322. package/dist/dts/Predicate.d.ts +513 -0
  323. package/dist/dts/Predicate.d.ts.map +1 -1
  324. package/dist/dts/PubSub.d.ts +28 -0
  325. package/dist/dts/PubSub.d.ts.map +1 -1
  326. package/dist/dts/Queue.d.ts +106 -2
  327. package/dist/dts/Queue.d.ts.map +1 -1
  328. package/dist/dts/RcMap.d.ts +70 -0
  329. package/dist/dts/RcMap.d.ts.map +1 -1
  330. package/dist/dts/Readable.d.ts +16 -0
  331. package/dist/dts/Readable.d.ts.map +1 -1
  332. package/dist/dts/Record.d.ts +800 -0
  333. package/dist/dts/Record.d.ts.map +1 -1
  334. package/dist/dts/RedBlackTree.d.ts +300 -0
  335. package/dist/dts/RedBlackTree.d.ts.map +1 -1
  336. package/dist/dts/Ref.d.ts +88 -0
  337. package/dist/dts/Ref.d.ts.map +1 -1
  338. package/dist/dts/RegExp.d.ts +12 -2
  339. package/dist/dts/RegExp.d.ts.map +1 -1
  340. package/dist/dts/Request.d.ts +76 -0
  341. package/dist/dts/Request.d.ts.map +1 -1
  342. package/dist/dts/RequestResolver.d.ts +144 -0
  343. package/dist/dts/RequestResolver.d.ts.map +1 -1
  344. package/dist/dts/Resource.d.ts +21 -1
  345. package/dist/dts/Resource.d.ts.map +1 -1
  346. package/dist/dts/Runtime.d.ts +126 -0
  347. package/dist/dts/Runtime.d.ts.map +1 -1
  348. package/dist/dts/RuntimeFlags.d.ts +100 -0
  349. package/dist/dts/RuntimeFlags.d.ts.map +1 -1
  350. package/dist/dts/RuntimeFlagsPatch.d.ts +112 -0
  351. package/dist/dts/RuntimeFlagsPatch.d.ts.map +1 -1
  352. package/dist/dts/STM.d.ts +1090 -0
  353. package/dist/dts/STM.d.ts.map +1 -1
  354. package/dist/dts/Schedule.d.ts +704 -0
  355. package/dist/dts/Schedule.d.ts.map +1 -1
  356. package/dist/dts/ScheduleInterval.d.ts +68 -0
  357. package/dist/dts/ScheduleInterval.d.ts.map +1 -1
  358. package/dist/dts/ScheduleIntervals.d.ts +50 -0
  359. package/dist/dts/ScheduleIntervals.d.ts.map +1 -1
  360. package/dist/dts/Scope.d.ts +36 -0
  361. package/dist/dts/Scope.d.ts.map +1 -1
  362. package/dist/dts/ScopedRef.d.ts +43 -1
  363. package/dist/dts/ScopedRef.d.ts.map +1 -1
  364. package/dist/dts/Sink.d.ts +464 -0
  365. package/dist/dts/Sink.d.ts.map +1 -1
  366. package/dist/dts/SortedMap.d.ts +76 -0
  367. package/dist/dts/SortedMap.d.ts.map +1 -1
  368. package/dist/dts/SortedSet.d.ts +142 -0
  369. package/dist/dts/SortedSet.d.ts.map +1 -1
  370. package/dist/dts/Stream.d.ts +4998 -1
  371. package/dist/dts/Stream.d.ts.map +1 -1
  372. package/dist/dts/StreamHaltStrategy.d.ts +12 -0
  373. package/dist/dts/StreamHaltStrategy.d.ts.map +1 -1
  374. package/dist/dts/String.d.ts +200 -0
  375. package/dist/dts/String.d.ts.map +1 -1
  376. package/dist/dts/Struct.d.ts +84 -0
  377. package/dist/dts/Struct.d.ts.map +1 -1
  378. package/dist/dts/Subscribable.d.ts +16 -0
  379. package/dist/dts/Subscribable.d.ts.map +1 -1
  380. package/dist/dts/SubscriptionRef.d.ts +152 -0
  381. package/dist/dts/SubscriptionRef.d.ts.map +1 -1
  382. package/dist/dts/SynchronizedRef.d.ts +152 -0
  383. package/dist/dts/SynchronizedRef.d.ts.map +1 -1
  384. package/dist/dts/TArray.d.ts +426 -0
  385. package/dist/dts/TArray.d.ts.map +1 -1
  386. package/dist/dts/TDeferred.d.ts +24 -0
  387. package/dist/dts/TDeferred.d.ts.map +1 -1
  388. package/dist/dts/TMap.d.ts +366 -0
  389. package/dist/dts/TMap.d.ts.map +1 -1
  390. package/dist/dts/TPriorityQueue.d.ts +60 -0
  391. package/dist/dts/TPriorityQueue.d.ts.map +1 -1
  392. package/dist/dts/TPubSub.d.ts +28 -0
  393. package/dist/dts/TPubSub.d.ts.map +1 -1
  394. package/dist/dts/TQueue.d.ts +108 -0
  395. package/dist/dts/TQueue.d.ts.map +1 -1
  396. package/dist/dts/TReentrantLock.d.ts +36 -0
  397. package/dist/dts/TReentrantLock.d.ts.map +1 -1
  398. package/dist/dts/TRef.d.ts +88 -0
  399. package/dist/dts/TRef.d.ts.map +1 -1
  400. package/dist/dts/TSemaphore.d.ts +40 -0
  401. package/dist/dts/TSemaphore.d.ts.map +1 -1
  402. package/dist/dts/TSet.d.ts +254 -0
  403. package/dist/dts/TSet.d.ts.map +1 -1
  404. package/dist/dts/Take.d.ts +56 -0
  405. package/dist/dts/Take.d.ts.map +1 -1
  406. package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
  407. package/dist/dts/TestClock.d.ts.map +1 -1
  408. package/dist/dts/TestServices.d.ts.map +1 -1
  409. package/dist/dts/Trie.d.ts +906 -0
  410. package/dist/dts/Trie.d.ts.map +1 -1
  411. package/dist/dts/Tuple.d.ts +203 -0
  412. package/dist/dts/Tuple.d.ts.map +1 -1
  413. package/dist/dts/Types.d.ts +39 -0
  414. package/dist/dts/Types.d.ts.map +1 -1
  415. package/dist/dts/Unify.d.ts +26 -13
  416. package/dist/dts/Unify.d.ts.map +1 -1
  417. package/dist/dts/UpstreamPullRequest.d.ts +12 -0
  418. package/dist/dts/UpstreamPullRequest.d.ts.map +1 -1
  419. package/dist/dts/UpstreamPullStrategy.d.ts +12 -0
  420. package/dist/dts/UpstreamPullStrategy.d.ts.map +1 -1
  421. package/dist/dts/Utils.d.ts.map +1 -1
  422. package/dist/dts/internal/core.d.ts.map +1 -1
  423. package/dist/dts/internal/hashMap.d.ts.map +1 -1
  424. package/dist/dts/internal/layer.d.ts.map +1 -1
  425. package/dist/dts/internal/managedRuntime/circular.d.ts +2 -0
  426. package/dist/dts/internal/managedRuntime/circular.d.ts.map +1 -0
  427. package/dist/dts/internal/stream.d.ts.map +1 -1
  428. package/dist/esm/Array.js +21 -0
  429. package/dist/esm/Array.js.map +1 -1
  430. package/dist/esm/BigDecimal.js +6 -3
  431. package/dist/esm/BigDecimal.js.map +1 -1
  432. package/dist/esm/BigInt.js.map +1 -1
  433. package/dist/esm/Boolean.js.map +1 -1
  434. package/dist/esm/Cause.js.map +1 -1
  435. package/dist/esm/Channel.js.map +1 -1
  436. package/dist/esm/ChildExecutorDecision.js.map +1 -1
  437. package/dist/esm/Chunk.js +4 -1
  438. package/dist/esm/Chunk.js.map +1 -1
  439. package/dist/esm/Config.js.map +1 -1
  440. package/dist/esm/ConfigError.js.map +1 -1
  441. package/dist/esm/ConfigProvider.js.map +1 -1
  442. package/dist/esm/ConfigProviderPathPatch.js.map +1 -1
  443. package/dist/esm/Console.js.map +1 -1
  444. package/dist/esm/Context.js.map +1 -1
  445. package/dist/esm/Cron.js +4 -1
  446. package/dist/esm/Cron.js.map +1 -1
  447. package/dist/esm/Data.js.map +1 -1
  448. package/dist/esm/DateTime.js +6 -0
  449. package/dist/esm/DateTime.js.map +1 -1
  450. package/dist/esm/Deferred.js.map +1 -1
  451. package/dist/esm/Differ.js.map +1 -1
  452. package/dist/esm/Duration.js +4 -1
  453. package/dist/esm/Duration.js.map +1 -1
  454. package/dist/esm/Effect.js +116 -30
  455. package/dist/esm/Effect.js.map +1 -1
  456. package/dist/esm/Either.js.map +1 -1
  457. package/dist/esm/Equivalence.js.map +1 -1
  458. package/dist/esm/ExecutionStrategy.js.map +1 -1
  459. package/dist/esm/Exit.js.map +1 -1
  460. package/dist/esm/Fiber.js.map +1 -1
  461. package/dist/esm/FiberHandle.js +3 -0
  462. package/dist/esm/FiberHandle.js.map +1 -1
  463. package/dist/esm/FiberId.js.map +1 -1
  464. package/dist/esm/FiberMap.js +3 -0
  465. package/dist/esm/FiberMap.js.map +1 -1
  466. package/dist/esm/FiberRef.js.map +1 -1
  467. package/dist/esm/FiberRefs.js.map +1 -1
  468. package/dist/esm/FiberRefsPatch.js.map +1 -1
  469. package/dist/esm/FiberSet.js +3 -0
  470. package/dist/esm/FiberSet.js.map +1 -1
  471. package/dist/esm/Function.js.map +1 -1
  472. package/dist/esm/GroupBy.js.map +1 -1
  473. package/dist/esm/Hash.js.map +1 -1
  474. package/dist/esm/HashMap.js.map +1 -1
  475. package/dist/esm/HashSet.js.map +1 -1
  476. package/dist/esm/Inspectable.js +14 -0
  477. package/dist/esm/Inspectable.js.map +1 -1
  478. package/dist/esm/Iterable.js.map +1 -1
  479. package/dist/esm/KeyedPool.js.map +1 -1
  480. package/dist/esm/Layer.js.map +1 -1
  481. package/dist/esm/List.js +7 -1
  482. package/dist/esm/List.js.map +1 -1
  483. package/dist/esm/LogLevel.js.map +1 -1
  484. package/dist/esm/Logger.js.map +1 -1
  485. package/dist/esm/Mailbox.js.map +1 -1
  486. package/dist/esm/ManagedRuntime.js +15 -0
  487. package/dist/esm/ManagedRuntime.js.map +1 -1
  488. package/dist/esm/MergeDecision.js.map +1 -1
  489. package/dist/esm/MergeState.js.map +1 -1
  490. package/dist/esm/MergeStrategy.js.map +1 -1
  491. package/dist/esm/Metric.js.map +1 -1
  492. package/dist/esm/MetricHook.js.map +1 -1
  493. package/dist/esm/MetricKey.js.map +1 -1
  494. package/dist/esm/MetricPolling.js.map +1 -1
  495. package/dist/esm/MetricState.js.map +1 -1
  496. package/dist/esm/Micro.js +7 -1
  497. package/dist/esm/Micro.js.map +1 -1
  498. package/dist/esm/MutableHashMap.js +4 -1
  499. package/dist/esm/MutableHashMap.js.map +1 -1
  500. package/dist/esm/MutableHashSet.js +4 -1
  501. package/dist/esm/MutableHashSet.js.map +1 -1
  502. package/dist/esm/MutableList.js +4 -1
  503. package/dist/esm/MutableList.js.map +1 -1
  504. package/dist/esm/MutableQueue.js +4 -1
  505. package/dist/esm/MutableQueue.js.map +1 -1
  506. package/dist/esm/MutableRef.js +4 -1
  507. package/dist/esm/MutableRef.js.map +1 -1
  508. package/dist/esm/Number.js.map +1 -1
  509. package/dist/esm/Option.js.map +1 -1
  510. package/dist/esm/Order.js.map +1 -1
  511. package/dist/esm/Ordering.js.map +1 -1
  512. package/dist/esm/Pipeable.js.map +1 -1
  513. package/dist/esm/Pool.js.map +1 -1
  514. package/dist/esm/Predicate.js +15 -0
  515. package/dist/esm/Predicate.js.map +1 -1
  516. package/dist/esm/PubSub.js.map +1 -1
  517. package/dist/esm/Queue.js.map +1 -1
  518. package/dist/esm/RcMap.js.map +1 -1
  519. package/dist/esm/Readable.js.map +1 -1
  520. package/dist/esm/Record.js.map +1 -1
  521. package/dist/esm/RedBlackTree.js.map +1 -1
  522. package/dist/esm/Ref.js.map +1 -1
  523. package/dist/esm/RegExp.js +16 -0
  524. package/dist/esm/RegExp.js.map +1 -1
  525. package/dist/esm/Request.js.map +1 -1
  526. package/dist/esm/RequestResolver.js.map +1 -1
  527. package/dist/esm/Resource.js.map +1 -1
  528. package/dist/esm/Runtime.js.map +1 -1
  529. package/dist/esm/RuntimeFlags.js.map +1 -1
  530. package/dist/esm/RuntimeFlagsPatch.js.map +1 -1
  531. package/dist/esm/STM.js.map +1 -1
  532. package/dist/esm/Schedule.js.map +1 -1
  533. package/dist/esm/ScheduleInterval.js.map +1 -1
  534. package/dist/esm/ScheduleIntervals.js.map +1 -1
  535. package/dist/esm/Scheduler.js.map +1 -1
  536. package/dist/esm/Scope.js.map +1 -1
  537. package/dist/esm/ScopedRef.js.map +1 -1
  538. package/dist/esm/Sink.js.map +1 -1
  539. package/dist/esm/SortedMap.js +4 -1
  540. package/dist/esm/SortedMap.js.map +1 -1
  541. package/dist/esm/SortedSet.js +4 -1
  542. package/dist/esm/SortedSet.js.map +1 -1
  543. package/dist/esm/Stream.js +14 -0
  544. package/dist/esm/Stream.js.map +1 -1
  545. package/dist/esm/StreamHaltStrategy.js.map +1 -1
  546. package/dist/esm/String.js.map +1 -1
  547. package/dist/esm/Struct.js.map +1 -1
  548. package/dist/esm/Subscribable.js.map +1 -1
  549. package/dist/esm/SubscriptionRef.js.map +1 -1
  550. package/dist/esm/SynchronizedRef.js.map +1 -1
  551. package/dist/esm/TArray.js.map +1 -1
  552. package/dist/esm/TDeferred.js.map +1 -1
  553. package/dist/esm/TMap.js.map +1 -1
  554. package/dist/esm/TPriorityQueue.js.map +1 -1
  555. package/dist/esm/TPubSub.js.map +1 -1
  556. package/dist/esm/TQueue.js.map +1 -1
  557. package/dist/esm/TReentrantLock.js.map +1 -1
  558. package/dist/esm/TRef.js.map +1 -1
  559. package/dist/esm/TSemaphore.js.map +1 -1
  560. package/dist/esm/TSet.js.map +1 -1
  561. package/dist/esm/Take.js.map +1 -1
  562. package/dist/esm/TestAnnotationMap.js.map +1 -1
  563. package/dist/esm/TestClock.js.map +1 -1
  564. package/dist/esm/TestServices.js.map +1 -1
  565. package/dist/esm/Trie.js.map +1 -1
  566. package/dist/esm/Tuple.js +19 -0
  567. package/dist/esm/Tuple.js.map +1 -1
  568. package/dist/esm/Unify.js.map +1 -1
  569. package/dist/esm/UpstreamPullRequest.js.map +1 -1
  570. package/dist/esm/UpstreamPullStrategy.js.map +1 -1
  571. package/dist/esm/Utils.js +1 -14
  572. package/dist/esm/Utils.js.map +1 -1
  573. package/dist/esm/internal/cause.js +4 -1
  574. package/dist/esm/internal/cause.js.map +1 -1
  575. package/dist/esm/internal/context.js +7 -2
  576. package/dist/esm/internal/context.js.map +1 -1
  577. package/dist/esm/internal/core-effect.js.map +1 -1
  578. package/dist/esm/internal/core.js +14 -2
  579. package/dist/esm/internal/core.js.map +1 -1
  580. package/dist/esm/internal/effect/circular.js +5 -1
  581. package/dist/esm/internal/effect/circular.js.map +1 -1
  582. package/dist/esm/internal/fiberId.js +10 -1
  583. package/dist/esm/internal/fiberId.js.map +1 -1
  584. package/dist/esm/internal/hashMap.js +4 -1
  585. package/dist/esm/internal/hashMap.js.map +1 -1
  586. package/dist/esm/internal/hashSet.js +4 -1
  587. package/dist/esm/internal/hashSet.js.map +1 -1
  588. package/dist/esm/internal/layer.js +32 -18
  589. package/dist/esm/internal/layer.js.map +1 -1
  590. package/dist/esm/internal/mailbox.js +3 -0
  591. package/dist/esm/internal/mailbox.js.map +1 -1
  592. package/dist/esm/internal/managedRuntime/circular.js +4 -0
  593. package/dist/esm/internal/managedRuntime/circular.js.map +1 -0
  594. package/dist/esm/internal/managedRuntime.js +21 -8
  595. package/dist/esm/internal/managedRuntime.js.map +1 -1
  596. package/dist/esm/internal/option.js +4 -1
  597. package/dist/esm/internal/option.js.map +1 -1
  598. package/dist/esm/internal/pool.js +6 -1
  599. package/dist/esm/internal/pool.js.map +1 -1
  600. package/dist/esm/internal/redBlackTree.js +4 -1
  601. package/dist/esm/internal/redBlackTree.js.map +1 -1
  602. package/dist/esm/internal/resource.js +15 -5
  603. package/dist/esm/internal/resource.js.map +1 -1
  604. package/dist/esm/internal/runtime.js +4 -1
  605. package/dist/esm/internal/runtime.js.map +1 -1
  606. package/dist/esm/internal/scopedRef.js +11 -8
  607. package/dist/esm/internal/scopedRef.js.map +1 -1
  608. package/dist/esm/internal/stm/core.js +1 -2
  609. package/dist/esm/internal/stm/core.js.map +1 -1
  610. package/dist/esm/internal/stream.js +9 -0
  611. package/dist/esm/internal/stream.js.map +1 -1
  612. package/dist/esm/internal/trie.js +4 -1
  613. package/dist/esm/internal/trie.js.map +1 -1
  614. package/dist/esm/internal/version.js +1 -1
  615. package/package.json +1 -1
  616. package/src/Array.ts +2791 -40
  617. package/src/BigDecimal.ts +589 -19
  618. package/src/BigInt.ts +516 -16
  619. package/src/Boolean.ts +241 -8
  620. package/src/Cause.ts +177 -1
  621. package/src/Channel.ts +766 -49
  622. package/src/ChildExecutorDecision.ts +12 -0
  623. package/src/Chunk.ts +822 -5
  624. package/src/Config.ts +187 -8
  625. package/src/ConfigError.ts +16 -0
  626. package/src/ConfigProvider.ts +89 -1
  627. package/src/ConfigProviderPathPatch.ts +32 -0
  628. package/src/Console.ts +37 -8
  629. package/src/Context.ts +234 -3
  630. package/src/Cron.ts +16 -1
  631. package/src/Data.ts +165 -0
  632. package/src/DateTime.ts +1012 -50
  633. package/src/Deferred.ts +171 -1
  634. package/src/Differ.ts +89 -27
  635. package/src/Duration.ts +160 -17
  636. package/src/Effect.ts +4717 -164
  637. package/src/Either.ts +650 -34
  638. package/src/Equivalence.ts +24 -0
  639. package/src/ExecutionStrategy.ts +29 -10
  640. package/src/Exit.ts +252 -0
  641. package/src/Fiber.ts +182 -0
  642. package/src/FiberHandle.ts +45 -0
  643. package/src/FiberId.ts +24 -0
  644. package/src/FiberMap.ts +147 -21
  645. package/src/FiberRef.ts +80 -0
  646. package/src/FiberRefs.ts +84 -0
  647. package/src/FiberRefsPatch.ts +35 -1
  648. package/src/FiberSet.ts +41 -0
  649. package/src/Function.ts +416 -31
  650. package/src/GroupBy.ts +38 -0
  651. package/src/Hash.ts +8 -0
  652. package/src/HashMap.ts +316 -0
  653. package/src/HashSet.ts +284 -0
  654. package/src/Inspectable.ts +22 -0
  655. package/src/Iterable.ts +456 -6
  656. package/src/KeyedPool.ts +34 -0
  657. package/src/Layer.ts +475 -38
  658. package/src/List.ts +483 -4
  659. package/src/LogLevel.ts +46 -0
  660. package/src/Logger.ts +195 -4
  661. package/src/Mailbox.ts +16 -0
  662. package/src/ManagedRuntime.ts +46 -2
  663. package/src/MergeDecision.ts +8 -0
  664. package/src/MergeState.ts +8 -0
  665. package/src/MergeStrategy.ts +25 -8
  666. package/src/Metric.ts +426 -15
  667. package/src/MetricHook.ts +24 -0
  668. package/src/MetricKey.ts +62 -8
  669. package/src/MetricPolling.ts +42 -6
  670. package/src/MetricState.ts +16 -0
  671. package/src/Micro.ts +1223 -61
  672. package/src/MutableHashMap.ts +109 -2
  673. package/src/MutableHashSet.ts +28 -1
  674. package/src/MutableList.ts +40 -1
  675. package/src/MutableQueue.ts +66 -1
  676. package/src/MutableRef.ts +60 -1
  677. package/src/Number.ts +500 -16
  678. package/src/Option.ts +1042 -16
  679. package/src/Order.ts +24 -0
  680. package/src/Ordering.ts +66 -0
  681. package/src/Pipeable.ts +224 -21
  682. package/src/Pool.ts +42 -1
  683. package/src/Predicate.ts +514 -0
  684. package/src/PubSub.ts +28 -0
  685. package/src/Queue.ts +106 -2
  686. package/src/RcMap.ts +70 -0
  687. package/src/Readable.ts +18 -7
  688. package/src/Record.ts +814 -40
  689. package/src/RedBlackTree.ts +305 -1
  690. package/src/Ref.ts +88 -0
  691. package/src/RegExp.ts +17 -0
  692. package/src/Request.ts +76 -0
  693. package/src/RequestResolver.ts +145 -4
  694. package/src/Resource.ts +22 -1
  695. package/src/Runtime.ts +134 -2
  696. package/src/RuntimeFlags.ts +100 -0
  697. package/src/RuntimeFlagsPatch.ts +112 -0
  698. package/src/STM.ts +1107 -11
  699. package/src/Schedule.ts +704 -0
  700. package/src/ScheduleInterval.ts +68 -0
  701. package/src/ScheduleIntervals.ts +50 -0
  702. package/src/Scheduler.ts +2 -0
  703. package/src/Scope.ts +36 -0
  704. package/src/ScopedRef.ts +44 -1
  705. package/src/Sink.ts +464 -0
  706. package/src/SortedMap.ts +80 -1
  707. package/src/SortedSet.ts +147 -4
  708. package/src/Stream.ts +5041 -54
  709. package/src/StreamHaltStrategy.ts +29 -12
  710. package/src/String.ts +200 -0
  711. package/src/Struct.ts +86 -7
  712. package/src/Subscribable.ts +16 -0
  713. package/src/SubscriptionRef.ts +159 -11
  714. package/src/SynchronizedRef.ts +169 -8
  715. package/src/TArray.ts +431 -1
  716. package/src/TDeferred.ts +24 -0
  717. package/src/TMap.ts +381 -12
  718. package/src/TPriorityQueue.ts +60 -0
  719. package/src/TPubSub.ts +28 -0
  720. package/src/TQueue.ts +108 -0
  721. package/src/TReentrantLock.ts +36 -0
  722. package/src/TRef.ts +88 -0
  723. package/src/TSemaphore.ts +40 -0
  724. package/src/TSet.ts +280 -12
  725. package/src/Take.ts +56 -0
  726. package/src/TestAnnotationMap.ts +45 -1
  727. package/src/TestClock.ts +6 -0
  728. package/src/TestServices.ts +66 -0
  729. package/src/Trie.ts +906 -0
  730. package/src/Tuple.ts +223 -8
  731. package/src/Types.ts +41 -0
  732. package/src/Unify.ts +28 -17
  733. package/src/UpstreamPullRequest.ts +12 -0
  734. package/src/UpstreamPullStrategy.ts +12 -0
  735. package/src/Utils.ts +1 -15
  736. package/src/internal/cause.ts +4 -1
  737. package/src/internal/context.ts +7 -2
  738. package/src/internal/core-effect.ts +7 -7
  739. package/src/internal/core.ts +14 -2
  740. package/src/internal/effect/circular.ts +8 -2
  741. package/src/internal/fiberId.ts +10 -1
  742. package/src/internal/hashMap.ts +4 -1
  743. package/src/internal/hashSet.ts +4 -1
  744. package/src/internal/layer.ts +105 -38
  745. package/src/internal/mailbox.ts +3 -0
  746. package/src/internal/managedRuntime/circular.ts +6 -0
  747. package/src/internal/managedRuntime.ts +36 -22
  748. package/src/internal/option.ts +4 -1
  749. package/src/internal/pool.ts +7 -1
  750. package/src/internal/redBlackTree.ts +4 -1
  751. package/src/internal/resource.ts +16 -5
  752. package/src/internal/runtime.ts +4 -1
  753. package/src/internal/scopedRef.ts +12 -8
  754. package/src/internal/stm/core.ts +2 -3
  755. package/src/internal/stream.ts +27 -0
  756. package/src/internal/trie.ts +4 -1
  757. package/src/internal/version.ts +1 -1
@@ -96,7 +96,47 @@ export declare const isEmptyReadonlyRecord: <K extends string, A>(self: Readonly
96
96
  * @since 2.0.0
97
97
  */
98
98
  export declare const fromIterableWith: {
99
+ /**
100
+ * Takes an iterable and a projection function and returns a record.
101
+ * 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.
102
+ *
103
+ * @param self - An iterable of values to be mapped to a record.
104
+ * @param f - A projection function that maps values of the iterable to a tuple of a key and a value.
105
+ *
106
+ * @example
107
+ * import { fromIterableWith } from "effect/Record"
108
+ *
109
+ * const input = [1, 2, 3, 4]
110
+ *
111
+ * assert.deepStrictEqual(
112
+ * fromIterableWith(input, a => [String(a), a * 2]),
113
+ * { '1': 2, '2': 4, '3': 6, '4': 8 }
114
+ * )
115
+ *
116
+ * @category constructors
117
+ * @since 2.0.0
118
+ */
99
119
  <A, K extends string | symbol, B>(f: (a: A) => readonly [K, B]): (self: Iterable<A>) => Record<ReadonlyRecord.NonLiteralKey<K>, B>;
120
+ /**
121
+ * Takes an iterable and a projection function and returns a record.
122
+ * 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.
123
+ *
124
+ * @param self - An iterable of values to be mapped to a record.
125
+ * @param f - A projection function that maps values of the iterable to a tuple of a key and a value.
126
+ *
127
+ * @example
128
+ * import { fromIterableWith } from "effect/Record"
129
+ *
130
+ * const input = [1, 2, 3, 4]
131
+ *
132
+ * assert.deepStrictEqual(
133
+ * fromIterableWith(input, a => [String(a), a * 2]),
134
+ * { '1': 2, '2': 4, '3': 6, '4': 8 }
135
+ * )
136
+ *
137
+ * @category constructors
138
+ * @since 2.0.0
139
+ */
100
140
  <A, K extends string | symbol, B>(self: Iterable<A>, f: (a: A) => readonly [K, B]): Record<ReadonlyRecord.NonLiteralKey<K>, B>;
101
141
  };
102
142
  /**
@@ -160,7 +200,37 @@ export declare const fromEntries: <Entry extends readonly [string | symbol, any]
160
200
  * @since 2.0.0
161
201
  */
162
202
  export declare const collect: {
203
+ /**
204
+ * Transforms the values of a record into an `Array` with a custom mapping function.
205
+ *
206
+ * @param self - The record to transform.
207
+ * @param f - The custom mapping function to apply to each key/value of the record.
208
+ *
209
+ * @example
210
+ * import { collect } from "effect/Record"
211
+ *
212
+ * const x = { a: 1, b: 2, c: 3 }
213
+ * assert.deepStrictEqual(collect(x, (key, n) => [key, n]), [["a", 1], ["b", 2], ["c", 3]])
214
+ *
215
+ * @category conversions
216
+ * @since 2.0.0
217
+ */
163
218
  <K extends string, A, B>(f: (key: K, a: A) => B): (self: ReadonlyRecord<K, A>) => Array<B>;
219
+ /**
220
+ * Transforms the values of a record into an `Array` with a custom mapping function.
221
+ *
222
+ * @param self - The record to transform.
223
+ * @param f - The custom mapping function to apply to each key/value of the record.
224
+ *
225
+ * @example
226
+ * import { collect } from "effect/Record"
227
+ *
228
+ * const x = { a: 1, b: 2, c: 3 }
229
+ * assert.deepStrictEqual(collect(x, (key, n) => [key, n]), [["a", 1], ["b", 2], ["c", 3]])
230
+ *
231
+ * @category conversions
232
+ * @since 2.0.0
233
+ */
164
234
  <K extends string, A, B>(self: ReadonlyRecord<K, A>, f: (key: K, a: A) => B): Array<B>;
165
235
  };
166
236
  /**
@@ -206,7 +276,35 @@ export declare const size: <K extends string, A>(self: ReadonlyRecord<K, A>) =>
206
276
  * @since 2.0.0
207
277
  */
208
278
  export declare const has: {
279
+ /**
280
+ * Check if a given `key` exists in a record.
281
+ *
282
+ * @param self - the record to look in.
283
+ * @param key - the key to look for in the record.
284
+ *
285
+ * @example
286
+ * import { empty, has } from "effect/Record"
287
+ *
288
+ * assert.deepStrictEqual(has({ a: 1, b: 2 }, "a"), true);
289
+ * assert.deepStrictEqual(has(empty<string>(), "c"), false);
290
+ *
291
+ * @since 2.0.0
292
+ */
209
293
  <K extends string | symbol>(key: NoInfer<K>): <A>(self: ReadonlyRecord<K, A>) => boolean;
294
+ /**
295
+ * Check if a given `key` exists in a record.
296
+ *
297
+ * @param self - the record to look in.
298
+ * @param key - the key to look for in the record.
299
+ *
300
+ * @example
301
+ * import { empty, has } from "effect/Record"
302
+ *
303
+ * assert.deepStrictEqual(has({ a: 1, b: 2 }, "a"), true);
304
+ * assert.deepStrictEqual(has(empty<string>(), "c"), false);
305
+ *
306
+ * @since 2.0.0
307
+ */
210
308
  <K extends string | symbol, A>(self: ReadonlyRecord<K, A>, key: NoInfer<K>): boolean;
211
309
  };
212
310
  /**
@@ -226,7 +324,39 @@ export declare const has: {
226
324
  * @since 2.0.0
227
325
  */
228
326
  export declare const get: {
327
+ /**
328
+ * Retrieve a value at a particular key from a record, returning it wrapped in an `Option`.
329
+ *
330
+ * @param self - The record to retrieve value from.
331
+ * @param key - Key to retrieve from record.
332
+ *
333
+ * @example
334
+ * import { Record as R, Option } from "effect"
335
+ *
336
+ * const person: Record<string, unknown> = { name: "John Doe", age: 35 }
337
+ *
338
+ * assert.deepStrictEqual(R.get(person, "name"), Option.some("John Doe"))
339
+ * assert.deepStrictEqual(R.get(person, "email"), Option.none())
340
+ *
341
+ * @since 2.0.0
342
+ */
229
343
  <K extends string | symbol>(key: NoInfer<K>): <A>(self: ReadonlyRecord<K, A>) => Option.Option<A>;
344
+ /**
345
+ * Retrieve a value at a particular key from a record, returning it wrapped in an `Option`.
346
+ *
347
+ * @param self - The record to retrieve value from.
348
+ * @param key - Key to retrieve from record.
349
+ *
350
+ * @example
351
+ * import { Record as R, Option } from "effect"
352
+ *
353
+ * const person: Record<string, unknown> = { name: "John Doe", age: 35 }
354
+ *
355
+ * assert.deepStrictEqual(R.get(person, "name"), Option.some("John Doe"))
356
+ * assert.deepStrictEqual(R.get(person, "email"), Option.none())
357
+ *
358
+ * @since 2.0.0
359
+ */
230
360
  <K extends string | symbol, A>(self: ReadonlyRecord<K, A>, key: NoInfer<K>): Option.Option<A>;
231
361
  };
232
362
  /**
@@ -254,7 +384,55 @@ export declare const get: {
254
384
  * @since 2.0.0
255
385
  */
256
386
  export declare const modify: {
387
+ /**
388
+ * Apply a function to the element at the specified key, creating a new record.
389
+ * If the key does not exist, the record is returned unchanged.
390
+ *
391
+ * @param self - The record to be updated.
392
+ * @param key - The key of the element to modify.
393
+ * @param f - The function to apply to the element.
394
+ *
395
+ * @example
396
+ * import { Record as R } from "effect"
397
+ *
398
+ * const f = (x: number) => x * 2
399
+ *
400
+ * assert.deepStrictEqual(
401
+ * R.modify({ a: 3 }, 'a', f),
402
+ * { a: 6 }
403
+ * )
404
+ * assert.deepStrictEqual(
405
+ * R.modify({ a: 3 } as Record<string, number>, 'b', f),
406
+ * { a: 3 }
407
+ * )
408
+ *
409
+ * @since 2.0.0
410
+ */
257
411
  <K extends string | symbol, A, B>(key: NoInfer<K>, f: (a: A) => B): (self: ReadonlyRecord<K, A>) => Record<K, A | B>;
412
+ /**
413
+ * Apply a function to the element at the specified key, creating a new record.
414
+ * If the key does not exist, the record is returned unchanged.
415
+ *
416
+ * @param self - The record to be updated.
417
+ * @param key - The key of the element to modify.
418
+ * @param f - The function to apply to the element.
419
+ *
420
+ * @example
421
+ * import { Record as R } from "effect"
422
+ *
423
+ * const f = (x: number) => x * 2
424
+ *
425
+ * assert.deepStrictEqual(
426
+ * R.modify({ a: 3 }, 'a', f),
427
+ * { a: 6 }
428
+ * )
429
+ * assert.deepStrictEqual(
430
+ * R.modify({ a: 3 } as Record<string, number>, 'b', f),
431
+ * { a: 3 }
432
+ * )
433
+ *
434
+ * @since 2.0.0
435
+ */
258
436
  <K extends string | symbol, A, B>(self: ReadonlyRecord<K, A>, key: NoInfer<K>, f: (a: A) => B): Record<K, A | B>;
259
437
  };
260
438
  /**
@@ -282,7 +460,55 @@ export declare const modify: {
282
460
  * @since 2.0.0
283
461
  */
284
462
  export declare const modifyOption: {
463
+ /**
464
+ * Apply a function to the element at the specified key, creating a new record,
465
+ * or return `None` if the key doesn't exist.
466
+ *
467
+ * @param self - The record to be updated.
468
+ * @param key - The key of the element to modify.
469
+ * @param f - The function to apply to the element.
470
+ *
471
+ * @example
472
+ * import { Record as R, Option } from "effect"
473
+ *
474
+ * const f = (x: number) => x * 2
475
+ *
476
+ * assert.deepStrictEqual(
477
+ * R.modifyOption({ a: 3 }, 'a', f),
478
+ * Option.some({ a: 6 })
479
+ * )
480
+ * assert.deepStrictEqual(
481
+ * R.modifyOption({ a: 3 } as Record<string, number>, 'b', f),
482
+ * Option.none()
483
+ * )
484
+ *
485
+ * @since 2.0.0
486
+ */
285
487
  <K extends string | symbol, A, B>(key: NoInfer<K>, f: (a: A) => B): (self: ReadonlyRecord<K, A>) => Option.Option<Record<K, A | B>>;
488
+ /**
489
+ * Apply a function to the element at the specified key, creating a new record,
490
+ * or return `None` if the key doesn't exist.
491
+ *
492
+ * @param self - The record to be updated.
493
+ * @param key - The key of the element to modify.
494
+ * @param f - The function to apply to the element.
495
+ *
496
+ * @example
497
+ * import { Record as R, Option } from "effect"
498
+ *
499
+ * const f = (x: number) => x * 2
500
+ *
501
+ * assert.deepStrictEqual(
502
+ * R.modifyOption({ a: 3 }, 'a', f),
503
+ * Option.some({ a: 6 })
504
+ * )
505
+ * assert.deepStrictEqual(
506
+ * R.modifyOption({ a: 3 } as Record<string, number>, 'b', f),
507
+ * Option.none()
508
+ * )
509
+ *
510
+ * @since 2.0.0
511
+ */
286
512
  <K extends string | symbol, A, B>(self: ReadonlyRecord<K, A>, key: NoInfer<K>, f: (a: A) => B): Option.Option<Record<K, A | B>>;
287
513
  };
288
514
  /**
@@ -304,7 +530,43 @@ export declare const modifyOption: {
304
530
  * @since 2.0.0
305
531
  */
306
532
  export declare const replaceOption: {
533
+ /**
534
+ * Replaces a value in the record with the new value passed as parameter.
535
+ *
536
+ * @param self - The record to be updated.
537
+ * @param key - The key to search for in the record.
538
+ * @param b - The new value to replace the existing value with.
539
+ *
540
+ * @example
541
+ * import { Record, Option } from "effect"
542
+ *
543
+ * assert.deepStrictEqual(
544
+ * Record.replaceOption({ a: 1, b: 2, c: 3 }, 'a', 10),
545
+ * Option.some({ a: 10, b: 2, c: 3 })
546
+ * )
547
+ * assert.deepStrictEqual(Record.replaceOption(Record.empty<string>(), 'a', 10), Option.none())
548
+ *
549
+ * @since 2.0.0
550
+ */
307
551
  <K extends string | symbol, B>(key: NoInfer<K>, b: B): <A>(self: ReadonlyRecord<K, A>) => Option.Option<Record<K, A | B>>;
552
+ /**
553
+ * Replaces a value in the record with the new value passed as parameter.
554
+ *
555
+ * @param self - The record to be updated.
556
+ * @param key - The key to search for in the record.
557
+ * @param b - The new value to replace the existing value with.
558
+ *
559
+ * @example
560
+ * import { Record, Option } from "effect"
561
+ *
562
+ * assert.deepStrictEqual(
563
+ * Record.replaceOption({ a: 1, b: 2, c: 3 }, 'a', 10),
564
+ * Option.some({ a: 10, b: 2, c: 3 })
565
+ * )
566
+ * assert.deepStrictEqual(Record.replaceOption(Record.empty<string>(), 'a', 10), Option.none())
567
+ *
568
+ * @since 2.0.0
569
+ */
308
570
  <K extends string | symbol, A, B>(self: ReadonlyRecord<K, A>, key: NoInfer<K>, b: B): Option.Option<Record<K, A | B>>;
309
571
  };
310
572
  /**
@@ -322,7 +584,35 @@ export declare const replaceOption: {
322
584
  * @since 2.0.0
323
585
  */
324
586
  export declare const remove: {
587
+ /**
588
+ * If the given key exists in the record, returns a new record with the key removed,
589
+ * otherwise returns a copy of the original record.
590
+ *
591
+ * @param self - the record to remove the key from.
592
+ * @param key - the key to remove from the record.
593
+ *
594
+ * @example
595
+ * import { remove } from "effect/Record"
596
+ *
597
+ * assert.deepStrictEqual(remove({ a: 1, b: 2 }, "a"), { b: 2 })
598
+ *
599
+ * @since 2.0.0
600
+ */
325
601
  <K extends string | symbol, X extends K>(key: X): <A>(self: ReadonlyRecord<K, A>) => Record<Exclude<K, X>, A>;
602
+ /**
603
+ * If the given key exists in the record, returns a new record with the key removed,
604
+ * otherwise returns a copy of the original record.
605
+ *
606
+ * @param self - the record to remove the key from.
607
+ * @param key - the key to remove from the record.
608
+ *
609
+ * @example
610
+ * import { remove } from "effect/Record"
611
+ *
612
+ * assert.deepStrictEqual(remove({ a: 1, b: 2 }, "a"), { b: 2 })
613
+ *
614
+ * @since 2.0.0
615
+ */
326
616
  <K extends string | symbol, A, X extends K>(self: ReadonlyRecord<K, A>, key: X): Record<Exclude<K, X>, A>;
327
617
  };
328
618
  /**
@@ -343,7 +633,41 @@ export declare const remove: {
343
633
  * @since 2.0.0
344
634
  */
345
635
  export declare const pop: {
636
+ /**
637
+ * Retrieves the value of the property with the given `key` from a record and returns an `Option`
638
+ * of a tuple with the value and the record with the removed property.
639
+ * If the key is not present, returns `O.none`.
640
+ *
641
+ * @param self - The input record.
642
+ * @param key - The key of the property to retrieve.
643
+ *
644
+ * @example
645
+ * import { Record as R, Option } from "effect"
646
+ *
647
+ * assert.deepStrictEqual(R.pop({ a: 1, b: 2 }, "a"), Option.some([1, { b: 2 }]))
648
+ * assert.deepStrictEqual(R.pop({ a: 1, b: 2 } as Record<string, number>, "c"), Option.none())
649
+ *
650
+ * @category record
651
+ * @since 2.0.0
652
+ */
346
653
  <K extends string | symbol, X extends K>(key: X): <A>(self: ReadonlyRecord<K, A>) => Option.Option<[A, Record<Exclude<K, X>, A>]>;
654
+ /**
655
+ * Retrieves the value of the property with the given `key` from a record and returns an `Option`
656
+ * of a tuple with the value and the record with the removed property.
657
+ * If the key is not present, returns `O.none`.
658
+ *
659
+ * @param self - The input record.
660
+ * @param key - The key of the property to retrieve.
661
+ *
662
+ * @example
663
+ * import { Record as R, Option } from "effect"
664
+ *
665
+ * assert.deepStrictEqual(R.pop({ a: 1, b: 2 }, "a"), Option.some([1, { b: 2 }]))
666
+ * assert.deepStrictEqual(R.pop({ a: 1, b: 2 } as Record<string, number>, "c"), Option.none())
667
+ *
668
+ * @category record
669
+ * @since 2.0.0
670
+ */
347
671
  <K extends string | symbol, A, X extends K>(self: ReadonlyRecord<K, A>, key: X): Option.Option<[A, Record<Exclude<K, X>, A>]>;
348
672
  };
349
673
  /**
@@ -367,7 +691,47 @@ export declare const pop: {
367
691
  * @since 2.0.0
368
692
  */
369
693
  export declare const map: {
694
+ /**
695
+ * Maps a record into another record by applying a transformation function to each of its values.
696
+ *
697
+ * @param self - The record to be mapped.
698
+ * @param f - A transformation function that will be applied to each of the values in the record.
699
+ *
700
+ * @example
701
+ * import { map } from "effect/Record"
702
+ *
703
+ * const f = (n: number) => `-${n}`
704
+ *
705
+ * assert.deepStrictEqual(map({ a: 3, b: 5 }, f), { a: "-3", b: "-5" })
706
+ *
707
+ * const g = (n: number, key: string) => `${key.toUpperCase()}-${n}`
708
+ *
709
+ * assert.deepStrictEqual(map({ a: 3, b: 5 }, g), { a: "A-3", b: "B-5" })
710
+ *
711
+ * @category mapping
712
+ * @since 2.0.0
713
+ */
370
714
  <K extends string, A, B>(f: (a: A, key: NoInfer<K>) => B): (self: ReadonlyRecord<K, A>) => Record<K, B>;
715
+ /**
716
+ * Maps a record into another record by applying a transformation function to each of its values.
717
+ *
718
+ * @param self - The record to be mapped.
719
+ * @param f - A transformation function that will be applied to each of the values in the record.
720
+ *
721
+ * @example
722
+ * import { map } from "effect/Record"
723
+ *
724
+ * const f = (n: number) => `-${n}`
725
+ *
726
+ * assert.deepStrictEqual(map({ a: 3, b: 5 }, f), { a: "-3", b: "-5" })
727
+ *
728
+ * const g = (n: number, key: string) => `${key.toUpperCase()}-${n}`
729
+ *
730
+ * assert.deepStrictEqual(map({ a: 3, b: 5 }, g), { a: "A-3", b: "B-5" })
731
+ *
732
+ * @category mapping
733
+ * @since 2.0.0
734
+ */
371
735
  <K extends string, A, B>(self: ReadonlyRecord<K, A>, f: (a: A, key: NoInfer<K>) => B): Record<K, B>;
372
736
  };
373
737
  /**
@@ -382,7 +746,29 @@ export declare const map: {
382
746
  * @since 2.0.0
383
747
  */
384
748
  export declare const mapKeys: {
749
+ /**
750
+ * Maps the keys of a `ReadonlyRecord` while preserving the corresponding values.
751
+ *
752
+ * @example
753
+ * import { mapKeys } from "effect/Record"
754
+ *
755
+ * assert.deepStrictEqual(mapKeys({ a: 3, b: 5 }, (key) => key.toUpperCase()), { A: 3, B: 5 })
756
+ *
757
+ * @category mapping
758
+ * @since 2.0.0
759
+ */
385
760
  <K extends string, A, K2 extends string>(f: (key: K, a: A) => K2): (self: ReadonlyRecord<K, A>) => Record<K2, A>;
761
+ /**
762
+ * Maps the keys of a `ReadonlyRecord` while preserving the corresponding values.
763
+ *
764
+ * @example
765
+ * import { mapKeys } from "effect/Record"
766
+ *
767
+ * assert.deepStrictEqual(mapKeys({ a: 3, b: 5 }, (key) => key.toUpperCase()), { A: 3, B: 5 })
768
+ *
769
+ * @category mapping
770
+ * @since 2.0.0
771
+ */
386
772
  <K extends string, A, K2 extends string>(self: ReadonlyRecord<K, A>, f: (key: K, a: A) => K2): Record<K2, A>;
387
773
  };
388
774
  /**
@@ -397,7 +783,29 @@ export declare const mapKeys: {
397
783
  * @since 2.0.0
398
784
  */
399
785
  export declare const mapEntries: {
786
+ /**
787
+ * Maps entries of a `ReadonlyRecord` using the provided function, allowing modification of both keys and corresponding values.
788
+ *
789
+ * @example
790
+ * import { mapEntries } from "effect/Record"
791
+ *
792
+ * assert.deepStrictEqual(mapEntries({ a: 3, b: 5 }, (a, key) => [key.toUpperCase(), a + 1]), { A: 4, B: 6 })
793
+ *
794
+ * @category mapping
795
+ * @since 2.0.0
796
+ */
400
797
  <K extends string, A, K2 extends string, B>(f: (a: A, key: K) => readonly [K2, B]): (self: ReadonlyRecord<K, A>) => Record<K2, B>;
798
+ /**
799
+ * Maps entries of a `ReadonlyRecord` using the provided function, allowing modification of both keys and corresponding values.
800
+ *
801
+ * @example
802
+ * import { mapEntries } from "effect/Record"
803
+ *
804
+ * assert.deepStrictEqual(mapEntries({ a: 3, b: 5 }, (a, key) => [key.toUpperCase(), a + 1]), { A: 4, B: 6 })
805
+ *
806
+ * @category mapping
807
+ * @since 2.0.0
808
+ */
401
809
  <K extends string, A, K2 extends string, B>(self: ReadonlyRecord<K, A>, f: (a: A, key: K) => [K2, B]): Record<K2, B>;
402
810
  };
403
811
  /**
@@ -417,7 +825,39 @@ export declare const mapEntries: {
417
825
  * @since 2.0.0
418
826
  */
419
827
  export declare const filterMap: {
828
+ /**
829
+ * Transforms a record into a record by applying the function `f` to each key and value in the original record.
830
+ * If the function returns `Some`, the key-value pair is included in the output record.
831
+ *
832
+ * @param self - The input record.
833
+ * @param f - The transformation function.
834
+ *
835
+ * @example
836
+ * import { Record, Option } from "effect"
837
+ *
838
+ * const x = { a: 1, b: 2, c: 3 }
839
+ * const f = (a: number, key: string) => a > 2 ? Option.some(a * 2) : Option.none()
840
+ * assert.deepStrictEqual(Record.filterMap(x, f), { c: 6 })
841
+ *
842
+ * @since 2.0.0
843
+ */
420
844
  <K extends string, A, B>(f: (a: A, key: K) => Option.Option<B>): (self: ReadonlyRecord<K, A>) => Record<ReadonlyRecord.NonLiteralKey<K>, B>;
845
+ /**
846
+ * Transforms a record into a record by applying the function `f` to each key and value in the original record.
847
+ * If the function returns `Some`, the key-value pair is included in the output record.
848
+ *
849
+ * @param self - The input record.
850
+ * @param f - The transformation function.
851
+ *
852
+ * @example
853
+ * import { Record, Option } from "effect"
854
+ *
855
+ * const x = { a: 1, b: 2, c: 3 }
856
+ * const f = (a: number, key: string) => a > 2 ? Option.some(a * 2) : Option.none()
857
+ * assert.deepStrictEqual(Record.filterMap(x, f), { c: 6 })
858
+ *
859
+ * @since 2.0.0
860
+ */
421
861
  <K extends string, A, B>(self: ReadonlyRecord<K, A>, f: (a: A, key: K) => Option.Option<B>): Record<ReadonlyRecord.NonLiteralKey<K>, B>;
422
862
  };
423
863
  /**
@@ -436,9 +876,69 @@ export declare const filterMap: {
436
876
  * @since 2.0.0
437
877
  */
438
878
  export declare const filter: {
879
+ /**
880
+ * Selects properties from a record whose values match the given predicate.
881
+ *
882
+ * @param self - The record to filter.
883
+ * @param predicate - A function that returns a `boolean` value to determine if the entry should be included in the new record.
884
+ *
885
+ * @example
886
+ * import { filter } from "effect/Record"
887
+ *
888
+ * const x = { a: 1, b: 2, c: 3, d: 4 }
889
+ * assert.deepStrictEqual(filter(x, (n) => n > 2), { c: 3, d: 4 })
890
+ *
891
+ * @category filtering
892
+ * @since 2.0.0
893
+ */
439
894
  <K extends string, A, B extends A>(refinement: (a: NoInfer<A>, key: K) => a is B): (self: ReadonlyRecord<K, A>) => Record<ReadonlyRecord.NonLiteralKey<K>, B>;
895
+ /**
896
+ * Selects properties from a record whose values match the given predicate.
897
+ *
898
+ * @param self - The record to filter.
899
+ * @param predicate - A function that returns a `boolean` value to determine if the entry should be included in the new record.
900
+ *
901
+ * @example
902
+ * import { filter } from "effect/Record"
903
+ *
904
+ * const x = { a: 1, b: 2, c: 3, d: 4 }
905
+ * assert.deepStrictEqual(filter(x, (n) => n > 2), { c: 3, d: 4 })
906
+ *
907
+ * @category filtering
908
+ * @since 2.0.0
909
+ */
440
910
  <K extends string, A>(predicate: (A: NoInfer<A>, key: K) => boolean): (self: ReadonlyRecord<K, A>) => Record<ReadonlyRecord.NonLiteralKey<K>, A>;
911
+ /**
912
+ * Selects properties from a record whose values match the given predicate.
913
+ *
914
+ * @param self - The record to filter.
915
+ * @param predicate - A function that returns a `boolean` value to determine if the entry should be included in the new record.
916
+ *
917
+ * @example
918
+ * import { filter } from "effect/Record"
919
+ *
920
+ * const x = { a: 1, b: 2, c: 3, d: 4 }
921
+ * assert.deepStrictEqual(filter(x, (n) => n > 2), { c: 3, d: 4 })
922
+ *
923
+ * @category filtering
924
+ * @since 2.0.0
925
+ */
441
926
  <K extends string, A, B extends A>(self: ReadonlyRecord<K, A>, refinement: (a: A, key: K) => a is B): Record<ReadonlyRecord.NonLiteralKey<K>, B>;
927
+ /**
928
+ * Selects properties from a record whose values match the given predicate.
929
+ *
930
+ * @param self - The record to filter.
931
+ * @param predicate - A function that returns a `boolean` value to determine if the entry should be included in the new record.
932
+ *
933
+ * @example
934
+ * import { filter } from "effect/Record"
935
+ *
936
+ * const x = { a: 1, b: 2, c: 3, d: 4 }
937
+ * assert.deepStrictEqual(filter(x, (n) => n > 2), { c: 3, d: 4 })
938
+ *
939
+ * @category filtering
940
+ * @since 2.0.0
941
+ */
442
942
  <K extends string, A>(self: ReadonlyRecord<K, A>, predicate: (a: A, key: K) => boolean): Record<ReadonlyRecord.NonLiteralKey<K>, A>;
443
943
  };
444
944
  /**
@@ -505,7 +1005,39 @@ export declare const getRights: <K extends string, R, L>(self: ReadonlyRecord<K,
505
1005
  * @since 2.0.0
506
1006
  */
507
1007
  export declare const partitionMap: {
1008
+ /**
1009
+ * Partitions the elements of a record into two groups: those that match a predicate, and those that don't.
1010
+ *
1011
+ * @param self - The record to partition.
1012
+ * @param f - The predicate function to apply to each element.
1013
+ *
1014
+ * @example
1015
+ * import { Record, Either } from "effect"
1016
+ *
1017
+ * const x = { a: 1, b: 2, c: 3 }
1018
+ * const f = (n: number) => (n % 2 === 0 ? Either.right(n) : Either.left(n))
1019
+ * assert.deepStrictEqual(Record.partitionMap(x, f), [{ a: 1, c: 3 }, { b: 2}])
1020
+ *
1021
+ * @category filtering
1022
+ * @since 2.0.0
1023
+ */
508
1024
  <K extends string, A, B, C>(f: (a: A, key: K) => Either<C, B>): (self: ReadonlyRecord<K, A>) => [left: Record<ReadonlyRecord.NonLiteralKey<K>, B>, right: Record<ReadonlyRecord.NonLiteralKey<K>, C>];
1025
+ /**
1026
+ * Partitions the elements of a record into two groups: those that match a predicate, and those that don't.
1027
+ *
1028
+ * @param self - The record to partition.
1029
+ * @param f - The predicate function to apply to each element.
1030
+ *
1031
+ * @example
1032
+ * import { Record, Either } from "effect"
1033
+ *
1034
+ * const x = { a: 1, b: 2, c: 3 }
1035
+ * const f = (n: number) => (n % 2 === 0 ? Either.right(n) : Either.left(n))
1036
+ * assert.deepStrictEqual(Record.partitionMap(x, f), [{ a: 1, c: 3 }, { b: 2}])
1037
+ *
1038
+ * @category filtering
1039
+ * @since 2.0.0
1040
+ */
509
1041
  <K extends string, A, B, C>(self: ReadonlyRecord<K, A>, f: (a: A, key: K) => Either<C, B>): [left: Record<ReadonlyRecord.NonLiteralKey<K>, B>, right: Record<ReadonlyRecord.NonLiteralKey<K>, C>];
510
1042
  };
511
1043
  /**
@@ -544,15 +1076,83 @@ export declare const separate: <K extends string, A, B>(self: ReadonlyRecord<K,
544
1076
  * @since 2.0.0
545
1077
  */
546
1078
  export declare const partition: {
1079
+ /**
1080
+ * Partitions a record into two separate records based on the result of a predicate function.
1081
+ *
1082
+ * @param self - The input record to partition.
1083
+ * @param predicate - The partitioning function to determine the partitioning of each value of the record.
1084
+ *
1085
+ * @example
1086
+ * import { partition } from "effect/Record"
1087
+ *
1088
+ * assert.deepStrictEqual(
1089
+ * partition({ a: 1, b: 3 }, (n) => n > 2),
1090
+ * [{ a: 1 }, { b: 3 }]
1091
+ * )
1092
+ *
1093
+ * @category filtering
1094
+ * @since 2.0.0
1095
+ */
547
1096
  <K extends string, A, B extends A>(refinement: (a: NoInfer<A>, key: K) => a is B): (self: ReadonlyRecord<K, A>) => [
548
1097
  excluded: Record<ReadonlyRecord.NonLiteralKey<K>, Exclude<A, B>>,
549
1098
  satisfying: Record<ReadonlyRecord.NonLiteralKey<K>, B>
550
1099
  ];
1100
+ /**
1101
+ * Partitions a record into two separate records based on the result of a predicate function.
1102
+ *
1103
+ * @param self - The input record to partition.
1104
+ * @param predicate - The partitioning function to determine the partitioning of each value of the record.
1105
+ *
1106
+ * @example
1107
+ * import { partition } from "effect/Record"
1108
+ *
1109
+ * assert.deepStrictEqual(
1110
+ * partition({ a: 1, b: 3 }, (n) => n > 2),
1111
+ * [{ a: 1 }, { b: 3 }]
1112
+ * )
1113
+ *
1114
+ * @category filtering
1115
+ * @since 2.0.0
1116
+ */
551
1117
  <K extends string, A>(predicate: (a: NoInfer<A>, key: K) => boolean): (self: ReadonlyRecord<K, A>) => [excluded: Record<ReadonlyRecord.NonLiteralKey<K>, A>, satisfying: Record<ReadonlyRecord.NonLiteralKey<K>, A>];
1118
+ /**
1119
+ * Partitions a record into two separate records based on the result of a predicate function.
1120
+ *
1121
+ * @param self - The input record to partition.
1122
+ * @param predicate - The partitioning function to determine the partitioning of each value of the record.
1123
+ *
1124
+ * @example
1125
+ * import { partition } from "effect/Record"
1126
+ *
1127
+ * assert.deepStrictEqual(
1128
+ * partition({ a: 1, b: 3 }, (n) => n > 2),
1129
+ * [{ a: 1 }, { b: 3 }]
1130
+ * )
1131
+ *
1132
+ * @category filtering
1133
+ * @since 2.0.0
1134
+ */
552
1135
  <K extends string, A, B extends A>(self: ReadonlyRecord<K, A>, refinement: (a: A, key: K) => a is B): [
553
1136
  excluded: Record<ReadonlyRecord.NonLiteralKey<K>, Exclude<A, B>>,
554
1137
  satisfying: Record<ReadonlyRecord.NonLiteralKey<K>, B>
555
1138
  ];
1139
+ /**
1140
+ * Partitions a record into two separate records based on the result of a predicate function.
1141
+ *
1142
+ * @param self - The input record to partition.
1143
+ * @param predicate - The partitioning function to determine the partitioning of each value of the record.
1144
+ *
1145
+ * @example
1146
+ * import { partition } from "effect/Record"
1147
+ *
1148
+ * assert.deepStrictEqual(
1149
+ * partition({ a: 1, b: 3 }, (n) => n > 2),
1150
+ * [{ a: 1 }, { b: 3 }]
1151
+ * )
1152
+ *
1153
+ * @category filtering
1154
+ * @since 2.0.0
1155
+ */
556
1156
  <K extends string, A>(self: ReadonlyRecord<K, A>, predicate: (a: A, key: K) => boolean): [excluded: Record<ReadonlyRecord.NonLiteralKey<K>, A>, satisfying: Record<ReadonlyRecord.NonLiteralKey<K>, A>];
557
1157
  };
558
1158
  /**
@@ -587,7 +1187,37 @@ export declare const values: <K extends string, A>(self: ReadonlyRecord<K, A>) =
587
1187
  * @since 2.0.0
588
1188
  */
589
1189
  export declare const set: {
1190
+ /**
1191
+ * Add a new key-value pair or update an existing key's value in a record.
1192
+ *
1193
+ * @param self - The record to which you want to add or update a key-value pair.
1194
+ * @param key - The key you want to add or update.
1195
+ * @param values - The value you want to associate with the key.
1196
+ *
1197
+ * @example
1198
+ * import { set } from "effect/Record"
1199
+ *
1200
+ * assert.deepStrictEqual(set("a", 5)({ a: 1, b: 2 }), { a: 5, b: 2 });
1201
+ * assert.deepStrictEqual(set("c", 5)({ a: 1, b: 2 }), { a: 1, b: 2, c: 5 });
1202
+ *
1203
+ * @since 2.0.0
1204
+ */
590
1205
  <K extends string | symbol, K1 extends K | ((string | symbol) & {}), B>(key: K1, value: B): <A>(self: ReadonlyRecord<K, A>) => Record<K | K1, A | B>;
1206
+ /**
1207
+ * Add a new key-value pair or update an existing key's value in a record.
1208
+ *
1209
+ * @param self - The record to which you want to add or update a key-value pair.
1210
+ * @param key - The key you want to add or update.
1211
+ * @param values - The value you want to associate with the key.
1212
+ *
1213
+ * @example
1214
+ * import { set } from "effect/Record"
1215
+ *
1216
+ * assert.deepStrictEqual(set("a", 5)({ a: 1, b: 2 }), { a: 5, b: 2 });
1217
+ * assert.deepStrictEqual(set("c", 5)({ a: 1, b: 2 }), { a: 1, b: 2, c: 5 });
1218
+ *
1219
+ * @since 2.0.0
1220
+ */
591
1221
  <K extends string | symbol, A, K1 extends K | ((string | symbol) & {}), B>(self: ReadonlyRecord<K, A>, key: K1, value: B): Record<K | K1, A | B>;
592
1222
  };
593
1223
  /**
@@ -607,7 +1237,39 @@ export declare const set: {
607
1237
  * @since 2.0.0
608
1238
  */
609
1239
  export declare const replace: {
1240
+ /**
1241
+ * Replace a key's value in a record and return the updated record.
1242
+ * If the key does not exist in the record, a copy of the original record is returned.
1243
+ *
1244
+ * @param self - The original record.
1245
+ * @param key - The key to replace.
1246
+ * @param value - The new value to associate with the key.
1247
+ *
1248
+ * @example
1249
+ * import { Record } from "effect"
1250
+ *
1251
+ * assert.deepStrictEqual(Record.replace("a", 3)({ a: 1, b: 2 }), { a: 3, b: 2 });
1252
+ * assert.deepStrictEqual(Record.replace("c", 3)({ a: 1, b: 2 }), { a: 1, b: 2 });
1253
+ *
1254
+ * @since 2.0.0
1255
+ */
610
1256
  <K extends string | symbol, B>(key: NoInfer<K>, value: B): <A>(self: ReadonlyRecord<K, A>) => Record<K, A | B>;
1257
+ /**
1258
+ * Replace a key's value in a record and return the updated record.
1259
+ * If the key does not exist in the record, a copy of the original record is returned.
1260
+ *
1261
+ * @param self - The original record.
1262
+ * @param key - The key to replace.
1263
+ * @param value - The new value to associate with the key.
1264
+ *
1265
+ * @example
1266
+ * import { Record } from "effect"
1267
+ *
1268
+ * assert.deepStrictEqual(Record.replace("a", 3)({ a: 1, b: 2 }), { a: 3, b: 2 });
1269
+ * assert.deepStrictEqual(Record.replace("c", 3)({ a: 1, b: 2 }), { a: 1, b: 2 });
1270
+ *
1271
+ * @since 2.0.0
1272
+ */
611
1273
  <K extends string | symbol, A, B>(self: ReadonlyRecord<K, A>, key: NoInfer<K>, value: B): Record<K, A | B>;
612
1274
  };
613
1275
  /**
@@ -633,7 +1295,25 @@ export declare const isSubrecordBy: <A>(equivalence: Equivalence<A>) => {
633
1295
  * @since 2.0.0
634
1296
  */
635
1297
  export declare const isSubrecord: {
1298
+ /**
1299
+ * Check if one record is a subrecord of another, meaning it contains all the keys and values found in the second record.
1300
+ * This comparison uses default equality checks (`Equal.equivalence()`).
1301
+ *
1302
+ * @param self - The first record to check.
1303
+ * @param that - The second record to compare against.
1304
+ *
1305
+ * @since 2.0.0
1306
+ */
636
1307
  <K extends string, A>(that: ReadonlyRecord<K, A>): (self: ReadonlyRecord<K, A>) => boolean;
1308
+ /**
1309
+ * Check if one record is a subrecord of another, meaning it contains all the keys and values found in the second record.
1310
+ * This comparison uses default equality checks (`Equal.equivalence()`).
1311
+ *
1312
+ * @param self - The first record to check.
1313
+ * @param that - The second record to compare against.
1314
+ *
1315
+ * @since 2.0.0
1316
+ */
637
1317
  <K extends string, A>(self: ReadonlyRecord<K, A>, that: ReadonlyRecord<K, A>): boolean;
638
1318
  };
639
1319
  /**
@@ -647,7 +1327,27 @@ export declare const isSubrecord: {
647
1327
  * @since 2.0.0
648
1328
  */
649
1329
  export declare const reduce: {
1330
+ /**
1331
+ * Reduce a record to a single value by combining its entries with a specified function.
1332
+ *
1333
+ * @param self - The record to reduce.
1334
+ * @param zero - The initial value of the accumulator.
1335
+ * @param f - The function to combine entries (accumulator, value, key).
1336
+ *
1337
+ * @category folding
1338
+ * @since 2.0.0
1339
+ */
650
1340
  <Z, V, K extends string>(zero: Z, f: (accumulator: Z, value: V, key: K) => Z): (self: ReadonlyRecord<K, V>) => Z;
1341
+ /**
1342
+ * Reduce a record to a single value by combining its entries with a specified function.
1343
+ *
1344
+ * @param self - The record to reduce.
1345
+ * @param zero - The initial value of the accumulator.
1346
+ * @param f - The function to combine entries (accumulator, value, key).
1347
+ *
1348
+ * @category folding
1349
+ * @since 2.0.0
1350
+ */
651
1351
  <K extends string, V, Z>(self: ReadonlyRecord<K, V>, zero: Z, f: (accumulator: Z, value: V, key: K) => Z): Z;
652
1352
  };
653
1353
  /**
@@ -659,9 +1359,41 @@ export declare const reduce: {
659
1359
  * @since 2.0.0
660
1360
  */
661
1361
  export declare const every: {
1362
+ /**
1363
+ * Check if all entries in a record meet a specific condition.
1364
+ *
1365
+ * @param self - The record to check.
1366
+ * @param predicate - The condition to test entries (value, key).
1367
+ *
1368
+ * @since 2.0.0
1369
+ */
662
1370
  <A, K extends string, B extends A>(refinement: (value: A, key: K) => value is B): (self: ReadonlyRecord<K, A>) => self is ReadonlyRecord<K, B>;
1371
+ /**
1372
+ * Check if all entries in a record meet a specific condition.
1373
+ *
1374
+ * @param self - The record to check.
1375
+ * @param predicate - The condition to test entries (value, key).
1376
+ *
1377
+ * @since 2.0.0
1378
+ */
663
1379
  <A, K extends string>(predicate: (value: A, key: K) => boolean): (self: ReadonlyRecord<K, A>) => boolean;
1380
+ /**
1381
+ * Check if all entries in a record meet a specific condition.
1382
+ *
1383
+ * @param self - The record to check.
1384
+ * @param predicate - The condition to test entries (value, key).
1385
+ *
1386
+ * @since 2.0.0
1387
+ */
664
1388
  <A, K extends string, B extends A>(self: ReadonlyRecord<K, A>, refinement: (value: A, key: K) => value is B): self is ReadonlyRecord<K, B>;
1389
+ /**
1390
+ * Check if all entries in a record meet a specific condition.
1391
+ *
1392
+ * @param self - The record to check.
1393
+ * @param predicate - The condition to test entries (value, key).
1394
+ *
1395
+ * @since 2.0.0
1396
+ */
665
1397
  <K extends string, A>(self: ReadonlyRecord<K, A>, predicate: (value: A, key: K) => boolean): boolean;
666
1398
  };
667
1399
  /**
@@ -673,7 +1405,23 @@ export declare const every: {
673
1405
  * @since 2.0.0
674
1406
  */
675
1407
  export declare const some: {
1408
+ /**
1409
+ * Check if any entry in a record meets a specific condition.
1410
+ *
1411
+ * @param self - The record to check.
1412
+ * @param predicate - The condition to test entries (value, key).
1413
+ *
1414
+ * @since 2.0.0
1415
+ */
676
1416
  <A, K extends string>(predicate: (value: A, key: K) => boolean): (self: ReadonlyRecord<K, A>) => boolean;
1417
+ /**
1418
+ * Check if any entry in a record meets a specific condition.
1419
+ *
1420
+ * @param self - The record to check.
1421
+ * @param predicate - The condition to test entries (value, key).
1422
+ *
1423
+ * @since 2.0.0
1424
+ */
677
1425
  <K extends string, A>(self: ReadonlyRecord<K, A>, predicate: (value: A, key: K) => boolean): boolean;
678
1426
  };
679
1427
  /**
@@ -686,7 +1434,25 @@ export declare const some: {
686
1434
  * @since 2.0.0
687
1435
  */
688
1436
  export declare const union: {
1437
+ /**
1438
+ * Merge two records, preserving entries that exist in either of the records.
1439
+ *
1440
+ * @param self - The first record.
1441
+ * @param that - The second record to combine with the first.
1442
+ * @param combine - A function to specify how to merge entries with the same key.
1443
+ *
1444
+ * @since 2.0.0
1445
+ */
689
1446
  <K1 extends string, A, B, C>(that: ReadonlyRecord<K1, B>, combine: (selfValue: A, thatValue: B) => C): <K0 extends string>(self: ReadonlyRecord<K0, A>) => Record<K0 | K1, A | B | C>;
1447
+ /**
1448
+ * Merge two records, preserving entries that exist in either of the records.
1449
+ *
1450
+ * @param self - The first record.
1451
+ * @param that - The second record to combine with the first.
1452
+ * @param combine - A function to specify how to merge entries with the same key.
1453
+ *
1454
+ * @since 2.0.0
1455
+ */
690
1456
  <K0 extends string, A, K1 extends string, B, C>(self: ReadonlyRecord<K0, A>, that: ReadonlyRecord<K1, B>, combine: (selfValue: A, thatValue: B) => C): Record<K0 | K1, A | B | C>;
691
1457
  };
692
1458
  /**
@@ -699,7 +1465,25 @@ export declare const union: {
699
1465
  * @since 2.0.0
700
1466
  */
701
1467
  export declare const intersection: {
1468
+ /**
1469
+ * Merge two records, retaining only the entries that exist in both records.
1470
+ *
1471
+ * @param self - The first record.
1472
+ * @param that - The second record to merge with the first.
1473
+ * @param combine - A function to specify how to merge entries with the same key.
1474
+ *
1475
+ * @since 2.0.0
1476
+ */
702
1477
  <K1 extends string, A, B, C>(that: ReadonlyRecord<K1, B>, combine: (selfValue: A, thatValue: B) => C): <K0 extends string>(self: ReadonlyRecord<K0, A>) => Record<ReadonlyRecord.IntersectKeys<K0, K1>, C>;
1478
+ /**
1479
+ * Merge two records, retaining only the entries that exist in both records.
1480
+ *
1481
+ * @param self - The first record.
1482
+ * @param that - The second record to merge with the first.
1483
+ * @param combine - A function to specify how to merge entries with the same key.
1484
+ *
1485
+ * @since 2.0.0
1486
+ */
703
1487
  <K0 extends string, A, K1 extends string, B, C>(self: ReadonlyRecord<K0, A>, that: ReadonlyRecord<K1, B>, combine: (selfValue: A, thatValue: B) => C): Record<ReadonlyRecord.IntersectKeys<K0, K1>, C>;
704
1488
  };
705
1489
  /**
@@ -711,7 +1495,23 @@ export declare const intersection: {
711
1495
  * @since 2.0.0
712
1496
  */
713
1497
  export declare const difference: {
1498
+ /**
1499
+ * Merge two records, preserving only the entries that are unique to each record.
1500
+ *
1501
+ * @param self - The first record.
1502
+ * @param that - The second record to compare with the first.
1503
+ *
1504
+ * @since 2.0.0
1505
+ */
714
1506
  <K1 extends string, B>(that: ReadonlyRecord<K1, B>): <K0 extends string, A>(self: ReadonlyRecord<K0, A>) => Record<K0 | K1, A | B>;
1507
+ /**
1508
+ * Merge two records, preserving only the entries that are unique to each record.
1509
+ *
1510
+ * @param self - The first record.
1511
+ * @param that - The second record to compare with the first.
1512
+ *
1513
+ * @since 2.0.0
1514
+ */
715
1515
  <K0 extends string, A, K1 extends string, B>(self: ReadonlyRecord<K0, A>, that: ReadonlyRecord<K1, B>): Record<K0 | K1, A | B>;
716
1516
  };
717
1517
  /**