effect 3.8.4 → 3.8.5

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 (595) hide show
  1. package/dist/cjs/Array.js.map +1 -1
  2. package/dist/cjs/BigDecimal.js +2 -3
  3. package/dist/cjs/BigDecimal.js.map +1 -1
  4. package/dist/cjs/BigInt.js.map +1 -1
  5. package/dist/cjs/Boolean.js.map +1 -1
  6. package/dist/cjs/Cause.js.map +1 -1
  7. package/dist/cjs/Channel.js.map +1 -1
  8. package/dist/cjs/ChildExecutorDecision.js.map +1 -1
  9. package/dist/cjs/Chunk.js.map +1 -1
  10. package/dist/cjs/Config.js.map +1 -1
  11. package/dist/cjs/ConfigError.js.map +1 -1
  12. package/dist/cjs/ConfigProvider.js.map +1 -1
  13. package/dist/cjs/ConfigProviderPathPatch.js.map +1 -1
  14. package/dist/cjs/Console.js.map +1 -1
  15. package/dist/cjs/Context.js.map +1 -1
  16. package/dist/cjs/Cron.js.map +1 -1
  17. package/dist/cjs/Data.js.map +1 -1
  18. package/dist/cjs/DateTime.js.map +1 -1
  19. package/dist/cjs/Deferred.js.map +1 -1
  20. package/dist/cjs/Differ.js.map +1 -1
  21. package/dist/cjs/Duration.js.map +1 -1
  22. package/dist/cjs/Effect.js.map +1 -1
  23. package/dist/cjs/Either.js.map +1 -1
  24. package/dist/cjs/Equivalence.js.map +1 -1
  25. package/dist/cjs/ExecutionStrategy.js.map +1 -1
  26. package/dist/cjs/Exit.js.map +1 -1
  27. package/dist/cjs/Fiber.js.map +1 -1
  28. package/dist/cjs/FiberHandle.js.map +1 -1
  29. package/dist/cjs/FiberId.js.map +1 -1
  30. package/dist/cjs/FiberMap.js.map +1 -1
  31. package/dist/cjs/FiberRef.js.map +1 -1
  32. package/dist/cjs/FiberRefs.js.map +1 -1
  33. package/dist/cjs/FiberRefsPatch.js.map +1 -1
  34. package/dist/cjs/FiberSet.js.map +1 -1
  35. package/dist/cjs/Function.js.map +1 -1
  36. package/dist/cjs/GroupBy.js.map +1 -1
  37. package/dist/cjs/Hash.js.map +1 -1
  38. package/dist/cjs/HashMap.js.map +1 -1
  39. package/dist/cjs/HashSet.js.map +1 -1
  40. package/dist/cjs/Iterable.js.map +1 -1
  41. package/dist/cjs/KeyedPool.js.map +1 -1
  42. package/dist/cjs/Layer.js.map +1 -1
  43. package/dist/cjs/List.js.map +1 -1
  44. package/dist/cjs/LogLevel.js.map +1 -1
  45. package/dist/cjs/Logger.js.map +1 -1
  46. package/dist/cjs/Mailbox.js.map +1 -1
  47. package/dist/cjs/MergeDecision.js.map +1 -1
  48. package/dist/cjs/MergeState.js.map +1 -1
  49. package/dist/cjs/MergeStrategy.js.map +1 -1
  50. package/dist/cjs/Metric.js.map +1 -1
  51. package/dist/cjs/MetricHook.js.map +1 -1
  52. package/dist/cjs/MetricKey.js.map +1 -1
  53. package/dist/cjs/MetricPolling.js.map +1 -1
  54. package/dist/cjs/MetricState.js.map +1 -1
  55. package/dist/cjs/Micro.js.map +1 -1
  56. package/dist/cjs/MutableHashMap.js.map +1 -1
  57. package/dist/cjs/MutableHashSet.js.map +1 -1
  58. package/dist/cjs/MutableList.js.map +1 -1
  59. package/dist/cjs/MutableQueue.js.map +1 -1
  60. package/dist/cjs/MutableRef.js.map +1 -1
  61. package/dist/cjs/Number.js.map +1 -1
  62. package/dist/cjs/Option.js.map +1 -1
  63. package/dist/cjs/Order.js.map +1 -1
  64. package/dist/cjs/Ordering.js.map +1 -1
  65. package/dist/cjs/Pipeable.js.map +1 -1
  66. package/dist/cjs/Pool.js.map +1 -1
  67. package/dist/cjs/Predicate.js.map +1 -1
  68. package/dist/cjs/PubSub.js.map +1 -1
  69. package/dist/cjs/Queue.js.map +1 -1
  70. package/dist/cjs/RcMap.js.map +1 -1
  71. package/dist/cjs/Readable.js.map +1 -1
  72. package/dist/cjs/Record.js.map +1 -1
  73. package/dist/cjs/RedBlackTree.js.map +1 -1
  74. package/dist/cjs/Ref.js.map +1 -1
  75. package/dist/cjs/Request.js.map +1 -1
  76. package/dist/cjs/RequestResolver.js.map +1 -1
  77. package/dist/cjs/Runtime.js.map +1 -1
  78. package/dist/cjs/RuntimeFlags.js.map +1 -1
  79. package/dist/cjs/RuntimeFlagsPatch.js.map +1 -1
  80. package/dist/cjs/STM.js.map +1 -1
  81. package/dist/cjs/Schedule.js.map +1 -1
  82. package/dist/cjs/ScheduleInterval.js.map +1 -1
  83. package/dist/cjs/ScheduleIntervals.js.map +1 -1
  84. package/dist/cjs/Scheduler.js.map +1 -1
  85. package/dist/cjs/Scope.js.map +1 -1
  86. package/dist/cjs/ScopedRef.js.map +1 -1
  87. package/dist/cjs/Sink.js.map +1 -1
  88. package/dist/cjs/SortedMap.js.map +1 -1
  89. package/dist/cjs/SortedSet.js.map +1 -1
  90. package/dist/cjs/Stream.js +17 -3
  91. package/dist/cjs/Stream.js.map +1 -1
  92. package/dist/cjs/StreamHaltStrategy.js.map +1 -1
  93. package/dist/cjs/String.js.map +1 -1
  94. package/dist/cjs/Struct.js.map +1 -1
  95. package/dist/cjs/Subscribable.js.map +1 -1
  96. package/dist/cjs/SubscriptionRef.js.map +1 -1
  97. package/dist/cjs/SynchronizedRef.js.map +1 -1
  98. package/dist/cjs/TArray.js.map +1 -1
  99. package/dist/cjs/TDeferred.js.map +1 -1
  100. package/dist/cjs/TMap.js.map +1 -1
  101. package/dist/cjs/TPriorityQueue.js.map +1 -1
  102. package/dist/cjs/TPubSub.js.map +1 -1
  103. package/dist/cjs/TQueue.js.map +1 -1
  104. package/dist/cjs/TReentrantLock.js.map +1 -1
  105. package/dist/cjs/TRef.js.map +1 -1
  106. package/dist/cjs/TSemaphore.js.map +1 -1
  107. package/dist/cjs/TSet.js.map +1 -1
  108. package/dist/cjs/Take.js.map +1 -1
  109. package/dist/cjs/TestAnnotationMap.js.map +1 -1
  110. package/dist/cjs/TestClock.js.map +1 -1
  111. package/dist/cjs/TestServices.js.map +1 -1
  112. package/dist/cjs/Trie.js.map +1 -1
  113. package/dist/cjs/Tuple.js.map +1 -1
  114. package/dist/cjs/Unify.js.map +1 -1
  115. package/dist/cjs/UpstreamPullRequest.js.map +1 -1
  116. package/dist/cjs/UpstreamPullStrategy.js.map +1 -1
  117. package/dist/cjs/Utils.js +1 -14
  118. package/dist/cjs/Utils.js.map +1 -1
  119. package/dist/cjs/internal/core.js +4 -3
  120. package/dist/cjs/internal/core.js.map +1 -1
  121. package/dist/cjs/internal/runtime.js +1 -1
  122. package/dist/cjs/internal/runtime.js.map +1 -1
  123. package/dist/cjs/internal/stream.js +12 -3
  124. package/dist/cjs/internal/stream.js.map +1 -1
  125. package/dist/cjs/internal/version.js +1 -1
  126. package/dist/dts/Array.d.ts +2684 -0
  127. package/dist/dts/Array.d.ts.map +1 -1
  128. package/dist/dts/BigDecimal.d.ts +558 -1
  129. package/dist/dts/BigDecimal.d.ts.map +1 -1
  130. package/dist/dts/BigInt.d.ts +490 -0
  131. package/dist/dts/BigInt.d.ts.map +1 -1
  132. package/dist/dts/Boolean.d.ts +228 -0
  133. package/dist/dts/Boolean.d.ts.map +1 -1
  134. package/dist/dts/Cause.d.ts +172 -0
  135. package/dist/dts/Cause.d.ts.map +1 -1
  136. package/dist/dts/Channel.d.ts +750 -0
  137. package/dist/dts/Channel.d.ts.map +1 -1
  138. package/dist/dts/ChildExecutorDecision.d.ts +12 -0
  139. package/dist/dts/ChildExecutorDecision.d.ts.map +1 -1
  140. package/dist/dts/Chunk.d.ts +791 -0
  141. package/dist/dts/Chunk.d.ts.map +1 -1
  142. package/dist/dts/Config.d.ts +174 -0
  143. package/dist/dts/Config.d.ts.map +1 -1
  144. package/dist/dts/ConfigError.d.ts +16 -0
  145. package/dist/dts/ConfigError.d.ts.map +1 -1
  146. package/dist/dts/ConfigProvider.d.ts +84 -0
  147. package/dist/dts/ConfigProvider.d.ts.map +1 -1
  148. package/dist/dts/ConfigProviderPathPatch.d.ts +32 -0
  149. package/dist/dts/ConfigProviderPathPatch.d.ts.map +1 -1
  150. package/dist/dts/Console.d.ts +24 -0
  151. package/dist/dts/Console.d.ts.map +1 -1
  152. package/dist/dts/Context.d.ts +232 -0
  153. package/dist/dts/Context.d.ts.map +1 -1
  154. package/dist/dts/Cron.d.ts +12 -0
  155. package/dist/dts/Cron.d.ts.map +1 -1
  156. package/dist/dts/Data.d.ts +165 -0
  157. package/dist/dts/Data.d.ts.map +1 -1
  158. package/dist/dts/DateTime.d.ts +878 -0
  159. package/dist/dts/DateTime.d.ts.map +1 -1
  160. package/dist/dts/Deferred.d.ts +170 -0
  161. package/dist/dts/Deferred.d.ts.map +1 -1
  162. package/dist/dts/Differ.d.ts +78 -0
  163. package/dist/dts/Differ.d.ts.map +1 -1
  164. package/dist/dts/Duration.d.ts +130 -0
  165. package/dist/dts/Duration.d.ts.map +1 -1
  166. package/dist/dts/Effect.d.ts +4117 -3
  167. package/dist/dts/Effect.d.ts.map +1 -1
  168. package/dist/dts/Either.d.ts +620 -0
  169. package/dist/dts/Either.d.ts.map +1 -1
  170. package/dist/dts/Equivalence.d.ts +24 -0
  171. package/dist/dts/Equivalence.d.ts.map +1 -1
  172. package/dist/dts/ExecutionStrategy.d.ts +14 -0
  173. package/dist/dts/ExecutionStrategy.d.ts.map +1 -1
  174. package/dist/dts/Exit.d.ts +252 -0
  175. package/dist/dts/Exit.d.ts.map +1 -1
  176. package/dist/dts/Fiber.d.ts +182 -0
  177. package/dist/dts/Fiber.d.ts.map +1 -1
  178. package/dist/dts/FiberHandle.d.ts +42 -0
  179. package/dist/dts/FiberHandle.d.ts.map +1 -1
  180. package/dist/dts/FiberId.d.ts +24 -0
  181. package/dist/dts/FiberId.d.ts.map +1 -1
  182. package/dist/dts/FiberMap.d.ts +102 -0
  183. package/dist/dts/FiberMap.d.ts.map +1 -1
  184. package/dist/dts/FiberRef.d.ts +80 -0
  185. package/dist/dts/FiberRef.d.ts.map +1 -1
  186. package/dist/dts/FiberRefs.d.ts +84 -0
  187. package/dist/dts/FiberRefs.d.ts.map +1 -1
  188. package/dist/dts/FiberRefsPatch.d.ts +30 -0
  189. package/dist/dts/FiberRefsPatch.d.ts.map +1 -1
  190. package/dist/dts/FiberSet.d.ts +38 -0
  191. package/dist/dts/FiberSet.d.ts.map +1 -1
  192. package/dist/dts/Function.d.ts +144 -28
  193. package/dist/dts/Function.d.ts.map +1 -1
  194. package/dist/dts/GroupBy.d.ts +38 -0
  195. package/dist/dts/GroupBy.d.ts.map +1 -1
  196. package/dist/dts/Hash.d.ts +8 -0
  197. package/dist/dts/Hash.d.ts.map +1 -1
  198. package/dist/dts/HashMap.d.ts +300 -0
  199. package/dist/dts/HashMap.d.ts.map +1 -1
  200. package/dist/dts/HashSet.d.ts +284 -0
  201. package/dist/dts/HashSet.d.ts.map +1 -1
  202. package/dist/dts/Iterable.d.ts +454 -0
  203. package/dist/dts/Iterable.d.ts.map +1 -1
  204. package/dist/dts/KeyedPool.d.ts +34 -0
  205. package/dist/dts/KeyedPool.d.ts.map +1 -1
  206. package/dist/dts/Layer.d.ts +414 -0
  207. package/dist/dts/Layer.d.ts.map +1 -1
  208. package/dist/dts/List.d.ts +430 -0
  209. package/dist/dts/List.d.ts.map +1 -1
  210. package/dist/dts/LogLevel.d.ts +46 -0
  211. package/dist/dts/LogLevel.d.ts.map +1 -1
  212. package/dist/dts/Logger.d.ts +194 -0
  213. package/dist/dts/Logger.d.ts.map +1 -1
  214. package/dist/dts/Mailbox.d.ts +16 -0
  215. package/dist/dts/Mailbox.d.ts.map +1 -1
  216. package/dist/dts/MergeDecision.d.ts +8 -0
  217. package/dist/dts/MergeDecision.d.ts.map +1 -1
  218. package/dist/dts/MergeState.d.ts +8 -0
  219. package/dist/dts/MergeState.d.ts.map +1 -1
  220. package/dist/dts/MergeStrategy.d.ts +12 -0
  221. package/dist/dts/MergeStrategy.d.ts.map +1 -1
  222. package/dist/dts/Metric.d.ts +410 -0
  223. package/dist/dts/Metric.d.ts.map +1 -1
  224. package/dist/dts/MetricHook.d.ts +24 -0
  225. package/dist/dts/MetricHook.d.ts.map +1 -1
  226. package/dist/dts/MetricKey.d.ts +48 -0
  227. package/dist/dts/MetricKey.d.ts.map +1 -1
  228. package/dist/dts/MetricPolling.d.ts +40 -0
  229. package/dist/dts/MetricPolling.d.ts.map +1 -1
  230. package/dist/dts/MetricState.d.ts +16 -0
  231. package/dist/dts/MetricState.d.ts.map +1 -1
  232. package/dist/dts/Micro.d.ts +1110 -0
  233. package/dist/dts/Micro.d.ts.map +1 -1
  234. package/dist/dts/MutableHashMap.d.ts +50 -0
  235. package/dist/dts/MutableHashMap.d.ts.map +1 -1
  236. package/dist/dts/MutableHashSet.d.ts +24 -0
  237. package/dist/dts/MutableHashSet.d.ts.map +1 -1
  238. package/dist/dts/MutableList.d.ts +36 -0
  239. package/dist/dts/MutableList.d.ts.map +1 -1
  240. package/dist/dts/MutableQueue.d.ts +62 -0
  241. package/dist/dts/MutableQueue.d.ts.map +1 -1
  242. package/dist/dts/MutableRef.d.ts +56 -0
  243. package/dist/dts/MutableRef.d.ts.map +1 -1
  244. package/dist/dts/Number.d.ts +474 -0
  245. package/dist/dts/Number.d.ts.map +1 -1
  246. package/dist/dts/Option.d.ts +1019 -0
  247. package/dist/dts/Option.d.ts.map +1 -1
  248. package/dist/dts/Order.d.ts +24 -0
  249. package/dist/dts/Order.d.ts.map +1 -1
  250. package/dist/dts/Ordering.d.ts +66 -0
  251. package/dist/dts/Ordering.d.ts.map +1 -1
  252. package/dist/dts/Pipeable.d.ts +21 -21
  253. package/dist/dts/Pipeable.d.ts.map +1 -1
  254. package/dist/dts/Pool.d.ts +16 -0
  255. package/dist/dts/Pool.d.ts.map +1 -1
  256. package/dist/dts/Predicate.d.ts +498 -0
  257. package/dist/dts/Predicate.d.ts.map +1 -1
  258. package/dist/dts/PubSub.d.ts +28 -0
  259. package/dist/dts/PubSub.d.ts.map +1 -1
  260. package/dist/dts/Queue.d.ts +104 -0
  261. package/dist/dts/Queue.d.ts.map +1 -1
  262. package/dist/dts/RcMap.d.ts +70 -0
  263. package/dist/dts/RcMap.d.ts.map +1 -1
  264. package/dist/dts/Readable.d.ts +16 -0
  265. package/dist/dts/Readable.d.ts.map +1 -1
  266. package/dist/dts/Record.d.ts +800 -0
  267. package/dist/dts/Record.d.ts.map +1 -1
  268. package/dist/dts/RedBlackTree.d.ts +300 -0
  269. package/dist/dts/RedBlackTree.d.ts.map +1 -1
  270. package/dist/dts/Ref.d.ts +88 -0
  271. package/dist/dts/Ref.d.ts.map +1 -1
  272. package/dist/dts/Request.d.ts +76 -0
  273. package/dist/dts/Request.d.ts.map +1 -1
  274. package/dist/dts/RequestResolver.d.ts +144 -0
  275. package/dist/dts/RequestResolver.d.ts.map +1 -1
  276. package/dist/dts/Runtime.d.ts +126 -0
  277. package/dist/dts/Runtime.d.ts.map +1 -1
  278. package/dist/dts/RuntimeFlags.d.ts +100 -0
  279. package/dist/dts/RuntimeFlags.d.ts.map +1 -1
  280. package/dist/dts/RuntimeFlagsPatch.d.ts +112 -0
  281. package/dist/dts/RuntimeFlagsPatch.d.ts.map +1 -1
  282. package/dist/dts/STM.d.ts +1090 -0
  283. package/dist/dts/STM.d.ts.map +1 -1
  284. package/dist/dts/Schedule.d.ts +704 -0
  285. package/dist/dts/Schedule.d.ts.map +1 -1
  286. package/dist/dts/ScheduleInterval.d.ts +68 -0
  287. package/dist/dts/ScheduleInterval.d.ts.map +1 -1
  288. package/dist/dts/ScheduleIntervals.d.ts +50 -0
  289. package/dist/dts/ScheduleIntervals.d.ts.map +1 -1
  290. package/dist/dts/Scope.d.ts +36 -0
  291. package/dist/dts/Scope.d.ts.map +1 -1
  292. package/dist/dts/ScopedRef.d.ts +22 -0
  293. package/dist/dts/ScopedRef.d.ts.map +1 -1
  294. package/dist/dts/Sink.d.ts +464 -0
  295. package/dist/dts/Sink.d.ts.map +1 -1
  296. package/dist/dts/SortedMap.d.ts +76 -0
  297. package/dist/dts/SortedMap.d.ts.map +1 -1
  298. package/dist/dts/SortedSet.d.ts +142 -0
  299. package/dist/dts/SortedSet.d.ts.map +1 -1
  300. package/dist/dts/Stream.d.ts +4998 -1
  301. package/dist/dts/Stream.d.ts.map +1 -1
  302. package/dist/dts/StreamHaltStrategy.d.ts +12 -0
  303. package/dist/dts/StreamHaltStrategy.d.ts.map +1 -1
  304. package/dist/dts/String.d.ts +200 -0
  305. package/dist/dts/String.d.ts.map +1 -1
  306. package/dist/dts/Struct.d.ts +84 -0
  307. package/dist/dts/Struct.d.ts.map +1 -1
  308. package/dist/dts/Subscribable.d.ts +16 -0
  309. package/dist/dts/Subscribable.d.ts.map +1 -1
  310. package/dist/dts/SubscriptionRef.d.ts +152 -0
  311. package/dist/dts/SubscriptionRef.d.ts.map +1 -1
  312. package/dist/dts/SynchronizedRef.d.ts +152 -0
  313. package/dist/dts/SynchronizedRef.d.ts.map +1 -1
  314. package/dist/dts/TArray.d.ts +426 -0
  315. package/dist/dts/TArray.d.ts.map +1 -1
  316. package/dist/dts/TDeferred.d.ts +24 -0
  317. package/dist/dts/TDeferred.d.ts.map +1 -1
  318. package/dist/dts/TMap.d.ts +366 -0
  319. package/dist/dts/TMap.d.ts.map +1 -1
  320. package/dist/dts/TPriorityQueue.d.ts +60 -0
  321. package/dist/dts/TPriorityQueue.d.ts.map +1 -1
  322. package/dist/dts/TPubSub.d.ts +28 -0
  323. package/dist/dts/TPubSub.d.ts.map +1 -1
  324. package/dist/dts/TQueue.d.ts +108 -0
  325. package/dist/dts/TQueue.d.ts.map +1 -1
  326. package/dist/dts/TReentrantLock.d.ts +36 -0
  327. package/dist/dts/TReentrantLock.d.ts.map +1 -1
  328. package/dist/dts/TRef.d.ts +88 -0
  329. package/dist/dts/TRef.d.ts.map +1 -1
  330. package/dist/dts/TSemaphore.d.ts +40 -0
  331. package/dist/dts/TSemaphore.d.ts.map +1 -1
  332. package/dist/dts/TSet.d.ts +254 -0
  333. package/dist/dts/TSet.d.ts.map +1 -1
  334. package/dist/dts/Take.d.ts +56 -0
  335. package/dist/dts/Take.d.ts.map +1 -1
  336. package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
  337. package/dist/dts/TestClock.d.ts.map +1 -1
  338. package/dist/dts/TestServices.d.ts.map +1 -1
  339. package/dist/dts/Trie.d.ts +906 -0
  340. package/dist/dts/Trie.d.ts.map +1 -1
  341. package/dist/dts/Tuple.d.ts +144 -0
  342. package/dist/dts/Tuple.d.ts.map +1 -1
  343. package/dist/dts/Unify.d.ts +18 -0
  344. package/dist/dts/Unify.d.ts.map +1 -1
  345. package/dist/dts/UpstreamPullRequest.d.ts +12 -0
  346. package/dist/dts/UpstreamPullRequest.d.ts.map +1 -1
  347. package/dist/dts/UpstreamPullStrategy.d.ts +12 -0
  348. package/dist/dts/UpstreamPullStrategy.d.ts.map +1 -1
  349. package/dist/dts/Utils.d.ts.map +1 -1
  350. package/dist/dts/internal/stream.d.ts.map +1 -1
  351. package/dist/esm/Array.js.map +1 -1
  352. package/dist/esm/BigDecimal.js +2 -2
  353. package/dist/esm/BigDecimal.js.map +1 -1
  354. package/dist/esm/BigInt.js.map +1 -1
  355. package/dist/esm/Boolean.js.map +1 -1
  356. package/dist/esm/Cause.js.map +1 -1
  357. package/dist/esm/Channel.js.map +1 -1
  358. package/dist/esm/ChildExecutorDecision.js.map +1 -1
  359. package/dist/esm/Chunk.js.map +1 -1
  360. package/dist/esm/Config.js.map +1 -1
  361. package/dist/esm/ConfigError.js.map +1 -1
  362. package/dist/esm/ConfigProvider.js.map +1 -1
  363. package/dist/esm/ConfigProviderPathPatch.js.map +1 -1
  364. package/dist/esm/Console.js.map +1 -1
  365. package/dist/esm/Context.js.map +1 -1
  366. package/dist/esm/Cron.js.map +1 -1
  367. package/dist/esm/Data.js.map +1 -1
  368. package/dist/esm/DateTime.js.map +1 -1
  369. package/dist/esm/Deferred.js.map +1 -1
  370. package/dist/esm/Differ.js.map +1 -1
  371. package/dist/esm/Duration.js.map +1 -1
  372. package/dist/esm/Effect.js.map +1 -1
  373. package/dist/esm/Either.js.map +1 -1
  374. package/dist/esm/Equivalence.js.map +1 -1
  375. package/dist/esm/ExecutionStrategy.js.map +1 -1
  376. package/dist/esm/Exit.js.map +1 -1
  377. package/dist/esm/Fiber.js.map +1 -1
  378. package/dist/esm/FiberHandle.js.map +1 -1
  379. package/dist/esm/FiberId.js.map +1 -1
  380. package/dist/esm/FiberMap.js.map +1 -1
  381. package/dist/esm/FiberRef.js.map +1 -1
  382. package/dist/esm/FiberRefs.js.map +1 -1
  383. package/dist/esm/FiberRefsPatch.js.map +1 -1
  384. package/dist/esm/FiberSet.js.map +1 -1
  385. package/dist/esm/Function.js.map +1 -1
  386. package/dist/esm/GroupBy.js.map +1 -1
  387. package/dist/esm/Hash.js.map +1 -1
  388. package/dist/esm/HashMap.js.map +1 -1
  389. package/dist/esm/HashSet.js.map +1 -1
  390. package/dist/esm/Iterable.js.map +1 -1
  391. package/dist/esm/KeyedPool.js.map +1 -1
  392. package/dist/esm/Layer.js.map +1 -1
  393. package/dist/esm/List.js.map +1 -1
  394. package/dist/esm/LogLevel.js.map +1 -1
  395. package/dist/esm/Logger.js.map +1 -1
  396. package/dist/esm/Mailbox.js.map +1 -1
  397. package/dist/esm/MergeDecision.js.map +1 -1
  398. package/dist/esm/MergeState.js.map +1 -1
  399. package/dist/esm/MergeStrategy.js.map +1 -1
  400. package/dist/esm/Metric.js.map +1 -1
  401. package/dist/esm/MetricHook.js.map +1 -1
  402. package/dist/esm/MetricKey.js.map +1 -1
  403. package/dist/esm/MetricPolling.js.map +1 -1
  404. package/dist/esm/MetricState.js.map +1 -1
  405. package/dist/esm/Micro.js.map +1 -1
  406. package/dist/esm/MutableHashMap.js.map +1 -1
  407. package/dist/esm/MutableHashSet.js.map +1 -1
  408. package/dist/esm/MutableList.js.map +1 -1
  409. package/dist/esm/MutableQueue.js.map +1 -1
  410. package/dist/esm/MutableRef.js.map +1 -1
  411. package/dist/esm/Number.js.map +1 -1
  412. package/dist/esm/Option.js.map +1 -1
  413. package/dist/esm/Order.js.map +1 -1
  414. package/dist/esm/Ordering.js.map +1 -1
  415. package/dist/esm/Pipeable.js.map +1 -1
  416. package/dist/esm/Pool.js.map +1 -1
  417. package/dist/esm/Predicate.js.map +1 -1
  418. package/dist/esm/PubSub.js.map +1 -1
  419. package/dist/esm/Queue.js.map +1 -1
  420. package/dist/esm/RcMap.js.map +1 -1
  421. package/dist/esm/Readable.js.map +1 -1
  422. package/dist/esm/Record.js.map +1 -1
  423. package/dist/esm/RedBlackTree.js.map +1 -1
  424. package/dist/esm/Ref.js.map +1 -1
  425. package/dist/esm/Request.js.map +1 -1
  426. package/dist/esm/RequestResolver.js.map +1 -1
  427. package/dist/esm/Runtime.js.map +1 -1
  428. package/dist/esm/RuntimeFlags.js.map +1 -1
  429. package/dist/esm/RuntimeFlagsPatch.js.map +1 -1
  430. package/dist/esm/STM.js.map +1 -1
  431. package/dist/esm/Schedule.js.map +1 -1
  432. package/dist/esm/ScheduleInterval.js.map +1 -1
  433. package/dist/esm/ScheduleIntervals.js.map +1 -1
  434. package/dist/esm/Scheduler.js.map +1 -1
  435. package/dist/esm/Scope.js.map +1 -1
  436. package/dist/esm/ScopedRef.js.map +1 -1
  437. package/dist/esm/Sink.js.map +1 -1
  438. package/dist/esm/SortedMap.js.map +1 -1
  439. package/dist/esm/SortedSet.js.map +1 -1
  440. package/dist/esm/Stream.js +14 -0
  441. package/dist/esm/Stream.js.map +1 -1
  442. package/dist/esm/StreamHaltStrategy.js.map +1 -1
  443. package/dist/esm/String.js.map +1 -1
  444. package/dist/esm/Struct.js.map +1 -1
  445. package/dist/esm/Subscribable.js.map +1 -1
  446. package/dist/esm/SubscriptionRef.js.map +1 -1
  447. package/dist/esm/SynchronizedRef.js.map +1 -1
  448. package/dist/esm/TArray.js.map +1 -1
  449. package/dist/esm/TDeferred.js.map +1 -1
  450. package/dist/esm/TMap.js.map +1 -1
  451. package/dist/esm/TPriorityQueue.js.map +1 -1
  452. package/dist/esm/TPubSub.js.map +1 -1
  453. package/dist/esm/TQueue.js.map +1 -1
  454. package/dist/esm/TReentrantLock.js.map +1 -1
  455. package/dist/esm/TRef.js.map +1 -1
  456. package/dist/esm/TSemaphore.js.map +1 -1
  457. package/dist/esm/TSet.js.map +1 -1
  458. package/dist/esm/Take.js.map +1 -1
  459. package/dist/esm/TestAnnotationMap.js.map +1 -1
  460. package/dist/esm/TestClock.js.map +1 -1
  461. package/dist/esm/TestServices.js.map +1 -1
  462. package/dist/esm/Trie.js.map +1 -1
  463. package/dist/esm/Tuple.js.map +1 -1
  464. package/dist/esm/Unify.js.map +1 -1
  465. package/dist/esm/UpstreamPullRequest.js.map +1 -1
  466. package/dist/esm/UpstreamPullStrategy.js.map +1 -1
  467. package/dist/esm/Utils.js +1 -14
  468. package/dist/esm/Utils.js.map +1 -1
  469. package/dist/esm/internal/core.js +1 -1
  470. package/dist/esm/internal/core.js.map +1 -1
  471. package/dist/esm/internal/runtime.js +1 -1
  472. package/dist/esm/internal/runtime.js.map +1 -1
  473. package/dist/esm/internal/stream.js +9 -0
  474. package/dist/esm/internal/stream.js.map +1 -1
  475. package/dist/esm/internal/version.js +1 -1
  476. package/package.json +1 -1
  477. package/src/Array.ts +2723 -36
  478. package/src/BigDecimal.ts +585 -18
  479. package/src/BigInt.ts +516 -16
  480. package/src/Boolean.ts +241 -8
  481. package/src/Cause.ts +177 -1
  482. package/src/Channel.ts +766 -49
  483. package/src/ChildExecutorDecision.ts +12 -0
  484. package/src/Chunk.ts +818 -4
  485. package/src/Config.ts +187 -8
  486. package/src/ConfigError.ts +16 -0
  487. package/src/ConfigProvider.ts +89 -1
  488. package/src/ConfigProviderPathPatch.ts +32 -0
  489. package/src/Console.ts +37 -8
  490. package/src/Context.ts +232 -0
  491. package/src/Cron.ts +12 -0
  492. package/src/Data.ts +165 -0
  493. package/src/DateTime.ts +1006 -50
  494. package/src/Deferred.ts +170 -0
  495. package/src/Differ.ts +89 -27
  496. package/src/Duration.ts +156 -16
  497. package/src/Effect.ts +4297 -123
  498. package/src/Either.ts +650 -34
  499. package/src/Equivalence.ts +24 -0
  500. package/src/ExecutionStrategy.ts +29 -10
  501. package/src/Exit.ts +252 -0
  502. package/src/Fiber.ts +182 -0
  503. package/src/FiberHandle.ts +42 -0
  504. package/src/FiberId.ts +24 -0
  505. package/src/FiberMap.ts +144 -21
  506. package/src/FiberRef.ts +80 -0
  507. package/src/FiberRefs.ts +84 -0
  508. package/src/FiberRefsPatch.ts +35 -1
  509. package/src/FiberSet.ts +38 -0
  510. package/src/Function.ts +416 -31
  511. package/src/GroupBy.ts +38 -0
  512. package/src/Hash.ts +8 -0
  513. package/src/HashMap.ts +300 -0
  514. package/src/HashSet.ts +284 -0
  515. package/src/Iterable.ts +456 -6
  516. package/src/KeyedPool.ts +34 -0
  517. package/src/Layer.ts +426 -30
  518. package/src/List.ts +476 -3
  519. package/src/LogLevel.ts +46 -0
  520. package/src/Logger.ts +195 -4
  521. package/src/Mailbox.ts +16 -0
  522. package/src/MergeDecision.ts +8 -0
  523. package/src/MergeState.ts +8 -0
  524. package/src/MergeStrategy.ts +25 -8
  525. package/src/Metric.ts +426 -15
  526. package/src/MetricHook.ts +24 -0
  527. package/src/MetricKey.ts +62 -8
  528. package/src/MetricPolling.ts +42 -6
  529. package/src/MetricState.ts +16 -0
  530. package/src/Micro.ts +1212 -56
  531. package/src/MutableHashMap.ts +105 -1
  532. package/src/MutableHashSet.ts +24 -0
  533. package/src/MutableList.ts +36 -0
  534. package/src/MutableQueue.ts +62 -0
  535. package/src/MutableRef.ts +56 -0
  536. package/src/Number.ts +500 -16
  537. package/src/Option.ts +1042 -16
  538. package/src/Order.ts +24 -0
  539. package/src/Ordering.ts +66 -0
  540. package/src/Pipeable.ts +224 -21
  541. package/src/Pool.ts +16 -0
  542. package/src/Predicate.ts +498 -0
  543. package/src/PubSub.ts +28 -0
  544. package/src/Queue.ts +104 -0
  545. package/src/RcMap.ts +70 -0
  546. package/src/Readable.ts +18 -7
  547. package/src/Record.ts +814 -40
  548. package/src/RedBlackTree.ts +305 -1
  549. package/src/Ref.ts +88 -0
  550. package/src/Request.ts +76 -0
  551. package/src/RequestResolver.ts +145 -4
  552. package/src/Runtime.ts +134 -2
  553. package/src/RuntimeFlags.ts +100 -0
  554. package/src/RuntimeFlagsPatch.ts +112 -0
  555. package/src/STM.ts +1107 -11
  556. package/src/Schedule.ts +704 -0
  557. package/src/ScheduleInterval.ts +68 -0
  558. package/src/ScheduleIntervals.ts +50 -0
  559. package/src/Scheduler.ts +2 -0
  560. package/src/Scope.ts +36 -0
  561. package/src/ScopedRef.ts +22 -0
  562. package/src/Sink.ts +464 -0
  563. package/src/SortedMap.ts +76 -0
  564. package/src/SortedSet.ts +143 -3
  565. package/src/Stream.ts +5041 -54
  566. package/src/StreamHaltStrategy.ts +29 -12
  567. package/src/String.ts +200 -0
  568. package/src/Struct.ts +86 -7
  569. package/src/Subscribable.ts +16 -0
  570. package/src/SubscriptionRef.ts +159 -11
  571. package/src/SynchronizedRef.ts +169 -8
  572. package/src/TArray.ts +431 -1
  573. package/src/TDeferred.ts +24 -0
  574. package/src/TMap.ts +381 -12
  575. package/src/TPriorityQueue.ts +60 -0
  576. package/src/TPubSub.ts +28 -0
  577. package/src/TQueue.ts +108 -0
  578. package/src/TReentrantLock.ts +36 -0
  579. package/src/TRef.ts +88 -0
  580. package/src/TSemaphore.ts +40 -0
  581. package/src/TSet.ts +280 -12
  582. package/src/Take.ts +56 -0
  583. package/src/TestAnnotationMap.ts +45 -1
  584. package/src/TestClock.ts +6 -0
  585. package/src/TestServices.ts +66 -0
  586. package/src/Trie.ts +906 -0
  587. package/src/Tuple.ts +157 -8
  588. package/src/Unify.ts +19 -3
  589. package/src/UpstreamPullRequest.ts +12 -0
  590. package/src/UpstreamPullStrategy.ts +12 -0
  591. package/src/Utils.ts +1 -15
  592. package/src/internal/core.ts +1 -1
  593. package/src/internal/runtime.ts +1 -1
  594. package/src/internal/stream.ts +27 -0
  595. package/src/internal/version.ts +1 -1
package/src/STM.ts CHANGED
@@ -169,10 +169,28 @@ export const isSTM: (u: unknown) => u is STM<unknown, unknown, unknown> = core.i
169
169
  * @category constructors
170
170
  */
171
171
  export const acquireUseRelease: {
172
+ /**
173
+ * Treats the specified `acquire` transaction as the acquisition of a
174
+ * resource. The `acquire` transaction will be executed interruptibly. If it
175
+ * is a success and is committed the specified `release` workflow will be
176
+ * executed uninterruptibly as soon as the `use` workflow completes execution.
177
+ *
178
+ * @since 2.0.0
179
+ * @category constructors
180
+ */
172
181
  <A, A2, E2, R2, A3, E3, R3>(
173
182
  use: (resource: A) => STM<A2, E2, R2>,
174
183
  release: (resource: A) => STM<A3, E3, R3>
175
184
  ): <E, R>(acquire: STM<A, E, R>) => Effect.Effect<A2, E2 | E3 | E, R2 | R3 | R>
185
+ /**
186
+ * Treats the specified `acquire` transaction as the acquisition of a
187
+ * resource. The `acquire` transaction will be executed interruptibly. If it
188
+ * is a success and is committed the specified `release` workflow will be
189
+ * executed uninterruptibly as soon as the `use` workflow completes execution.
190
+ *
191
+ * @since 2.0.0
192
+ * @category constructors
193
+ */
176
194
  <A, E, R, A2, E2, R2, A3, E3, R3>(
177
195
  acquire: STM<A, E, R>,
178
196
  use: (resource: A) => STM<A2, E2, R2>,
@@ -257,7 +275,19 @@ export const all: All.Signature = stm.all
257
275
  * @category mapping
258
276
  */
259
277
  export const as: {
278
+ /**
279
+ * Maps the success value of this effect to the specified constant value.
280
+ *
281
+ * @since 2.0.0
282
+ * @category mapping
283
+ */
260
284
  <A2>(value: A2): <A, E, R>(self: STM<A, E, R>) => STM<A2, E, R>
285
+ /**
286
+ * Maps the success value of this effect to the specified constant value.
287
+ *
288
+ * @since 2.0.0
289
+ * @category mapping
290
+ */
261
291
  <A, E, R, A2>(self: STM<A, E, R>, value: A2): STM<A2, E, R>
262
292
  } = stm.as
263
293
 
@@ -302,7 +332,19 @@ export const attempt: <A>(evaluate: LazyArg<A>) => STM<A, unknown> = stm.attempt
302
332
  * @category error handling
303
333
  */
304
334
  export const catchAll: {
335
+ /**
336
+ * Recovers from all errors.
337
+ *
338
+ * @since 2.0.0
339
+ * @category error handling
340
+ */
305
341
  <E, B, E1, R1>(f: (e: E) => STM<B, E1, R1>): <A, R>(self: STM<A, E, R>) => STM<B | A, E1, R1 | R>
342
+ /**
343
+ * Recovers from all errors.
344
+ *
345
+ * @since 2.0.0
346
+ * @category error handling
347
+ */
306
348
  <A, E, R, B, E1, R1>(self: STM<A, E, R>, f: (e: E) => STM<B, E1, R1>): STM<A | B, E1, R | R1>
307
349
  } = core.catchAll
308
350
 
@@ -313,9 +355,21 @@ export const catchAll: {
313
355
  * @category error handling
314
356
  */
315
357
  export const catchSome: {
358
+ /**
359
+ * Recovers from some or all of the error cases.
360
+ *
361
+ * @since 2.0.0
362
+ * @category error handling
363
+ */
316
364
  <E, A2, E2, R2>(
317
365
  pf: (error: E) => Option.Option<STM<A2, E2, R2>>
318
366
  ): <A, R>(self: STM<A, E, R>) => STM<A2 | A, E | E2, R2 | R>
367
+ /**
368
+ * Recovers from some or all of the error cases.
369
+ *
370
+ * @since 2.0.0
371
+ * @category error handling
372
+ */
319
373
  <A, E, R, A2, E2, R2>(
320
374
  self: STM<A, E, R>,
321
375
  pf: (error: E) => Option.Option<STM<A2, E2, R2>>
@@ -329,10 +383,22 @@ export const catchSome: {
329
383
  * @category error handling
330
384
  */
331
385
  export const catchTag: {
386
+ /**
387
+ * Recovers from the specified tagged error.
388
+ *
389
+ * @since 2.0.0
390
+ * @category error handling
391
+ */
332
392
  <K extends E["_tag"] & string, E extends { _tag: string }, A1, E1, R1>(
333
393
  k: K,
334
394
  f: (e: Extract<E, { _tag: K }>) => STM<A1, E1, R1>
335
395
  ): <A, R>(self: STM<A, E, R>) => STM<A1 | A, E1 | Exclude<E, { _tag: K }>, R1 | R>
396
+ /**
397
+ * Recovers from the specified tagged error.
398
+ *
399
+ * @since 2.0.0
400
+ * @category error handling
401
+ */
336
402
  <A, E extends { _tag: string }, R, K extends E["_tag"] & string, A1, E1, R1>(
337
403
  self: STM<A, E, R>,
338
404
  k: K,
@@ -347,12 +413,16 @@ export const catchTag: {
347
413
  * @category error handling
348
414
  */
349
415
  export const catchTags: {
416
+ /**
417
+ * Recovers from multiple tagged errors.
418
+ *
419
+ * @since 2.0.0
420
+ * @category error handling
421
+ */
350
422
  <
351
423
  E extends { _tag: string },
352
424
  Cases extends { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => STM<any, any, any>) }
353
- >(
354
- cases: Cases
355
- ): <A, R>(
425
+ >(cases: Cases): <A, R>(
356
426
  self: STM<A, E, R>
357
427
  ) => STM<
358
428
  | A
@@ -362,15 +432,18 @@ export const catchTags: {
362
432
  | R
363
433
  | { [K in keyof Cases]: Cases[K] extends (...args: Array<any>) => STM<any, any, infer R> ? R : never }[keyof Cases]
364
434
  >
435
+ /**
436
+ * Recovers from multiple tagged errors.
437
+ *
438
+ * @since 2.0.0
439
+ * @category error handling
440
+ */
365
441
  <
366
442
  R,
367
443
  E extends { _tag: string },
368
444
  A,
369
445
  Cases extends { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => STM<any, any, any>) }
370
- >(
371
- self: STM<A, E, R>,
372
- cases: Cases
373
- ): STM<
446
+ >(self: STM<A, E, R>, cases: Cases): STM<
374
447
  | A
375
448
  | { [K in keyof Cases]: Cases[K] extends (...args: Array<any>) => STM<infer A, any, any> ? A : never }[keyof Cases],
376
449
  | Exclude<E, { _tag: keyof Cases }>
@@ -395,7 +468,19 @@ export const check: (predicate: LazyArg<boolean>) => STM<void> = stm.check
395
468
  * @category mutations
396
469
  */
397
470
  export const collect: {
471
+ /**
472
+ * Simultaneously filters and maps the value produced by this effect.
473
+ *
474
+ * @since 2.0.0
475
+ * @category mutations
476
+ */
398
477
  <A, A2>(pf: (a: A) => Option.Option<A2>): <E, R>(self: STM<A, E, R>) => STM<A2, E, R>
478
+ /**
479
+ * Simultaneously filters and maps the value produced by this effect.
480
+ *
481
+ * @since 2.0.0
482
+ * @category mutations
483
+ */
399
484
  <A, E, R, A2>(self: STM<A, E, R>, pf: (a: A) => Option.Option<A2>): STM<A2, E, R>
400
485
  } = stm.collect
401
486
 
@@ -406,7 +491,19 @@ export const collect: {
406
491
  * @category mutations
407
492
  */
408
493
  export const collectSTM: {
494
+ /**
495
+ * Simultaneously filters and maps the value produced by this effect.
496
+ *
497
+ * @since 2.0.0
498
+ * @category mutations
499
+ */
409
500
  <A, A2, E2, R2>(pf: (a: A) => Option.Option<STM<A2, E2, R2>>): <E, R>(self: STM<A, E, R>) => STM<A2, E2 | E, R2 | R>
501
+ /**
502
+ * Simultaneously filters and maps the value produced by this effect.
503
+ *
504
+ * @since 2.0.0
505
+ * @category mutations
506
+ */
410
507
  <A, E, R, A2, E2, R2>(self: STM<A, E, R>, pf: (a: A) => Option.Option<STM<A2, E2, R2>>): STM<A2, E | E2, R | R2>
411
508
  } = stm.collectSTM
412
509
 
@@ -470,8 +567,25 @@ export const contextWithSTM: <R0, A, E, R>(
470
567
  * @category context
471
568
  */
472
569
  export const mapInputContext: {
570
+ /**
571
+ * Transforms the environment being provided to this effect with the specified
572
+ * function.
573
+ *
574
+ * @since 2.0.0
575
+ * @category context
576
+ */
473
577
  <R0, R>(f: (context: Context.Context<R0>) => Context.Context<R>): <A, E>(self: STM<A, E, R>) => STM<A, E, R0>
474
- <A, E, R0, R>(self: STM<A, E, R>, f: (context: Context.Context<R0>) => Context.Context<R>): STM<A, E, R0>
578
+ /**
579
+ * Transforms the environment being provided to this effect with the specified
580
+ * function.
581
+ *
582
+ * @since 2.0.0
583
+ * @category context
584
+ */
585
+ <A, E, R0, R>(
586
+ self: STM<A, E, R>,
587
+ f: (context: Context.Context<R0>) => Context.Context<R>
588
+ ): STM<A, E, R0>
475
589
  } = core.mapInputContext
476
590
 
477
591
  /**
@@ -516,7 +630,23 @@ export const either: <A, E, R>(self: STM<A, E, R>) => STM<Either.Either<A, E>, n
516
630
  * @category finalization
517
631
  */
518
632
  export const ensuring: {
633
+ /**
634
+ * Executes the specified finalization transaction whether or not this effect
635
+ * succeeds. Note that as with all STM transactions, if the full transaction
636
+ * fails, everything will be rolled back.
637
+ *
638
+ * @since 2.0.0
639
+ * @category finalization
640
+ */
519
641
  <R1, B>(finalizer: STM<B, never, R1>): <A, E, R>(self: STM<A, E, R>) => STM<A, E, R1 | R>
642
+ /**
643
+ * Executes the specified finalization transaction whether or not this effect
644
+ * succeeds. Note that as with all STM transactions, if the full transaction
645
+ * fails, everything will be rolled back.
646
+ *
647
+ * @since 2.0.0
648
+ * @category finalization
649
+ */
520
650
  <A, E, R, R1, B>(self: STM<A, E, R>, finalizer: STM<B, never, R1>): STM<A, E, R | R1>
521
651
  } = core.ensuring
522
652
 
@@ -537,7 +667,21 @@ export const eventually: <A, E, R>(self: STM<A, E, R>) => STM<A, E, R> = stm.eve
537
667
  * @category constructors
538
668
  */
539
669
  export const every: {
670
+ /**
671
+ * Determines whether all elements of the `Iterable<A>` satisfy the effectual
672
+ * predicate.
673
+ *
674
+ * @since 2.0.0
675
+ * @category constructors
676
+ */
540
677
  <A, R, E>(predicate: (a: NoInfer<A>) => STM<boolean, E, R>): (iterable: Iterable<A>) => STM<boolean, E, R>
678
+ /**
679
+ * Determines whether all elements of the `Iterable<A>` satisfy the effectual
680
+ * predicate.
681
+ *
682
+ * @since 2.0.0
683
+ * @category constructors
684
+ */
541
685
  <A, R, E>(iterable: Iterable<A>, predicate: (a: A) => STM<boolean, E, R>): STM<boolean, E, R>
542
686
  } = stm.every
543
687
 
@@ -549,7 +693,21 @@ export const every: {
549
693
  * @category constructors
550
694
  */
551
695
  export const exists: {
696
+ /**
697
+ * Determines whether any element of the `Iterable[A]` satisfies the effectual
698
+ * predicate `f`.
699
+ *
700
+ * @since 2.0.0
701
+ * @category constructors
702
+ */
552
703
  <A, R, E>(predicate: (a: NoInfer<A>) => STM<boolean, E, R>): (iterable: Iterable<A>) => STM<boolean, E, R>
704
+ /**
705
+ * Determines whether any element of the `Iterable[A]` satisfies the effectual
706
+ * predicate `f`.
707
+ *
708
+ * @since 2.0.0
709
+ * @category constructors
710
+ */
553
711
  <A, R, E>(iterable: Iterable<A>, predicate: (a: A) => STM<boolean, E, R>): STM<boolean, E, R>
554
712
  } = stm.exists
555
713
 
@@ -584,7 +742,19 @@ export const fiberId: STM<FiberId.FiberId> = stm.fiberId
584
742
  * @category constructors
585
743
  */
586
744
  export const filter: {
745
+ /**
746
+ * Filters the collection using the specified effectual predicate.
747
+ *
748
+ * @since 2.0.0
749
+ * @category constructors
750
+ */
587
751
  <A, R, E>(predicate: (a: NoInfer<A>) => STM<boolean, E, R>): (iterable: Iterable<A>) => STM<Array<A>, E, R>
752
+ /**
753
+ * Filters the collection using the specified effectual predicate.
754
+ *
755
+ * @since 2.0.0
756
+ * @category constructors
757
+ */
588
758
  <A, R, E>(iterable: Iterable<A>, predicate: (a: A) => STM<boolean, E, R>): STM<Array<A>, E, R>
589
759
  } = stm.filter
590
760
 
@@ -596,7 +766,21 @@ export const filter: {
596
766
  * @category constructors
597
767
  */
598
768
  export const filterNot: {
769
+ /**
770
+ * Filters the collection using the specified effectual predicate, removing
771
+ * all elements that satisfy the predicate.
772
+ *
773
+ * @since 2.0.0
774
+ * @category constructors
775
+ */
599
776
  <A, R, E>(predicate: (a: NoInfer<A>) => STM<boolean, E, R>): (iterable: Iterable<A>) => STM<Array<A>, E, R>
777
+ /**
778
+ * Filters the collection using the specified effectual predicate, removing
779
+ * all elements that satisfy the predicate.
780
+ *
781
+ * @since 2.0.0
782
+ * @category constructors
783
+ */
600
784
  <A, R, E>(iterable: Iterable<A>, predicate: (a: A) => STM<boolean, E, R>): STM<Array<A>, E, R>
601
785
  } = stm.filterNot
602
786
 
@@ -607,12 +791,36 @@ export const filterNot: {
607
791
  * @category filtering
608
792
  */
609
793
  export const filterOrDie: {
794
+ /**
795
+ * Dies with specified defect if the predicate fails.
796
+ *
797
+ * @since 2.0.0
798
+ * @category filtering
799
+ */
610
800
  <A, B extends A>(
611
801
  refinement: Refinement<NoInfer<A>, B>,
612
802
  defect: LazyArg<unknown>
613
803
  ): <E, R>(self: STM<A, E, R>) => STM<B, E, R>
804
+ /**
805
+ * Dies with specified defect if the predicate fails.
806
+ *
807
+ * @since 2.0.0
808
+ * @category filtering
809
+ */
614
810
  <A>(predicate: Predicate<NoInfer<A>>, defect: LazyArg<unknown>): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
811
+ /**
812
+ * Dies with specified defect if the predicate fails.
813
+ *
814
+ * @since 2.0.0
815
+ * @category filtering
816
+ */
615
817
  <A, E, R, B extends A>(self: STM<A, E, R>, refinement: Refinement<A, B>, defect: LazyArg<unknown>): STM<B, E, R>
818
+ /**
819
+ * Dies with specified defect if the predicate fails.
820
+ *
821
+ * @since 2.0.0
822
+ * @category filtering
823
+ */
616
824
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>, defect: LazyArg<unknown>): STM<A, E, R>
617
825
  } = stm.filterOrDie
618
826
 
@@ -624,9 +832,37 @@ export const filterOrDie: {
624
832
  * @category filtering
625
833
  */
626
834
  export const filterOrDieMessage: {
835
+ /**
836
+ * Dies with a `Cause.RuntimeException` having the specified message if the
837
+ * predicate fails.
838
+ *
839
+ * @since 2.0.0
840
+ * @category filtering
841
+ */
627
842
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>, message: string): <E, R>(self: STM<A, E, R>) => STM<B, E, R>
843
+ /**
844
+ * Dies with a `Cause.RuntimeException` having the specified message if the
845
+ * predicate fails.
846
+ *
847
+ * @since 2.0.0
848
+ * @category filtering
849
+ */
628
850
  <A>(predicate: Predicate<NoInfer<A>>, message: string): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
851
+ /**
852
+ * Dies with a `Cause.RuntimeException` having the specified message if the
853
+ * predicate fails.
854
+ *
855
+ * @since 2.0.0
856
+ * @category filtering
857
+ */
629
858
  <A, E, R, B extends A>(self: STM<A, E, R>, refinement: Refinement<A, B>, message: string): STM<B, E, R>
859
+ /**
860
+ * Dies with a `Cause.RuntimeException` having the specified message if the
861
+ * predicate fails.
862
+ *
863
+ * @since 2.0.0
864
+ * @category filtering
865
+ */
630
866
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>, message: string): STM<A, E, R>
631
867
  } = stm.filterOrDieMessage
632
868
 
@@ -637,19 +873,43 @@ export const filterOrDieMessage: {
637
873
  * @category filtering
638
874
  */
639
875
  export const filterOrElse: {
876
+ /**
877
+ * Supplies `orElse` if the predicate fails.
878
+ *
879
+ * @since 2.0.0
880
+ * @category filtering
881
+ */
640
882
  <A, B extends A, C, E2, R2>(
641
883
  refinement: Refinement<NoInfer<A>, B>,
642
884
  orElse: (a: NoInfer<A>) => STM<C, E2, R2>
643
885
  ): <E, R>(self: STM<A, E, R>) => STM<B | C, E2 | E, R2 | R>
886
+ /**
887
+ * Supplies `orElse` if the predicate fails.
888
+ *
889
+ * @since 2.0.0
890
+ * @category filtering
891
+ */
644
892
  <A, B, E2, R2>(
645
893
  predicate: Predicate<NoInfer<A>>,
646
894
  orElse: (a: NoInfer<A>) => STM<B, E2, R2>
647
895
  ): <E, R>(self: STM<A, E, R>) => STM<A | B, E2 | E, R2 | R>
896
+ /**
897
+ * Supplies `orElse` if the predicate fails.
898
+ *
899
+ * @since 2.0.0
900
+ * @category filtering
901
+ */
648
902
  <A, E, R, B extends A, C, E2, R2>(
649
903
  self: STM<A, E, R>,
650
904
  refinement: Refinement<A, B>,
651
905
  orElse: (a: A) => STM<C, E2, R2>
652
906
  ): STM<B | C, E | E2, R | R2>
907
+ /**
908
+ * Supplies `orElse` if the predicate fails.
909
+ *
910
+ * @since 2.0.0
911
+ * @category filtering
912
+ */
653
913
  <A, E, R, B, E2, R2>(
654
914
  self: STM<A, E, R>,
655
915
  predicate: Predicate<A>,
@@ -664,19 +924,43 @@ export const filterOrElse: {
664
924
  * @category filtering
665
925
  */
666
926
  export const filterOrFail: {
927
+ /**
928
+ * Fails with the specified error if the predicate fails.
929
+ *
930
+ * @since 2.0.0
931
+ * @category filtering
932
+ */
667
933
  <A, B extends A, E2>(
668
934
  refinement: Refinement<NoInfer<A>, B>,
669
935
  orFailWith: (a: NoInfer<A>) => E2
670
936
  ): <E, R>(self: STM<A, E, R>) => STM<B, E2 | E, R>
937
+ /**
938
+ * Fails with the specified error if the predicate fails.
939
+ *
940
+ * @since 2.0.0
941
+ * @category filtering
942
+ */
671
943
  <A, E2>(
672
944
  predicate: Predicate<NoInfer<A>>,
673
945
  orFailWith: (a: NoInfer<A>) => E2
674
946
  ): <E, R>(self: STM<A, E, R>) => STM<A, E2 | E, R>
947
+ /**
948
+ * Fails with the specified error if the predicate fails.
949
+ *
950
+ * @since 2.0.0
951
+ * @category filtering
952
+ */
675
953
  <A, E, R, B extends A, E2>(
676
954
  self: STM<A, E, R>,
677
955
  refinement: Refinement<A, B>,
678
956
  orFailWith: (a: A) => E2
679
957
  ): STM<B, E | E2, R>
958
+ /**
959
+ * Fails with the specified error if the predicate fails.
960
+ *
961
+ * @since 2.0.0
962
+ * @category filtering
963
+ */
680
964
  <A, E, R, E2>(self: STM<A, E, R>, predicate: Predicate<A>, orFailWith: (a: A) => E2): STM<A, E | E2, R>
681
965
  } = stm.filterOrFail
682
966
 
@@ -688,7 +972,21 @@ export const filterOrFail: {
688
972
  * @category sequencing
689
973
  */
690
974
  export const flatMap: {
975
+ /**
976
+ * Feeds the value produced by this effect to the specified function, and then
977
+ * runs the returned effect as well to produce its results.
978
+ *
979
+ * @since 2.0.0
980
+ * @category sequencing
981
+ */
691
982
  <A, A2, E1, R1>(f: (a: A) => STM<A2, E1, R1>): <E, R>(self: STM<A, E, R>) => STM<A2, E1 | E, R1 | R>
983
+ /**
984
+ * Feeds the value produced by this effect to the specified function, and then
985
+ * runs the returned effect as well to produce its results.
986
+ *
987
+ * @since 2.0.0
988
+ * @category sequencing
989
+ */
692
990
  <A, E, R, A2, E1, R1>(self: STM<A, E, R>, f: (a: A) => STM<A2, E1, R1>): STM<A2, E | E1, R | R1>
693
991
  } = core.flatMap
694
992
 
@@ -718,7 +1016,21 @@ export const flip: <A, E, R>(self: STM<A, E, R>) => STM<E, A, R> = stm.flip
718
1016
  * @category mutations
719
1017
  */
720
1018
  export const flipWith: {
1019
+ /**
1020
+ * Swaps the error/value parameters, applies the function `f` and flips the
1021
+ * parameters back
1022
+ *
1023
+ * @since 2.0.0
1024
+ * @category mutations
1025
+ */
721
1026
  <E, A, R, E2, A2, R2>(f: (stm: STM<E, A, R>) => STM<E2, A2, R2>): (self: STM<A, E, R>) => STM<A | A2, E | E2, R | R2>
1027
+ /**
1028
+ * Swaps the error/value parameters, applies the function `f` and flips the
1029
+ * parameters back
1030
+ *
1031
+ * @since 2.0.0
1032
+ * @category mutations
1033
+ */
722
1034
  <A, E, R, E2, A2, R2>(self: STM<A, E, R>, f: (stm: STM<E, A, R>) => STM<E2, A2, R2>): STM<A | A2, E | E2, R | R2>
723
1035
  } = stm.flipWith
724
1036
 
@@ -730,9 +1042,23 @@ export const flipWith: {
730
1042
  * @category folding
731
1043
  */
732
1044
  export const match: {
1045
+ /**
1046
+ * Folds over the `STM` effect, handling both failure and success, but not
1047
+ * retry.
1048
+ *
1049
+ * @since 2.0.0
1050
+ * @category folding
1051
+ */
733
1052
  <E, A2, A, A3>(
734
1053
  options: { readonly onFailure: (error: E) => A2; readonly onSuccess: (value: A) => A3 }
735
1054
  ): <R>(self: STM<A, E, R>) => STM<A2 | A3, never, R>
1055
+ /**
1056
+ * Folds over the `STM` effect, handling both failure and success, but not
1057
+ * retry.
1058
+ *
1059
+ * @since 2.0.0
1060
+ * @category folding
1061
+ */
736
1062
  <A, E, R, A2, A3>(
737
1063
  self: STM<A, E, R>,
738
1064
  options: { readonly onFailure: (error: E) => A2; readonly onSuccess: (value: A) => A3 }
@@ -746,9 +1072,21 @@ export const match: {
746
1072
  * @category folding
747
1073
  */
748
1074
  export const matchSTM: {
1075
+ /**
1076
+ * Effectfully folds over the `STM` effect, handling both failure and success.
1077
+ *
1078
+ * @since 2.0.0
1079
+ * @category folding
1080
+ */
749
1081
  <E, A1, E1, R1, A, A2, E2, R2>(
750
1082
  options: { readonly onFailure: (e: E) => STM<A1, E1, R1>; readonly onSuccess: (a: A) => STM<A2, E2, R2> }
751
1083
  ): <R>(self: STM<A, E, R>) => STM<A1 | A2, E1 | E2, R1 | R2 | R>
1084
+ /**
1085
+ * Effectfully folds over the `STM` effect, handling both failure and success.
1086
+ *
1087
+ * @since 2.0.0
1088
+ * @category folding
1089
+ */
752
1090
  <A, E, R, A1, E1, R1, A2, E2, R2>(
753
1091
  self: STM<A, E, R>,
754
1092
  options: { readonly onFailure: (e: E) => STM<A1, E1, R1>; readonly onSuccess: (a: A) => STM<A2, E2, R2> }
@@ -763,20 +1101,52 @@ export const matchSTM: {
763
1101
  * @category traversing
764
1102
  */
765
1103
  export const forEach: {
1104
+ /**
1105
+ * Applies the function `f` to each element of the `Iterable<A>` and returns
1106
+ * a transactional effect that produces a new `Chunk<A2>`.
1107
+ *
1108
+ * @since 2.0.0
1109
+ * @category traversing
1110
+ */
766
1111
  <A, A2, E, R>(
767
1112
  f: (a: A) => STM<A2, E, R>,
768
1113
  options?: { readonly discard?: false | undefined } | undefined
769
1114
  ): (elements: Iterable<A>) => STM<Array<A2>, E, R>
1115
+ /**
1116
+ * Applies the function `f` to each element of the `Iterable<A>` and returns
1117
+ * a transactional effect that produces a new `Chunk<A2>`.
1118
+ *
1119
+ * @since 2.0.0
1120
+ * @category traversing
1121
+ */
770
1122
  <A, A2, E, R>(
771
1123
  f: (a: A) => STM<A2, E, R>,
772
1124
  options: { readonly discard: true }
773
1125
  ): (elements: Iterable<A>) => STM<void, E, R>
1126
+ /**
1127
+ * Applies the function `f` to each element of the `Iterable<A>` and returns
1128
+ * a transactional effect that produces a new `Chunk<A2>`.
1129
+ *
1130
+ * @since 2.0.0
1131
+ * @category traversing
1132
+ */
774
1133
  <A, A2, E, R>(
775
1134
  elements: Iterable<A>,
776
1135
  f: (a: A) => STM<A2, E, R>,
777
1136
  options?: { readonly discard?: false | undefined } | undefined
778
1137
  ): STM<Array<A2>, E, R>
779
- <A, A2, E, R>(elements: Iterable<A>, f: (a: A) => STM<A2, E, R>, options: { readonly discard: true }): STM<void, E, R>
1138
+ /**
1139
+ * Applies the function `f` to each element of the `Iterable<A>` and returns
1140
+ * a transactional effect that produces a new `Chunk<A2>`.
1141
+ *
1142
+ * @since 2.0.0
1143
+ * @category traversing
1144
+ */
1145
+ <A, A2, E, R>(
1146
+ elements: Iterable<A>,
1147
+ f: (a: A) => STM<A2, E, R>,
1148
+ options: { readonly discard: true }
1149
+ ): STM<void, E, R>
780
1150
  } = stm.forEach
781
1151
 
782
1152
  /**
@@ -1202,6 +1572,25 @@ export const iterate: <Z, E, R>(
1202
1572
  * @category constructors
1203
1573
  */
1204
1574
  export const loop: {
1575
+ /**
1576
+ * Loops with the specified transactional function, collecting the results
1577
+ * into a list. The moral equivalent of:
1578
+ *
1579
+ * ```ts
1580
+ * const as = []
1581
+ * let s = initial
1582
+ *
1583
+ * while (cont(s)) {
1584
+ * as.push(body(s))
1585
+ * s = inc(s)
1586
+ * }
1587
+ *
1588
+ * return as
1589
+ * ```
1590
+ *
1591
+ * @since 2.0.0
1592
+ * @category constructors
1593
+ */
1205
1594
  <Z, A, E, R>(
1206
1595
  initial: Z,
1207
1596
  options: {
@@ -1211,7 +1600,26 @@ export const loop: {
1211
1600
  readonly discard?: false | undefined
1212
1601
  }
1213
1602
  ): STM<Array<A>, E, R>
1214
- <Z, A, E, R>(
1603
+ /**
1604
+ * Loops with the specified transactional function, collecting the results
1605
+ * into a list. The moral equivalent of:
1606
+ *
1607
+ * ```ts
1608
+ * const as = []
1609
+ * let s = initial
1610
+ *
1611
+ * while (cont(s)) {
1612
+ * as.push(body(s))
1613
+ * s = inc(s)
1614
+ * }
1615
+ *
1616
+ * return as
1617
+ * ```
1618
+ *
1619
+ * @since 2.0.0
1620
+ * @category constructors
1621
+ */
1622
+ <Z, A, E, R>(
1215
1623
  initial: Z,
1216
1624
  options: {
1217
1625
  readonly while: (z: Z) => boolean
@@ -1229,7 +1637,19 @@ export const loop: {
1229
1637
  * @category mapping
1230
1638
  */
1231
1639
  export const map: {
1640
+ /**
1641
+ * Maps the value produced by the effect.
1642
+ *
1643
+ * @since 2.0.0
1644
+ * @category mapping
1645
+ */
1232
1646
  <A, B>(f: (a: A) => B): <E, R>(self: STM<A, E, R>) => STM<B, E, R>
1647
+ /**
1648
+ * Maps the value produced by the effect.
1649
+ *
1650
+ * @since 2.0.0
1651
+ * @category mapping
1652
+ */
1233
1653
  <A, E, R, B>(self: STM<A, E, R>, f: (a: A) => B): STM<B, E, R>
1234
1654
  } = core.map
1235
1655
 
@@ -1242,7 +1662,23 @@ export const map: {
1242
1662
  * @category mapping
1243
1663
  */
1244
1664
  export const mapAttempt: {
1665
+ /**
1666
+ * Maps the value produced by the effect with the specified function that may
1667
+ * throw exceptions but is otherwise pure, translating any thrown exceptions
1668
+ * into typed failed effects.
1669
+ *
1670
+ * @since 2.0.0
1671
+ * @category mapping
1672
+ */
1245
1673
  <A, B>(f: (a: A) => B): <E, R>(self: STM<A, E, R>) => STM<B, unknown, R>
1674
+ /**
1675
+ * Maps the value produced by the effect with the specified function that may
1676
+ * throw exceptions but is otherwise pure, translating any thrown exceptions
1677
+ * into typed failed effects.
1678
+ *
1679
+ * @since 2.0.0
1680
+ * @category mapping
1681
+ */
1246
1682
  <A, E, R, B>(self: STM<A, E, R>, f: (a: A) => B): STM<B, unknown, R>
1247
1683
  } = stm.mapAttempt
1248
1684
 
@@ -1254,9 +1690,23 @@ export const mapAttempt: {
1254
1690
  * @category mapping
1255
1691
  */
1256
1692
  export const mapBoth: {
1693
+ /**
1694
+ * Returns an `STM` effect whose failure and success channels have been mapped
1695
+ * by the specified pair of functions, `f` and `g`.
1696
+ *
1697
+ * @since 2.0.0
1698
+ * @category mapping
1699
+ */
1257
1700
  <E, E2, A, A2>(
1258
1701
  options: { readonly onFailure: (error: E) => E2; readonly onSuccess: (value: A) => A2 }
1259
1702
  ): <R>(self: STM<A, E, R>) => STM<A2, E2, R>
1703
+ /**
1704
+ * Returns an `STM` effect whose failure and success channels have been mapped
1705
+ * by the specified pair of functions, `f` and `g`.
1706
+ *
1707
+ * @since 2.0.0
1708
+ * @category mapping
1709
+ */
1260
1710
  <A, E, R, E2, A2>(
1261
1711
  self: STM<A, E, R>,
1262
1712
  options: { readonly onFailure: (error: E) => E2; readonly onSuccess: (value: A) => A2 }
@@ -1270,7 +1720,19 @@ export const mapBoth: {
1270
1720
  * @category mapping
1271
1721
  */
1272
1722
  export const mapError: {
1723
+ /**
1724
+ * Maps from one error type to another.
1725
+ *
1726
+ * @since 2.0.0
1727
+ * @category mapping
1728
+ */
1273
1729
  <E, E2>(f: (error: E) => E2): <A, R>(self: STM<A, E, R>) => STM<A, E2, R>
1730
+ /**
1731
+ * Maps from one error type to another.
1732
+ *
1733
+ * @since 2.0.0
1734
+ * @category mapping
1735
+ */
1274
1736
  <A, E, R, E2>(self: STM<A, E, R>, f: (error: E) => E2): STM<A, E2, R>
1275
1737
  } = stm.mapError
1276
1738
 
@@ -1290,7 +1752,19 @@ export const merge: <A, E, R>(self: STM<A, E, R>) => STM<E | A, never, R> = stm.
1290
1752
  * @category constructors
1291
1753
  */
1292
1754
  export const mergeAll: {
1755
+ /**
1756
+ * Merges an `Iterable<STM>` to a single `STM`, working sequentially.
1757
+ *
1758
+ * @since 2.0.0
1759
+ * @category constructors
1760
+ */
1293
1761
  <A2, A>(zero: A2, f: (a2: A2, a: A) => A2): <E, R>(iterable: Iterable<STM<A, E, R>>) => STM<A2, E, R>
1762
+ /**
1763
+ * Merges an `Iterable<STM>` to a single `STM`, working sequentially.
1764
+ *
1765
+ * @since 2.0.0
1766
+ * @category constructors
1767
+ */
1294
1768
  <A, E, R, A2>(iterable: Iterable<STM<A, E, R>>, zero: A2, f: (a2: A2, a: A) => A2): STM<A2, E, R>
1295
1769
  } = stm.mergeAll
1296
1770
 
@@ -1335,7 +1809,21 @@ export const orDie: <A, E, R>(self: STM<A, E, R>) => STM<A, never, R> = stm.orDi
1335
1809
  * @category error handling
1336
1810
  */
1337
1811
  export const orDieWith: {
1812
+ /**
1813
+ * Keeps none of the errors, and terminates the fiber running the `STM` effect
1814
+ * with them, using the specified function to convert the `E` into a defect.
1815
+ *
1816
+ * @since 2.0.0
1817
+ * @category error handling
1818
+ */
1338
1819
  <E>(f: (error: E) => unknown): <A, R>(self: STM<A, E, R>) => STM<A, never, R>
1820
+ /**
1821
+ * Keeps none of the errors, and terminates the fiber running the `STM` effect
1822
+ * with them, using the specified function to convert the `E` into a defect.
1823
+ *
1824
+ * @since 2.0.0
1825
+ * @category error handling
1826
+ */
1339
1827
  <A, E, R>(self: STM<A, E, R>, f: (error: E) => unknown): STM<A, never, R>
1340
1828
  } = stm.orDieWith
1341
1829
 
@@ -1347,7 +1835,21 @@ export const orDieWith: {
1347
1835
  * @category error handling
1348
1836
  */
1349
1837
  export const orElse: {
1838
+ /**
1839
+ * Tries this effect first, and if it fails or retries, tries the other
1840
+ * effect.
1841
+ *
1842
+ * @since 2.0.0
1843
+ * @category error handling
1844
+ */
1350
1845
  <A2, E2, R2>(that: LazyArg<STM<A2, E2, R2>>): <A, E, R>(self: STM<A, E, R>) => STM<A2 | A, E2, R2 | R>
1846
+ /**
1847
+ * Tries this effect first, and if it fails or retries, tries the other
1848
+ * effect.
1849
+ *
1850
+ * @since 2.0.0
1851
+ * @category error handling
1852
+ */
1351
1853
  <A, E, R, A2, E2, R2>(self: STM<A, E, R>, that: LazyArg<STM<A2, E2, R2>>): STM<A | A2, E2, R | R2>
1352
1854
  } = stm.orElse
1353
1855
 
@@ -1360,7 +1862,23 @@ export const orElse: {
1360
1862
  * @category error handling
1361
1863
  */
1362
1864
  export const orElseEither: {
1865
+ /**
1866
+ * Returns a transactional effect that will produce the value of this effect
1867
+ * in left side, unless it fails or retries, in which case, it will produce
1868
+ * the value of the specified effect in right side.
1869
+ *
1870
+ * @since 2.0.0
1871
+ * @category error handling
1872
+ */
1363
1873
  <A2, E2, R2>(that: LazyArg<STM<A2, E2, R2>>): <A, E, R>(self: STM<A, E, R>) => STM<Either.Either<A2, A>, E2, R2 | R>
1874
+ /**
1875
+ * Returns a transactional effect that will produce the value of this effect
1876
+ * in left side, unless it fails or retries, in which case, it will produce
1877
+ * the value of the specified effect in right side.
1878
+ *
1879
+ * @since 2.0.0
1880
+ * @category error handling
1881
+ */
1364
1882
  <A, E, R, A2, E2, R2>(self: STM<A, E, R>, that: LazyArg<STM<A2, E2, R2>>): STM<Either.Either<A2, A>, E2, R | R2>
1365
1883
  } = stm.orElseEither
1366
1884
 
@@ -1372,7 +1890,21 @@ export const orElseEither: {
1372
1890
  * @category error handling
1373
1891
  */
1374
1892
  export const orElseFail: {
1893
+ /**
1894
+ * Tries this effect first, and if it fails or retries, fails with the
1895
+ * specified error.
1896
+ *
1897
+ * @since 2.0.0
1898
+ * @category error handling
1899
+ */
1375
1900
  <E2>(error: LazyArg<E2>): <A, E, R>(self: STM<A, E, R>) => STM<A, E2, R>
1901
+ /**
1902
+ * Tries this effect first, and if it fails or retries, fails with the
1903
+ * specified error.
1904
+ *
1905
+ * @since 2.0.0
1906
+ * @category error handling
1907
+ */
1376
1908
  <A, E, R, E2>(self: STM<A, E, R>, error: LazyArg<E2>): STM<A, E2, R>
1377
1909
  } = stm.orElseFail
1378
1910
 
@@ -1385,9 +1917,25 @@ export const orElseFail: {
1385
1917
  * @category error handling
1386
1918
  */
1387
1919
  export const orElseOptional: {
1920
+ /**
1921
+ * Returns an effect that will produce the value of this effect, unless it
1922
+ * fails with the `None` value, in which case it will produce the value of the
1923
+ * specified effect.
1924
+ *
1925
+ * @since 2.0.0
1926
+ * @category error handling
1927
+ */
1388
1928
  <A2, E2, R2>(
1389
1929
  that: LazyArg<STM<A2, Option.Option<E2>, R2>>
1390
1930
  ): <A, E, R>(self: STM<A, Option.Option<E>, R>) => STM<A2 | A, Option.Option<E2 | E>, R2 | R>
1931
+ /**
1932
+ * Returns an effect that will produce the value of this effect, unless it
1933
+ * fails with the `None` value, in which case it will produce the value of the
1934
+ * specified effect.
1935
+ *
1936
+ * @since 2.0.0
1937
+ * @category error handling
1938
+ */
1391
1939
  <A, E, R, A2, E2, R2>(
1392
1940
  self: STM<A, Option.Option<E>, R>,
1393
1941
  that: LazyArg<STM<A2, Option.Option<E2>, R2>>
@@ -1402,7 +1950,21 @@ export const orElseOptional: {
1402
1950
  * @category error handling
1403
1951
  */
1404
1952
  export const orElseSucceed: {
1953
+ /**
1954
+ * Tries this effect first, and if it fails or retries, succeeds with the
1955
+ * specified value.
1956
+ *
1957
+ * @since 2.0.0
1958
+ * @category error handling
1959
+ */
1405
1960
  <A2>(value: LazyArg<A2>): <A, E, R>(self: STM<A, E, R>) => STM<A2 | A, never, R>
1961
+ /**
1962
+ * Tries this effect first, and if it fails or retries, succeeds with the
1963
+ * specified value.
1964
+ *
1965
+ * @since 2.0.0
1966
+ * @category error handling
1967
+ */
1406
1968
  <A, E, R, A2>(self: STM<A, E, R>, value: LazyArg<A2>): STM<A | A2, never, R>
1407
1969
  } = stm.orElseSucceed
1408
1970
 
@@ -1414,7 +1976,21 @@ export const orElseSucceed: {
1414
1976
  * @category error handling
1415
1977
  */
1416
1978
  export const orTry: {
1979
+ /**
1980
+ * Tries this effect first, and if it enters retry, then it tries the other
1981
+ * effect. This is an equivalent of Haskell's orElse.
1982
+ *
1983
+ * @since 2.0.0
1984
+ * @category error handling
1985
+ */
1417
1986
  <A1, E1, R1>(that: LazyArg<STM<A1, E1, R1>>): <A, E, R>(self: STM<A, E, R>) => STM<A1 | A, E1 | E, R1 | R>
1987
+ /**
1988
+ * Tries this effect first, and if it enters retry, then it tries the other
1989
+ * effect. This is an equivalent of Haskell's orElse.
1990
+ *
1991
+ * @since 2.0.0
1992
+ * @category error handling
1993
+ */
1418
1994
  <A, E, R, A1, E1, R1>(self: STM<A, E, R>, that: LazyArg<STM<A1, E1, R1>>): STM<A | A1, E | E1, R | R1>
1419
1995
  } = core.orTry
1420
1996
 
@@ -1426,9 +2002,23 @@ export const orTry: {
1426
2002
  * @category traversing
1427
2003
  */
1428
2004
  export const partition: {
2005
+ /**
2006
+ * Feeds elements of type `A` to a function `f` that returns an effect.
2007
+ * Collects all successes and failures in a tupled fashion.
2008
+ *
2009
+ * @since 2.0.0
2010
+ * @category traversing
2011
+ */
1429
2012
  <A, A2, E, R>(
1430
2013
  f: (a: A) => STM<A2, E, R>
1431
2014
  ): (elements: Iterable<A>) => STM<[excluded: Array<E>, satisfying: Array<A2>], never, R>
2015
+ /**
2016
+ * Feeds elements of type `A` to a function `f` that returns an effect.
2017
+ * Collects all successes and failures in a tupled fashion.
2018
+ *
2019
+ * @since 2.0.0
2020
+ * @category traversing
2021
+ */
1432
2022
  <A, A2, E, R>(
1433
2023
  elements: Iterable<A>,
1434
2024
  f: (a: A) => STM<A2, E, R>
@@ -1443,7 +2033,21 @@ export const partition: {
1443
2033
  * @category context
1444
2034
  */
1445
2035
  export const provideContext: {
2036
+ /**
2037
+ * Provides the transaction its required environment, which eliminates its
2038
+ * dependency on `R`.
2039
+ *
2040
+ * @since 2.0.0
2041
+ * @category context
2042
+ */
1446
2043
  <R>(env: Context.Context<R>): <A, E>(self: STM<A, E, R>) => STM<A, E>
2044
+ /**
2045
+ * Provides the transaction its required environment, which eliminates its
2046
+ * dependency on `R`.
2047
+ *
2048
+ * @since 2.0.0
2049
+ * @category context
2050
+ */
1447
2051
  <A, E, R>(self: STM<A, E, R>, env: Context.Context<R>): STM<A, E>
1448
2052
  } = stm.provideContext
1449
2053
 
@@ -1455,7 +2059,21 @@ export const provideContext: {
1455
2059
  * @category context
1456
2060
  */
1457
2061
  export const provideSomeContext: {
2062
+ /**
2063
+ * Splits the context into two parts, providing one part using the
2064
+ * specified layer and leaving the remainder `R0`.
2065
+ *
2066
+ * @since 2.0.0
2067
+ * @category context
2068
+ */
1458
2069
  <R>(context: Context.Context<R>): <R1, E, A>(self: STM<A, E, R1>) => STM<A, E, Exclude<R1, R>>
2070
+ /**
2071
+ * Splits the context into two parts, providing one part using the
2072
+ * specified layer and leaving the remainder `R0`.
2073
+ *
2074
+ * @since 2.0.0
2075
+ * @category context
2076
+ */
1459
2077
  <R, R1, E, A>(self: STM<A, E, R1>, context: Context.Context<R>): STM<A, E, Exclude<R1, R>>
1460
2078
  } = stm.provideSomeContext
1461
2079
 
@@ -1467,10 +2085,24 @@ export const provideSomeContext: {
1467
2085
  * @category context
1468
2086
  */
1469
2087
  export const provideService: {
2088
+ /**
2089
+ * Provides the effect with the single service it requires. If the transactional
2090
+ * effect requires more than one service use `provideEnvironment` instead.
2091
+ *
2092
+ * @since 2.0.0
2093
+ * @category context
2094
+ */
1470
2095
  <T extends Context.Tag<any, any>>(
1471
2096
  tag: T,
1472
2097
  resource: Context.Tag.Service<T>
1473
2098
  ): <A, E, R>(self: STM<A, E, R>) => STM<A, E, Exclude<R, Context.Tag.Identifier<T>>>
2099
+ /**
2100
+ * Provides the effect with the single service it requires. If the transactional
2101
+ * effect requires more than one service use `provideEnvironment` instead.
2102
+ *
2103
+ * @since 2.0.0
2104
+ * @category context
2105
+ */
1474
2106
  <A, E, R, T extends Context.Tag<any, any>>(
1475
2107
  self: STM<A, E, R>,
1476
2108
  tag: T,
@@ -1486,10 +2118,24 @@ export const provideService: {
1486
2118
  * @category context
1487
2119
  */
1488
2120
  export const provideServiceSTM: {
2121
+ /**
2122
+ * Provides the effect with the single service it requires. If the transactional
2123
+ * effect requires more than one service use `provideEnvironment` instead.
2124
+ *
2125
+ * @since 2.0.0
2126
+ * @category context
2127
+ */
1489
2128
  <T extends Context.Tag<any, any>, E1, R1>(
1490
2129
  tag: T,
1491
2130
  stm: STM<Context.Tag.Service<T>, E1, R1>
1492
2131
  ): <A, E, R>(self: STM<A, E, R>) => STM<A, E1 | E, R1 | Exclude<R, Context.Tag.Identifier<T>>>
2132
+ /**
2133
+ * Provides the effect with the single service it requires. If the transactional
2134
+ * effect requires more than one service use `provideEnvironment` instead.
2135
+ *
2136
+ * @since 2.0.0
2137
+ * @category context
2138
+ */
1493
2139
  <A, E, R, T extends Context.Tag<any, any>, E1, R1>(
1494
2140
  self: STM<A, E, R>,
1495
2141
  tag: T,
@@ -1505,7 +2151,21 @@ export const provideServiceSTM: {
1505
2151
  * @category constructors
1506
2152
  */
1507
2153
  export const reduce: {
2154
+ /**
2155
+ * Folds an `Iterable<A>` using an effectual function f, working sequentially
2156
+ * from left to right.
2157
+ *
2158
+ * @since 2.0.0
2159
+ * @category constructors
2160
+ */
1508
2161
  <S, A, E, R>(zero: S, f: (s: S, a: A) => STM<S, E, R>): (iterable: Iterable<A>) => STM<S, E, R>
2162
+ /**
2163
+ * Folds an `Iterable<A>` using an effectual function f, working sequentially
2164
+ * from left to right.
2165
+ *
2166
+ * @since 2.0.0
2167
+ * @category constructors
2168
+ */
1509
2169
  <S, A, E, R>(iterable: Iterable<A>, zero: S, f: (s: S, a: A) => STM<S, E, R>): STM<S, E, R>
1510
2170
  } = stm.reduce
1511
2171
 
@@ -1516,10 +2176,22 @@ export const reduce: {
1516
2176
  * @category constructors
1517
2177
  */
1518
2178
  export const reduceAll: {
2179
+ /**
2180
+ * Reduces an `Iterable<STM>` to a single `STM`, working sequentially.
2181
+ *
2182
+ * @since 2.0.0
2183
+ * @category constructors
2184
+ */
1519
2185
  <A, E2, R2>(
1520
2186
  initial: STM<A, E2, R2>,
1521
2187
  f: (x: A, y: A) => A
1522
2188
  ): <E, R>(iterable: Iterable<STM<A, E, R>>) => STM<A, E2 | E, R2 | R>
2189
+ /**
2190
+ * Reduces an `Iterable<STM>` to a single `STM`, working sequentially.
2191
+ *
2192
+ * @since 2.0.0
2193
+ * @category constructors
2194
+ */
1523
2195
  <A, E, R, E2, R2>(
1524
2196
  iterable: Iterable<STM<A, E, R>>,
1525
2197
  initial: STM<A, E2, R2>,
@@ -1535,7 +2207,21 @@ export const reduceAll: {
1535
2207
  * @category constructors
1536
2208
  */
1537
2209
  export const reduceRight: {
2210
+ /**
2211
+ * Folds an `Iterable<A>` using an effectual function f, working sequentially
2212
+ * from right to left.
2213
+ *
2214
+ * @since 2.0.0
2215
+ * @category constructors
2216
+ */
1538
2217
  <S, A, R, E>(zero: S, f: (s: S, a: A) => STM<S, E, R>): (iterable: Iterable<A>) => STM<S, E, R>
2218
+ /**
2219
+ * Folds an `Iterable<A>` using an effectual function f, working sequentially
2220
+ * from right to left.
2221
+ *
2222
+ * @since 2.0.0
2223
+ * @category constructors
2224
+ */
1539
2225
  <S, A, R, E>(iterable: Iterable<A>, zero: S, f: (s: S, a: A) => STM<S, E, R>): STM<S, E, R>
1540
2226
  } = stm.reduceRight
1541
2227
 
@@ -1546,7 +2232,19 @@ export const reduceRight: {
1546
2232
  * @category mutations
1547
2233
  */
1548
2234
  export const refineOrDie: {
2235
+ /**
2236
+ * Keeps some of the errors, and terminates the fiber with the rest.
2237
+ *
2238
+ * @since 2.0.0
2239
+ * @category mutations
2240
+ */
1549
2241
  <E, E2>(pf: (error: E) => Option.Option<E2>): <A, R>(self: STM<A, E, R>) => STM<A, E2, R>
2242
+ /**
2243
+ * Keeps some of the errors, and terminates the fiber with the rest.
2244
+ *
2245
+ * @since 2.0.0
2246
+ * @category mutations
2247
+ */
1550
2248
  <A, E, R, E2>(self: STM<A, E, R>, pf: (error: E) => Option.Option<E2>): STM<A, E2, R>
1551
2249
  } = stm.refineOrDie
1552
2250
 
@@ -1558,8 +2256,26 @@ export const refineOrDie: {
1558
2256
  * @category mutations
1559
2257
  */
1560
2258
  export const refineOrDieWith: {
2259
+ /**
2260
+ * Keeps some of the errors, and terminates the fiber with the rest, using the
2261
+ * specified function to convert the `E` into a `Throwable`.
2262
+ *
2263
+ * @since 2.0.0
2264
+ * @category mutations
2265
+ */
1561
2266
  <E, E2>(pf: (error: E) => Option.Option<E2>, f: (error: E) => unknown): <A, R>(self: STM<A, E, R>) => STM<A, E2, R>
1562
- <A, E, R, E2>(self: STM<A, E, R>, pf: (error: E) => Option.Option<E2>, f: (error: E) => unknown): STM<A, E2, R>
2267
+ /**
2268
+ * Keeps some of the errors, and terminates the fiber with the rest, using the
2269
+ * specified function to convert the `E` into a `Throwable`.
2270
+ *
2271
+ * @since 2.0.0
2272
+ * @category mutations
2273
+ */
2274
+ <A, E, R, E2>(
2275
+ self: STM<A, E, R>,
2276
+ pf: (error: E) => Option.Option<E2>,
2277
+ f: (error: E) => unknown
2278
+ ): STM<A, E2, R>
1563
2279
  } = stm.refineOrDieWith
1564
2280
 
1565
2281
  /**
@@ -1570,7 +2286,21 @@ export const refineOrDieWith: {
1570
2286
  * @category mutations
1571
2287
  */
1572
2288
  export const reject: {
2289
+ /**
2290
+ * Fail with the returned value if the `PartialFunction` matches, otherwise
2291
+ * continue with our held value.
2292
+ *
2293
+ * @since 2.0.0
2294
+ * @category mutations
2295
+ */
1573
2296
  <A, E2>(pf: (a: A) => Option.Option<E2>): <E, R>(self: STM<A, E, R>) => STM<A, E2 | E, R>
2297
+ /**
2298
+ * Fail with the returned value if the `PartialFunction` matches, otherwise
2299
+ * continue with our held value.
2300
+ *
2301
+ * @since 2.0.0
2302
+ * @category mutations
2303
+ */
1574
2304
  <A, E, R, E2>(self: STM<A, E, R>, pf: (a: A) => Option.Option<E2>): STM<A, E | E2, R>
1575
2305
  } = stm.reject
1576
2306
 
@@ -1583,7 +2313,23 @@ export const reject: {
1583
2313
  * @category mutations
1584
2314
  */
1585
2315
  export const rejectSTM: {
2316
+ /**
2317
+ * Continue with the returned computation if the specified partial function
2318
+ * matches, translating the successful match into a failure, otherwise continue
2319
+ * with our held value.
2320
+ *
2321
+ * @since 2.0.0
2322
+ * @category mutations
2323
+ */
1586
2324
  <A, E2, R2>(pf: (a: A) => Option.Option<STM<E2, E2, R2>>): <E, R>(self: STM<A, E, R>) => STM<A, E2 | E, R2 | R>
2325
+ /**
2326
+ * Continue with the returned computation if the specified partial function
2327
+ * matches, translating the successful match into a failure, otherwise continue
2328
+ * with our held value.
2329
+ *
2330
+ * @since 2.0.0
2331
+ * @category mutations
2332
+ */
1587
2333
  <A, E, R, E2, R2>(self: STM<A, E, R>, pf: (a: A) => Option.Option<STM<E2, E2, R2>>): STM<A, E | E2, R | R2>
1588
2334
  } = stm.rejectSTM
1589
2335
 
@@ -1603,7 +2349,37 @@ export const rejectSTM: {
1603
2349
  * @category mutations
1604
2350
  */
1605
2351
  export const repeatUntil: {
2352
+ /**
2353
+ * Repeats this `STM` effect until its result satisfies the specified
2354
+ * predicate.
2355
+ *
2356
+ * **WARNING**: `repeatUntil` uses a busy loop to repeat the effect and will
2357
+ * consume a thread until it completes (it cannot yield). This is because STM
2358
+ * describes a single atomic transaction which must either complete, retry or
2359
+ * fail a transaction before yielding back to the Effect runtime.
2360
+ * - Use `retryUntil` instead if you don't need to maintain transaction
2361
+ * state for repeats.
2362
+ * - Ensure repeating the STM effect will eventually satisfy the predicate.
2363
+ *
2364
+ * @since 2.0.0
2365
+ * @category mutations
2366
+ */
1606
2367
  <A>(predicate: Predicate<A>): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
2368
+ /**
2369
+ * Repeats this `STM` effect until its result satisfies the specified
2370
+ * predicate.
2371
+ *
2372
+ * **WARNING**: `repeatUntil` uses a busy loop to repeat the effect and will
2373
+ * consume a thread until it completes (it cannot yield). This is because STM
2374
+ * describes a single atomic transaction which must either complete, retry or
2375
+ * fail a transaction before yielding back to the Effect runtime.
2376
+ * - Use `retryUntil` instead if you don't need to maintain transaction
2377
+ * state for repeats.
2378
+ * - Ensure repeating the STM effect will eventually satisfy the predicate.
2379
+ *
2380
+ * @since 2.0.0
2381
+ * @category mutations
2382
+ */
1607
2383
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>): STM<A, E, R>
1608
2384
  } = stm.repeatUntil
1609
2385
 
@@ -1624,7 +2400,39 @@ export const repeatUntil: {
1624
2400
  * @category mutations
1625
2401
  */
1626
2402
  export const repeatWhile: {
2403
+ /**
2404
+ * Repeats this `STM` effect while its result satisfies the specified
2405
+ * predicate.
2406
+ *
2407
+ * **WARNING**: `repeatWhile` uses a busy loop to repeat the effect and will
2408
+ * consume a thread until it completes (it cannot yield). This is because STM
2409
+ * describes a single atomic transaction which must either complete, retry or
2410
+ * fail a transaction before yielding back to the Effect runtime.
2411
+ * - Use `retryWhile` instead if you don't need to maintain transaction
2412
+ * state for repeats.
2413
+ * - Ensure repeating the STM effect will eventually not satisfy the
2414
+ * predicate.
2415
+ *
2416
+ * @since 2.0.0
2417
+ * @category mutations
2418
+ */
1627
2419
  <A>(predicate: Predicate<A>): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
2420
+ /**
2421
+ * Repeats this `STM` effect while its result satisfies the specified
2422
+ * predicate.
2423
+ *
2424
+ * **WARNING**: `repeatWhile` uses a busy loop to repeat the effect and will
2425
+ * consume a thread until it completes (it cannot yield). This is because STM
2426
+ * describes a single atomic transaction which must either complete, retry or
2427
+ * fail a transaction before yielding back to the Effect runtime.
2428
+ * - Use `retryWhile` instead if you don't need to maintain transaction
2429
+ * state for repeats.
2430
+ * - Ensure repeating the STM effect will eventually not satisfy the
2431
+ * predicate.
2432
+ *
2433
+ * @since 2.0.0
2434
+ * @category mutations
2435
+ */
1628
2436
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>): STM<A, E, R>
1629
2437
  } = stm.repeatWhile
1630
2438
 
@@ -1636,7 +2444,21 @@ export const repeatWhile: {
1636
2444
  * @category constructors
1637
2445
  */
1638
2446
  export const replicate: {
2447
+ /**
2448
+ * Replicates the given effect n times. If 0 or negative numbers are given, an
2449
+ * empty `Chunk` will be returned.
2450
+ *
2451
+ * @since 2.0.0
2452
+ * @category constructors
2453
+ */
1639
2454
  (n: number): <A, E, R>(self: STM<A, E, R>) => Array<STM<A, E, R>>
2455
+ /**
2456
+ * Replicates the given effect n times. If 0 or negative numbers are given, an
2457
+ * empty `Chunk` will be returned.
2458
+ *
2459
+ * @since 2.0.0
2460
+ * @category constructors
2461
+ */
1640
2462
  <A, E, R>(self: STM<A, E, R>, n: number): Array<STM<A, E, R>>
1641
2463
  } = stm.replicate
1642
2464
 
@@ -1648,7 +2470,21 @@ export const replicate: {
1648
2470
  * @category constructors
1649
2471
  */
1650
2472
  export const replicateSTM: {
2473
+ /**
2474
+ * Performs this transaction the specified number of times and collects the
2475
+ * results.
2476
+ *
2477
+ * @since 2.0.0
2478
+ * @category constructors
2479
+ */
1651
2480
  (n: number): <A, E, R>(self: STM<A, E, R>) => STM<Array<A>, E, R>
2481
+ /**
2482
+ * Performs this transaction the specified number of times and collects the
2483
+ * results.
2484
+ *
2485
+ * @since 2.0.0
2486
+ * @category constructors
2487
+ */
1652
2488
  <A, E, R>(self: STM<A, E, R>, n: number): STM<Array<A>, E, R>
1653
2489
  } = stm.replicateSTM
1654
2490
 
@@ -1660,7 +2496,21 @@ export const replicateSTM: {
1660
2496
  * @category constructors
1661
2497
  */
1662
2498
  export const replicateSTMDiscard: {
2499
+ /**
2500
+ * Performs this transaction the specified number of times, discarding the
2501
+ * results.
2502
+ *
2503
+ * @since 2.0.0
2504
+ * @category constructors
2505
+ */
1663
2506
  (n: number): <A, E, R>(self: STM<A, E, R>) => STM<void, E, R>
2507
+ /**
2508
+ * Performs this transaction the specified number of times, discarding the
2509
+ * results.
2510
+ *
2511
+ * @since 2.0.0
2512
+ * @category constructors
2513
+ */
1664
2514
  <A, E, R>(self: STM<A, E, R>, n: number): STM<void, E, R>
1665
2515
  } = stm.replicateSTMDiscard
1666
2516
 
@@ -1681,9 +2531,37 @@ export const retry: STM<never> = core.retry
1681
2531
  * @category mutations
1682
2532
  */
1683
2533
  export const retryUntil: {
2534
+ /**
2535
+ * Filters the value produced by this effect, retrying the transaction until
2536
+ * the predicate returns `true` for the value.
2537
+ *
2538
+ * @since 2.0.0
2539
+ * @category mutations
2540
+ */
1684
2541
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): <E, R>(self: STM<A, E, R>) => STM<B, E, R>
2542
+ /**
2543
+ * Filters the value produced by this effect, retrying the transaction until
2544
+ * the predicate returns `true` for the value.
2545
+ *
2546
+ * @since 2.0.0
2547
+ * @category mutations
2548
+ */
1685
2549
  <A>(predicate: Predicate<A>): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
2550
+ /**
2551
+ * Filters the value produced by this effect, retrying the transaction until
2552
+ * the predicate returns `true` for the value.
2553
+ *
2554
+ * @since 2.0.0
2555
+ * @category mutations
2556
+ */
1686
2557
  <A, E, R, B extends A>(self: STM<A, E, R>, refinement: Refinement<A, B>): STM<B, E, R>
2558
+ /**
2559
+ * Filters the value produced by this effect, retrying the transaction until
2560
+ * the predicate returns `true` for the value.
2561
+ *
2562
+ * @since 2.0.0
2563
+ * @category mutations
2564
+ */
1687
2565
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>): STM<A, E, R>
1688
2566
  } = stm.retryUntil
1689
2567
 
@@ -1695,7 +2573,21 @@ export const retryUntil: {
1695
2573
  * @category mutations
1696
2574
  */
1697
2575
  export const retryWhile: {
2576
+ /**
2577
+ * Filters the value produced by this effect, retrying the transaction while
2578
+ * the predicate returns `true` for the value.
2579
+ *
2580
+ * @since 2.0.0
2581
+ * @category mutations
2582
+ */
1698
2583
  <A>(predicate: Predicate<A>): <E, R>(self: STM<A, E, R>) => STM<A, E, R>
2584
+ /**
2585
+ * Filters the value produced by this effect, retrying the transaction while
2586
+ * the predicate returns `true` for the value.
2587
+ *
2588
+ * @since 2.0.0
2589
+ * @category mutations
2590
+ */
1699
2591
  <A, E, R>(self: STM<A, E, R>, predicate: Predicate<A>): STM<A, E, R>
1700
2592
  } = stm.retryWhile
1701
2593
 
@@ -1740,10 +2632,26 @@ export const succeedSome: <A>(value: A) => STM<Option.Option<A>> = stm.succeedSo
1740
2632
  * @category mutations
1741
2633
  */
1742
2634
  export const summarized: {
2635
+ /**
2636
+ * Summarizes a `STM` effect by computing a provided value before and after
2637
+ * execution, and then combining the values to produce a summary, together
2638
+ * with the result of execution.
2639
+ *
2640
+ * @since 2.0.0
2641
+ * @category mutations
2642
+ */
1743
2643
  <A2, E2, R2, A3>(
1744
2644
  summary: STM<A2, E2, R2>,
1745
2645
  f: (before: A2, after: A2) => A3
1746
2646
  ): <A, E, R>(self: STM<A, E, R>) => STM<[A3, A], E2 | E, R2 | R>
2647
+ /**
2648
+ * Summarizes a `STM` effect by computing a provided value before and after
2649
+ * execution, and then combining the values to produce a summary, together
2650
+ * with the result of execution.
2651
+ *
2652
+ * @since 2.0.0
2653
+ * @category mutations
2654
+ */
1747
2655
  <A, E, R, A2, E2, R2, A3>(
1748
2656
  self: STM<A, E, R>,
1749
2657
  summary: STM<A2, E2, R2>,
@@ -1775,7 +2683,19 @@ export const sync: <A>(evaluate: () => A) => STM<A> = core.sync
1775
2683
  * @category sequencing
1776
2684
  */
1777
2685
  export const tap: {
2686
+ /**
2687
+ * "Peeks" at the success of transactional effect.
2688
+ *
2689
+ * @since 2.0.0
2690
+ * @category sequencing
2691
+ */
1778
2692
  <A, X, E2, R2>(f: (a: A) => STM<X, E2, R2>): <E, R>(self: STM<A, E, R>) => STM<A, E2 | E, R2 | R>
2693
+ /**
2694
+ * "Peeks" at the success of transactional effect.
2695
+ *
2696
+ * @since 2.0.0
2697
+ * @category sequencing
2698
+ */
1779
2699
  <A, E, R, X, E2, R2>(self: STM<A, E, R>, f: (a: A) => STM<X, E2, R2>): STM<A, E | E2, R | R2>
1780
2700
  } = stm.tap
1781
2701
 
@@ -1786,9 +2706,21 @@ export const tap: {
1786
2706
  * @category sequencing
1787
2707
  */
1788
2708
  export const tapBoth: {
2709
+ /**
2710
+ * "Peeks" at both sides of an transactional effect.
2711
+ *
2712
+ * @since 2.0.0
2713
+ * @category sequencing
2714
+ */
1789
2715
  <XE extends E, A2, E2, R2, XA extends A, A3, E3, R3, A, E>(
1790
2716
  options: { readonly onFailure: (error: XE) => STM<A2, E2, R2>; readonly onSuccess: (value: XA) => STM<A3, E3, R3> }
1791
2717
  ): <R>(self: STM<A, E, R>) => STM<A, E | E2 | E3, R2 | R3 | R>
2718
+ /**
2719
+ * "Peeks" at both sides of an transactional effect.
2720
+ *
2721
+ * @since 2.0.0
2722
+ * @category sequencing
2723
+ */
1792
2724
  <A, E, R, XE extends E, A2, E2, R2, XA extends A, A3, E3, R3>(
1793
2725
  self: STM<A, E, R>,
1794
2726
  options: { readonly onFailure: (error: XE) => STM<A2, E2, R2>; readonly onSuccess: (value: XA) => STM<A3, E3, R3> }
@@ -1802,7 +2734,19 @@ export const tapBoth: {
1802
2734
  * @category sequencing
1803
2735
  */
1804
2736
  export const tapError: {
2737
+ /**
2738
+ * "Peeks" at the error of the transactional effect.
2739
+ *
2740
+ * @since 2.0.0
2741
+ * @category sequencing
2742
+ */
1805
2743
  <E, X, E2, R2>(f: (error: NoInfer<E>) => STM<X, E2, R2>): <A, R>(self: STM<A, E, R>) => STM<A, E | E2, R2 | R>
2744
+ /**
2745
+ * "Peeks" at the error of the transactional effect.
2746
+ *
2747
+ * @since 2.0.0
2748
+ * @category sequencing
2749
+ */
1806
2750
  <A, E, R, X, E2, R2>(self: STM<A, E, R>, f: (error: E) => STM<X, E2, R2>): STM<A, E | E2, R | R2>
1807
2751
  } = stm.tapError
1808
2752
 
@@ -1832,7 +2776,19 @@ export {
1832
2776
  * @category mutations
1833
2777
  */
1834
2778
  export const unless: {
2779
+ /**
2780
+ * The moral equivalent of `if (!p) exp`
2781
+ *
2782
+ * @since 2.0.0
2783
+ * @category mutations
2784
+ */
1835
2785
  (predicate: LazyArg<boolean>): <A, E, R>(self: STM<A, E, R>) => STM<Option.Option<A>, E, R>
2786
+ /**
2787
+ * The moral equivalent of `if (!p) exp`
2788
+ *
2789
+ * @since 2.0.0
2790
+ * @category mutations
2791
+ */
1836
2792
  <A, E, R>(self: STM<A, E, R>, predicate: LazyArg<boolean>): STM<Option.Option<A>, E, R>
1837
2793
  } = stm.unless
1838
2794
 
@@ -1843,7 +2799,19 @@ export const unless: {
1843
2799
  * @category mutations
1844
2800
  */
1845
2801
  export const unlessSTM: {
2802
+ /**
2803
+ * The moral equivalent of `if (!p) exp` when `p` has side-effects
2804
+ *
2805
+ * @since 2.0.0
2806
+ * @category mutations
2807
+ */
1846
2808
  <E2, R2>(predicate: STM<boolean, E2, R2>): <A, E, R>(self: STM<A, E, R>) => STM<Option.Option<A>, E2 | E, R2 | R>
2809
+ /**
2810
+ * The moral equivalent of `if (!p) exp` when `p` has side-effects
2811
+ *
2812
+ * @since 2.0.0
2813
+ * @category mutations
2814
+ */
1847
2815
  <A, E, R, E2, R2>(self: STM<A, E, R>, predicate: STM<boolean, E2, R2>): STM<Option.Option<A>, E | E2, R | R2>
1848
2816
  } = stm.unlessSTM
1849
2817
 
@@ -1877,7 +2845,27 @@ export {
1877
2845
  * @category mutations
1878
2846
  */
1879
2847
  export const validateAll: {
2848
+ /**
2849
+ * Feeds elements of type `A` to `f` and accumulates all errors in error
2850
+ * channel or successes in success channel.
2851
+ *
2852
+ * This combinator is lossy meaning that if there are errors all successes
2853
+ * will be lost. To retain all information please use `STM.partition`.
2854
+ *
2855
+ * @since 2.0.0
2856
+ * @category mutations
2857
+ */
1880
2858
  <A, B, E, R>(f: (a: A) => STM<B, E, R>): (elements: Iterable<A>) => STM<Array<B>, [E, ...Array<E>], R>
2859
+ /**
2860
+ * Feeds elements of type `A` to `f` and accumulates all errors in error
2861
+ * channel or successes in success channel.
2862
+ *
2863
+ * This combinator is lossy meaning that if there are errors all successes
2864
+ * will be lost. To retain all information please use `STM.partition`.
2865
+ *
2866
+ * @since 2.0.0
2867
+ * @category mutations
2868
+ */
1881
2869
  <A, B, E, R>(elements: Iterable<A>, f: (a: A) => STM<B, E, R>): STM<Array<B>, [E, ...Array<E>], R>
1882
2870
  } = stm.validateAll
1883
2871
 
@@ -1889,7 +2877,21 @@ export const validateAll: {
1889
2877
  * @category mutations
1890
2878
  */
1891
2879
  export const validateFirst: {
2880
+ /**
2881
+ * Feeds elements of type `A` to `f` until it succeeds. Returns first success
2882
+ * or the accumulation of all errors.
2883
+ *
2884
+ * @since 2.0.0
2885
+ * @category mutations
2886
+ */
1892
2887
  <A, B, E, R>(f: (a: A) => STM<B, E, R>): (elements: Iterable<A>) => STM<B, Array<E>, R>
2888
+ /**
2889
+ * Feeds elements of type `A` to `f` until it succeeds. Returns first success
2890
+ * or the accumulation of all errors.
2891
+ *
2892
+ * @since 2.0.0
2893
+ * @category mutations
2894
+ */
1893
2895
  <A, B, E, R>(elements: Iterable<A>, f: (a: A) => STM<B, E, R>): STM<B, Array<E>, R>
1894
2896
  } = stm.validateFirst
1895
2897
 
@@ -1900,7 +2902,19 @@ export const validateFirst: {
1900
2902
  * @category mutations
1901
2903
  */
1902
2904
  export const when: {
2905
+ /**
2906
+ * The moral equivalent of `if (p) exp`.
2907
+ *
2908
+ * @since 2.0.0
2909
+ * @category mutations
2910
+ */
1903
2911
  (predicate: LazyArg<boolean>): <A, E, R>(self: STM<A, E, R>) => STM<Option.Option<A>, E, R>
2912
+ /**
2913
+ * The moral equivalent of `if (p) exp`.
2914
+ *
2915
+ * @since 2.0.0
2916
+ * @category mutations
2917
+ */
1904
2918
  <A, E, R>(self: STM<A, E, R>, predicate: LazyArg<boolean>): STM<Option.Option<A>, E, R>
1905
2919
  } = stm.when
1906
2920
 
@@ -1911,7 +2925,19 @@ export const when: {
1911
2925
  * @category mutations
1912
2926
  */
1913
2927
  export const whenSTM: {
2928
+ /**
2929
+ * The moral equivalent of `if (p) exp` when `p` has side-effects.
2930
+ *
2931
+ * @since 2.0.0
2932
+ * @category mutations
2933
+ */
1914
2934
  <E2, R2>(predicate: STM<boolean, E2, R2>): <A, E, R>(self: STM<A, E, R>) => STM<Option.Option<A>, E2 | E, R2 | R>
2935
+ /**
2936
+ * The moral equivalent of `if (p) exp` when `p` has side-effects.
2937
+ *
2938
+ * @since 2.0.0
2939
+ * @category mutations
2940
+ */
1915
2941
  <A, E, R, E2, R2>(self: STM<A, E, R>, predicate: STM<boolean, E2, R2>): STM<Option.Option<A>, E | E2, R | R2>
1916
2942
  } = stm.whenSTM
1917
2943
 
@@ -1922,7 +2948,19 @@ export const whenSTM: {
1922
2948
  * @category zipping
1923
2949
  */
1924
2950
  export const zip: {
2951
+ /**
2952
+ * Sequentially zips this value with the specified one.
2953
+ *
2954
+ * @since 2.0.0
2955
+ * @category zipping
2956
+ */
1925
2957
  <A1, E1, R1>(that: STM<A1, E1, R1>): <A, E, R>(self: STM<A, E, R>) => STM<[A, A1], E1 | E, R1 | R>
2958
+ /**
2959
+ * Sequentially zips this value with the specified one.
2960
+ *
2961
+ * @since 2.0.0
2962
+ * @category zipping
2963
+ */
1926
2964
  <A, E, R, A1, E1, R1>(self: STM<A, E, R>, that: STM<A1, E1, R1>): STM<[A, A1], E | E1, R | R1>
1927
2965
  } = core.zip
1928
2966
 
@@ -1934,7 +2972,21 @@ export const zip: {
1934
2972
  * @category zipping
1935
2973
  */
1936
2974
  export const zipLeft: {
2975
+ /**
2976
+ * Sequentially zips this value with the specified one, discarding the second
2977
+ * element of the tuple.
2978
+ *
2979
+ * @since 2.0.0
2980
+ * @category zipping
2981
+ */
1937
2982
  <A1, E1, R1>(that: STM<A1, E1, R1>): <A, E, R>(self: STM<A, E, R>) => STM<A, E1 | E, R1 | R>
2983
+ /**
2984
+ * Sequentially zips this value with the specified one, discarding the second
2985
+ * element of the tuple.
2986
+ *
2987
+ * @since 2.0.0
2988
+ * @category zipping
2989
+ */
1938
2990
  <A, E, R, A1, E1, R1>(self: STM<A, E, R>, that: STM<A1, E1, R1>): STM<A, E | E1, R | R1>
1939
2991
  } = core.zipLeft
1940
2992
 
@@ -1946,7 +2998,21 @@ export const zipLeft: {
1946
2998
  * @category zipping
1947
2999
  */
1948
3000
  export const zipRight: {
3001
+ /**
3002
+ * Sequentially zips this value with the specified one, discarding the first
3003
+ * element of the tuple.
3004
+ *
3005
+ * @since 2.0.0
3006
+ * @category zipping
3007
+ */
1949
3008
  <A1, E1, R1>(that: STM<A1, E1, R1>): <A, E, R>(self: STM<A, E, R>) => STM<A1, E1 | E, R1 | R>
3009
+ /**
3010
+ * Sequentially zips this value with the specified one, discarding the first
3011
+ * element of the tuple.
3012
+ *
3013
+ * @since 2.0.0
3014
+ * @category zipping
3015
+ */
1950
3016
  <A, E, R, A1, E1, R1>(self: STM<A, E, R>, that: STM<A1, E1, R1>): STM<A1, E | E1, R | R1>
1951
3017
  } = core.zipRight
1952
3018
 
@@ -1958,10 +3024,24 @@ export const zipRight: {
1958
3024
  * @category zipping
1959
3025
  */
1960
3026
  export const zipWith: {
3027
+ /**
3028
+ * Sequentially zips this value with the specified one, combining the values
3029
+ * using the specified combiner function.
3030
+ *
3031
+ * @since 2.0.0
3032
+ * @category zipping
3033
+ */
1961
3034
  <A1, E1, R1, A, A2>(
1962
3035
  that: STM<A1, E1, R1>,
1963
3036
  f: (a: A, b: A1) => A2
1964
3037
  ): <E, R>(self: STM<A, E, R>) => STM<A2, E1 | E, R1 | R>
3038
+ /**
3039
+ * Sequentially zips this value with the specified one, combining the values
3040
+ * using the specified combiner function.
3041
+ *
3042
+ * @since 2.0.0
3043
+ * @category zipping
3044
+ */
1965
3045
  <A, E, R, A1, E1, R1, A2>(self: STM<A, E, R>, that: STM<A1, E1, R1>, f: (a: A, b: A1) => A2): STM<A2, E | E1, R | R1>
1966
3046
  } = core.zipWith
1967
3047
 
@@ -2008,10 +3088,18 @@ export const Do: STM<{}> = succeed({})
2008
3088
  * @since 2.0.0
2009
3089
  */
2010
3090
  export const bind: {
3091
+ /**
3092
+ * @category do notation
3093
+ * @since 2.0.0
3094
+ */
2011
3095
  <N extends string, K, A, E2, R2>(
2012
3096
  tag: Exclude<N, keyof K>,
2013
3097
  f: (_: K) => STM<A, E2, R2>
2014
3098
  ): <E, R>(self: STM<K, E, R>) => STM<MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R>
3099
+ /**
3100
+ * @category do notation
3101
+ * @since 2.0.0
3102
+ */
2015
3103
  <K, E, R, N extends string, A, E2, R2>(
2016
3104
  self: STM<K, E, R>,
2017
3105
  tag: Exclude<N, keyof K>,
@@ -2044,6 +3132,14 @@ export {
2044
3132
  * @since 2.0.0
2045
3133
  */
2046
3134
  export const bindTo: {
3135
+ /**
3136
+ * @category do notation
3137
+ * @since 2.0.0
3138
+ */
2047
3139
  <N extends string>(tag: N): <A, E, R>(self: STM<A, E, R>) => STM<Record<N, A>, E, R>
3140
+ /**
3141
+ * @category do notation
3142
+ * @since 2.0.0
3143
+ */
2048
3144
  <A, E, R, N extends string>(self: STM<A, E, R>, tag: N): STM<Record<N, A>, E, R>
2049
3145
  } = stm.bindTo