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/Micro.ts CHANGED
@@ -403,7 +403,17 @@ export const causeSquash = <E>(self: MicroCause<E>): unknown =>
403
403
  * @category MicroCause
404
404
  */
405
405
  export const causeWithTrace: {
406
+ /**
407
+ * @since 3.4.6
408
+ * @experimental
409
+ * @category MicroCause
410
+ */
406
411
  (trace: string): <E>(self: MicroCause<E>) => MicroCause<E>
412
+ /**
413
+ * @since 3.4.6
414
+ * @experimental
415
+ * @category MicroCause
416
+ */
407
417
  <E>(self: MicroCause<E>, trace: string): MicroCause<E>
408
418
  } = dual(2, <E>(self: MicroCause<E>, trace: string): MicroCause<E> => {
409
419
  const traces = [...self.traces, trace]
@@ -606,7 +616,17 @@ export const envUnsafeMakeEmpty = (): Env<never> => {
606
616
  * @category environment
607
617
  */
608
618
  export const envGet: {
619
+ /**
620
+ * @since 3.4.0
621
+ * @experimental
622
+ * @category environment
623
+ */
609
624
  <A>(ref: EnvRef<A>): <R>(self: Env<R>) => A
625
+ /**
626
+ * @since 3.4.0
627
+ * @experimental
628
+ * @category environment
629
+ */
610
630
  <A, R>(self: Env<R>, ref: EnvRef<A>): A
611
631
  } = dual(2, <R, A>(self: Env<R>, ref: EnvRef<A>): A => ref.key in self.refs ? (self.refs[ref.key] as A) : ref.initial)
612
632
 
@@ -616,7 +636,17 @@ export const envGet: {
616
636
  * @category environment
617
637
  */
618
638
  export const envSet: {
639
+ /**
640
+ * @since 3.4.0
641
+ * @experimental
642
+ * @category environment
643
+ */
619
644
  <A>(ref: EnvRef<A>, value: A): <R>(self: Env<R>) => Env<R>
645
+ /**
646
+ * @since 3.4.0
647
+ * @experimental
648
+ * @category environment
649
+ */
620
650
  <A, R>(self: Env<R>, ref: EnvRef<A>, value: A): Env<R>
621
651
  } = dual(3, <R, A>(self: Env<R>, ref: EnvRef<A>, value: A): Env<R> => {
622
652
  const refs = Object.assign(Object.create(null), self.refs)
@@ -630,7 +660,17 @@ export const envSet: {
630
660
  * @category environment
631
661
  */
632
662
  export const envMutate: {
663
+ /**
664
+ * @since 3.4.0
665
+ * @experimental
666
+ * @category environment
667
+ */
633
668
  (f: (map: Record<string, unknown>) => void): <R>(self: Env<R>) => Env<R>
669
+ /**
670
+ * @since 3.4.0
671
+ * @experimental
672
+ * @category environment
673
+ */
634
674
  <R>(self: Env<R>, f: (map: Record<string, unknown>) => void): Env<R>
635
675
  } = dual(
636
676
  2,
@@ -684,7 +724,21 @@ export const getEnvRef = <A>(envRef: EnvRef<A>): Micro<A> =>
684
724
  * @category environment
685
725
  */
686
726
  export const locally: {
727
+ /**
728
+ * Set the value of the given `EnvRef` for the duration of the effect.
729
+ *
730
+ * @since 3.4.0
731
+ * @experimental
732
+ * @category environment
733
+ */
687
734
  <A>(fiberRef: EnvRef<A>, value: A): <XA, E, R>(self: Micro<XA, E, R>) => Micro<XA, E, R>
735
+ /**
736
+ * Set the value of the given `EnvRef` for the duration of the effect.
737
+ *
738
+ * @since 3.4.0
739
+ * @experimental
740
+ * @category environment
741
+ */
688
742
  <XA, E, R, A>(self: Micro<XA, E, R>, fiberRef: EnvRef<A>, value: A): Micro<XA, E, R>
689
743
  } = dual(
690
744
  3,
@@ -709,7 +763,21 @@ export const context = <R>(): Micro<Context.Context<R>> => getEnvRef(currentCont
709
763
  * @category environment
710
764
  */
711
765
  export const provideContext: {
766
+ /**
767
+ * Merge the given `Context` with the current context.
768
+ *
769
+ * @since 3.4.0
770
+ * @experimental
771
+ * @category environment
772
+ */
712
773
  <XR>(context: Context.Context<XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, XR>>
774
+ /**
775
+ * Merge the given `Context` with the current context.
776
+ *
777
+ * @since 3.4.0
778
+ * @experimental
779
+ * @category environment
780
+ */
713
781
  <A, E, R, XR>(self: Micro<A, E, R>, context: Context.Context<XR>): Micro<A, E, Exclude<R, XR>>
714
782
  } = dual(
715
783
  2,
@@ -729,7 +797,21 @@ export const provideContext: {
729
797
  * @category environment
730
798
  */
731
799
  export const provideService: {
800
+ /**
801
+ * Add the provided service to the current context.
802
+ *
803
+ * @since 3.4.0
804
+ * @experimental
805
+ * @category environment
806
+ */
732
807
  <I, S>(tag: Context.Tag<I, S>, service: S): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, I>>
808
+ /**
809
+ * Add the provided service to the current context.
810
+ *
811
+ * @since 3.4.0
812
+ * @experimental
813
+ * @category environment
814
+ */
733
815
  <A, E, R, I, S>(self: Micro<A, E, R>, tag: Context.Tag<I, S>, service: S): Micro<A, E, Exclude<R, I>>
734
816
  } = dual(
735
817
  3,
@@ -750,10 +832,26 @@ export const provideService: {
750
832
  * @category environment
751
833
  */
752
834
  export const provideServiceEffect: {
835
+ /**
836
+ * Create a service using the provided `Micro` effect, and add it to the
837
+ * current context.
838
+ *
839
+ * @since 3.4.6
840
+ * @experimental
841
+ * @category environment
842
+ */
753
843
  <I, S, E2, R2>(
754
844
  tag: Context.Tag<I, S>,
755
845
  acquire: Micro<S, E2, R2>
756
846
  ): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | E2, Exclude<R, I> | R2>
847
+ /**
848
+ * Create a service using the provided `Micro` effect, and add it to the
849
+ * current context.
850
+ *
851
+ * @since 3.4.6
852
+ * @experimental
853
+ * @category environment
854
+ */
757
855
  <A, E, R, I, S, E2, R2>(
758
856
  self: Micro<A, E, R>,
759
857
  tag: Context.Tag<I, S>,
@@ -995,7 +1093,39 @@ export const currentScheduler: EnvRef<MicroScheduler> = envRefMake(
995
1093
  * )
996
1094
  */
997
1095
  export const withConcurrency: {
1096
+ /**
1097
+ * If you have a `Micro` that uses `concurrency: "inherit"`, you can use this
1098
+ * api to control the concurrency of that `Micro` when it is run.
1099
+ *
1100
+ * @since 3.4.0
1101
+ * @experimental
1102
+ * @category environment refs
1103
+ * @example
1104
+ * import * as Micro from "effect/Micro"
1105
+ *
1106
+ * Micro.forEach([1, 2, 3], (n) => Micro.succeed(n), {
1107
+ * concurrency: "inherit"
1108
+ * }).pipe(
1109
+ * Micro.withConcurrency(2) // use a concurrency of 2
1110
+ * )
1111
+ */
998
1112
  (concurrency: "unbounded" | number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>
1113
+ /**
1114
+ * If you have a `Micro` that uses `concurrency: "inherit"`, you can use this
1115
+ * api to control the concurrency of that `Micro` when it is run.
1116
+ *
1117
+ * @since 3.4.0
1118
+ * @experimental
1119
+ * @category environment refs
1120
+ * @example
1121
+ * import * as Micro from "effect/Micro"
1122
+ *
1123
+ * Micro.forEach([1, 2, 3], (n) => Micro.succeed(n), {
1124
+ * concurrency: "inherit"
1125
+ * }).pipe(
1126
+ * Micro.withConcurrency(2) // use a concurrency of 2
1127
+ * )
1128
+ */
999
1129
  <A, E, R>(self: Micro<A, E, R>, concurrency: "unbounded" | number): Micro<A, E, R>
1000
1130
  } = dual(
1001
1131
  2,
@@ -1482,7 +1612,23 @@ export const flatten = <A, E, R, E2, R2>(self: Micro<Micro<A, E, R>, E2, R2>): M
1482
1612
  * @category mapping & sequencing
1483
1613
  */
1484
1614
  export const map: {
1615
+ /**
1616
+ * Transforms the success value of the `Micro` effect with the specified
1617
+ * function.
1618
+ *
1619
+ * @since 3.4.0
1620
+ * @experimental
1621
+ * @category mapping & sequencing
1622
+ */
1485
1623
  <A, B>(f: (a: A) => B): <E, R>(self: Micro<A, E, R>) => Micro<B, E, R>
1624
+ /**
1625
+ * Transforms the success value of the `Micro` effect with the specified
1626
+ * function.
1627
+ *
1628
+ * @since 3.4.0
1629
+ * @experimental
1630
+ * @category mapping & sequencing
1631
+ */
1486
1632
  <A, E, R, B>(self: Micro<A, E, R>, f: (a: A) => B): Micro<B, E, R>
1487
1633
  } = dual(2, <A, E, R, B>(self: Micro<A, E, R>, f: (a: A) => B): Micro<B, E, R> =>
1488
1634
  make(function(env, onExit) {
@@ -1500,7 +1646,23 @@ export const map: {
1500
1646
  * @category mapping & sequencing
1501
1647
  */
1502
1648
  export const as: {
1649
+ /**
1650
+ * Create a `Micro` effect that will replace the success value of the given
1651
+ * effect.
1652
+ *
1653
+ * @since 3.4.0
1654
+ * @experimental
1655
+ * @category mapping & sequencing
1656
+ */
1503
1657
  <A, B>(value: B): <E, R>(self: Micro<A, E, R>) => Micro<B, E, R>
1658
+ /**
1659
+ * Create a `Micro` effect that will replace the success value of the given
1660
+ * effect.
1661
+ *
1662
+ * @since 3.4.0
1663
+ * @experimental
1664
+ * @category mapping & sequencing
1665
+ */
1504
1666
  <A, E, R, B>(self: Micro<A, E, R>, value: B): Micro<B, E, R>
1505
1667
  } = dual(2, <A, E, R, B>(self: Micro<A, E, R>, value: B): Micro<B, E, R> => map(self, (_) => value))
1506
1668
 
@@ -1522,7 +1684,23 @@ export const asSome = <A, E, R>(self: Micro<A, E, R>): Micro<Option.Option<A>, E
1522
1684
  * @category mapping & sequencing
1523
1685
  */
1524
1686
  export const flatMap: {
1687
+ /**
1688
+ * Map the success value of this `Micro` effect to another `Micro` effect, then
1689
+ * flatten the result.
1690
+ *
1691
+ * @since 3.4.0
1692
+ * @experimental
1693
+ * @category mapping & sequencing
1694
+ */
1525
1695
  <A, B, E2, R2>(f: (a: A) => Micro<B, E2, R2>): <E, R>(self: Micro<A, E, R>) => Micro<B, E | E2, R | R2>
1696
+ /**
1697
+ * Map the success value of this `Micro` effect to another `Micro` effect, then
1698
+ * flatten the result.
1699
+ *
1700
+ * @since 3.4.0
1701
+ * @experimental
1702
+ * @category mapping & sequencing
1703
+ */
1526
1704
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (a: A) => Micro<B, E2, R2>): Micro<B, E | E2, R | R2>
1527
1705
  } = dual(
1528
1706
  2,
@@ -1562,23 +1740,63 @@ export const flip = <A, E, R>(self: Micro<A, E, R>): Micro<E, A, R> =>
1562
1740
  * @category mapping & sequencing
1563
1741
  */
1564
1742
  export const andThen: {
1565
- <A, X>(
1566
- f: (a: A) => X
1567
- ): <E, R>(
1743
+ /**
1744
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1745
+ * a single api.
1746
+ *
1747
+ * It also allows you to pass in a `Micro` effect directly, which will be
1748
+ * executed after the current effect.
1749
+ *
1750
+ * @since 3.4.0
1751
+ * @experimental
1752
+ * @category mapping & sequencing
1753
+ */
1754
+ <A, X>(f: (a: A) => X): <E, R>(
1568
1755
  self: Micro<A, E, R>
1569
1756
  ) => [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1>
1570
1757
  : Micro<X, E, R>
1571
- <X>(
1572
- f: NotFunction<X>
1573
- ): <A, E, R>(
1758
+ /**
1759
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1760
+ * a single api.
1761
+ *
1762
+ * It also allows you to pass in a `Micro` effect directly, which will be
1763
+ * executed after the current effect.
1764
+ *
1765
+ * @since 3.4.0
1766
+ * @experimental
1767
+ * @category mapping & sequencing
1768
+ */
1769
+ <X>(f: NotFunction<X>): <A, E, R>(
1574
1770
  self: Micro<A, E, R>
1575
1771
  ) => [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1>
1576
1772
  : Micro<X, E, R>
1773
+ /**
1774
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1775
+ * a single api.
1776
+ *
1777
+ * It also allows you to pass in a `Micro` effect directly, which will be
1778
+ * executed after the current effect.
1779
+ *
1780
+ * @since 3.4.0
1781
+ * @experimental
1782
+ * @category mapping & sequencing
1783
+ */
1577
1784
  <A, E, R, X>(
1578
1785
  self: Micro<A, E, R>,
1579
1786
  f: (a: A) => X
1580
1787
  ): [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1>
1581
1788
  : Micro<X, E, R>
1789
+ /**
1790
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1791
+ * a single api.
1792
+ *
1793
+ * It also allows you to pass in a `Micro` effect directly, which will be
1794
+ * executed after the current effect.
1795
+ *
1796
+ * @since 3.4.0
1797
+ * @experimental
1798
+ * @category mapping & sequencing
1799
+ */
1582
1800
  <A, E, R, X>(
1583
1801
  self: Micro<A, E, R>,
1584
1802
  f: NotFunction<X>
@@ -1614,23 +1832,55 @@ export const andThen: {
1614
1832
  * @category mapping & sequencing
1615
1833
  */
1616
1834
  export const tap: {
1617
- <A, X>(
1618
- f: (a: NoInfer<A>) => X
1619
- ): <E, R>(
1835
+ /**
1836
+ * Execute a side effect from the success value of the `Micro` effect.
1837
+ *
1838
+ * It is similar to the `andThen` api, but the success value is ignored.
1839
+ *
1840
+ * @since 3.4.0
1841
+ * @experimental
1842
+ * @category mapping & sequencing
1843
+ */
1844
+ <A, X>(f: (a: NoInfer<A>) => X): <E, R>(
1620
1845
  self: Micro<A, E, R>
1621
1846
  ) => [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1>
1622
1847
  : Micro<A, E, R>
1623
- <X>(
1624
- f: NotFunction<X>
1625
- ): <A, E, R>(
1848
+ /**
1849
+ * Execute a side effect from the success value of the `Micro` effect.
1850
+ *
1851
+ * It is similar to the `andThen` api, but the success value is ignored.
1852
+ *
1853
+ * @since 3.4.0
1854
+ * @experimental
1855
+ * @category mapping & sequencing
1856
+ */
1857
+ <X>(f: NotFunction<X>): <A, E, R>(
1626
1858
  self: Micro<A, E, R>
1627
1859
  ) => [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1>
1628
1860
  : Micro<A, E, R>
1861
+ /**
1862
+ * Execute a side effect from the success value of the `Micro` effect.
1863
+ *
1864
+ * It is similar to the `andThen` api, but the success value is ignored.
1865
+ *
1866
+ * @since 3.4.0
1867
+ * @experimental
1868
+ * @category mapping & sequencing
1869
+ */
1629
1870
  <A, E, R, X>(
1630
1871
  self: Micro<A, E, R>,
1631
1872
  f: (a: NoInfer<A>) => X
1632
1873
  ): [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1>
1633
1874
  : Micro<A, E, R>
1875
+ /**
1876
+ * Execute a side effect from the success value of the `Micro` effect.
1877
+ *
1878
+ * It is similar to the `andThen` api, but the success value is ignored.
1879
+ *
1880
+ * @since 3.4.0
1881
+ * @experimental
1882
+ * @category mapping & sequencing
1883
+ */
1634
1884
  <A, E, R, X>(
1635
1885
  self: Micro<A, E, R>,
1636
1886
  f: NotFunction<X>
@@ -1797,7 +2047,23 @@ export const raceAllFirst = <Eff extends Micro<any, any, any>>(
1797
2047
  * @category sequencing
1798
2048
  */
1799
2049
  export const race: {
2050
+ /**
2051
+ * Returns an effect that races two effects, yielding the value of the first
2052
+ * effect to succeed. Losers of the race will be interrupted immediately
2053
+ *
2054
+ * @since 3.4.0
2055
+ * @experimental
2056
+ * @category sequencing
2057
+ */
1800
2058
  <A2, E2, R2>(that: Micro<A2, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>
2059
+ /**
2060
+ * Returns an effect that races two effects, yielding the value of the first
2061
+ * effect to succeed. Losers of the race will be interrupted immediately
2062
+ *
2063
+ * @since 3.4.0
2064
+ * @experimental
2065
+ * @category sequencing
2066
+ */
1801
2067
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>): Micro<A | A2, E | E2, R | R2>
1802
2068
  } = dual(
1803
2069
  2,
@@ -1814,7 +2080,23 @@ export const race: {
1814
2080
  * @category sequencing
1815
2081
  */
1816
2082
  export const raceFirst: {
2083
+ /**
2084
+ * Returns an effect that races two effects, yielding the value of the first
2085
+ * effect to succeed *or* fail. Losers of the race will be interrupted immediately
2086
+ *
2087
+ * @since 3.4.0
2088
+ * @experimental
2089
+ * @category sequencing
2090
+ */
1817
2091
  <A2, E2, R2>(that: Micro<A2, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>
2092
+ /**
2093
+ * Returns an effect that races two effects, yielding the value of the first
2094
+ * effect to succeed *or* fail. Losers of the race will be interrupted immediately
2095
+ *
2096
+ * @since 3.4.0
2097
+ * @experimental
2098
+ * @category sequencing
2099
+ */
1818
2100
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>): Micro<A | A2, E | E2, R | R2>
1819
2101
  } = dual(
1820
2102
  2,
@@ -1835,12 +2117,36 @@ export const raceFirst: {
1835
2117
  * @category zipping
1836
2118
  */
1837
2119
  export const zip: {
2120
+ // ----------------------------------------------------------------------------
2121
+ // zipping
2122
+ // ----------------------------------------------------------------------------
2123
+
2124
+ /**
2125
+ * Combine two `Micro` effects into a single effect that produces a tuple of
2126
+ * their results.
2127
+ *
2128
+ * @since 3.4.0
2129
+ * @experimental
2130
+ * @category zipping
2131
+ */
1838
2132
  <A2, E2, R2>(
1839
2133
  that: Micro<A2, E2, R2>,
1840
2134
  options?:
1841
2135
  | { readonly concurrent?: boolean | undefined }
1842
2136
  | undefined
1843
2137
  ): <A, E, R>(self: Micro<A, E, R>) => Micro<[A, A2], E2 | E, R2 | R>
2138
+ // ----------------------------------------------------------------------------
2139
+ // zipping
2140
+ // ----------------------------------------------------------------------------
2141
+
2142
+ /**
2143
+ * Combine two `Micro` effects into a single effect that produces a tuple of
2144
+ * their results.
2145
+ *
2146
+ * @since 3.4.0
2147
+ * @experimental
2148
+ * @category zipping
2149
+ */
1844
2150
  <A, E, R, A2, E2, R2>(
1845
2151
  self: Micro<A, E, R>,
1846
2152
  that: Micro<A2, E2, R2>,
@@ -1862,11 +2168,29 @@ export const zip: {
1862
2168
  * @category zipping
1863
2169
  */
1864
2170
  export const zipWith: {
2171
+ /**
2172
+ * The `Micro.zipWith` function combines two `Micro` effects and allows you to
2173
+ * apply a function to the results of the combined effects, transforming them
2174
+ * into a single value.
2175
+ *
2176
+ * @since 3.4.3
2177
+ * @experimental
2178
+ * @category zipping
2179
+ */
1865
2180
  <A2, E2, R2, A, B>(
1866
2181
  that: Micro<A2, E2, R2>,
1867
2182
  f: (a: A, b: A2) => B,
1868
2183
  options?: { readonly concurrent?: boolean | undefined }
1869
2184
  ): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R2 | R>
2185
+ /**
2186
+ * The `Micro.zipWith` function combines two `Micro` effects and allows you to
2187
+ * apply a function to the results of the combined effects, transforming them
2188
+ * into a single value.
2189
+ *
2190
+ * @since 3.4.3
2191
+ * @experimental
2192
+ * @category zipping
2193
+ */
1870
2194
  <A, E, R, A2, E2, R2, B>(
1871
2195
  self: Micro<A, E, R>,
1872
2196
  that: Micro<A2, E2, R2>,
@@ -1902,19 +2226,79 @@ export const zipWith: {
1902
2226
  * @category filtering & conditionals
1903
2227
  */
1904
2228
  export const filterOrFailCause: {
2229
+ // ----------------------------------------------------------------------------
2230
+ // filtering & conditionals
2231
+ // ----------------------------------------------------------------------------
2232
+
2233
+ /**
2234
+ * Filter the specified effect with the provided function, failing with specified
2235
+ * `MicroCause` if the predicate fails.
2236
+ *
2237
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2238
+ * refine and narrow down the type of the success channel by providing a
2239
+ *
2240
+ * @since 3.4.0
2241
+ * @experimental
2242
+ * @category filtering & conditionals
2243
+ */
1905
2244
  <A, B extends A, E2>(
1906
2245
  refinement: Refinement<A, B>,
1907
2246
  orFailWith: (a: NoInfer<A>) => MicroCause<E2>
1908
2247
  ): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R>
2248
+ // ----------------------------------------------------------------------------
2249
+ // filtering & conditionals
2250
+ // ----------------------------------------------------------------------------
2251
+
2252
+ /**
2253
+ * Filter the specified effect with the provided function, failing with specified
2254
+ * `MicroCause` if the predicate fails.
2255
+ *
2256
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2257
+ * refine and narrow down the type of the success channel by providing a
2258
+ *
2259
+ * @since 3.4.0
2260
+ * @experimental
2261
+ * @category filtering & conditionals
2262
+ */
1909
2263
  <A, E2>(
1910
2264
  predicate: Predicate<NoInfer<A>>,
1911
2265
  orFailWith: (a: NoInfer<A>) => MicroCause<E2>
1912
2266
  ): <E, R>(self: Micro<A, E, R>) => Micro<A, E2 | E, R>
2267
+ // ----------------------------------------------------------------------------
2268
+ // filtering & conditionals
2269
+ // ----------------------------------------------------------------------------
2270
+
2271
+ /**
2272
+ * Filter the specified effect with the provided function, failing with specified
2273
+ * `MicroCause` if the predicate fails.
2274
+ *
2275
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2276
+ * refine and narrow down the type of the success channel by providing a
2277
+ *
2278
+ * @since 3.4.0
2279
+ * @experimental
2280
+ * @category filtering & conditionals
2281
+ */
1913
2282
  <A, E, R, B extends A, E2>(
1914
2283
  self: Micro<A, E, R>,
1915
2284
  refinement: Refinement<A, B>,
1916
2285
  orFailWith: (a: A) => MicroCause<E2>
1917
2286
  ): Micro<B, E | E2, R>
2287
+ // ----------------------------------------------------------------------------
2288
+ // filtering & conditionals
2289
+ // ----------------------------------------------------------------------------
2290
+
2291
+ /**
2292
+ * Filter the specified effect with the provided function, failing with specified
2293
+ * `MicroCause` if the predicate fails.
2294
+ *
2295
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2296
+ * refine and narrow down the type of the success channel by providing a
2297
+ *
2298
+ * @since 3.4.0
2299
+ * @experimental
2300
+ * @category filtering & conditionals
2301
+ */
1918
2302
  <A, E, R, E2>(
1919
2303
  self: Micro<A, E, R>,
1920
2304
  predicate: Predicate<A>,
@@ -1938,19 +2322,63 @@ export const filterOrFailCause: {
1938
2322
  * @category filtering & conditionals
1939
2323
  */
1940
2324
  export const filterOrFail: {
2325
+ /**
2326
+ * Filter the specified effect with the provided function, failing with specified
2327
+ * error if the predicate fails.
2328
+ *
2329
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2330
+ * refine and narrow down the type of the success channel by providing a
2331
+ *
2332
+ * @since 3.4.0
2333
+ * @experimental
2334
+ * @category filtering & conditionals
2335
+ */
1941
2336
  <A, B extends A, E2>(
1942
2337
  refinement: Refinement<A, B>,
1943
2338
  orFailWith: (a: NoInfer<A>) => E2
1944
2339
  ): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R>
2340
+ /**
2341
+ * Filter the specified effect with the provided function, failing with specified
2342
+ * error if the predicate fails.
2343
+ *
2344
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2345
+ * refine and narrow down the type of the success channel by providing a
2346
+ *
2347
+ * @since 3.4.0
2348
+ * @experimental
2349
+ * @category filtering & conditionals
2350
+ */
1945
2351
  <A, E2>(
1946
2352
  predicate: Predicate<NoInfer<A>>,
1947
2353
  orFailWith: (a: NoInfer<A>) => E2
1948
2354
  ): <E, R>(self: Micro<A, E, R>) => Micro<A, E2 | E, R>
2355
+ /**
2356
+ * Filter the specified effect with the provided function, failing with specified
2357
+ * error if the predicate fails.
2358
+ *
2359
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2360
+ * refine and narrow down the type of the success channel by providing a
2361
+ *
2362
+ * @since 3.4.0
2363
+ * @experimental
2364
+ * @category filtering & conditionals
2365
+ */
1949
2366
  <A, E, R, B extends A, E2>(
1950
2367
  self: Micro<A, E, R>,
1951
2368
  refinement: Refinement<A, B>,
1952
2369
  orFailWith: (a: A) => E2
1953
2370
  ): Micro<B, E | E2, R>
2371
+ /**
2372
+ * Filter the specified effect with the provided function, failing with specified
2373
+ * error if the predicate fails.
2374
+ *
2375
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
2376
+ * refine and narrow down the type of the success channel by providing a
2377
+ *
2378
+ * @since 3.4.0
2379
+ * @experimental
2380
+ * @category filtering & conditionals
2381
+ */
1954
2382
  <A, E, R, E2>(self: Micro<A, E, R>, predicate: Predicate<A>, orFailWith: (a: A) => E2): Micro<A, E | E2, R>
1955
2383
  } = dual((args) => isMicro(args[0]), <A, E, R, B extends A, E2>(
1956
2384
  self: Micro<A, E, R>,
@@ -1966,9 +2394,23 @@ export const filterOrFail: {
1966
2394
  * @category filtering & conditionals
1967
2395
  */
1968
2396
  export const when: {
2397
+ /**
2398
+ * The moral equivalent of `if (p) exp`.
2399
+ *
2400
+ * @since 3.4.0
2401
+ * @experimental
2402
+ * @category filtering & conditionals
2403
+ */
1969
2404
  <E2 = never, R2 = never>(
1970
2405
  condition: LazyArg<boolean> | Micro<boolean, E2, R2>
1971
2406
  ): <A, E, R>(self: Micro<A, E, R>) => Micro<Option.Option<A>, E | E2, R | R2>
2407
+ /**
2408
+ * The moral equivalent of `if (p) exp`.
2409
+ *
2410
+ * @since 3.4.0
2411
+ * @experimental
2412
+ * @category filtering & conditionals
2413
+ */
1972
2414
  <A, E, R, E2 = never, R2 = never>(
1973
2415
  self: Micro<A, E, R>,
1974
2416
  condition: LazyArg<boolean> | Micro<boolean, E2, R2>
@@ -1997,16 +2439,49 @@ export const when: {
1997
2439
  * @category repetition
1998
2440
  */
1999
2441
  export const repeatExit: {
2000
- <A, E>(options: {
2001
- while: Predicate<MicroExit<A, E>>
2002
- times?: number | undefined
2003
- schedule?: MicroSchedule | undefined
2004
- }): <R>(self: Micro<A, E, R>) => Micro<A, E, R>
2005
- <A, E, R>(self: Micro<A, E, R>, options: {
2006
- while: Predicate<MicroExit<A, E>>
2007
- times?: number | undefined
2008
- schedule?: MicroSchedule | undefined
2009
- }): Micro<A, E, R>
2442
+ // ----------------------------------------------------------------------------
2443
+ // repetition
2444
+ // ----------------------------------------------------------------------------
2445
+
2446
+ /**
2447
+ * Repeat the given `Micro` using the provided options.
2448
+ *
2449
+ * The `while` predicate will be checked after each iteration, and can use the
2450
+ * fall `MicroExit` of the effect to determine if the repetition should continue.
2451
+ *
2452
+ * @since 3.4.6
2453
+ * @experimental
2454
+ * @category repetition
2455
+ */
2456
+ <A, E>(
2457
+ options: {
2458
+ while: Predicate<MicroExit<A, E>>
2459
+ times?: number | undefined
2460
+ schedule?: MicroSchedule | undefined
2461
+ }
2462
+ ): <R>(self: Micro<A, E, R>) => Micro<A, E, R>
2463
+ // ----------------------------------------------------------------------------
2464
+ // repetition
2465
+ // ----------------------------------------------------------------------------
2466
+
2467
+ /**
2468
+ * Repeat the given `Micro` using the provided options.
2469
+ *
2470
+ * The `while` predicate will be checked after each iteration, and can use the
2471
+ * fall `MicroExit` of the effect to determine if the repetition should continue.
2472
+ *
2473
+ * @since 3.4.6
2474
+ * @experimental
2475
+ * @category repetition
2476
+ */
2477
+ <A, E, R>(
2478
+ self: Micro<A, E, R>,
2479
+ options: {
2480
+ while: Predicate<MicroExit<A, E>>
2481
+ times?: number | undefined
2482
+ schedule?: MicroSchedule | undefined
2483
+ }
2484
+ ): Micro<A, E, R>
2010
2485
  } = dual(2, <A, E, R>(self: Micro<A, E, R>, options: {
2011
2486
  while: Predicate<MicroExit<A, E>>
2012
2487
  times?: number | undefined
@@ -2049,6 +2524,14 @@ export const repeatExit: {
2049
2524
  * @category repetition
2050
2525
  */
2051
2526
  export const repeat: {
2527
+ /**
2528
+ * Repeat the given `Micro` effect using the provided options. Only successful
2529
+ * results will be repeated.
2530
+ *
2531
+ * @since 3.4.0
2532
+ * @experimental
2533
+ * @category repetition
2534
+ */
2052
2535
  <A, E>(
2053
2536
  options?: {
2054
2537
  while?: Predicate<A> | undefined
@@ -2056,6 +2539,14 @@ export const repeat: {
2056
2539
  schedule?: MicroSchedule | undefined
2057
2540
  } | undefined
2058
2541
  ): <R>(self: Micro<A, E, R>) => Micro<A, E, R>
2542
+ /**
2543
+ * Repeat the given `Micro` effect using the provided options. Only successful
2544
+ * results will be repeated.
2545
+ *
2546
+ * @since 3.4.0
2547
+ * @experimental
2548
+ * @category repetition
2549
+ */
2059
2550
  <A, E, R>(
2060
2551
  self: Micro<A, E, R>,
2061
2552
  options?: {
@@ -2142,7 +2633,23 @@ export const scheduleExponential = (baseMillis: number, factor = 2): MicroSchedu
2142
2633
  * @category scheduling
2143
2634
  */
2144
2635
  export const scheduleAddDelay: {
2636
+ /**
2637
+ * Returns a new `MicroSchedule` with an added calculated delay to each delay
2638
+ * returned by this schedule.
2639
+ *
2640
+ * @since 3.4.6
2641
+ * @experimental
2642
+ * @category scheduling
2643
+ */
2145
2644
  (f: () => number): (self: MicroSchedule) => MicroSchedule
2645
+ /**
2646
+ * Returns a new `MicroSchedule` with an added calculated delay to each delay
2647
+ * returned by this schedule.
2648
+ *
2649
+ * @since 3.4.6
2650
+ * @experimental
2651
+ * @category scheduling
2652
+ */
2146
2653
  (self: MicroSchedule, f: () => number): MicroSchedule
2147
2654
  } = dual(
2148
2655
  2,
@@ -2159,7 +2666,23 @@ export const scheduleAddDelay: {
2159
2666
  * @category scheduling
2160
2667
  */
2161
2668
  export const scheduleWithMaxDelay: {
2669
+ /**
2670
+ * Transform a `MicroSchedule` to one that will have a delay that will never exceed
2671
+ * the specified maximum.
2672
+ *
2673
+ * @since 3.4.6
2674
+ * @experimental
2675
+ * @category scheduling
2676
+ */
2162
2677
  (max: number): (self: MicroSchedule) => MicroSchedule
2678
+ /**
2679
+ * Transform a `MicroSchedule` to one that will have a delay that will never exceed
2680
+ * the specified maximum.
2681
+ *
2682
+ * @since 3.4.6
2683
+ * @experimental
2684
+ * @category scheduling
2685
+ */
2163
2686
  (self: MicroSchedule, max: number): MicroSchedule
2164
2687
  } = dual(
2165
2688
  2,
@@ -2176,7 +2699,23 @@ export const scheduleWithMaxDelay: {
2176
2699
  * @category scheduling
2177
2700
  */
2178
2701
  export const scheduleWithMaxElapsed: {
2702
+ /**
2703
+ * Transform a `MicroSchedule` to one that will stop repeating after the specified
2704
+ * amount of time.
2705
+ *
2706
+ * @since 3.4.6
2707
+ * @experimental
2708
+ * @category scheduling
2709
+ */
2179
2710
  (max: number): (self: MicroSchedule) => MicroSchedule
2711
+ /**
2712
+ * Transform a `MicroSchedule` to one that will stop repeating after the specified
2713
+ * amount of time.
2714
+ *
2715
+ * @since 3.4.6
2716
+ * @experimental
2717
+ * @category scheduling
2718
+ */
2180
2719
  (self: MicroSchedule, max: number): MicroSchedule
2181
2720
  } = dual(
2182
2721
  2,
@@ -2193,7 +2732,23 @@ export const scheduleWithMaxElapsed: {
2193
2732
  * @category scheduling
2194
2733
  */
2195
2734
  export const scheduleUnion: {
2735
+ /**
2736
+ * Combines two `MicroSchedule`s, by recurring if either schedule wants to
2737
+ * recur, using the minimum of the two durations between recurrences.
2738
+ *
2739
+ * @since 3.4.6
2740
+ * @experimental
2741
+ * @category scheduling
2742
+ */
2196
2743
  (that: MicroSchedule): (self: MicroSchedule) => MicroSchedule
2744
+ /**
2745
+ * Combines two `MicroSchedule`s, by recurring if either schedule wants to
2746
+ * recur, using the minimum of the two durations between recurrences.
2747
+ *
2748
+ * @since 3.4.6
2749
+ * @experimental
2750
+ * @category scheduling
2751
+ */
2197
2752
  (self: MicroSchedule, that: MicroSchedule): MicroSchedule
2198
2753
  } = dual(
2199
2754
  2,
@@ -2210,7 +2765,23 @@ export const scheduleUnion: {
2210
2765
  * @category scheduling
2211
2766
  */
2212
2767
  export const scheduleIntersect: {
2768
+ /**
2769
+ * Combines two `MicroSchedule`s, by recurring only if both schedules want to
2770
+ * recur, using the maximum of the two durations between recurrences.
2771
+ *
2772
+ * @since 3.4.6
2773
+ * @experimental
2774
+ * @category scheduling
2775
+ */
2213
2776
  (that: MicroSchedule): (self: MicroSchedule) => MicroSchedule
2777
+ /**
2778
+ * Combines two `MicroSchedule`s, by recurring only if both schedules want to
2779
+ * recur, using the maximum of the two durations between recurrences.
2780
+ *
2781
+ * @since 3.4.6
2782
+ * @experimental
2783
+ * @category scheduling
2784
+ */
2214
2785
  (self: MicroSchedule, that: MicroSchedule): MicroSchedule
2215
2786
  } = dual(
2216
2787
  2,
@@ -2231,9 +2802,33 @@ export const scheduleIntersect: {
2231
2802
  * @category error handling
2232
2803
  */
2233
2804
  export const catchAllCause: {
2805
+ // ----------------------------------------------------------------------------
2806
+ // error handling
2807
+ // ----------------------------------------------------------------------------
2808
+
2809
+ /**
2810
+ * Catch the full `MicroCause` object of the given `Micro` effect, allowing you to
2811
+ * recover from any kind of cause.
2812
+ *
2813
+ * @since 3.4.6
2814
+ * @experimental
2815
+ * @category error handling
2816
+ */
2234
2817
  <E, B, E2, R2>(
2235
2818
  f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
2236
2819
  ): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E2, R | R2>
2820
+ // ----------------------------------------------------------------------------
2821
+ // error handling
2822
+ // ----------------------------------------------------------------------------
2823
+
2824
+ /**
2825
+ * Catch the full `MicroCause` object of the given `Micro` effect, allowing you to
2826
+ * recover from any kind of cause.
2827
+ *
2828
+ * @since 3.4.6
2829
+ * @experimental
2830
+ * @category error handling
2831
+ */
2237
2832
  <A, E, R, B, E2, R2>(
2238
2833
  self: Micro<A, E, R>,
2239
2834
  f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
@@ -2255,19 +2850,51 @@ export const catchAllCause: {
2255
2850
  * @category error handling
2256
2851
  */
2257
2852
  export const catchCauseIf: {
2853
+ /**
2854
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
2855
+ * using the provided predicate to determine if the failure should be caught.
2856
+ *
2857
+ * @since 3.4.6
2858
+ * @experimental
2859
+ * @category error handling
2860
+ */
2258
2861
  <E, B, E2, R2, EB extends MicroCause<E>>(
2259
2862
  refinement: Refinement<MicroCause<E>, EB>,
2260
2863
  f: (cause: EB) => Micro<B, E2, R2>
2261
2864
  ): <A, R>(self: Micro<A, E, R>) => Micro<A | B, Exclude<E, MicroCause.Error<EB>> | E2, R | R2>
2865
+ /**
2866
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
2867
+ * using the provided predicate to determine if the failure should be caught.
2868
+ *
2869
+ * @since 3.4.6
2870
+ * @experimental
2871
+ * @category error handling
2872
+ */
2262
2873
  <E, B, E2, R2>(
2263
2874
  predicate: Predicate<MicroCause<NoInfer<E>>>,
2264
2875
  f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
2265
2876
  ): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E | E2, R | R2>
2877
+ /**
2878
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
2879
+ * using the provided predicate to determine if the failure should be caught.
2880
+ *
2881
+ * @since 3.4.6
2882
+ * @experimental
2883
+ * @category error handling
2884
+ */
2266
2885
  <A, E, R, B, E2, R2, EB extends MicroCause<E>>(
2267
2886
  self: Micro<A, E, R>,
2268
2887
  refinement: Refinement<MicroCause<E>, EB>,
2269
2888
  f: (cause: EB) => Micro<B, E2, R2>
2270
2889
  ): Micro<A | B, Exclude<E, MicroCause.Error<EB>> | E2, R | R2>
2890
+ /**
2891
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
2892
+ * using the provided predicate to determine if the failure should be caught.
2893
+ *
2894
+ * @since 3.4.6
2895
+ * @experimental
2896
+ * @category error handling
2897
+ */
2271
2898
  <A, E, R, B, E2, R2>(
2272
2899
  self: Micro<A, E, R>,
2273
2900
  predicate: Predicate<MicroCause<NoInfer<E>>>,
@@ -2298,9 +2925,25 @@ export const catchCauseIf: {
2298
2925
  * @category error handling
2299
2926
  */
2300
2927
  export const catchAll: {
2301
- <E, B, E2, R2>(
2302
- f: (e: NoInfer<E>) => Micro<B, E2, R2>
2303
- ): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E2, R | R2>
2928
+ /**
2929
+ * Catch the error of the given `Micro` effect, allowing you to recover from it.
2930
+ *
2931
+ * It only catches expected (`MicroCause.Fail`) errors.
2932
+ *
2933
+ * @since 3.4.6
2934
+ * @experimental
2935
+ * @category error handling
2936
+ */
2937
+ <E, B, E2, R2>(f: (e: NoInfer<E>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E2, R | R2>
2938
+ /**
2939
+ * Catch the error of the given `Micro` effect, allowing you to recover from it.
2940
+ *
2941
+ * It only catches expected (`MicroCause.Fail`) errors.
2942
+ *
2943
+ * @since 3.4.6
2944
+ * @experimental
2945
+ * @category error handling
2946
+ */
2304
2947
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (e: NoInfer<E>) => Micro<B, E2, R2>): Micro<A | B, E2, R | R2>
2305
2948
  } = dual(
2306
2949
  2,
@@ -2318,9 +2961,21 @@ export const catchAll: {
2318
2961
  * @category error handling
2319
2962
  */
2320
2963
  export const catchAllDefect: {
2321
- <E, B, E2, R2>(
2322
- f: (defect: unknown) => Micro<B, E2, R2>
2323
- ): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E | E2, R | R2>
2964
+ /**
2965
+ * Catch any unexpected errors of the given `Micro` effect, allowing you to recover from them.
2966
+ *
2967
+ * @since 3.4.6
2968
+ * @experimental
2969
+ * @category error handling
2970
+ */
2971
+ <E, B, E2, R2>(f: (defect: unknown) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E | E2, R | R2>
2972
+ /**
2973
+ * Catch any unexpected errors of the given `Micro` effect, allowing you to recover from them.
2974
+ *
2975
+ * @since 3.4.6
2976
+ * @experimental
2977
+ * @category error handling
2978
+ */
2324
2979
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (defect: unknown) => Micro<B, E2, R2>): Micro<A | B, E | E2, R | R2>
2325
2980
  } = dual(
2326
2981
  2,
@@ -2336,9 +2991,23 @@ export const catchAllDefect: {
2336
2991
  * @category error handling
2337
2992
  */
2338
2993
  export const tapErrorCause: {
2994
+ /**
2995
+ * Perform a side effect using the full `MicroCause` object of the given `Micro`.
2996
+ *
2997
+ * @since 3.4.6
2998
+ * @experimental
2999
+ * @category error handling
3000
+ */
2339
3001
  <E, B, E2, R2>(
2340
3002
  f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
2341
3003
  ): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3004
+ /**
3005
+ * Perform a side effect using the full `MicroCause` object of the given `Micro`.
3006
+ *
3007
+ * @since 3.4.6
3008
+ * @experimental
3009
+ * @category error handling
3010
+ */
2342
3011
  <A, E, R, B, E2, R2>(
2343
3012
  self: Micro<A, E, R>,
2344
3013
  f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
@@ -2360,19 +3029,51 @@ export const tapErrorCause: {
2360
3029
  * @category error handling
2361
3030
  */
2362
3031
  export const tapErrorCauseIf: {
3032
+ /**
3033
+ * Perform a side effect using if a `MicroCause` object matches the specified
3034
+ * predicate.
3035
+ *
3036
+ * @since 3.4.0
3037
+ * @experimental
3038
+ * @category error handling
3039
+ */
2363
3040
  <E, B, E2, R2, EB extends MicroCause<E>>(
2364
3041
  refinement: Refinement<MicroCause<E>, EB>,
2365
3042
  f: (a: EB) => Micro<B, E2, R2>
2366
3043
  ): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3044
+ /**
3045
+ * Perform a side effect using if a `MicroCause` object matches the specified
3046
+ * predicate.
3047
+ *
3048
+ * @since 3.4.0
3049
+ * @experimental
3050
+ * @category error handling
3051
+ */
2367
3052
  <E, B, E2, R2>(
2368
3053
  predicate: (cause: NoInfer<MicroCause<E>>) => boolean,
2369
3054
  f: (a: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>
2370
3055
  ): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3056
+ /**
3057
+ * Perform a side effect using if a `MicroCause` object matches the specified
3058
+ * predicate.
3059
+ *
3060
+ * @since 3.4.0
3061
+ * @experimental
3062
+ * @category error handling
3063
+ */
2371
3064
  <A, E, R, B, E2, R2, EB extends MicroCause<E>>(
2372
3065
  self: Micro<A, E, R>,
2373
3066
  refinement: Refinement<MicroCause<E>, EB>,
2374
3067
  f: (a: EB) => Micro<B, E2, R2>
2375
3068
  ): Micro<A, E | E2, R | R2>
3069
+ /**
3070
+ * Perform a side effect using if a `MicroCause` object matches the specified
3071
+ * predicate.
3072
+ *
3073
+ * @since 3.4.0
3074
+ * @experimental
3075
+ * @category error handling
3076
+ */
2376
3077
  <A, E, R, B, E2, R2>(
2377
3078
  self: Micro<A, E, R>,
2378
3079
  predicate: (cause: NoInfer<MicroCause<E>>) => boolean,
@@ -2395,9 +3096,21 @@ export const tapErrorCauseIf: {
2395
3096
  * @category error handling
2396
3097
  */
2397
3098
  export const tapError: {
2398
- <E, B, E2, R2>(
2399
- f: (e: NoInfer<E>) => Micro<B, E2, R2>
2400
- ): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3099
+ /**
3100
+ * Perform a side effect from expected errors of the given `Micro`.
3101
+ *
3102
+ * @since 3.4.6
3103
+ * @experimental
3104
+ * @category error handling
3105
+ */
3106
+ <E, B, E2, R2>(f: (e: NoInfer<E>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3107
+ /**
3108
+ * Perform a side effect from expected errors of the given `Micro`.
3109
+ *
3110
+ * @since 3.4.6
3111
+ * @experimental
3112
+ * @category error handling
3113
+ */
2401
3114
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (e: NoInfer<E>) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>
2402
3115
  } = dual(
2403
3116
  2,
@@ -2413,9 +3126,21 @@ export const tapError: {
2413
3126
  * @category error handling
2414
3127
  */
2415
3128
  export const tapDefect: {
2416
- <E, B, E2, R2>(
2417
- f: (defect: unknown) => Micro<B, E2, R2>
2418
- ): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3129
+ /**
3130
+ * Perform a side effect from unexpected errors of the given `Micro`.
3131
+ *
3132
+ * @since 3.4.6
3133
+ * @experimental
3134
+ * @category error handling
3135
+ */
3136
+ <E, B, E2, R2>(f: (defect: unknown) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>
3137
+ /**
3138
+ * Perform a side effect from unexpected errors of the given `Micro`.
3139
+ *
3140
+ * @since 3.4.6
3141
+ * @experimental
3142
+ * @category error handling
3143
+ */
2419
3144
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (defect: unknown) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>
2420
3145
  } = dual(
2421
3146
  2,
@@ -2431,19 +3156,47 @@ export const tapDefect: {
2431
3156
  * @category error handling
2432
3157
  */
2433
3158
  export const catchIf: {
3159
+ /**
3160
+ * Catch any expected errors that match the specified predicate.
3161
+ *
3162
+ * @since 3.4.0
3163
+ * @experimental
3164
+ * @category error handling
3165
+ */
2434
3166
  <E, EB extends E, A2, E2, R2>(
2435
3167
  refinement: Refinement<NoInfer<E>, EB>,
2436
3168
  f: (e: EB) => Micro<A2, E2, R2>
2437
3169
  ): <A, R>(self: Micro<A, E, R>) => Micro<A2 | A, E2 | Exclude<E, EB>, R2 | R>
3170
+ /**
3171
+ * Catch any expected errors that match the specified predicate.
3172
+ *
3173
+ * @since 3.4.0
3174
+ * @experimental
3175
+ * @category error handling
3176
+ */
2438
3177
  <E, A2, E2, R2>(
2439
3178
  predicate: Predicate<NoInfer<E>>,
2440
3179
  f: (e: NoInfer<E>) => Micro<A2, E2, R2>
2441
3180
  ): <A, R>(self: Micro<A, E, R>) => Micro<A2 | A, E | E2, R2 | R>
3181
+ /**
3182
+ * Catch any expected errors that match the specified predicate.
3183
+ *
3184
+ * @since 3.4.0
3185
+ * @experimental
3186
+ * @category error handling
3187
+ */
2442
3188
  <A, E, R, EB extends E, A2, E2, R2>(
2443
3189
  self: Micro<A, E, R>,
2444
3190
  refinement: Refinement<E, EB>,
2445
3191
  f: (e: EB) => Micro<A2, E2, R2>
2446
3192
  ): Micro<A | A2, E2 | Exclude<E, EB>, R | R2>
3193
+ /**
3194
+ * Catch any expected errors that match the specified predicate.
3195
+ *
3196
+ * @since 3.4.0
3197
+ * @experimental
3198
+ * @category error handling
3199
+ */
2447
3200
  <A, E, R, A2, E2, R2>(
2448
3201
  self: Micro<A, E, R>,
2449
3202
  predicate: Predicate<E>,
@@ -2471,10 +3224,24 @@ export const catchIf: {
2471
3224
  * @category error handling
2472
3225
  */
2473
3226
  export const catchTag: {
3227
+ /**
3228
+ * Recovers from the specified tagged error.
3229
+ *
3230
+ * @since 3.4.0
3231
+ * @experimental
3232
+ * @category error handling
3233
+ */
2474
3234
  <K extends E extends { _tag: string } ? E["_tag"] : never, E, A1, E1, R1>(
2475
3235
  k: K,
2476
3236
  f: (e: Extract<E, { _tag: K }>) => Micro<A1, E1, R1>
2477
3237
  ): <A, R>(self: Micro<A, E, R>) => Micro<A1 | A, E1 | Exclude<E, { _tag: K }>, R1 | R>
3238
+ /**
3239
+ * Recovers from the specified tagged error.
3240
+ *
3241
+ * @since 3.4.0
3242
+ * @experimental
3243
+ * @category error handling
3244
+ */
2478
3245
  <A, E, R, K extends E extends { _tag: string } ? E["_tag"] : never, R1, E1, A1>(
2479
3246
  self: Micro<A, E, R>,
2480
3247
  k: K,
@@ -2495,7 +3262,21 @@ export const catchTag: {
2495
3262
  * @category error handling
2496
3263
  */
2497
3264
  export const mapErrorCause: {
3265
+ /**
3266
+ * Transform the full `MicroCause` object of the given `Micro` effect.
3267
+ *
3268
+ * @since 3.4.6
3269
+ * @experimental
3270
+ * @category error handling
3271
+ */
2498
3272
  <E, E2>(f: (e: MicroCause<E>) => MicroCause<E2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E2, R>
3273
+ /**
3274
+ * Transform the full `MicroCause` object of the given `Micro` effect.
3275
+ *
3276
+ * @since 3.4.6
3277
+ * @experimental
3278
+ * @category error handling
3279
+ */
2499
3280
  <A, E, R, E2>(self: Micro<A, E, R>, f: (e: MicroCause<E>) => MicroCause<E2>): Micro<A, E2, R>
2500
3281
  } = dual(
2501
3282
  2,
@@ -2511,7 +3292,21 @@ export const mapErrorCause: {
2511
3292
  * @category error handling
2512
3293
  */
2513
3294
  export const mapError: {
3295
+ /**
3296
+ * Transform any expected errors of the given `Micro` effect.
3297
+ *
3298
+ * @since 3.4.0
3299
+ * @experimental
3300
+ * @category error handling
3301
+ */
2514
3302
  <E, E2>(f: (e: E) => E2): <A, R>(self: Micro<A, E, R>) => Micro<A, E2, R>
3303
+ /**
3304
+ * Transform any expected errors of the given `Micro` effect.
3305
+ *
3306
+ * @since 3.4.0
3307
+ * @experimental
3308
+ * @category error handling
3309
+ */
2515
3310
  <A, E, R, E2>(self: Micro<A, E, R>, f: (e: E) => E2): Micro<A, E2, R>
2516
3311
  } = dual(
2517
3312
  2,
@@ -2536,7 +3331,21 @@ export const orDie = <A, E, R>(self: Micro<A, E, R>): Micro<A, never, R> => catc
2536
3331
  * @category error handling
2537
3332
  */
2538
3333
  export const orElseSucceed: {
3334
+ /**
3335
+ * Recover from all errors by succeeding with the given value.
3336
+ *
3337
+ * @since 3.4.0
3338
+ * @experimental
3339
+ * @category error handling
3340
+ */
2539
3341
  <B>(f: LazyArg<B>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | B, never, R>
3342
+ /**
3343
+ * Recover from all errors by succeeding with the given value.
3344
+ *
3345
+ * @since 3.4.0
3346
+ * @experimental
3347
+ * @category error handling
3348
+ */
2540
3349
  <A, E, R, B>(self: Micro<A, E, R>, f: LazyArg<B>): Micro<A | B, never, R>
2541
3350
  } = dual(
2542
3351
  2,
@@ -2599,6 +3408,13 @@ export const either = <A, E, R>(self: Micro<A, E, R>): Micro<Either.Either<A, E>
2599
3408
  * @category error handling
2600
3409
  */
2601
3410
  export const retry: {
3411
+ /**
3412
+ * Retry the given `Micro` effect using the provided options.
3413
+ *
3414
+ * @since 3.4.0
3415
+ * @experimental
3416
+ * @category error handling
3417
+ */
2602
3418
  <A, E>(
2603
3419
  options?: {
2604
3420
  while?: Predicate<E> | undefined
@@ -2606,6 +3422,13 @@ export const retry: {
2606
3422
  schedule?: MicroSchedule | undefined
2607
3423
  } | undefined
2608
3424
  ): <R>(self: Micro<A, E, R>) => Micro<A, E, R>
3425
+ /**
3426
+ * Retry the given `Micro` effect using the provided options.
3427
+ *
3428
+ * @since 3.4.0
3429
+ * @experimental
3430
+ * @category error handling
3431
+ */
2609
3432
  <A, E, R>(
2610
3433
  self: Micro<A, E, R>,
2611
3434
  options?: {
@@ -2638,7 +3461,23 @@ export const retry: {
2638
3461
  * @category error handling
2639
3462
  */
2640
3463
  export const withTrace: {
3464
+ /**
3465
+ * Add a stack trace to any failures that occur in the effect. The trace will be
3466
+ * added to the `traces` field of the `MicroCause` object.
3467
+ *
3468
+ * @since 3.4.0
3469
+ * @experimental
3470
+ * @category error handling
3471
+ */
2641
3472
  (name: string): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>
3473
+ /**
3474
+ * Add a stack trace to any failures that occur in the effect. The trace will be
3475
+ * added to the `traces` field of the `MicroCause` object.
3476
+ *
3477
+ * @since 3.4.0
3478
+ * @experimental
3479
+ * @category error handling
3480
+ */
2642
3481
  <A, E, R>(self: Micro<A, E, R>, name: string): Micro<A, E, R>
2643
3482
  } = function() {
2644
3483
  const prevLimit = globalThis.Error.stackTraceLimit
@@ -2679,12 +3518,30 @@ export const withTrace: {
2679
3518
  * @category pattern matching
2680
3519
  */
2681
3520
  export const matchCauseEffect: {
3521
+ // ----------------------------------------------------------------------------
3522
+ // pattern matching
3523
+ // ----------------------------------------------------------------------------
3524
+
3525
+ /**
3526
+ * @since 3.4.6
3527
+ * @experimental
3528
+ * @category pattern matching
3529
+ */
2682
3530
  <E, A2, E2, R2, A, A3, E3, R3>(
2683
3531
  options: {
2684
3532
  readonly onFailure: (cause: MicroCause<E>) => Micro<A2, E2, R2>
2685
3533
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>
2686
3534
  }
2687
3535
  ): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, E2 | E3, R2 | R3 | R>
3536
+ // ----------------------------------------------------------------------------
3537
+ // pattern matching
3538
+ // ----------------------------------------------------------------------------
3539
+
3540
+ /**
3541
+ * @since 3.4.6
3542
+ * @experimental
3543
+ * @category pattern matching
3544
+ */
2688
3545
  <A, E, R, A2, E2, R2, A3, E3, R3>(
2689
3546
  self: Micro<A, E, R>,
2690
3547
  options: {
@@ -2719,12 +3576,22 @@ export const matchCauseEffect: {
2719
3576
  * @category pattern matching
2720
3577
  */
2721
3578
  export const matchCause: {
3579
+ /**
3580
+ * @since 3.4.6
3581
+ * @experimental
3582
+ * @category pattern matching
3583
+ */
2722
3584
  <E, A2, A, A3>(
2723
3585
  options: {
2724
3586
  readonly onFailure: (cause: MicroCause<E>) => A2
2725
3587
  readonly onSuccess: (a: A) => A3
2726
3588
  }
2727
3589
  ): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, never, R>
3590
+ /**
3591
+ * @since 3.4.6
3592
+ * @experimental
3593
+ * @category pattern matching
3594
+ */
2728
3595
  <A, E, R, A2, A3>(
2729
3596
  self: Micro<A, E, R>,
2730
3597
  options: {
@@ -2753,12 +3620,22 @@ export const matchCause: {
2753
3620
  * @category pattern matching
2754
3621
  */
2755
3622
  export const matchEffect: {
3623
+ /**
3624
+ * @since 3.4.6
3625
+ * @experimental
3626
+ * @category pattern matching
3627
+ */
2756
3628
  <E, A2, E2, R2, A, A3, E3, R3>(
2757
3629
  options: {
2758
3630
  readonly onFailure: (e: E) => Micro<A2, E2, R2>
2759
3631
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>
2760
3632
  }
2761
3633
  ): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, E2 | E3, R2 | R3 | R>
3634
+ /**
3635
+ * @since 3.4.6
3636
+ * @experimental
3637
+ * @category pattern matching
3638
+ */
2762
3639
  <A, E, R, A2, E2, R2, A3, E3, R3>(
2763
3640
  self: Micro<A, E, R>,
2764
3641
  options: {
@@ -2787,12 +3664,22 @@ export const matchEffect: {
2787
3664
  * @category pattern matching
2788
3665
  */
2789
3666
  export const match: {
3667
+ /**
3668
+ * @since 3.4.0
3669
+ * @experimental
3670
+ * @category pattern matching
3671
+ */
2790
3672
  <E, A2, A, A3>(
2791
3673
  options: {
2792
3674
  readonly onFailure: (error: E) => A2
2793
3675
  readonly onSuccess: (value: A) => A3
2794
3676
  }
2795
3677
  ): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, never, R>
3678
+ /**
3679
+ * @since 3.4.0
3680
+ * @experimental
3681
+ * @category pattern matching
3682
+ */
2796
3683
  <A, E, R, A2, A3>(
2797
3684
  self: Micro<A, E, R>,
2798
3685
  options: {
@@ -2845,7 +3732,23 @@ export const sleep = (millis: number): Micro<void> =>
2845
3732
  * @category delays & timeouts
2846
3733
  */
2847
3734
  export const delay: {
3735
+ /**
3736
+ * Returns an effect that will delay the execution of this effect by the
3737
+ * specified duration.
3738
+ *
3739
+ * @since 3.4.0
3740
+ * @experimental
3741
+ * @category delays & timeouts
3742
+ */
2848
3743
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>
3744
+ /**
3745
+ * Returns an effect that will delay the execution of this effect by the
3746
+ * specified duration.
3747
+ *
3748
+ * @since 3.4.0
3749
+ * @experimental
3750
+ * @category delays & timeouts
3751
+ */
2849
3752
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<A, E, R>
2850
3753
  } = dual(
2851
3754
  2,
@@ -2863,14 +3766,39 @@ export const delay: {
2863
3766
  * @category delays & timeouts
2864
3767
  */
2865
3768
  export const timeoutOrElse: {
2866
- <A2, E2, R2>(options: {
2867
- readonly duration: number
2868
- readonly onTimeout: LazyArg<Micro<A2, E2, R2>>
2869
- }): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>
2870
- <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, options: {
2871
- readonly duration: number
2872
- readonly onTimeout: LazyArg<Micro<A2, E2, R2>>
2873
- }): Micro<A | A2, E | E2, R | R2>
3769
+ /**
3770
+ * Returns an effect that will timeout this effect, that will execute the
3771
+ * fallback effect if the timeout elapses before the effect has produced a value.
3772
+ *
3773
+ * If the timeout elapses, the running effect will be safely interrupted.
3774
+ *
3775
+ * @since 3.4.0
3776
+ * @experimental
3777
+ * @category delays & timeouts
3778
+ */
3779
+ <A2, E2, R2>(
3780
+ options: {
3781
+ readonly duration: number
3782
+ readonly onTimeout: LazyArg<Micro<A2, E2, R2>>
3783
+ }
3784
+ ): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>
3785
+ /**
3786
+ * Returns an effect that will timeout this effect, that will execute the
3787
+ * fallback effect if the timeout elapses before the effect has produced a value.
3788
+ *
3789
+ * If the timeout elapses, the running effect will be safely interrupted.
3790
+ *
3791
+ * @since 3.4.0
3792
+ * @experimental
3793
+ * @category delays & timeouts
3794
+ */
3795
+ <A, E, R, A2, E2, R2>(
3796
+ self: Micro<A, E, R>,
3797
+ options: {
3798
+ readonly duration: number
3799
+ readonly onTimeout: LazyArg<Micro<A2, E2, R2>>
3800
+ }
3801
+ ): Micro<A | A2, E | E2, R | R2>
2874
3802
  } = dual(
2875
3803
  2,
2876
3804
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, options: {
@@ -2892,7 +3820,29 @@ export const timeoutOrElse: {
2892
3820
  * @category delays & timeouts
2893
3821
  */
2894
3822
  export const timeout: {
3823
+ /**
3824
+ * Returns an effect that will timeout this effect, that will fail with a
3825
+ * `TimeoutException` if the timeout elapses before the effect has produced a
3826
+ * value.
3827
+ *
3828
+ * If the timeout elapses, the running effect will be safely interrupted.
3829
+ *
3830
+ * @since 3.4.0
3831
+ * @experimental
3832
+ * @category delays & timeouts
3833
+ */
2895
3834
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | TimeoutException, R>
3835
+ /**
3836
+ * Returns an effect that will timeout this effect, that will fail with a
3837
+ * `TimeoutException` if the timeout elapses before the effect has produced a
3838
+ * value.
3839
+ *
3840
+ * If the timeout elapses, the running effect will be safely interrupted.
3841
+ *
3842
+ * @since 3.4.0
3843
+ * @experimental
3844
+ * @category delays & timeouts
3845
+ */
2896
3846
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<A, E | TimeoutException, R>
2897
3847
  } = dual(
2898
3848
  2,
@@ -2912,7 +3862,29 @@ export const timeout: {
2912
3862
  * @category delays & timeouts
2913
3863
  */
2914
3864
  export const timeoutOption: {
3865
+ /**
3866
+ * Returns an effect that will timeout this effect, succeeding with a `None`
3867
+ * if the timeout elapses before the effect has produced a value; and `Some` of
3868
+ * the produced value otherwise.
3869
+ *
3870
+ * If the timeout elapses, the running effect will be safely interrupted.
3871
+ *
3872
+ * @since 3.4.0
3873
+ * @experimental
3874
+ * @category delays & timeouts
3875
+ */
2915
3876
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<Option.Option<A>, E, R>
3877
+ /**
3878
+ * Returns an effect that will timeout this effect, succeeding with a `None`
3879
+ * if the timeout elapses before the effect has produced a value; and `Some` of
3880
+ * the produced value otherwise.
3881
+ *
3882
+ * If the timeout elapses, the running effect will be safely interrupted.
3883
+ *
3884
+ * @since 3.4.0
3885
+ * @experimental
3886
+ * @category delays & timeouts
3887
+ */
2916
3888
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<Option.Option<A>, E, R>
2917
3889
  } = dual(
2918
3890
  2,
@@ -3069,7 +4041,21 @@ export const scope: Micro<MicroScope, never, MicroScope> = service(MicroScope)
3069
4041
  * @category resources & finalization
3070
4042
  */
3071
4043
  export const provideScope: {
4044
+ /**
4045
+ * Provide a `MicroScope` to an effect.
4046
+ *
4047
+ * @since 3.4.0
4048
+ * @experimental
4049
+ * @category resources & finalization
4050
+ */
3072
4051
  (scope: MicroScope): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, MicroScope>>
4052
+ /**
4053
+ * Provide a `MicroScope` to an effect.
4054
+ *
4055
+ * @since 3.4.0
4056
+ * @experimental
4057
+ * @category resources & finalization
4058
+ */
3073
4059
  <A, E, R>(self: Micro<A, E, R>, scope: MicroScope): Micro<A, E, Exclude<R, MicroScope>>
3074
4060
  } = dual(
3075
4061
  2,
@@ -3128,9 +4114,25 @@ export const addFinalizer = (
3128
4114
  * @category resources & finalization
3129
4115
  */
3130
4116
  export const onExit: {
4117
+ /**
4118
+ * When the `Micro` effect is completed, run the given finalizer effect with the
4119
+ * `MicroExit` of the executed effect.
4120
+ *
4121
+ * @since 3.4.6
4122
+ * @experimental
4123
+ * @category resources & finalization
4124
+ */
3131
4125
  <A, E, XE, XR>(
3132
4126
  f: (exit: MicroExit<A, E>) => Micro<void, XE, XR>
3133
4127
  ): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4128
+ /**
4129
+ * When the `Micro` effect is completed, run the given finalizer effect with the
4130
+ * `MicroExit` of the executed effect.
4131
+ *
4132
+ * @since 3.4.6
4133
+ * @experimental
4134
+ * @category resources & finalization
4135
+ */
3134
4136
  <A, E, R, XE, XR>(self: Micro<A, E, R>, f: (exit: MicroExit<A, E>) => Micro<void, XE, XR>): Micro<A, E | XE, R | XR>
3135
4137
  } = dual(
3136
4138
  2,
@@ -3149,19 +4151,51 @@ export const onExit: {
3149
4151
  * @category resources & finalization
3150
4152
  */
3151
4153
  export const onExitIf: {
4154
+ /**
4155
+ * When the `Micro` effect is completed, run the given finalizer effect if it
4156
+ * matches the specified predicate.
4157
+ *
4158
+ * @since 3.4.6
4159
+ * @experimental
4160
+ * @category resources & finalization
4161
+ */
3152
4162
  <A, E, XE, XR, B extends MicroExit<A, E>>(
3153
4163
  refinement: Refinement<MicroExit<A, E>, B>,
3154
4164
  f: (exit: B) => Micro<void, XE, XR>
3155
4165
  ): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4166
+ /**
4167
+ * When the `Micro` effect is completed, run the given finalizer effect if it
4168
+ * matches the specified predicate.
4169
+ *
4170
+ * @since 3.4.6
4171
+ * @experimental
4172
+ * @category resources & finalization
4173
+ */
3156
4174
  <A, E, XE, XR>(
3157
4175
  predicate: Predicate<MicroExit<NoInfer<A>, NoInfer<E>>>,
3158
4176
  f: (exit: MicroExit<NoInfer<A>, NoInfer<E>>) => Micro<void, XE, XR>
3159
4177
  ): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4178
+ /**
4179
+ * When the `Micro` effect is completed, run the given finalizer effect if it
4180
+ * matches the specified predicate.
4181
+ *
4182
+ * @since 3.4.6
4183
+ * @experimental
4184
+ * @category resources & finalization
4185
+ */
3160
4186
  <A, E, R, XE, XR, B extends MicroExit<A, E>>(
3161
4187
  self: Micro<A, E, R>,
3162
4188
  refinement: Refinement<MicroExit<A, E>, B>,
3163
4189
  f: (exit: B) => Micro<void, XE, XR>
3164
4190
  ): Micro<A, E | XE, R | XR>
4191
+ /**
4192
+ * When the `Micro` effect is completed, run the given finalizer effect if it
4193
+ * matches the specified predicate.
4194
+ *
4195
+ * @since 3.4.6
4196
+ * @experimental
4197
+ * @category resources & finalization
4198
+ */
3165
4199
  <A, E, R, XE, XR>(
3166
4200
  self: Micro<A, E, R>,
3167
4201
  predicate: Predicate<MicroExit<NoInfer<A>, NoInfer<E>>>,
@@ -3199,9 +4233,21 @@ export const onExitIf: {
3199
4233
  * @category resources & finalization
3200
4234
  */
3201
4235
  export const ensuring: {
3202
- <XE, XR>(
3203
- finalizer: Micro<void, XE, XR>
3204
- ): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4236
+ /**
4237
+ * Regardless of the result of the this `Micro` effect, run the finalizer effect.
4238
+ *
4239
+ * @since 3.4.0
4240
+ * @experimental
4241
+ * @category resources & finalization
4242
+ */
4243
+ <XE, XR>(finalizer: Micro<void, XE, XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4244
+ /**
4245
+ * Regardless of the result of the this `Micro` effect, run the finalizer effect.
4246
+ *
4247
+ * @since 3.4.0
4248
+ * @experimental
4249
+ * @category resources & finalization
4250
+ */
3205
4251
  <A, E, R, XE, XR>(self: Micro<A, E, R>, finalizer: Micro<void, XE, XR>): Micro<A, E | XE, R | XR>
3206
4252
  } = dual(
3207
4253
  2,
@@ -3218,9 +4264,25 @@ export const ensuring: {
3218
4264
  * @category resources & finalization
3219
4265
  */
3220
4266
  export const onError: {
4267
+ /**
4268
+ * When the `Micro` effect fails, run the given finalizer effect with the
4269
+ * `MicroCause` of the executed effect.
4270
+ *
4271
+ * @since 3.4.6
4272
+ * @experimental
4273
+ * @category resources & finalization
4274
+ */
3221
4275
  <A, E, XE, XR>(
3222
4276
  f: (cause: MicroCause<NoInfer<E>>) => Micro<void, XE, XR>
3223
4277
  ): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4278
+ /**
4279
+ * When the `Micro` effect fails, run the given finalizer effect with the
4280
+ * `MicroCause` of the executed effect.
4281
+ *
4282
+ * @since 3.4.6
4283
+ * @experimental
4284
+ * @category resources & finalization
4285
+ */
3224
4286
  <A, E, R, XE, XR>(
3225
4287
  self: Micro<A, E, R>,
3226
4288
  f: (cause: MicroCause<NoInfer<E>>) => Micro<void, XE, XR>
@@ -3241,9 +4303,21 @@ export const onError: {
3241
4303
  * @category resources & finalization
3242
4304
  */
3243
4305
  export const onInterrupt: {
3244
- <XE, XR>(
3245
- finalizer: Micro<void, XE, XR>
3246
- ): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4306
+ /**
4307
+ * If this `Micro` effect is aborted, run the finalizer effect.
4308
+ *
4309
+ * @since 3.4.6
4310
+ * @experimental
4311
+ * @category resources & finalization
4312
+ */
4313
+ <XE, XR>(finalizer: Micro<void, XE, XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>
4314
+ /**
4315
+ * If this `Micro` effect is aborted, run the finalizer effect.
4316
+ *
4317
+ * @since 3.4.6
4318
+ * @experimental
4319
+ * @category resources & finalization
4320
+ */
3247
4321
  <A, E, R, XE, XR>(self: Micro<A, E, R>, finalizer: Micro<void, XE, XR>): Micro<A, E | XE, R | XR>
3248
4322
  } = dual(
3249
4323
  2,
@@ -3499,14 +4573,48 @@ export const all = <
3499
4573
  * @category collecting & elements
3500
4574
  */
3501
4575
  export const forEach: {
3502
- <A, B, E, R>(iterable: Iterable<A>, f: (a: A, index: number) => Micro<B, E, R>, options?: {
3503
- readonly concurrency?: Concurrency | undefined
3504
- readonly discard?: false | undefined
3505
- }): Micro<Array<B>, E, R>
3506
- <A, B, E, R>(iterable: Iterable<A>, f: (a: A, index: number) => Micro<B, E, R>, options: {
3507
- readonly concurrency?: Concurrency | undefined
3508
- readonly discard: true
3509
- }): Micro<void, E, R>
4576
+ /**
4577
+ * For each element of the provided iterable, run the effect and collect the results.
4578
+ *
4579
+ * If the `discard` option is set to `true`, the results will be discarded and
4580
+ * the effect will return `void`.
4581
+ *
4582
+ * The `concurrency` option can be set to control how many effects are run in
4583
+ * parallel. By default, the effects are run sequentially.
4584
+ *
4585
+ * @since 3.4.0
4586
+ * @experimental
4587
+ * @category collecting & elements
4588
+ */
4589
+ <A, B, E, R>(
4590
+ iterable: Iterable<A>,
4591
+ f: (a: A, index: number) => Micro<B, E, R>,
4592
+ options?: {
4593
+ readonly concurrency?: Concurrency | undefined
4594
+ readonly discard?: false | undefined
4595
+ }
4596
+ ): Micro<Array<B>, E, R>
4597
+ /**
4598
+ * For each element of the provided iterable, run the effect and collect the results.
4599
+ *
4600
+ * If the `discard` option is set to `true`, the results will be discarded and
4601
+ * the effect will return `void`.
4602
+ *
4603
+ * The `concurrency` option can be set to control how many effects are run in
4604
+ * parallel. By default, the effects are run sequentially.
4605
+ *
4606
+ * @since 3.4.0
4607
+ * @experimental
4608
+ * @category collecting & elements
4609
+ */
4610
+ <A, B, E, R>(
4611
+ iterable: Iterable<A>,
4612
+ f: (a: A, index: number) => Micro<B, E, R>,
4613
+ options: {
4614
+ readonly concurrency?: Concurrency | undefined
4615
+ readonly discard: true
4616
+ }
4617
+ ): Micro<void, E, R>
3510
4618
  } = <
3511
4619
  A,
3512
4620
  B,
@@ -3648,7 +4756,21 @@ export const Do: Micro<{}> = succeed({})
3648
4756
  * @category do notation
3649
4757
  */
3650
4758
  export const bindTo: {
4759
+ /**
4760
+ * Bind the success value of this `Micro` effect to the provided name.
4761
+ *
4762
+ * @since 3.4.0
4763
+ * @experimental
4764
+ * @category do notation
4765
+ */
3651
4766
  <N extends string>(name: N): <A, E, R>(self: Micro<A, E, R>) => Micro<{ [K in N]: A }, E, R>
4767
+ /**
4768
+ * Bind the success value of this `Micro` effect to the provided name.
4769
+ *
4770
+ * @since 3.4.0
4771
+ * @experimental
4772
+ * @category do notation
4773
+ */
3652
4774
  <A, E, R, N extends string>(self: Micro<A, E, R>, name: N): Micro<{ [K in N]: A }, E, R>
3653
4775
  } = doNotation.bindTo<MicroTypeLambda>(map)
3654
4776
 
@@ -3660,10 +4782,24 @@ export const bindTo: {
3660
4782
  * @category do notation
3661
4783
  */
3662
4784
  export const bind: {
4785
+ /**
4786
+ * Bind the success value of this `Micro` effect to the provided name.
4787
+ *
4788
+ * @since 3.4.0
4789
+ * @experimental
4790
+ * @category do notation
4791
+ */
3663
4792
  <N extends string, A extends Record<string, any>, B, E2, R2>(
3664
4793
  name: N,
3665
4794
  f: (a: A) => Micro<B, E2, R2>
3666
4795
  ): <E, R>(self: Micro<A, E, R>) => Micro<Simplify<Omit<A, N> & { [K in N]: B }>, E | E2, R | R2>
4796
+ /**
4797
+ * Bind the success value of this `Micro` effect to the provided name.
4798
+ *
4799
+ * @since 3.4.0
4800
+ * @experimental
4801
+ * @category do notation
4802
+ */
3667
4803
  <A extends Record<string, any>, E, R, B, E2, R2, N extends string>(
3668
4804
  self: Micro<A, E, R>,
3669
4805
  name: N,
@@ -3905,7 +5041,27 @@ export const forkDaemon = <A, E, R>(self: Micro<A, E, R>): Micro<Handle<A, E>, n
3905
5041
  * @category handle & forking
3906
5042
  */
3907
5043
  export const forkIn: {
5044
+ /**
5045
+ * Run the `Micro` effect in a new `Handle` that can be awaited, joined, or
5046
+ * aborted.
5047
+ *
5048
+ * The lifetime of the handle will be attached to the provided `MicroScope`.
5049
+ *
5050
+ * @since 3.4.0
5051
+ * @experimental
5052
+ * @category handle & forking
5053
+ */
3908
5054
  (scope: MicroScope): <A, E, R>(self: Micro<A, E, R>) => Micro<Handle<A, E>, never, R>
5055
+ /**
5056
+ * Run the `Micro` effect in a new `Handle` that can be awaited, joined, or
5057
+ * aborted.
5058
+ *
5059
+ * The lifetime of the handle will be attached to the provided `MicroScope`.
5060
+ *
5061
+ * @since 3.4.0
5062
+ * @experimental
5063
+ * @category handle & forking
5064
+ */
3909
5065
  <A, E, R>(self: Micro<A, E, R>, scope: MicroScope): Micro<Handle<A, E>, never, R>
3910
5066
  } = dual(
3911
5067
  2,