effect 3.8.3 → 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 (599) 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 +54 -23
  56. package/dist/cjs/Micro.js.map +1 -1
  57. package/dist/cjs/MutableHashMap.js.map +1 -1
  58. package/dist/cjs/MutableHashSet.js.map +1 -1
  59. package/dist/cjs/MutableList.js.map +1 -1
  60. package/dist/cjs/MutableQueue.js.map +1 -1
  61. package/dist/cjs/MutableRef.js.map +1 -1
  62. package/dist/cjs/Number.js.map +1 -1
  63. package/dist/cjs/Option.js.map +1 -1
  64. package/dist/cjs/Order.js.map +1 -1
  65. package/dist/cjs/Ordering.js.map +1 -1
  66. package/dist/cjs/Pipeable.js.map +1 -1
  67. package/dist/cjs/Pool.js.map +1 -1
  68. package/dist/cjs/Predicate.js.map +1 -1
  69. package/dist/cjs/PubSub.js.map +1 -1
  70. package/dist/cjs/Queue.js.map +1 -1
  71. package/dist/cjs/RcMap.js.map +1 -1
  72. package/dist/cjs/Readable.js.map +1 -1
  73. package/dist/cjs/Record.js.map +1 -1
  74. package/dist/cjs/RedBlackTree.js.map +1 -1
  75. package/dist/cjs/Ref.js.map +1 -1
  76. package/dist/cjs/Request.js.map +1 -1
  77. package/dist/cjs/RequestResolver.js.map +1 -1
  78. package/dist/cjs/Runtime.js.map +1 -1
  79. package/dist/cjs/RuntimeFlags.js.map +1 -1
  80. package/dist/cjs/RuntimeFlagsPatch.js.map +1 -1
  81. package/dist/cjs/STM.js.map +1 -1
  82. package/dist/cjs/Schedule.js.map +1 -1
  83. package/dist/cjs/ScheduleInterval.js.map +1 -1
  84. package/dist/cjs/ScheduleIntervals.js.map +1 -1
  85. package/dist/cjs/Scheduler.js.map +1 -1
  86. package/dist/cjs/Scope.js +25 -15
  87. package/dist/cjs/Scope.js.map +1 -1
  88. package/dist/cjs/ScopedRef.js.map +1 -1
  89. package/dist/cjs/Sink.js.map +1 -1
  90. package/dist/cjs/SortedMap.js.map +1 -1
  91. package/dist/cjs/SortedSet.js.map +1 -1
  92. package/dist/cjs/Stream.js +17 -3
  93. package/dist/cjs/Stream.js.map +1 -1
  94. package/dist/cjs/StreamHaltStrategy.js.map +1 -1
  95. package/dist/cjs/String.js.map +1 -1
  96. package/dist/cjs/Struct.js.map +1 -1
  97. package/dist/cjs/Subscribable.js.map +1 -1
  98. package/dist/cjs/SubscriptionRef.js.map +1 -1
  99. package/dist/cjs/SynchronizedRef.js.map +1 -1
  100. package/dist/cjs/TArray.js.map +1 -1
  101. package/dist/cjs/TDeferred.js.map +1 -1
  102. package/dist/cjs/TMap.js.map +1 -1
  103. package/dist/cjs/TPriorityQueue.js.map +1 -1
  104. package/dist/cjs/TPubSub.js.map +1 -1
  105. package/dist/cjs/TQueue.js.map +1 -1
  106. package/dist/cjs/TReentrantLock.js.map +1 -1
  107. package/dist/cjs/TRef.js.map +1 -1
  108. package/dist/cjs/TSemaphore.js.map +1 -1
  109. package/dist/cjs/TSet.js.map +1 -1
  110. package/dist/cjs/Take.js.map +1 -1
  111. package/dist/cjs/TestAnnotationMap.js.map +1 -1
  112. package/dist/cjs/TestClock.js.map +1 -1
  113. package/dist/cjs/TestServices.js.map +1 -1
  114. package/dist/cjs/Trie.js.map +1 -1
  115. package/dist/cjs/Tuple.js.map +1 -1
  116. package/dist/cjs/Unify.js.map +1 -1
  117. package/dist/cjs/UpstreamPullRequest.js.map +1 -1
  118. package/dist/cjs/UpstreamPullStrategy.js.map +1 -1
  119. package/dist/cjs/Utils.js +1 -14
  120. package/dist/cjs/Utils.js.map +1 -1
  121. package/dist/cjs/internal/core.js +4 -3
  122. package/dist/cjs/internal/core.js.map +1 -1
  123. package/dist/cjs/internal/runtime.js +1 -1
  124. package/dist/cjs/internal/runtime.js.map +1 -1
  125. package/dist/cjs/internal/stream.js +12 -3
  126. package/dist/cjs/internal/stream.js.map +1 -1
  127. package/dist/cjs/internal/version.js +1 -1
  128. package/dist/dts/Array.d.ts +2684 -0
  129. package/dist/dts/Array.d.ts.map +1 -1
  130. package/dist/dts/BigDecimal.d.ts +558 -1
  131. package/dist/dts/BigDecimal.d.ts.map +1 -1
  132. package/dist/dts/BigInt.d.ts +490 -0
  133. package/dist/dts/BigInt.d.ts.map +1 -1
  134. package/dist/dts/Boolean.d.ts +228 -0
  135. package/dist/dts/Boolean.d.ts.map +1 -1
  136. package/dist/dts/Cause.d.ts +172 -0
  137. package/dist/dts/Cause.d.ts.map +1 -1
  138. package/dist/dts/Channel.d.ts +750 -0
  139. package/dist/dts/Channel.d.ts.map +1 -1
  140. package/dist/dts/ChildExecutorDecision.d.ts +12 -0
  141. package/dist/dts/ChildExecutorDecision.d.ts.map +1 -1
  142. package/dist/dts/Chunk.d.ts +791 -0
  143. package/dist/dts/Chunk.d.ts.map +1 -1
  144. package/dist/dts/Config.d.ts +174 -0
  145. package/dist/dts/Config.d.ts.map +1 -1
  146. package/dist/dts/ConfigError.d.ts +16 -0
  147. package/dist/dts/ConfigError.d.ts.map +1 -1
  148. package/dist/dts/ConfigProvider.d.ts +84 -0
  149. package/dist/dts/ConfigProvider.d.ts.map +1 -1
  150. package/dist/dts/ConfigProviderPathPatch.d.ts +32 -0
  151. package/dist/dts/ConfigProviderPathPatch.d.ts.map +1 -1
  152. package/dist/dts/Console.d.ts +24 -0
  153. package/dist/dts/Console.d.ts.map +1 -1
  154. package/dist/dts/Context.d.ts +232 -0
  155. package/dist/dts/Context.d.ts.map +1 -1
  156. package/dist/dts/Cron.d.ts +12 -0
  157. package/dist/dts/Cron.d.ts.map +1 -1
  158. package/dist/dts/Data.d.ts +165 -0
  159. package/dist/dts/Data.d.ts.map +1 -1
  160. package/dist/dts/DateTime.d.ts +878 -0
  161. package/dist/dts/DateTime.d.ts.map +1 -1
  162. package/dist/dts/Deferred.d.ts +170 -0
  163. package/dist/dts/Deferred.d.ts.map +1 -1
  164. package/dist/dts/Differ.d.ts +78 -0
  165. package/dist/dts/Differ.d.ts.map +1 -1
  166. package/dist/dts/Duration.d.ts +130 -0
  167. package/dist/dts/Duration.d.ts.map +1 -1
  168. package/dist/dts/Effect.d.ts +4117 -3
  169. package/dist/dts/Effect.d.ts.map +1 -1
  170. package/dist/dts/Either.d.ts +620 -0
  171. package/dist/dts/Either.d.ts.map +1 -1
  172. package/dist/dts/Equivalence.d.ts +24 -0
  173. package/dist/dts/Equivalence.d.ts.map +1 -1
  174. package/dist/dts/ExecutionStrategy.d.ts +14 -0
  175. package/dist/dts/ExecutionStrategy.d.ts.map +1 -1
  176. package/dist/dts/Exit.d.ts +252 -0
  177. package/dist/dts/Exit.d.ts.map +1 -1
  178. package/dist/dts/Fiber.d.ts +182 -0
  179. package/dist/dts/Fiber.d.ts.map +1 -1
  180. package/dist/dts/FiberHandle.d.ts +42 -0
  181. package/dist/dts/FiberHandle.d.ts.map +1 -1
  182. package/dist/dts/FiberId.d.ts +24 -0
  183. package/dist/dts/FiberId.d.ts.map +1 -1
  184. package/dist/dts/FiberMap.d.ts +102 -0
  185. package/dist/dts/FiberMap.d.ts.map +1 -1
  186. package/dist/dts/FiberRef.d.ts +80 -0
  187. package/dist/dts/FiberRef.d.ts.map +1 -1
  188. package/dist/dts/FiberRefs.d.ts +84 -0
  189. package/dist/dts/FiberRefs.d.ts.map +1 -1
  190. package/dist/dts/FiberRefsPatch.d.ts +30 -0
  191. package/dist/dts/FiberRefsPatch.d.ts.map +1 -1
  192. package/dist/dts/FiberSet.d.ts +38 -0
  193. package/dist/dts/FiberSet.d.ts.map +1 -1
  194. package/dist/dts/Function.d.ts +144 -28
  195. package/dist/dts/Function.d.ts.map +1 -1
  196. package/dist/dts/GroupBy.d.ts +38 -0
  197. package/dist/dts/GroupBy.d.ts.map +1 -1
  198. package/dist/dts/Hash.d.ts +8 -0
  199. package/dist/dts/Hash.d.ts.map +1 -1
  200. package/dist/dts/HashMap.d.ts +300 -0
  201. package/dist/dts/HashMap.d.ts.map +1 -1
  202. package/dist/dts/HashSet.d.ts +284 -0
  203. package/dist/dts/HashSet.d.ts.map +1 -1
  204. package/dist/dts/Iterable.d.ts +454 -0
  205. package/dist/dts/Iterable.d.ts.map +1 -1
  206. package/dist/dts/KeyedPool.d.ts +34 -0
  207. package/dist/dts/KeyedPool.d.ts.map +1 -1
  208. package/dist/dts/Layer.d.ts +414 -0
  209. package/dist/dts/Layer.d.ts.map +1 -1
  210. package/dist/dts/List.d.ts +430 -0
  211. package/dist/dts/List.d.ts.map +1 -1
  212. package/dist/dts/LogLevel.d.ts +46 -0
  213. package/dist/dts/LogLevel.d.ts.map +1 -1
  214. package/dist/dts/Logger.d.ts +194 -0
  215. package/dist/dts/Logger.d.ts.map +1 -1
  216. package/dist/dts/Mailbox.d.ts +16 -0
  217. package/dist/dts/Mailbox.d.ts.map +1 -1
  218. package/dist/dts/MergeDecision.d.ts +8 -0
  219. package/dist/dts/MergeDecision.d.ts.map +1 -1
  220. package/dist/dts/MergeState.d.ts +8 -0
  221. package/dist/dts/MergeState.d.ts.map +1 -1
  222. package/dist/dts/MergeStrategy.d.ts +12 -0
  223. package/dist/dts/MergeStrategy.d.ts.map +1 -1
  224. package/dist/dts/Metric.d.ts +410 -0
  225. package/dist/dts/Metric.d.ts.map +1 -1
  226. package/dist/dts/MetricHook.d.ts +24 -0
  227. package/dist/dts/MetricHook.d.ts.map +1 -1
  228. package/dist/dts/MetricKey.d.ts +48 -0
  229. package/dist/dts/MetricKey.d.ts.map +1 -1
  230. package/dist/dts/MetricPolling.d.ts +40 -0
  231. package/dist/dts/MetricPolling.d.ts.map +1 -1
  232. package/dist/dts/MetricState.d.ts +16 -0
  233. package/dist/dts/MetricState.d.ts.map +1 -1
  234. package/dist/dts/Micro.d.ts +1203 -25
  235. package/dist/dts/Micro.d.ts.map +1 -1
  236. package/dist/dts/MutableHashMap.d.ts +50 -0
  237. package/dist/dts/MutableHashMap.d.ts.map +1 -1
  238. package/dist/dts/MutableHashSet.d.ts +24 -0
  239. package/dist/dts/MutableHashSet.d.ts.map +1 -1
  240. package/dist/dts/MutableList.d.ts +36 -0
  241. package/dist/dts/MutableList.d.ts.map +1 -1
  242. package/dist/dts/MutableQueue.d.ts +62 -0
  243. package/dist/dts/MutableQueue.d.ts.map +1 -1
  244. package/dist/dts/MutableRef.d.ts +56 -0
  245. package/dist/dts/MutableRef.d.ts.map +1 -1
  246. package/dist/dts/Number.d.ts +474 -0
  247. package/dist/dts/Number.d.ts.map +1 -1
  248. package/dist/dts/Option.d.ts +1019 -0
  249. package/dist/dts/Option.d.ts.map +1 -1
  250. package/dist/dts/Order.d.ts +24 -0
  251. package/dist/dts/Order.d.ts.map +1 -1
  252. package/dist/dts/Ordering.d.ts +66 -0
  253. package/dist/dts/Ordering.d.ts.map +1 -1
  254. package/dist/dts/Pipeable.d.ts +21 -21
  255. package/dist/dts/Pipeable.d.ts.map +1 -1
  256. package/dist/dts/Pool.d.ts +16 -0
  257. package/dist/dts/Pool.d.ts.map +1 -1
  258. package/dist/dts/Predicate.d.ts +498 -0
  259. package/dist/dts/Predicate.d.ts.map +1 -1
  260. package/dist/dts/PubSub.d.ts +28 -0
  261. package/dist/dts/PubSub.d.ts.map +1 -1
  262. package/dist/dts/Queue.d.ts +104 -0
  263. package/dist/dts/Queue.d.ts.map +1 -1
  264. package/dist/dts/RcMap.d.ts +70 -0
  265. package/dist/dts/RcMap.d.ts.map +1 -1
  266. package/dist/dts/Readable.d.ts +16 -0
  267. package/dist/dts/Readable.d.ts.map +1 -1
  268. package/dist/dts/Record.d.ts +800 -0
  269. package/dist/dts/Record.d.ts.map +1 -1
  270. package/dist/dts/RedBlackTree.d.ts +300 -0
  271. package/dist/dts/RedBlackTree.d.ts.map +1 -1
  272. package/dist/dts/Ref.d.ts +88 -0
  273. package/dist/dts/Ref.d.ts.map +1 -1
  274. package/dist/dts/Request.d.ts +76 -0
  275. package/dist/dts/Request.d.ts.map +1 -1
  276. package/dist/dts/RequestResolver.d.ts +144 -0
  277. package/dist/dts/RequestResolver.d.ts.map +1 -1
  278. package/dist/dts/Runtime.d.ts +126 -0
  279. package/dist/dts/Runtime.d.ts.map +1 -1
  280. package/dist/dts/RuntimeFlags.d.ts +100 -0
  281. package/dist/dts/RuntimeFlags.d.ts.map +1 -1
  282. package/dist/dts/RuntimeFlagsPatch.d.ts +112 -0
  283. package/dist/dts/RuntimeFlagsPatch.d.ts.map +1 -1
  284. package/dist/dts/STM.d.ts +1090 -0
  285. package/dist/dts/STM.d.ts.map +1 -1
  286. package/dist/dts/Schedule.d.ts +704 -0
  287. package/dist/dts/Schedule.d.ts.map +1 -1
  288. package/dist/dts/ScheduleInterval.d.ts +68 -0
  289. package/dist/dts/ScheduleInterval.d.ts.map +1 -1
  290. package/dist/dts/ScheduleIntervals.d.ts +50 -0
  291. package/dist/dts/ScheduleIntervals.d.ts.map +1 -1
  292. package/dist/dts/Scope.d.ts +76 -15
  293. package/dist/dts/Scope.d.ts.map +1 -1
  294. package/dist/dts/ScopedRef.d.ts +22 -0
  295. package/dist/dts/ScopedRef.d.ts.map +1 -1
  296. package/dist/dts/Sink.d.ts +464 -0
  297. package/dist/dts/Sink.d.ts.map +1 -1
  298. package/dist/dts/SortedMap.d.ts +76 -0
  299. package/dist/dts/SortedMap.d.ts.map +1 -1
  300. package/dist/dts/SortedSet.d.ts +142 -0
  301. package/dist/dts/SortedSet.d.ts.map +1 -1
  302. package/dist/dts/Stream.d.ts +4998 -1
  303. package/dist/dts/Stream.d.ts.map +1 -1
  304. package/dist/dts/StreamHaltStrategy.d.ts +12 -0
  305. package/dist/dts/StreamHaltStrategy.d.ts.map +1 -1
  306. package/dist/dts/String.d.ts +200 -0
  307. package/dist/dts/String.d.ts.map +1 -1
  308. package/dist/dts/Struct.d.ts +84 -0
  309. package/dist/dts/Struct.d.ts.map +1 -1
  310. package/dist/dts/Subscribable.d.ts +16 -0
  311. package/dist/dts/Subscribable.d.ts.map +1 -1
  312. package/dist/dts/SubscriptionRef.d.ts +152 -0
  313. package/dist/dts/SubscriptionRef.d.ts.map +1 -1
  314. package/dist/dts/SynchronizedRef.d.ts +152 -0
  315. package/dist/dts/SynchronizedRef.d.ts.map +1 -1
  316. package/dist/dts/TArray.d.ts +426 -0
  317. package/dist/dts/TArray.d.ts.map +1 -1
  318. package/dist/dts/TDeferred.d.ts +24 -0
  319. package/dist/dts/TDeferred.d.ts.map +1 -1
  320. package/dist/dts/TMap.d.ts +366 -0
  321. package/dist/dts/TMap.d.ts.map +1 -1
  322. package/dist/dts/TPriorityQueue.d.ts +60 -0
  323. package/dist/dts/TPriorityQueue.d.ts.map +1 -1
  324. package/dist/dts/TPubSub.d.ts +28 -0
  325. package/dist/dts/TPubSub.d.ts.map +1 -1
  326. package/dist/dts/TQueue.d.ts +108 -0
  327. package/dist/dts/TQueue.d.ts.map +1 -1
  328. package/dist/dts/TReentrantLock.d.ts +36 -0
  329. package/dist/dts/TReentrantLock.d.ts.map +1 -1
  330. package/dist/dts/TRef.d.ts +88 -0
  331. package/dist/dts/TRef.d.ts.map +1 -1
  332. package/dist/dts/TSemaphore.d.ts +40 -0
  333. package/dist/dts/TSemaphore.d.ts.map +1 -1
  334. package/dist/dts/TSet.d.ts +254 -0
  335. package/dist/dts/TSet.d.ts.map +1 -1
  336. package/dist/dts/Take.d.ts +56 -0
  337. package/dist/dts/Take.d.ts.map +1 -1
  338. package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
  339. package/dist/dts/TestClock.d.ts.map +1 -1
  340. package/dist/dts/TestServices.d.ts.map +1 -1
  341. package/dist/dts/Trie.d.ts +906 -0
  342. package/dist/dts/Trie.d.ts.map +1 -1
  343. package/dist/dts/Tuple.d.ts +144 -0
  344. package/dist/dts/Tuple.d.ts.map +1 -1
  345. package/dist/dts/Unify.d.ts +18 -0
  346. package/dist/dts/Unify.d.ts.map +1 -1
  347. package/dist/dts/UpstreamPullRequest.d.ts +12 -0
  348. package/dist/dts/UpstreamPullRequest.d.ts.map +1 -1
  349. package/dist/dts/UpstreamPullStrategy.d.ts +12 -0
  350. package/dist/dts/UpstreamPullStrategy.d.ts.map +1 -1
  351. package/dist/dts/Utils.d.ts.map +1 -1
  352. package/dist/dts/internal/stream.d.ts.map +1 -1
  353. package/dist/esm/Array.js.map +1 -1
  354. package/dist/esm/BigDecimal.js +2 -2
  355. package/dist/esm/BigDecimal.js.map +1 -1
  356. package/dist/esm/BigInt.js.map +1 -1
  357. package/dist/esm/Boolean.js.map +1 -1
  358. package/dist/esm/Cause.js.map +1 -1
  359. package/dist/esm/Channel.js.map +1 -1
  360. package/dist/esm/ChildExecutorDecision.js.map +1 -1
  361. package/dist/esm/Chunk.js.map +1 -1
  362. package/dist/esm/Config.js.map +1 -1
  363. package/dist/esm/ConfigError.js.map +1 -1
  364. package/dist/esm/ConfigProvider.js.map +1 -1
  365. package/dist/esm/ConfigProviderPathPatch.js.map +1 -1
  366. package/dist/esm/Console.js.map +1 -1
  367. package/dist/esm/Context.js.map +1 -1
  368. package/dist/esm/Cron.js.map +1 -1
  369. package/dist/esm/Data.js.map +1 -1
  370. package/dist/esm/DateTime.js.map +1 -1
  371. package/dist/esm/Deferred.js.map +1 -1
  372. package/dist/esm/Differ.js.map +1 -1
  373. package/dist/esm/Duration.js.map +1 -1
  374. package/dist/esm/Effect.js.map +1 -1
  375. package/dist/esm/Either.js.map +1 -1
  376. package/dist/esm/Equivalence.js.map +1 -1
  377. package/dist/esm/ExecutionStrategy.js.map +1 -1
  378. package/dist/esm/Exit.js.map +1 -1
  379. package/dist/esm/Fiber.js.map +1 -1
  380. package/dist/esm/FiberHandle.js.map +1 -1
  381. package/dist/esm/FiberId.js.map +1 -1
  382. package/dist/esm/FiberMap.js.map +1 -1
  383. package/dist/esm/FiberRef.js.map +1 -1
  384. package/dist/esm/FiberRefs.js.map +1 -1
  385. package/dist/esm/FiberRefsPatch.js.map +1 -1
  386. package/dist/esm/FiberSet.js.map +1 -1
  387. package/dist/esm/Function.js.map +1 -1
  388. package/dist/esm/GroupBy.js.map +1 -1
  389. package/dist/esm/Hash.js.map +1 -1
  390. package/dist/esm/HashMap.js.map +1 -1
  391. package/dist/esm/HashSet.js.map +1 -1
  392. package/dist/esm/Iterable.js.map +1 -1
  393. package/dist/esm/KeyedPool.js.map +1 -1
  394. package/dist/esm/Layer.js.map +1 -1
  395. package/dist/esm/List.js.map +1 -1
  396. package/dist/esm/LogLevel.js.map +1 -1
  397. package/dist/esm/Logger.js.map +1 -1
  398. package/dist/esm/Mailbox.js.map +1 -1
  399. package/dist/esm/MergeDecision.js.map +1 -1
  400. package/dist/esm/MergeState.js.map +1 -1
  401. package/dist/esm/MergeStrategy.js.map +1 -1
  402. package/dist/esm/Metric.js.map +1 -1
  403. package/dist/esm/MetricHook.js.map +1 -1
  404. package/dist/esm/MetricKey.js.map +1 -1
  405. package/dist/esm/MetricPolling.js.map +1 -1
  406. package/dist/esm/MetricState.js.map +1 -1
  407. package/dist/esm/Micro.js +50 -20
  408. package/dist/esm/Micro.js.map +1 -1
  409. package/dist/esm/MutableHashMap.js.map +1 -1
  410. package/dist/esm/MutableHashSet.js.map +1 -1
  411. package/dist/esm/MutableList.js.map +1 -1
  412. package/dist/esm/MutableQueue.js.map +1 -1
  413. package/dist/esm/MutableRef.js.map +1 -1
  414. package/dist/esm/Number.js.map +1 -1
  415. package/dist/esm/Option.js.map +1 -1
  416. package/dist/esm/Order.js.map +1 -1
  417. package/dist/esm/Ordering.js.map +1 -1
  418. package/dist/esm/Pipeable.js.map +1 -1
  419. package/dist/esm/Pool.js.map +1 -1
  420. package/dist/esm/Predicate.js.map +1 -1
  421. package/dist/esm/PubSub.js.map +1 -1
  422. package/dist/esm/Queue.js.map +1 -1
  423. package/dist/esm/RcMap.js.map +1 -1
  424. package/dist/esm/Readable.js.map +1 -1
  425. package/dist/esm/Record.js.map +1 -1
  426. package/dist/esm/RedBlackTree.js.map +1 -1
  427. package/dist/esm/Ref.js.map +1 -1
  428. package/dist/esm/Request.js.map +1 -1
  429. package/dist/esm/RequestResolver.js.map +1 -1
  430. package/dist/esm/Runtime.js.map +1 -1
  431. package/dist/esm/RuntimeFlags.js.map +1 -1
  432. package/dist/esm/RuntimeFlagsPatch.js.map +1 -1
  433. package/dist/esm/STM.js.map +1 -1
  434. package/dist/esm/Schedule.js.map +1 -1
  435. package/dist/esm/ScheduleInterval.js.map +1 -1
  436. package/dist/esm/ScheduleIntervals.js.map +1 -1
  437. package/dist/esm/Scheduler.js.map +1 -1
  438. package/dist/esm/Scope.js +25 -15
  439. package/dist/esm/Scope.js.map +1 -1
  440. package/dist/esm/ScopedRef.js.map +1 -1
  441. package/dist/esm/Sink.js.map +1 -1
  442. package/dist/esm/SortedMap.js.map +1 -1
  443. package/dist/esm/SortedSet.js.map +1 -1
  444. package/dist/esm/Stream.js +14 -0
  445. package/dist/esm/Stream.js.map +1 -1
  446. package/dist/esm/StreamHaltStrategy.js.map +1 -1
  447. package/dist/esm/String.js.map +1 -1
  448. package/dist/esm/Struct.js.map +1 -1
  449. package/dist/esm/Subscribable.js.map +1 -1
  450. package/dist/esm/SubscriptionRef.js.map +1 -1
  451. package/dist/esm/SynchronizedRef.js.map +1 -1
  452. package/dist/esm/TArray.js.map +1 -1
  453. package/dist/esm/TDeferred.js.map +1 -1
  454. package/dist/esm/TMap.js.map +1 -1
  455. package/dist/esm/TPriorityQueue.js.map +1 -1
  456. package/dist/esm/TPubSub.js.map +1 -1
  457. package/dist/esm/TQueue.js.map +1 -1
  458. package/dist/esm/TReentrantLock.js.map +1 -1
  459. package/dist/esm/TRef.js.map +1 -1
  460. package/dist/esm/TSemaphore.js.map +1 -1
  461. package/dist/esm/TSet.js.map +1 -1
  462. package/dist/esm/Take.js.map +1 -1
  463. package/dist/esm/TestAnnotationMap.js.map +1 -1
  464. package/dist/esm/TestClock.js.map +1 -1
  465. package/dist/esm/TestServices.js.map +1 -1
  466. package/dist/esm/Trie.js.map +1 -1
  467. package/dist/esm/Tuple.js.map +1 -1
  468. package/dist/esm/Unify.js.map +1 -1
  469. package/dist/esm/UpstreamPullRequest.js.map +1 -1
  470. package/dist/esm/UpstreamPullStrategy.js.map +1 -1
  471. package/dist/esm/Utils.js +1 -14
  472. package/dist/esm/Utils.js.map +1 -1
  473. package/dist/esm/internal/core.js +1 -1
  474. package/dist/esm/internal/core.js.map +1 -1
  475. package/dist/esm/internal/runtime.js +1 -1
  476. package/dist/esm/internal/runtime.js.map +1 -1
  477. package/dist/esm/internal/stream.js +9 -0
  478. package/dist/esm/internal/stream.js.map +1 -1
  479. package/dist/esm/internal/version.js +1 -1
  480. package/package.json +1 -1
  481. package/src/Array.ts +2723 -36
  482. package/src/BigDecimal.ts +585 -18
  483. package/src/BigInt.ts +516 -16
  484. package/src/Boolean.ts +241 -8
  485. package/src/Cause.ts +177 -1
  486. package/src/Channel.ts +766 -49
  487. package/src/ChildExecutorDecision.ts +12 -0
  488. package/src/Chunk.ts +818 -4
  489. package/src/Config.ts +187 -8
  490. package/src/ConfigError.ts +16 -0
  491. package/src/ConfigProvider.ts +89 -1
  492. package/src/ConfigProviderPathPatch.ts +32 -0
  493. package/src/Console.ts +37 -8
  494. package/src/Context.ts +232 -0
  495. package/src/Cron.ts +12 -0
  496. package/src/Data.ts +165 -0
  497. package/src/DateTime.ts +1006 -50
  498. package/src/Deferred.ts +170 -0
  499. package/src/Differ.ts +89 -27
  500. package/src/Duration.ts +156 -16
  501. package/src/Effect.ts +4297 -123
  502. package/src/Either.ts +650 -34
  503. package/src/Equivalence.ts +24 -0
  504. package/src/ExecutionStrategy.ts +29 -10
  505. package/src/Exit.ts +252 -0
  506. package/src/Fiber.ts +182 -0
  507. package/src/FiberHandle.ts +42 -0
  508. package/src/FiberId.ts +24 -0
  509. package/src/FiberMap.ts +144 -21
  510. package/src/FiberRef.ts +80 -0
  511. package/src/FiberRefs.ts +84 -0
  512. package/src/FiberRefsPatch.ts +35 -1
  513. package/src/FiberSet.ts +38 -0
  514. package/src/Function.ts +416 -31
  515. package/src/GroupBy.ts +38 -0
  516. package/src/Hash.ts +8 -0
  517. package/src/HashMap.ts +300 -0
  518. package/src/HashSet.ts +284 -0
  519. package/src/Iterable.ts +456 -6
  520. package/src/KeyedPool.ts +34 -0
  521. package/src/Layer.ts +426 -30
  522. package/src/List.ts +476 -3
  523. package/src/LogLevel.ts +46 -0
  524. package/src/Logger.ts +195 -4
  525. package/src/Mailbox.ts +16 -0
  526. package/src/MergeDecision.ts +8 -0
  527. package/src/MergeState.ts +8 -0
  528. package/src/MergeStrategy.ts +25 -8
  529. package/src/Metric.ts +426 -15
  530. package/src/MetricHook.ts +24 -0
  531. package/src/MetricKey.ts +62 -8
  532. package/src/MetricPolling.ts +42 -6
  533. package/src/MetricState.ts +16 -0
  534. package/src/Micro.ts +1350 -102
  535. package/src/MutableHashMap.ts +105 -1
  536. package/src/MutableHashSet.ts +24 -0
  537. package/src/MutableList.ts +36 -0
  538. package/src/MutableQueue.ts +62 -0
  539. package/src/MutableRef.ts +56 -0
  540. package/src/Number.ts +500 -16
  541. package/src/Option.ts +1042 -16
  542. package/src/Order.ts +24 -0
  543. package/src/Ordering.ts +66 -0
  544. package/src/Pipeable.ts +224 -21
  545. package/src/Pool.ts +16 -0
  546. package/src/Predicate.ts +498 -0
  547. package/src/PubSub.ts +28 -0
  548. package/src/Queue.ts +104 -0
  549. package/src/RcMap.ts +70 -0
  550. package/src/Readable.ts +18 -7
  551. package/src/Record.ts +814 -40
  552. package/src/RedBlackTree.ts +305 -1
  553. package/src/Ref.ts +88 -0
  554. package/src/Request.ts +76 -0
  555. package/src/RequestResolver.ts +145 -4
  556. package/src/Runtime.ts +134 -2
  557. package/src/RuntimeFlags.ts +100 -0
  558. package/src/RuntimeFlagsPatch.ts +112 -0
  559. package/src/STM.ts +1107 -11
  560. package/src/Schedule.ts +704 -0
  561. package/src/ScheduleInterval.ts +68 -0
  562. package/src/ScheduleIntervals.ts +50 -0
  563. package/src/Scheduler.ts +2 -0
  564. package/src/Scope.ts +83 -15
  565. package/src/ScopedRef.ts +22 -0
  566. package/src/Sink.ts +464 -0
  567. package/src/SortedMap.ts +76 -0
  568. package/src/SortedSet.ts +143 -3
  569. package/src/Stream.ts +5041 -54
  570. package/src/StreamHaltStrategy.ts +29 -12
  571. package/src/String.ts +200 -0
  572. package/src/Struct.ts +86 -7
  573. package/src/Subscribable.ts +16 -0
  574. package/src/SubscriptionRef.ts +159 -11
  575. package/src/SynchronizedRef.ts +169 -8
  576. package/src/TArray.ts +431 -1
  577. package/src/TDeferred.ts +24 -0
  578. package/src/TMap.ts +381 -12
  579. package/src/TPriorityQueue.ts +60 -0
  580. package/src/TPubSub.ts +28 -0
  581. package/src/TQueue.ts +108 -0
  582. package/src/TReentrantLock.ts +36 -0
  583. package/src/TRef.ts +88 -0
  584. package/src/TSemaphore.ts +40 -0
  585. package/src/TSet.ts +280 -12
  586. package/src/Take.ts +56 -0
  587. package/src/TestAnnotationMap.ts +45 -1
  588. package/src/TestClock.ts +6 -0
  589. package/src/TestServices.ts +66 -0
  590. package/src/Trie.ts +906 -0
  591. package/src/Tuple.ts +157 -8
  592. package/src/Unify.ts +19 -3
  593. package/src/UpstreamPullRequest.ts +12 -0
  594. package/src/UpstreamPullStrategy.ts +12 -0
  595. package/src/Utils.ts +1 -15
  596. package/src/internal/core.ts +1 -1
  597. package/src/internal/runtime.ts +1 -1
  598. package/src/internal/stream.ts +27 -0
  599. package/src/internal/version.ts +1 -1
@@ -53,11 +53,11 @@ export type runSymbol = typeof runSymbol;
53
53
  */
54
54
  export interface Micro<out A, out E = never, out R = never> extends Effect<A, E, R> {
55
55
  readonly [TypeId]: Micro.Variance<A, E, R>;
56
- readonly [runSymbol]: (env: Env<any>, onExit: (exit: MicroExit<A, E>) => void) => void;
56
+ [runSymbol](env: Env<any>, onExit: (exit: MicroExit<A, E>) => void): void;
57
+ [Symbol.iterator](): MicroIterator<Micro<A, E, R>>;
57
58
  [Unify.typeSymbol]?: unknown;
58
59
  [Unify.unifySymbol]?: MicroUnify<this>;
59
60
  [Unify.ignoreSymbol]?: MicroUnifyIgnore;
60
- [Symbol.iterator](): MicroIterator<Micro<A, E, R>>;
61
61
  }
62
62
  /**
63
63
  * @category models
@@ -126,6 +126,32 @@ export declare const isMicro: (u: unknown) => u is Micro<any, any, any>;
126
126
  export interface MicroIterator<T extends Micro<any, any, any>> {
127
127
  next(...args: ReadonlyArray<any>): IteratorResult<YieldWrap<T>, Micro.Success<T>>;
128
128
  }
129
+ /**
130
+ * @since 3.8.4
131
+ * @experimental
132
+ * @category models
133
+ */
134
+ export interface MicroClass {
135
+ new <A, E = never, R = never>(): Micro<A, E, R>;
136
+ }
137
+ declare const MicroBase: MicroClass;
138
+ /**
139
+ * @since 3.8.4
140
+ * @experimental
141
+ * @category constructors
142
+ */
143
+ export declare abstract class Class<out A, out E = never, out R = never> extends MicroBase<A, E, R> {
144
+ /**
145
+ * @since 3.8.4
146
+ * @experimental
147
+ */
148
+ abstract asMicro(): Micro<A, E, R>;
149
+ /**
150
+ * @since 3.8.4
151
+ * @experimental
152
+ */
153
+ [runSymbol](env: Env<any>, onExit: (exit: MicroExit<A, E>) => void): void;
154
+ }
129
155
  /**
130
156
  * @since 3.4.6
131
157
  * @experimental
@@ -246,7 +272,17 @@ export declare const causeSquash: <E>(self: MicroCause<E>) => unknown;
246
272
  * @category MicroCause
247
273
  */
248
274
  export declare const causeWithTrace: {
275
+ /**
276
+ * @since 3.4.6
277
+ * @experimental
278
+ * @category MicroCause
279
+ */
249
280
  (trace: string): <E>(self: MicroCause<E>) => MicroCause<E>;
281
+ /**
282
+ * @since 3.4.6
283
+ * @experimental
284
+ * @category MicroCause
285
+ */
250
286
  <E>(self: MicroCause<E>, trace: string): MicroCause<E>;
251
287
  };
252
288
  /**
@@ -368,28 +404,6 @@ export interface Env<R> extends Pipeable {
368
404
  };
369
405
  readonly refs: ReadonlyRecord<string, unknown>;
370
406
  }
371
- /**
372
- * @since 3.4.0
373
- * @experimental
374
- * @category environment
375
- */
376
- export declare const EnvRefTypeId: unique symbol;
377
- /**
378
- * @since 3.4.0
379
- * @experimental
380
- * @category environment
381
- */
382
- export type EnvRefTypeId = typeof EnvRefTypeId;
383
- /**
384
- * @since 3.4.0
385
- * @experimental
386
- * @category environment
387
- */
388
- export interface EnvRef<A> {
389
- readonly [EnvRefTypeId]: EnvRefTypeId;
390
- readonly key: string;
391
- readonly initial: A;
392
- }
393
407
  /**
394
408
  * @since 3.4.0
395
409
  * @experimental
@@ -408,7 +422,17 @@ export declare const envUnsafeMakeEmpty: () => Env<never>;
408
422
  * @category environment
409
423
  */
410
424
  export declare const envGet: {
425
+ /**
426
+ * @since 3.4.0
427
+ * @experimental
428
+ * @category environment
429
+ */
411
430
  <A>(ref: EnvRef<A>): <R>(self: Env<R>) => A;
431
+ /**
432
+ * @since 3.4.0
433
+ * @experimental
434
+ * @category environment
435
+ */
412
436
  <A, R>(self: Env<R>, ref: EnvRef<A>): A;
413
437
  };
414
438
  /**
@@ -417,7 +441,17 @@ export declare const envGet: {
417
441
  * @category environment
418
442
  */
419
443
  export declare const envSet: {
444
+ /**
445
+ * @since 3.4.0
446
+ * @experimental
447
+ * @category environment
448
+ */
420
449
  <A>(ref: EnvRef<A>, value: A): <R>(self: Env<R>) => Env<R>;
450
+ /**
451
+ * @since 3.4.0
452
+ * @experimental
453
+ * @category environment
454
+ */
421
455
  <A, R>(self: Env<R>, ref: EnvRef<A>, value: A): Env<R>;
422
456
  };
423
457
  /**
@@ -426,7 +460,17 @@ export declare const envSet: {
426
460
  * @category environment
427
461
  */
428
462
  export declare const envMutate: {
463
+ /**
464
+ * @since 3.4.0
465
+ * @experimental
466
+ * @category environment
467
+ */
429
468
  (f: (map: Record<string, unknown>) => void): <R>(self: Env<R>) => Env<R>;
469
+ /**
470
+ * @since 3.4.0
471
+ * @experimental
472
+ * @category environment
473
+ */
430
474
  <R>(self: Env<R>, f: (map: Record<string, unknown>) => void): Env<R>;
431
475
  };
432
476
  /**
@@ -465,7 +509,21 @@ export declare const getEnvRef: <A>(envRef: EnvRef<A>) => Micro<A>;
465
509
  * @category environment
466
510
  */
467
511
  export declare const locally: {
512
+ /**
513
+ * Set the value of the given `EnvRef` for the duration of the effect.
514
+ *
515
+ * @since 3.4.0
516
+ * @experimental
517
+ * @category environment
518
+ */
468
519
  <A>(fiberRef: EnvRef<A>, value: A): <XA, E, R>(self: Micro<XA, E, R>) => Micro<XA, E, R>;
520
+ /**
521
+ * Set the value of the given `EnvRef` for the duration of the effect.
522
+ *
523
+ * @since 3.4.0
524
+ * @experimental
525
+ * @category environment
526
+ */
469
527
  <XA, E, R, A>(self: Micro<XA, E, R>, fiberRef: EnvRef<A>, value: A): Micro<XA, E, R>;
470
528
  };
471
529
  /**
@@ -484,7 +542,21 @@ export declare const context: <R>() => Micro<Context.Context<R>>;
484
542
  * @category environment
485
543
  */
486
544
  export declare const provideContext: {
545
+ /**
546
+ * Merge the given `Context` with the current context.
547
+ *
548
+ * @since 3.4.0
549
+ * @experimental
550
+ * @category environment
551
+ */
487
552
  <XR>(context: Context.Context<XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, XR>>;
553
+ /**
554
+ * Merge the given `Context` with the current context.
555
+ *
556
+ * @since 3.4.0
557
+ * @experimental
558
+ * @category environment
559
+ */
488
560
  <A, E, R, XR>(self: Micro<A, E, R>, context: Context.Context<XR>): Micro<A, E, Exclude<R, XR>>;
489
561
  };
490
562
  /**
@@ -495,7 +567,21 @@ export declare const provideContext: {
495
567
  * @category environment
496
568
  */
497
569
  export declare const provideService: {
570
+ /**
571
+ * Add the provided service to the current context.
572
+ *
573
+ * @since 3.4.0
574
+ * @experimental
575
+ * @category environment
576
+ */
498
577
  <I, S>(tag: Context.Tag<I, S>, service: S): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, I>>;
578
+ /**
579
+ * Add the provided service to the current context.
580
+ *
581
+ * @since 3.4.0
582
+ * @experimental
583
+ * @category environment
584
+ */
499
585
  <A, E, R, I, S>(self: Micro<A, E, R>, tag: Context.Tag<I, S>, service: S): Micro<A, E, Exclude<R, I>>;
500
586
  };
501
587
  /**
@@ -507,7 +593,23 @@ export declare const provideService: {
507
593
  * @category environment
508
594
  */
509
595
  export declare const provideServiceEffect: {
596
+ /**
597
+ * Create a service using the provided `Micro` effect, and add it to the
598
+ * current context.
599
+ *
600
+ * @since 3.4.6
601
+ * @experimental
602
+ * @category environment
603
+ */
510
604
  <I, S, E2, R2>(tag: Context.Tag<I, S>, acquire: Micro<S, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | E2, Exclude<R, I> | R2>;
605
+ /**
606
+ * Create a service using the provided `Micro` effect, and add it to the
607
+ * current context.
608
+ *
609
+ * @since 3.4.6
610
+ * @experimental
611
+ * @category environment
612
+ */
511
613
  <A, E, R, I, S, E2, R2>(self: Micro<A, E, R>, tag: Context.Tag<I, S>, acquire: Micro<S, E2, R2>): Micro<A, E | E2, Exclude<R, I> | R2>;
512
614
  };
513
615
  /**
@@ -549,6 +651,49 @@ export declare class MicroSchedulerDefault implements MicroScheduler {
549
651
  */
550
652
  flush(): void;
551
653
  }
654
+ /**
655
+ * @since 3.4.0
656
+ * @experimental
657
+ * @category environment
658
+ */
659
+ export declare const EnvRefTypeId: unique symbol;
660
+ /**
661
+ * @since 3.4.0
662
+ * @experimental
663
+ * @category environment
664
+ */
665
+ export type EnvRefTypeId = typeof EnvRefTypeId;
666
+ /**
667
+ * @since 3.4.0
668
+ * @experimental
669
+ * @category environment
670
+ */
671
+ export interface EnvRef<A> extends Micro<A> {
672
+ readonly [EnvRefTypeId]: EnvRefTypeId;
673
+ readonly key: string;
674
+ readonly initial: A;
675
+ [Unify.typeSymbol]?: unknown;
676
+ [Unify.unifySymbol]?: EnvRefUnify<this>;
677
+ [Unify.ignoreSymbol]?: EnvRefUnifyIgnore;
678
+ }
679
+ /**
680
+ * @category models
681
+ * @since 3.8.4
682
+ * @experimental
683
+ */
684
+ export interface EnvRefUnify<A extends {
685
+ [Unify.typeSymbol]?: any;
686
+ }> extends MicroUnify<A> {
687
+ EnvRef?: () => A[Unify.typeSymbol] extends EnvRef<infer A0> | infer _ ? EnvRef<A0> : never;
688
+ }
689
+ /**
690
+ * @category models
691
+ * @since 3.8.4
692
+ * @experimental
693
+ */
694
+ export interface EnvRefUnifyIgnore extends MicroUnifyIgnore {
695
+ Micro?: true;
696
+ }
552
697
  /**
553
698
  * @since 3.4.0
554
699
  * @experimental
@@ -608,7 +753,39 @@ export declare const currentScheduler: EnvRef<MicroScheduler>;
608
753
  * )
609
754
  */
610
755
  export declare const withConcurrency: {
756
+ /**
757
+ * If you have a `Micro` that uses `concurrency: "inherit"`, you can use this
758
+ * api to control the concurrency of that `Micro` when it is run.
759
+ *
760
+ * @since 3.4.0
761
+ * @experimental
762
+ * @category environment refs
763
+ * @example
764
+ * import * as Micro from "effect/Micro"
765
+ *
766
+ * Micro.forEach([1, 2, 3], (n) => Micro.succeed(n), {
767
+ * concurrency: "inherit"
768
+ * }).pipe(
769
+ * Micro.withConcurrency(2) // use a concurrency of 2
770
+ * )
771
+ */
611
772
  (concurrency: "unbounded" | number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>;
773
+ /**
774
+ * If you have a `Micro` that uses `concurrency: "inherit"`, you can use this
775
+ * api to control the concurrency of that `Micro` when it is run.
776
+ *
777
+ * @since 3.4.0
778
+ * @experimental
779
+ * @category environment refs
780
+ * @example
781
+ * import * as Micro from "effect/Micro"
782
+ *
783
+ * Micro.forEach([1, 2, 3], (n) => Micro.succeed(n), {
784
+ * concurrency: "inherit"
785
+ * }).pipe(
786
+ * Micro.withConcurrency(2) // use a concurrency of 2
787
+ * )
788
+ */
612
789
  <A, E, R>(self: Micro<A, E, R>, concurrency: "unbounded" | number): Micro<A, E, R>;
613
790
  };
614
791
  /**
@@ -881,7 +1058,23 @@ export declare const flatten: <A, E, R, E2, R2>(self: Micro<Micro<A, E, R>, E2,
881
1058
  * @category mapping & sequencing
882
1059
  */
883
1060
  export declare const map: {
1061
+ /**
1062
+ * Transforms the success value of the `Micro` effect with the specified
1063
+ * function.
1064
+ *
1065
+ * @since 3.4.0
1066
+ * @experimental
1067
+ * @category mapping & sequencing
1068
+ */
884
1069
  <A, B>(f: (a: A) => B): <E, R>(self: Micro<A, E, R>) => Micro<B, E, R>;
1070
+ /**
1071
+ * Transforms the success value of the `Micro` effect with the specified
1072
+ * function.
1073
+ *
1074
+ * @since 3.4.0
1075
+ * @experimental
1076
+ * @category mapping & sequencing
1077
+ */
885
1078
  <A, E, R, B>(self: Micro<A, E, R>, f: (a: A) => B): Micro<B, E, R>;
886
1079
  };
887
1080
  /**
@@ -893,7 +1086,23 @@ export declare const map: {
893
1086
  * @category mapping & sequencing
894
1087
  */
895
1088
  export declare const as: {
1089
+ /**
1090
+ * Create a `Micro` effect that will replace the success value of the given
1091
+ * effect.
1092
+ *
1093
+ * @since 3.4.0
1094
+ * @experimental
1095
+ * @category mapping & sequencing
1096
+ */
896
1097
  <A, B>(value: B): <E, R>(self: Micro<A, E, R>) => Micro<B, E, R>;
1098
+ /**
1099
+ * Create a `Micro` effect that will replace the success value of the given
1100
+ * effect.
1101
+ *
1102
+ * @since 3.4.0
1103
+ * @experimental
1104
+ * @category mapping & sequencing
1105
+ */
897
1106
  <A, E, R, B>(self: Micro<A, E, R>, value: B): Micro<B, E, R>;
898
1107
  };
899
1108
  /**
@@ -913,7 +1122,23 @@ export declare const asSome: <A, E, R>(self: Micro<A, E, R>) => Micro<Option.Opt
913
1122
  * @category mapping & sequencing
914
1123
  */
915
1124
  export declare const flatMap: {
1125
+ /**
1126
+ * Map the success value of this `Micro` effect to another `Micro` effect, then
1127
+ * flatten the result.
1128
+ *
1129
+ * @since 3.4.0
1130
+ * @experimental
1131
+ * @category mapping & sequencing
1132
+ */
916
1133
  <A, B, E2, R2>(f: (a: A) => Micro<B, E2, R2>): <E, R>(self: Micro<A, E, R>) => Micro<B, E | E2, R | R2>;
1134
+ /**
1135
+ * Map the success value of this `Micro` effect to another `Micro` effect, then
1136
+ * flatten the result.
1137
+ *
1138
+ * @since 3.4.0
1139
+ * @experimental
1140
+ * @category mapping & sequencing
1141
+ */
917
1142
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (a: A) => Micro<B, E2, R2>): Micro<B, E | E2, R | R2>;
918
1143
  };
919
1144
  /**
@@ -936,9 +1161,53 @@ export declare const flip: <A, E, R>(self: Micro<A, E, R>) => Micro<E, A, R>;
936
1161
  * @category mapping & sequencing
937
1162
  */
938
1163
  export declare const andThen: {
1164
+ /**
1165
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1166
+ * a single api.
1167
+ *
1168
+ * It also allows you to pass in a `Micro` effect directly, which will be
1169
+ * executed after the current effect.
1170
+ *
1171
+ * @since 3.4.0
1172
+ * @experimental
1173
+ * @category mapping & sequencing
1174
+ */
939
1175
  <A, X>(f: (a: A) => X): <E, R>(self: Micro<A, E, R>) => [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1> : Micro<X, E, R>;
1176
+ /**
1177
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1178
+ * a single api.
1179
+ *
1180
+ * It also allows you to pass in a `Micro` effect directly, which will be
1181
+ * executed after the current effect.
1182
+ *
1183
+ * @since 3.4.0
1184
+ * @experimental
1185
+ * @category mapping & sequencing
1186
+ */
940
1187
  <X>(f: NotFunction<X>): <A, E, R>(self: Micro<A, E, R>) => [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1> : Micro<X, E, R>;
1188
+ /**
1189
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1190
+ * a single api.
1191
+ *
1192
+ * It also allows you to pass in a `Micro` effect directly, which will be
1193
+ * executed after the current effect.
1194
+ *
1195
+ * @since 3.4.0
1196
+ * @experimental
1197
+ * @category mapping & sequencing
1198
+ */
941
1199
  <A, E, R, X>(self: Micro<A, E, R>, f: (a: A) => X): [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1> : Micro<X, E, R>;
1200
+ /**
1201
+ * A more flexible version of `flatMap`, that combines `map` and `flatMap` into
1202
+ * a single api.
1203
+ *
1204
+ * It also allows you to pass in a `Micro` effect directly, which will be
1205
+ * executed after the current effect.
1206
+ *
1207
+ * @since 3.4.0
1208
+ * @experimental
1209
+ * @category mapping & sequencing
1210
+ */
942
1211
  <A, E, R, X>(self: Micro<A, E, R>, f: NotFunction<X>): [X] extends [Micro<infer A1, infer E1, infer R1>] ? Micro<A1, E | E1, R | R1> : Micro<X, E, R>;
943
1212
  };
944
1213
  /**
@@ -951,9 +1220,45 @@ export declare const andThen: {
951
1220
  * @category mapping & sequencing
952
1221
  */
953
1222
  export declare const tap: {
1223
+ /**
1224
+ * Execute a side effect from the success value of the `Micro` effect.
1225
+ *
1226
+ * It is similar to the `andThen` api, but the success value is ignored.
1227
+ *
1228
+ * @since 3.4.0
1229
+ * @experimental
1230
+ * @category mapping & sequencing
1231
+ */
954
1232
  <A, X>(f: (a: NoInfer<A>) => X): <E, R>(self: Micro<A, E, R>) => [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1> : Micro<A, E, R>;
1233
+ /**
1234
+ * Execute a side effect from the success value of the `Micro` effect.
1235
+ *
1236
+ * It is similar to the `andThen` api, but the success value is ignored.
1237
+ *
1238
+ * @since 3.4.0
1239
+ * @experimental
1240
+ * @category mapping & sequencing
1241
+ */
955
1242
  <X>(f: NotFunction<X>): <A, E, R>(self: Micro<A, E, R>) => [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1> : Micro<A, E, R>;
1243
+ /**
1244
+ * Execute a side effect from the success value of the `Micro` effect.
1245
+ *
1246
+ * It is similar to the `andThen` api, but the success value is ignored.
1247
+ *
1248
+ * @since 3.4.0
1249
+ * @experimental
1250
+ * @category mapping & sequencing
1251
+ */
956
1252
  <A, E, R, X>(self: Micro<A, E, R>, f: (a: NoInfer<A>) => X): [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1> : Micro<A, E, R>;
1253
+ /**
1254
+ * Execute a side effect from the success value of the `Micro` effect.
1255
+ *
1256
+ * It is similar to the `andThen` api, but the success value is ignored.
1257
+ *
1258
+ * @since 3.4.0
1259
+ * @experimental
1260
+ * @category mapping & sequencing
1261
+ */
957
1262
  <A, E, R, X>(self: Micro<A, E, R>, f: NotFunction<X>): [X] extends [Micro<infer _A1, infer E1, infer R1>] ? Micro<A, E | E1, R | R1> : Micro<A, E, R>;
958
1263
  };
959
1264
  /**
@@ -1009,7 +1314,23 @@ export declare const raceAllFirst: <Eff extends Micro<any, any, any>>(all: Itera
1009
1314
  * @category sequencing
1010
1315
  */
1011
1316
  export declare const race: {
1317
+ /**
1318
+ * Returns an effect that races two effects, yielding the value of the first
1319
+ * effect to succeed. Losers of the race will be interrupted immediately
1320
+ *
1321
+ * @since 3.4.0
1322
+ * @experimental
1323
+ * @category sequencing
1324
+ */
1012
1325
  <A2, E2, R2>(that: Micro<A2, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>;
1326
+ /**
1327
+ * Returns an effect that races two effects, yielding the value of the first
1328
+ * effect to succeed. Losers of the race will be interrupted immediately
1329
+ *
1330
+ * @since 3.4.0
1331
+ * @experimental
1332
+ * @category sequencing
1333
+ */
1013
1334
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>): Micro<A | A2, E | E2, R | R2>;
1014
1335
  };
1015
1336
  /**
@@ -1021,7 +1342,23 @@ export declare const race: {
1021
1342
  * @category sequencing
1022
1343
  */
1023
1344
  export declare const raceFirst: {
1345
+ /**
1346
+ * Returns an effect that races two effects, yielding the value of the first
1347
+ * effect to succeed *or* fail. Losers of the race will be interrupted immediately
1348
+ *
1349
+ * @since 3.4.0
1350
+ * @experimental
1351
+ * @category sequencing
1352
+ */
1024
1353
  <A2, E2, R2>(that: Micro<A2, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>;
1354
+ /**
1355
+ * Returns an effect that races two effects, yielding the value of the first
1356
+ * effect to succeed *or* fail. Losers of the race will be interrupted immediately
1357
+ *
1358
+ * @since 3.4.0
1359
+ * @experimental
1360
+ * @category sequencing
1361
+ */
1025
1362
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>): Micro<A | A2, E | E2, R | R2>;
1026
1363
  };
1027
1364
  /**
@@ -1033,9 +1370,25 @@ export declare const raceFirst: {
1033
1370
  * @category zipping
1034
1371
  */
1035
1372
  export declare const zip: {
1373
+ /**
1374
+ * Combine two `Micro` effects into a single effect that produces a tuple of
1375
+ * their results.
1376
+ *
1377
+ * @since 3.4.0
1378
+ * @experimental
1379
+ * @category zipping
1380
+ */
1036
1381
  <A2, E2, R2>(that: Micro<A2, E2, R2>, options?: {
1037
1382
  readonly concurrent?: boolean | undefined;
1038
1383
  } | undefined): <A, E, R>(self: Micro<A, E, R>) => Micro<[A, A2], E2 | E, R2 | R>;
1384
+ /**
1385
+ * Combine two `Micro` effects into a single effect that produces a tuple of
1386
+ * their results.
1387
+ *
1388
+ * @since 3.4.0
1389
+ * @experimental
1390
+ * @category zipping
1391
+ */
1039
1392
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>, options?: {
1040
1393
  readonly concurrent?: boolean | undefined;
1041
1394
  }): Micro<[A, A2], E | E2, R | R2>;
@@ -1050,9 +1403,27 @@ export declare const zip: {
1050
1403
  * @category zipping
1051
1404
  */
1052
1405
  export declare const zipWith: {
1406
+ /**
1407
+ * The `Micro.zipWith` function combines two `Micro` effects and allows you to
1408
+ * apply a function to the results of the combined effects, transforming them
1409
+ * into a single value.
1410
+ *
1411
+ * @since 3.4.3
1412
+ * @experimental
1413
+ * @category zipping
1414
+ */
1053
1415
  <A2, E2, R2, A, B>(that: Micro<A2, E2, R2>, f: (a: A, b: A2) => B, options?: {
1054
1416
  readonly concurrent?: boolean | undefined;
1055
1417
  }): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R2 | R>;
1418
+ /**
1419
+ * The `Micro.zipWith` function combines two `Micro` effects and allows you to
1420
+ * apply a function to the results of the combined effects, transforming them
1421
+ * into a single value.
1422
+ *
1423
+ * @since 3.4.3
1424
+ * @experimental
1425
+ * @category zipping
1426
+ */
1056
1427
  <A, E, R, A2, E2, R2, B>(self: Micro<A, E, R>, that: Micro<A2, E2, R2>, f: (a: A, b: A2) => B, options?: {
1057
1428
  readonly concurrent?: boolean | undefined;
1058
1429
  }): Micro<B, E2 | E, R2 | R>;
@@ -1069,9 +1440,53 @@ export declare const zipWith: {
1069
1440
  * @category filtering & conditionals
1070
1441
  */
1071
1442
  export declare const filterOrFailCause: {
1443
+ /**
1444
+ * Filter the specified effect with the provided function, failing with specified
1445
+ * `MicroCause` if the predicate fails.
1446
+ *
1447
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1448
+ * refine and narrow down the type of the success channel by providing a
1449
+ *
1450
+ * @since 3.4.0
1451
+ * @experimental
1452
+ * @category filtering & conditionals
1453
+ */
1072
1454
  <A, B extends A, E2>(refinement: Refinement<A, B>, orFailWith: (a: NoInfer<A>) => MicroCause<E2>): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R>;
1455
+ /**
1456
+ * Filter the specified effect with the provided function, failing with specified
1457
+ * `MicroCause` if the predicate fails.
1458
+ *
1459
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1460
+ * refine and narrow down the type of the success channel by providing a
1461
+ *
1462
+ * @since 3.4.0
1463
+ * @experimental
1464
+ * @category filtering & conditionals
1465
+ */
1073
1466
  <A, E2>(predicate: Predicate<NoInfer<A>>, orFailWith: (a: NoInfer<A>) => MicroCause<E2>): <E, R>(self: Micro<A, E, R>) => Micro<A, E2 | E, R>;
1467
+ /**
1468
+ * Filter the specified effect with the provided function, failing with specified
1469
+ * `MicroCause` if the predicate fails.
1470
+ *
1471
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1472
+ * refine and narrow down the type of the success channel by providing a
1473
+ *
1474
+ * @since 3.4.0
1475
+ * @experimental
1476
+ * @category filtering & conditionals
1477
+ */
1074
1478
  <A, E, R, B extends A, E2>(self: Micro<A, E, R>, refinement: Refinement<A, B>, orFailWith: (a: A) => MicroCause<E2>): Micro<B, E | E2, R>;
1479
+ /**
1480
+ * Filter the specified effect with the provided function, failing with specified
1481
+ * `MicroCause` if the predicate fails.
1482
+ *
1483
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1484
+ * refine and narrow down the type of the success channel by providing a
1485
+ *
1486
+ * @since 3.4.0
1487
+ * @experimental
1488
+ * @category filtering & conditionals
1489
+ */
1075
1490
  <A, E, R, E2>(self: Micro<A, E, R>, predicate: Predicate<A>, orFailWith: (a: A) => MicroCause<E2>): Micro<A, E | E2, R>;
1076
1491
  };
1077
1492
  /**
@@ -1086,9 +1501,53 @@ export declare const filterOrFailCause: {
1086
1501
  * @category filtering & conditionals
1087
1502
  */
1088
1503
  export declare const filterOrFail: {
1504
+ /**
1505
+ * Filter the specified effect with the provided function, failing with specified
1506
+ * error if the predicate fails.
1507
+ *
1508
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1509
+ * refine and narrow down the type of the success channel by providing a
1510
+ *
1511
+ * @since 3.4.0
1512
+ * @experimental
1513
+ * @category filtering & conditionals
1514
+ */
1089
1515
  <A, B extends A, E2>(refinement: Refinement<A, B>, orFailWith: (a: NoInfer<A>) => E2): <E, R>(self: Micro<A, E, R>) => Micro<B, E2 | E, R>;
1516
+ /**
1517
+ * Filter the specified effect with the provided function, failing with specified
1518
+ * error if the predicate fails.
1519
+ *
1520
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1521
+ * refine and narrow down the type of the success channel by providing a
1522
+ *
1523
+ * @since 3.4.0
1524
+ * @experimental
1525
+ * @category filtering & conditionals
1526
+ */
1090
1527
  <A, E2>(predicate: Predicate<NoInfer<A>>, orFailWith: (a: NoInfer<A>) => E2): <E, R>(self: Micro<A, E, R>) => Micro<A, E2 | E, R>;
1528
+ /**
1529
+ * Filter the specified effect with the provided function, failing with specified
1530
+ * error if the predicate fails.
1531
+ *
1532
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1533
+ * refine and narrow down the type of the success channel by providing a
1534
+ *
1535
+ * @since 3.4.0
1536
+ * @experimental
1537
+ * @category filtering & conditionals
1538
+ */
1091
1539
  <A, E, R, B extends A, E2>(self: Micro<A, E, R>, refinement: Refinement<A, B>, orFailWith: (a: A) => E2): Micro<B, E | E2, R>;
1540
+ /**
1541
+ * Filter the specified effect with the provided function, failing with specified
1542
+ * error if the predicate fails.
1543
+ *
1544
+ * In addition to the filtering capabilities discussed earlier, you have the option to further
1545
+ * refine and narrow down the type of the success channel by providing a
1546
+ *
1547
+ * @since 3.4.0
1548
+ * @experimental
1549
+ * @category filtering & conditionals
1550
+ */
1092
1551
  <A, E, R, E2>(self: Micro<A, E, R>, predicate: Predicate<A>, orFailWith: (a: A) => E2): Micro<A, E | E2, R>;
1093
1552
  };
1094
1553
  /**
@@ -1099,7 +1558,21 @@ export declare const filterOrFail: {
1099
1558
  * @category filtering & conditionals
1100
1559
  */
1101
1560
  export declare const when: {
1561
+ /**
1562
+ * The moral equivalent of `if (p) exp`.
1563
+ *
1564
+ * @since 3.4.0
1565
+ * @experimental
1566
+ * @category filtering & conditionals
1567
+ */
1102
1568
  <E2 = never, R2 = never>(condition: LazyArg<boolean> | Micro<boolean, E2, R2>): <A, E, R>(self: Micro<A, E, R>) => Micro<Option.Option<A>, E | E2, R | R2>;
1569
+ /**
1570
+ * The moral equivalent of `if (p) exp`.
1571
+ *
1572
+ * @since 3.4.0
1573
+ * @experimental
1574
+ * @category filtering & conditionals
1575
+ */
1103
1576
  <A, E, R, E2 = never, R2 = never>(self: Micro<A, E, R>, condition: LazyArg<boolean> | Micro<boolean, E2, R2>): Micro<Option.Option<A>, E | E2, R | R2>;
1104
1577
  };
1105
1578
  /**
@@ -1113,11 +1586,31 @@ export declare const when: {
1113
1586
  * @category repetition
1114
1587
  */
1115
1588
  export declare const repeatExit: {
1589
+ /**
1590
+ * Repeat the given `Micro` using the provided options.
1591
+ *
1592
+ * The `while` predicate will be checked after each iteration, and can use the
1593
+ * fall `MicroExit` of the effect to determine if the repetition should continue.
1594
+ *
1595
+ * @since 3.4.6
1596
+ * @experimental
1597
+ * @category repetition
1598
+ */
1116
1599
  <A, E>(options: {
1117
1600
  while: Predicate<MicroExit<A, E>>;
1118
1601
  times?: number | undefined;
1119
1602
  schedule?: MicroSchedule | undefined;
1120
1603
  }): <R>(self: Micro<A, E, R>) => Micro<A, E, R>;
1604
+ /**
1605
+ * Repeat the given `Micro` using the provided options.
1606
+ *
1607
+ * The `while` predicate will be checked after each iteration, and can use the
1608
+ * fall `MicroExit` of the effect to determine if the repetition should continue.
1609
+ *
1610
+ * @since 3.4.6
1611
+ * @experimental
1612
+ * @category repetition
1613
+ */
1121
1614
  <A, E, R>(self: Micro<A, E, R>, options: {
1122
1615
  while: Predicate<MicroExit<A, E>>;
1123
1616
  times?: number | undefined;
@@ -1133,11 +1626,27 @@ export declare const repeatExit: {
1133
1626
  * @category repetition
1134
1627
  */
1135
1628
  export declare const repeat: {
1629
+ /**
1630
+ * Repeat the given `Micro` effect using the provided options. Only successful
1631
+ * results will be repeated.
1632
+ *
1633
+ * @since 3.4.0
1634
+ * @experimental
1635
+ * @category repetition
1636
+ */
1136
1637
  <A, E>(options?: {
1137
1638
  while?: Predicate<A> | undefined;
1138
1639
  times?: number | undefined;
1139
1640
  schedule?: MicroSchedule | undefined;
1140
1641
  } | undefined): <R>(self: Micro<A, E, R>) => Micro<A, E, R>;
1642
+ /**
1643
+ * Repeat the given `Micro` effect using the provided options. Only successful
1644
+ * results will be repeated.
1645
+ *
1646
+ * @since 3.4.0
1647
+ * @experimental
1648
+ * @category repetition
1649
+ */
1141
1650
  <A, E, R>(self: Micro<A, E, R>, options?: {
1142
1651
  while?: Predicate<A> | undefined;
1143
1652
  times?: number | undefined;
@@ -1199,7 +1708,23 @@ export declare const scheduleExponential: (baseMillis: number, factor?: number)
1199
1708
  * @category scheduling
1200
1709
  */
1201
1710
  export declare const scheduleAddDelay: {
1711
+ /**
1712
+ * Returns a new `MicroSchedule` with an added calculated delay to each delay
1713
+ * returned by this schedule.
1714
+ *
1715
+ * @since 3.4.6
1716
+ * @experimental
1717
+ * @category scheduling
1718
+ */
1202
1719
  (f: () => number): (self: MicroSchedule) => MicroSchedule;
1720
+ /**
1721
+ * Returns a new `MicroSchedule` with an added calculated delay to each delay
1722
+ * returned by this schedule.
1723
+ *
1724
+ * @since 3.4.6
1725
+ * @experimental
1726
+ * @category scheduling
1727
+ */
1203
1728
  (self: MicroSchedule, f: () => number): MicroSchedule;
1204
1729
  };
1205
1730
  /**
@@ -1211,7 +1736,23 @@ export declare const scheduleAddDelay: {
1211
1736
  * @category scheduling
1212
1737
  */
1213
1738
  export declare const scheduleWithMaxDelay: {
1739
+ /**
1740
+ * Transform a `MicroSchedule` to one that will have a delay that will never exceed
1741
+ * the specified maximum.
1742
+ *
1743
+ * @since 3.4.6
1744
+ * @experimental
1745
+ * @category scheduling
1746
+ */
1214
1747
  (max: number): (self: MicroSchedule) => MicroSchedule;
1748
+ /**
1749
+ * Transform a `MicroSchedule` to one that will have a delay that will never exceed
1750
+ * the specified maximum.
1751
+ *
1752
+ * @since 3.4.6
1753
+ * @experimental
1754
+ * @category scheduling
1755
+ */
1215
1756
  (self: MicroSchedule, max: number): MicroSchedule;
1216
1757
  };
1217
1758
  /**
@@ -1223,7 +1764,23 @@ export declare const scheduleWithMaxDelay: {
1223
1764
  * @category scheduling
1224
1765
  */
1225
1766
  export declare const scheduleWithMaxElapsed: {
1767
+ /**
1768
+ * Transform a `MicroSchedule` to one that will stop repeating after the specified
1769
+ * amount of time.
1770
+ *
1771
+ * @since 3.4.6
1772
+ * @experimental
1773
+ * @category scheduling
1774
+ */
1226
1775
  (max: number): (self: MicroSchedule) => MicroSchedule;
1776
+ /**
1777
+ * Transform a `MicroSchedule` to one that will stop repeating after the specified
1778
+ * amount of time.
1779
+ *
1780
+ * @since 3.4.6
1781
+ * @experimental
1782
+ * @category scheduling
1783
+ */
1227
1784
  (self: MicroSchedule, max: number): MicroSchedule;
1228
1785
  };
1229
1786
  /**
@@ -1235,7 +1792,23 @@ export declare const scheduleWithMaxElapsed: {
1235
1792
  * @category scheduling
1236
1793
  */
1237
1794
  export declare const scheduleUnion: {
1795
+ /**
1796
+ * Combines two `MicroSchedule`s, by recurring if either schedule wants to
1797
+ * recur, using the minimum of the two durations between recurrences.
1798
+ *
1799
+ * @since 3.4.6
1800
+ * @experimental
1801
+ * @category scheduling
1802
+ */
1238
1803
  (that: MicroSchedule): (self: MicroSchedule) => MicroSchedule;
1804
+ /**
1805
+ * Combines two `MicroSchedule`s, by recurring if either schedule wants to
1806
+ * recur, using the minimum of the two durations between recurrences.
1807
+ *
1808
+ * @since 3.4.6
1809
+ * @experimental
1810
+ * @category scheduling
1811
+ */
1239
1812
  (self: MicroSchedule, that: MicroSchedule): MicroSchedule;
1240
1813
  };
1241
1814
  /**
@@ -1247,7 +1820,23 @@ export declare const scheduleUnion: {
1247
1820
  * @category scheduling
1248
1821
  */
1249
1822
  export declare const scheduleIntersect: {
1823
+ /**
1824
+ * Combines two `MicroSchedule`s, by recurring only if both schedules want to
1825
+ * recur, using the maximum of the two durations between recurrences.
1826
+ *
1827
+ * @since 3.4.6
1828
+ * @experimental
1829
+ * @category scheduling
1830
+ */
1250
1831
  (that: MicroSchedule): (self: MicroSchedule) => MicroSchedule;
1832
+ /**
1833
+ * Combines two `MicroSchedule`s, by recurring only if both schedules want to
1834
+ * recur, using the maximum of the two durations between recurrences.
1835
+ *
1836
+ * @since 3.4.6
1837
+ * @experimental
1838
+ * @category scheduling
1839
+ */
1251
1840
  (self: MicroSchedule, that: MicroSchedule): MicroSchedule;
1252
1841
  };
1253
1842
  /**
@@ -1259,7 +1848,23 @@ export declare const scheduleIntersect: {
1259
1848
  * @category error handling
1260
1849
  */
1261
1850
  export declare const catchAllCause: {
1851
+ /**
1852
+ * Catch the full `MicroCause` object of the given `Micro` effect, allowing you to
1853
+ * recover from any kind of cause.
1854
+ *
1855
+ * @since 3.4.6
1856
+ * @experimental
1857
+ * @category error handling
1858
+ */
1262
1859
  <E, B, E2, R2>(f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E2, R | R2>;
1860
+ /**
1861
+ * Catch the full `MicroCause` object of the given `Micro` effect, allowing you to
1862
+ * recover from any kind of cause.
1863
+ *
1864
+ * @since 3.4.6
1865
+ * @experimental
1866
+ * @category error handling
1867
+ */
1263
1868
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): Micro<A | B, E2, R | R2>;
1264
1869
  };
1265
1870
  /**
@@ -1271,9 +1876,41 @@ export declare const catchAllCause: {
1271
1876
  * @category error handling
1272
1877
  */
1273
1878
  export declare const catchCauseIf: {
1879
+ /**
1880
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
1881
+ * using the provided predicate to determine if the failure should be caught.
1882
+ *
1883
+ * @since 3.4.6
1884
+ * @experimental
1885
+ * @category error handling
1886
+ */
1274
1887
  <E, B, E2, R2, EB extends MicroCause<E>>(refinement: Refinement<MicroCause<E>, EB>, f: (cause: EB) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A | B, Exclude<E, MicroCause.Error<EB>> | E2, R | R2>;
1888
+ /**
1889
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
1890
+ * using the provided predicate to determine if the failure should be caught.
1891
+ *
1892
+ * @since 3.4.6
1893
+ * @experimental
1894
+ * @category error handling
1895
+ */
1275
1896
  <E, B, E2, R2>(predicate: Predicate<MicroCause<NoInfer<E>>>, f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A | B, E | E2, R | R2>;
1897
+ /**
1898
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
1899
+ * using the provided predicate to determine if the failure should be caught.
1900
+ *
1901
+ * @since 3.4.6
1902
+ * @experimental
1903
+ * @category error handling
1904
+ */
1276
1905
  <A, E, R, B, E2, R2, EB extends MicroCause<E>>(self: Micro<A, E, R>, refinement: Refinement<MicroCause<E>, EB>, f: (cause: EB) => Micro<B, E2, R2>): Micro<A | B, Exclude<E, MicroCause.Error<EB>> | E2, R | R2>;
1906
+ /**
1907
+ * Selectively catch a `MicroCause` object of the given `Micro` effect,
1908
+ * using the provided predicate to determine if the failure should be caught.
1909
+ *
1910
+ * @since 3.4.6
1911
+ * @experimental
1912
+ * @category error handling
1913
+ */
1277
1914
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, predicate: Predicate<MicroCause<NoInfer<E>>>, f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): Micro<A | B, E | E2, R | R2>;
1278
1915
  };
1279
1916
  /**
@@ -1286,7 +1923,25 @@ export declare const catchCauseIf: {
1286
1923
  * @category error handling
1287
1924
  */
1288
1925
  export declare const catchAll: {
1926
+ /**
1927
+ * Catch the error of the given `Micro` effect, allowing you to recover from it.
1928
+ *
1929
+ * It only catches expected (`MicroCause.Fail`) errors.
1930
+ *
1931
+ * @since 3.4.6
1932
+ * @experimental
1933
+ * @category error handling
1934
+ */
1289
1935
  <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>;
1936
+ /**
1937
+ * Catch the error of the given `Micro` effect, allowing you to recover from it.
1938
+ *
1939
+ * It only catches expected (`MicroCause.Fail`) errors.
1940
+ *
1941
+ * @since 3.4.6
1942
+ * @experimental
1943
+ * @category error handling
1944
+ */
1290
1945
  <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>;
1291
1946
  };
1292
1947
  /**
@@ -1297,7 +1952,21 @@ export declare const catchAll: {
1297
1952
  * @category error handling
1298
1953
  */
1299
1954
  export declare const catchAllDefect: {
1955
+ /**
1956
+ * Catch any unexpected errors of the given `Micro` effect, allowing you to recover from them.
1957
+ *
1958
+ * @since 3.4.6
1959
+ * @experimental
1960
+ * @category error handling
1961
+ */
1300
1962
  <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>;
1963
+ /**
1964
+ * Catch any unexpected errors of the given `Micro` effect, allowing you to recover from them.
1965
+ *
1966
+ * @since 3.4.6
1967
+ * @experimental
1968
+ * @category error handling
1969
+ */
1301
1970
  <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>;
1302
1971
  };
1303
1972
  /**
@@ -1308,7 +1977,21 @@ export declare const catchAllDefect: {
1308
1977
  * @category error handling
1309
1978
  */
1310
1979
  export declare const tapErrorCause: {
1980
+ /**
1981
+ * Perform a side effect using the full `MicroCause` object of the given `Micro`.
1982
+ *
1983
+ * @since 3.4.6
1984
+ * @experimental
1985
+ * @category error handling
1986
+ */
1311
1987
  <E, B, E2, R2>(f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>;
1988
+ /**
1989
+ * Perform a side effect using the full `MicroCause` object of the given `Micro`.
1990
+ *
1991
+ * @since 3.4.6
1992
+ * @experimental
1993
+ * @category error handling
1994
+ */
1312
1995
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (cause: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>;
1313
1996
  };
1314
1997
  /**
@@ -1320,9 +2003,41 @@ export declare const tapErrorCause: {
1320
2003
  * @category error handling
1321
2004
  */
1322
2005
  export declare const tapErrorCauseIf: {
2006
+ /**
2007
+ * Perform a side effect using if a `MicroCause` object matches the specified
2008
+ * predicate.
2009
+ *
2010
+ * @since 3.4.0
2011
+ * @experimental
2012
+ * @category error handling
2013
+ */
1323
2014
  <E, B, E2, R2, EB extends MicroCause<E>>(refinement: Refinement<MicroCause<E>, EB>, f: (a: EB) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>;
2015
+ /**
2016
+ * Perform a side effect using if a `MicroCause` object matches the specified
2017
+ * predicate.
2018
+ *
2019
+ * @since 3.4.0
2020
+ * @experimental
2021
+ * @category error handling
2022
+ */
1324
2023
  <E, B, E2, R2>(predicate: (cause: NoInfer<MicroCause<E>>) => boolean, f: (a: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>;
2024
+ /**
2025
+ * Perform a side effect using if a `MicroCause` object matches the specified
2026
+ * predicate.
2027
+ *
2028
+ * @since 3.4.0
2029
+ * @experimental
2030
+ * @category error handling
2031
+ */
1325
2032
  <A, E, R, B, E2, R2, EB extends MicroCause<E>>(self: Micro<A, E, R>, refinement: Refinement<MicroCause<E>, EB>, f: (a: EB) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>;
2033
+ /**
2034
+ * Perform a side effect using if a `MicroCause` object matches the specified
2035
+ * predicate.
2036
+ *
2037
+ * @since 3.4.0
2038
+ * @experimental
2039
+ * @category error handling
2040
+ */
1326
2041
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, predicate: (cause: NoInfer<MicroCause<E>>) => boolean, f: (a: NoInfer<MicroCause<E>>) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>;
1327
2042
  };
1328
2043
  /**
@@ -1333,7 +2048,21 @@ export declare const tapErrorCauseIf: {
1333
2048
  * @category error handling
1334
2049
  */
1335
2050
  export declare const tapError: {
2051
+ /**
2052
+ * Perform a side effect from expected errors of the given `Micro`.
2053
+ *
2054
+ * @since 3.4.6
2055
+ * @experimental
2056
+ * @category error handling
2057
+ */
1336
2058
  <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>;
2059
+ /**
2060
+ * Perform a side effect from expected errors of the given `Micro`.
2061
+ *
2062
+ * @since 3.4.6
2063
+ * @experimental
2064
+ * @category error handling
2065
+ */
1337
2066
  <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>;
1338
2067
  };
1339
2068
  /**
@@ -1344,7 +2073,21 @@ export declare const tapError: {
1344
2073
  * @category error handling
1345
2074
  */
1346
2075
  export declare const tapDefect: {
2076
+ /**
2077
+ * Perform a side effect from unexpected errors of the given `Micro`.
2078
+ *
2079
+ * @since 3.4.6
2080
+ * @experimental
2081
+ * @category error handling
2082
+ */
1347
2083
  <E, B, E2, R2>(f: (defect: unknown) => Micro<B, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E | E2, R | R2>;
2084
+ /**
2085
+ * Perform a side effect from unexpected errors of the given `Micro`.
2086
+ *
2087
+ * @since 3.4.6
2088
+ * @experimental
2089
+ * @category error handling
2090
+ */
1348
2091
  <A, E, R, B, E2, R2>(self: Micro<A, E, R>, f: (defect: unknown) => Micro<B, E2, R2>): Micro<A, E | E2, R | R2>;
1349
2092
  };
1350
2093
  /**
@@ -1355,9 +2098,37 @@ export declare const tapDefect: {
1355
2098
  * @category error handling
1356
2099
  */
1357
2100
  export declare const catchIf: {
2101
+ /**
2102
+ * Catch any expected errors that match the specified predicate.
2103
+ *
2104
+ * @since 3.4.0
2105
+ * @experimental
2106
+ * @category error handling
2107
+ */
1358
2108
  <E, EB extends E, A2, E2, R2>(refinement: Refinement<NoInfer<E>, EB>, f: (e: EB) => Micro<A2, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A2 | A, E2 | Exclude<E, EB>, R2 | R>;
2109
+ /**
2110
+ * Catch any expected errors that match the specified predicate.
2111
+ *
2112
+ * @since 3.4.0
2113
+ * @experimental
2114
+ * @category error handling
2115
+ */
1359
2116
  <E, A2, E2, R2>(predicate: Predicate<NoInfer<E>>, f: (e: NoInfer<E>) => Micro<A2, E2, R2>): <A, R>(self: Micro<A, E, R>) => Micro<A2 | A, E | E2, R2 | R>;
2117
+ /**
2118
+ * Catch any expected errors that match the specified predicate.
2119
+ *
2120
+ * @since 3.4.0
2121
+ * @experimental
2122
+ * @category error handling
2123
+ */
1360
2124
  <A, E, R, EB extends E, A2, E2, R2>(self: Micro<A, E, R>, refinement: Refinement<E, EB>, f: (e: EB) => Micro<A2, E2, R2>): Micro<A | A2, E2 | Exclude<E, EB>, R | R2>;
2125
+ /**
2126
+ * Catch any expected errors that match the specified predicate.
2127
+ *
2128
+ * @since 3.4.0
2129
+ * @experimental
2130
+ * @category error handling
2131
+ */
1361
2132
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, predicate: Predicate<E>, f: (e: E) => Micro<A2, E2, R2>): Micro<A | A2, E | E2, R | R2>;
1362
2133
  };
1363
2134
  /**
@@ -1368,6 +2139,13 @@ export declare const catchIf: {
1368
2139
  * @category error handling
1369
2140
  */
1370
2141
  export declare const catchTag: {
2142
+ /**
2143
+ * Recovers from the specified tagged error.
2144
+ *
2145
+ * @since 3.4.0
2146
+ * @experimental
2147
+ * @category error handling
2148
+ */
1371
2149
  <K extends E extends {
1372
2150
  _tag: string;
1373
2151
  } ? E["_tag"] : never, E, A1, E1, R1>(k: K, f: (e: Extract<E, {
@@ -1375,6 +2153,13 @@ export declare const catchTag: {
1375
2153
  }>) => Micro<A1, E1, R1>): <A, R>(self: Micro<A, E, R>) => Micro<A1 | A, E1 | Exclude<E, {
1376
2154
  _tag: K;
1377
2155
  }>, R1 | R>;
2156
+ /**
2157
+ * Recovers from the specified tagged error.
2158
+ *
2159
+ * @since 3.4.0
2160
+ * @experimental
2161
+ * @category error handling
2162
+ */
1378
2163
  <A, E, R, K extends E extends {
1379
2164
  _tag: string;
1380
2165
  } ? E["_tag"] : never, R1, E1, A1>(self: Micro<A, E, R>, k: K, f: (e: Extract<E, {
@@ -1391,7 +2176,21 @@ export declare const catchTag: {
1391
2176
  * @category error handling
1392
2177
  */
1393
2178
  export declare const mapErrorCause: {
2179
+ /**
2180
+ * Transform the full `MicroCause` object of the given `Micro` effect.
2181
+ *
2182
+ * @since 3.4.6
2183
+ * @experimental
2184
+ * @category error handling
2185
+ */
1394
2186
  <E, E2>(f: (e: MicroCause<E>) => MicroCause<E2>): <A, R>(self: Micro<A, E, R>) => Micro<A, E2, R>;
2187
+ /**
2188
+ * Transform the full `MicroCause` object of the given `Micro` effect.
2189
+ *
2190
+ * @since 3.4.6
2191
+ * @experimental
2192
+ * @category error handling
2193
+ */
1395
2194
  <A, E, R, E2>(self: Micro<A, E, R>, f: (e: MicroCause<E>) => MicroCause<E2>): Micro<A, E2, R>;
1396
2195
  };
1397
2196
  /**
@@ -1402,7 +2201,21 @@ export declare const mapErrorCause: {
1402
2201
  * @category error handling
1403
2202
  */
1404
2203
  export declare const mapError: {
2204
+ /**
2205
+ * Transform any expected errors of the given `Micro` effect.
2206
+ *
2207
+ * @since 3.4.0
2208
+ * @experimental
2209
+ * @category error handling
2210
+ */
1405
2211
  <E, E2>(f: (e: E) => E2): <A, R>(self: Micro<A, E, R>) => Micro<A, E2, R>;
2212
+ /**
2213
+ * Transform any expected errors of the given `Micro` effect.
2214
+ *
2215
+ * @since 3.4.0
2216
+ * @experimental
2217
+ * @category error handling
2218
+ */
1406
2219
  <A, E, R, E2>(self: Micro<A, E, R>, f: (e: E) => E2): Micro<A, E2, R>;
1407
2220
  };
1408
2221
  /**
@@ -1422,7 +2235,21 @@ export declare const orDie: <A, E, R>(self: Micro<A, E, R>) => Micro<A, never, R
1422
2235
  * @category error handling
1423
2236
  */
1424
2237
  export declare const orElseSucceed: {
2238
+ /**
2239
+ * Recover from all errors by succeeding with the given value.
2240
+ *
2241
+ * @since 3.4.0
2242
+ * @experimental
2243
+ * @category error handling
2244
+ */
1425
2245
  <B>(f: LazyArg<B>): <A, E, R>(self: Micro<A, E, R>) => Micro<A | B, never, R>;
2246
+ /**
2247
+ * Recover from all errors by succeeding with the given value.
2248
+ *
2249
+ * @since 3.4.0
2250
+ * @experimental
2251
+ * @category error handling
2252
+ */
1426
2253
  <A, E, R, B>(self: Micro<A, E, R>, f: LazyArg<B>): Micro<A | B, never, R>;
1427
2254
  };
1428
2255
  /**
@@ -1469,11 +2296,25 @@ export declare const either: <A, E, R>(self: Micro<A, E, R>) => Micro<Either.Eit
1469
2296
  * @category error handling
1470
2297
  */
1471
2298
  export declare const retry: {
2299
+ /**
2300
+ * Retry the given `Micro` effect using the provided options.
2301
+ *
2302
+ * @since 3.4.0
2303
+ * @experimental
2304
+ * @category error handling
2305
+ */
1472
2306
  <A, E>(options?: {
1473
2307
  while?: Predicate<E> | undefined;
1474
2308
  times?: number | undefined;
1475
2309
  schedule?: MicroSchedule | undefined;
1476
2310
  } | undefined): <R>(self: Micro<A, E, R>) => Micro<A, E, R>;
2311
+ /**
2312
+ * Retry the given `Micro` effect using the provided options.
2313
+ *
2314
+ * @since 3.4.0
2315
+ * @experimental
2316
+ * @category error handling
2317
+ */
1477
2318
  <A, E, R>(self: Micro<A, E, R>, options?: {
1478
2319
  while?: Predicate<E> | undefined;
1479
2320
  times?: number | undefined;
@@ -1489,7 +2330,23 @@ export declare const retry: {
1489
2330
  * @category error handling
1490
2331
  */
1491
2332
  export declare const withTrace: {
2333
+ /**
2334
+ * Add a stack trace to any failures that occur in the effect. The trace will be
2335
+ * added to the `traces` field of the `MicroCause` object.
2336
+ *
2337
+ * @since 3.4.0
2338
+ * @experimental
2339
+ * @category error handling
2340
+ */
1492
2341
  (name: string): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>;
2342
+ /**
2343
+ * Add a stack trace to any failures that occur in the effect. The trace will be
2344
+ * added to the `traces` field of the `MicroCause` object.
2345
+ *
2346
+ * @since 3.4.0
2347
+ * @experimental
2348
+ * @category error handling
2349
+ */
1493
2350
  <A, E, R>(self: Micro<A, E, R>, name: string): Micro<A, E, R>;
1494
2351
  };
1495
2352
  /**
@@ -1498,10 +2355,20 @@ export declare const withTrace: {
1498
2355
  * @category pattern matching
1499
2356
  */
1500
2357
  export declare const matchCauseEffect: {
2358
+ /**
2359
+ * @since 3.4.6
2360
+ * @experimental
2361
+ * @category pattern matching
2362
+ */
1501
2363
  <E, A2, E2, R2, A, A3, E3, R3>(options: {
1502
2364
  readonly onFailure: (cause: MicroCause<E>) => Micro<A2, E2, R2>;
1503
2365
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>;
1504
2366
  }): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, E2 | E3, R2 | R3 | R>;
2367
+ /**
2368
+ * @since 3.4.6
2369
+ * @experimental
2370
+ * @category pattern matching
2371
+ */
1505
2372
  <A, E, R, A2, E2, R2, A3, E3, R3>(self: Micro<A, E, R>, options: {
1506
2373
  readonly onFailure: (cause: MicroCause<E>) => Micro<A2, E2, R2>;
1507
2374
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>;
@@ -1513,10 +2380,20 @@ export declare const matchCauseEffect: {
1513
2380
  * @category pattern matching
1514
2381
  */
1515
2382
  export declare const matchCause: {
2383
+ /**
2384
+ * @since 3.4.6
2385
+ * @experimental
2386
+ * @category pattern matching
2387
+ */
1516
2388
  <E, A2, A, A3>(options: {
1517
2389
  readonly onFailure: (cause: MicroCause<E>) => A2;
1518
2390
  readonly onSuccess: (a: A) => A3;
1519
2391
  }): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, never, R>;
2392
+ /**
2393
+ * @since 3.4.6
2394
+ * @experimental
2395
+ * @category pattern matching
2396
+ */
1520
2397
  <A, E, R, A2, A3>(self: Micro<A, E, R>, options: {
1521
2398
  readonly onFailure: (cause: MicroCause<E>) => A2;
1522
2399
  readonly onSuccess: (a: A) => A3;
@@ -1528,10 +2405,20 @@ export declare const matchCause: {
1528
2405
  * @category pattern matching
1529
2406
  */
1530
2407
  export declare const matchEffect: {
2408
+ /**
2409
+ * @since 3.4.6
2410
+ * @experimental
2411
+ * @category pattern matching
2412
+ */
1531
2413
  <E, A2, E2, R2, A, A3, E3, R3>(options: {
1532
2414
  readonly onFailure: (e: E) => Micro<A2, E2, R2>;
1533
2415
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>;
1534
2416
  }): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, E2 | E3, R2 | R3 | R>;
2417
+ /**
2418
+ * @since 3.4.6
2419
+ * @experimental
2420
+ * @category pattern matching
2421
+ */
1535
2422
  <A, E, R, A2, E2, R2, A3, E3, R3>(self: Micro<A, E, R>, options: {
1536
2423
  readonly onFailure: (e: E) => Micro<A2, E2, R2>;
1537
2424
  readonly onSuccess: (a: A) => Micro<A3, E3, R3>;
@@ -1543,10 +2430,20 @@ export declare const matchEffect: {
1543
2430
  * @category pattern matching
1544
2431
  */
1545
2432
  export declare const match: {
2433
+ /**
2434
+ * @since 3.4.0
2435
+ * @experimental
2436
+ * @category pattern matching
2437
+ */
1546
2438
  <E, A2, A, A3>(options: {
1547
2439
  readonly onFailure: (error: E) => A2;
1548
2440
  readonly onSuccess: (value: A) => A3;
1549
2441
  }): <R>(self: Micro<A, E, R>) => Micro<A2 | A3, never, R>;
2442
+ /**
2443
+ * @since 3.4.0
2444
+ * @experimental
2445
+ * @category pattern matching
2446
+ */
1550
2447
  <A, E, R, A2, A3>(self: Micro<A, E, R>, options: {
1551
2448
  readonly onFailure: (error: E) => A2;
1552
2449
  readonly onSuccess: (value: A) => A3;
@@ -1569,7 +2466,23 @@ export declare const sleep: (millis: number) => Micro<void>;
1569
2466
  * @category delays & timeouts
1570
2467
  */
1571
2468
  export declare const delay: {
2469
+ /**
2470
+ * Returns an effect that will delay the execution of this effect by the
2471
+ * specified duration.
2472
+ *
2473
+ * @since 3.4.0
2474
+ * @experimental
2475
+ * @category delays & timeouts
2476
+ */
1572
2477
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, R>;
2478
+ /**
2479
+ * Returns an effect that will delay the execution of this effect by the
2480
+ * specified duration.
2481
+ *
2482
+ * @since 3.4.0
2483
+ * @experimental
2484
+ * @category delays & timeouts
2485
+ */
1573
2486
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<A, E, R>;
1574
2487
  };
1575
2488
  /**
@@ -1583,10 +2496,30 @@ export declare const delay: {
1583
2496
  * @category delays & timeouts
1584
2497
  */
1585
2498
  export declare const timeoutOrElse: {
2499
+ /**
2500
+ * Returns an effect that will timeout this effect, that will execute the
2501
+ * fallback effect if the timeout elapses before the effect has produced a value.
2502
+ *
2503
+ * If the timeout elapses, the running effect will be safely interrupted.
2504
+ *
2505
+ * @since 3.4.0
2506
+ * @experimental
2507
+ * @category delays & timeouts
2508
+ */
1586
2509
  <A2, E2, R2>(options: {
1587
2510
  readonly duration: number;
1588
2511
  readonly onTimeout: LazyArg<Micro<A2, E2, R2>>;
1589
2512
  }): <A, E, R>(self: Micro<A, E, R>) => Micro<A | A2, E | E2, R | R2>;
2513
+ /**
2514
+ * Returns an effect that will timeout this effect, that will execute the
2515
+ * fallback effect if the timeout elapses before the effect has produced a value.
2516
+ *
2517
+ * If the timeout elapses, the running effect will be safely interrupted.
2518
+ *
2519
+ * @since 3.4.0
2520
+ * @experimental
2521
+ * @category delays & timeouts
2522
+ */
1590
2523
  <A, E, R, A2, E2, R2>(self: Micro<A, E, R>, options: {
1591
2524
  readonly duration: number;
1592
2525
  readonly onTimeout: LazyArg<Micro<A2, E2, R2>>;
@@ -1604,7 +2537,29 @@ export declare const timeoutOrElse: {
1604
2537
  * @category delays & timeouts
1605
2538
  */
1606
2539
  export declare const timeout: {
2540
+ /**
2541
+ * Returns an effect that will timeout this effect, that will fail with a
2542
+ * `TimeoutException` if the timeout elapses before the effect has produced a
2543
+ * value.
2544
+ *
2545
+ * If the timeout elapses, the running effect will be safely interrupted.
2546
+ *
2547
+ * @since 3.4.0
2548
+ * @experimental
2549
+ * @category delays & timeouts
2550
+ */
1607
2551
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | TimeoutException, R>;
2552
+ /**
2553
+ * Returns an effect that will timeout this effect, that will fail with a
2554
+ * `TimeoutException` if the timeout elapses before the effect has produced a
2555
+ * value.
2556
+ *
2557
+ * If the timeout elapses, the running effect will be safely interrupted.
2558
+ *
2559
+ * @since 3.4.0
2560
+ * @experimental
2561
+ * @category delays & timeouts
2562
+ */
1608
2563
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<A, E | TimeoutException, R>;
1609
2564
  };
1610
2565
  /**
@@ -1619,7 +2574,29 @@ export declare const timeout: {
1619
2574
  * @category delays & timeouts
1620
2575
  */
1621
2576
  export declare const timeoutOption: {
2577
+ /**
2578
+ * Returns an effect that will timeout this effect, succeeding with a `None`
2579
+ * if the timeout elapses before the effect has produced a value; and `Some` of
2580
+ * the produced value otherwise.
2581
+ *
2582
+ * If the timeout elapses, the running effect will be safely interrupted.
2583
+ *
2584
+ * @since 3.4.0
2585
+ * @experimental
2586
+ * @category delays & timeouts
2587
+ */
1622
2588
  (millis: number): <A, E, R>(self: Micro<A, E, R>) => Micro<Option.Option<A>, E, R>;
2589
+ /**
2590
+ * Returns an effect that will timeout this effect, succeeding with a `None`
2591
+ * if the timeout elapses before the effect has produced a value; and `Some` of
2592
+ * the produced value otherwise.
2593
+ *
2594
+ * If the timeout elapses, the running effect will be safely interrupted.
2595
+ *
2596
+ * @since 3.4.0
2597
+ * @experimental
2598
+ * @category delays & timeouts
2599
+ */
1623
2600
  <A, E, R>(self: Micro<A, E, R>, millis: number): Micro<Option.Option<A>, E, R>;
1624
2601
  };
1625
2602
  /**
@@ -1693,7 +2670,21 @@ export declare const scope: Micro<MicroScope, never, MicroScope>;
1693
2670
  * @category resources & finalization
1694
2671
  */
1695
2672
  export declare const provideScope: {
2673
+ /**
2674
+ * Provide a `MicroScope` to an effect.
2675
+ *
2676
+ * @since 3.4.0
2677
+ * @experimental
2678
+ * @category resources & finalization
2679
+ */
1696
2680
  (scope: MicroScope): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E, Exclude<R, MicroScope>>;
2681
+ /**
2682
+ * Provide a `MicroScope` to an effect.
2683
+ *
2684
+ * @since 3.4.0
2685
+ * @experimental
2686
+ * @category resources & finalization
2687
+ */
1697
2688
  <A, E, R>(self: Micro<A, E, R>, scope: MicroScope): Micro<A, E, Exclude<R, MicroScope>>;
1698
2689
  };
1699
2690
  /**
@@ -1731,7 +2722,23 @@ export declare const addFinalizer: (finalizer: (exit: MicroExit<unknown, unknown
1731
2722
  * @category resources & finalization
1732
2723
  */
1733
2724
  export declare const onExit: {
2725
+ /**
2726
+ * When the `Micro` effect is completed, run the given finalizer effect with the
2727
+ * `MicroExit` of the executed effect.
2728
+ *
2729
+ * @since 3.4.6
2730
+ * @experimental
2731
+ * @category resources & finalization
2732
+ */
1734
2733
  <A, E, XE, XR>(f: (exit: MicroExit<A, E>) => Micro<void, XE, XR>): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2734
+ /**
2735
+ * When the `Micro` effect is completed, run the given finalizer effect with the
2736
+ * `MicroExit` of the executed effect.
2737
+ *
2738
+ * @since 3.4.6
2739
+ * @experimental
2740
+ * @category resources & finalization
2741
+ */
1735
2742
  <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>;
1736
2743
  };
1737
2744
  /**
@@ -1743,9 +2750,41 @@ export declare const onExit: {
1743
2750
  * @category resources & finalization
1744
2751
  */
1745
2752
  export declare const onExitIf: {
2753
+ /**
2754
+ * When the `Micro` effect is completed, run the given finalizer effect if it
2755
+ * matches the specified predicate.
2756
+ *
2757
+ * @since 3.4.6
2758
+ * @experimental
2759
+ * @category resources & finalization
2760
+ */
1746
2761
  <A, E, XE, XR, B extends MicroExit<A, E>>(refinement: Refinement<MicroExit<A, E>, B>, f: (exit: B) => Micro<void, XE, XR>): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2762
+ /**
2763
+ * When the `Micro` effect is completed, run the given finalizer effect if it
2764
+ * matches the specified predicate.
2765
+ *
2766
+ * @since 3.4.6
2767
+ * @experimental
2768
+ * @category resources & finalization
2769
+ */
1747
2770
  <A, E, XE, XR>(predicate: Predicate<MicroExit<NoInfer<A>, NoInfer<E>>>, f: (exit: MicroExit<NoInfer<A>, NoInfer<E>>) => Micro<void, XE, XR>): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2771
+ /**
2772
+ * When the `Micro` effect is completed, run the given finalizer effect if it
2773
+ * matches the specified predicate.
2774
+ *
2775
+ * @since 3.4.6
2776
+ * @experimental
2777
+ * @category resources & finalization
2778
+ */
1748
2779
  <A, E, R, XE, XR, B extends MicroExit<A, E>>(self: Micro<A, E, R>, refinement: Refinement<MicroExit<A, E>, B>, f: (exit: B) => Micro<void, XE, XR>): Micro<A, E | XE, R | XR>;
2780
+ /**
2781
+ * When the `Micro` effect is completed, run the given finalizer effect if it
2782
+ * matches the specified predicate.
2783
+ *
2784
+ * @since 3.4.6
2785
+ * @experimental
2786
+ * @category resources & finalization
2787
+ */
1749
2788
  <A, E, R, XE, XR>(self: Micro<A, E, R>, predicate: Predicate<MicroExit<NoInfer<A>, NoInfer<E>>>, f: (exit: MicroExit<NoInfer<A>, NoInfer<E>>) => Micro<void, XE, XR>): Micro<A, E | XE, R | XR>;
1750
2789
  };
1751
2790
  /**
@@ -1756,7 +2795,21 @@ export declare const onExitIf: {
1756
2795
  * @category resources & finalization
1757
2796
  */
1758
2797
  export declare const ensuring: {
2798
+ /**
2799
+ * Regardless of the result of the this `Micro` effect, run the finalizer effect.
2800
+ *
2801
+ * @since 3.4.0
2802
+ * @experimental
2803
+ * @category resources & finalization
2804
+ */
1759
2805
  <XE, XR>(finalizer: Micro<void, XE, XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2806
+ /**
2807
+ * Regardless of the result of the this `Micro` effect, run the finalizer effect.
2808
+ *
2809
+ * @since 3.4.0
2810
+ * @experimental
2811
+ * @category resources & finalization
2812
+ */
1760
2813
  <A, E, R, XE, XR>(self: Micro<A, E, R>, finalizer: Micro<void, XE, XR>): Micro<A, E | XE, R | XR>;
1761
2814
  };
1762
2815
  /**
@@ -1768,7 +2821,23 @@ export declare const ensuring: {
1768
2821
  * @category resources & finalization
1769
2822
  */
1770
2823
  export declare const onError: {
2824
+ /**
2825
+ * When the `Micro` effect fails, run the given finalizer effect with the
2826
+ * `MicroCause` of the executed effect.
2827
+ *
2828
+ * @since 3.4.6
2829
+ * @experimental
2830
+ * @category resources & finalization
2831
+ */
1771
2832
  <A, E, XE, XR>(f: (cause: MicroCause<NoInfer<E>>) => Micro<void, XE, XR>): <R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2833
+ /**
2834
+ * When the `Micro` effect fails, run the given finalizer effect with the
2835
+ * `MicroCause` of the executed effect.
2836
+ *
2837
+ * @since 3.4.6
2838
+ * @experimental
2839
+ * @category resources & finalization
2840
+ */
1772
2841
  <A, E, R, XE, XR>(self: Micro<A, E, R>, f: (cause: MicroCause<NoInfer<E>>) => Micro<void, XE, XR>): Micro<A, E | XE, R | XR>;
1773
2842
  };
1774
2843
  /**
@@ -1779,7 +2848,21 @@ export declare const onError: {
1779
2848
  * @category resources & finalization
1780
2849
  */
1781
2850
  export declare const onInterrupt: {
2851
+ /**
2852
+ * If this `Micro` effect is aborted, run the finalizer effect.
2853
+ *
2854
+ * @since 3.4.6
2855
+ * @experimental
2856
+ * @category resources & finalization
2857
+ */
1782
2858
  <XE, XR>(finalizer: Micro<void, XE, XR>): <A, E, R>(self: Micro<A, E, R>) => Micro<A, E | XE, R | XR>;
2859
+ /**
2860
+ * If this `Micro` effect is aborted, run the finalizer effect.
2861
+ *
2862
+ * @since 3.4.6
2863
+ * @experimental
2864
+ * @category resources & finalization
2865
+ */
1783
2866
  <A, E, R, XE, XR>(self: Micro<A, E, R>, finalizer: Micro<void, XE, XR>): Micro<A, E | XE, R | XR>;
1784
2867
  };
1785
2868
  /**
@@ -1913,10 +2996,36 @@ export declare const all: <const Arg extends Iterable<Micro<any, any, any>> | Re
1913
2996
  * @category collecting & elements
1914
2997
  */
1915
2998
  export declare const forEach: {
2999
+ /**
3000
+ * For each element of the provided iterable, run the effect and collect the results.
3001
+ *
3002
+ * If the `discard` option is set to `true`, the results will be discarded and
3003
+ * the effect will return `void`.
3004
+ *
3005
+ * The `concurrency` option can be set to control how many effects are run in
3006
+ * parallel. By default, the effects are run sequentially.
3007
+ *
3008
+ * @since 3.4.0
3009
+ * @experimental
3010
+ * @category collecting & elements
3011
+ */
1916
3012
  <A, B, E, R>(iterable: Iterable<A>, f: (a: A, index: number) => Micro<B, E, R>, options?: {
1917
3013
  readonly concurrency?: Concurrency | undefined;
1918
3014
  readonly discard?: false | undefined;
1919
3015
  }): Micro<Array<B>, E, R>;
3016
+ /**
3017
+ * For each element of the provided iterable, run the effect and collect the results.
3018
+ *
3019
+ * If the `discard` option is set to `true`, the results will be discarded and
3020
+ * the effect will return `void`.
3021
+ *
3022
+ * The `concurrency` option can be set to control how many effects are run in
3023
+ * parallel. By default, the effects are run sequentially.
3024
+ *
3025
+ * @since 3.4.0
3026
+ * @experimental
3027
+ * @category collecting & elements
3028
+ */
1920
3029
  <A, B, E, R>(iterable: Iterable<A>, f: (a: A, index: number) => Micro<B, E, R>, options: {
1921
3030
  readonly concurrency?: Concurrency | undefined;
1922
3031
  readonly discard: true;
@@ -1963,9 +3072,23 @@ export declare const Do: Micro<{}>;
1963
3072
  * @category do notation
1964
3073
  */
1965
3074
  export declare const bindTo: {
3075
+ /**
3076
+ * Bind the success value of this `Micro` effect to the provided name.
3077
+ *
3078
+ * @since 3.4.0
3079
+ * @experimental
3080
+ * @category do notation
3081
+ */
1966
3082
  <N extends string>(name: N): <A, E, R>(self: Micro<A, E, R>) => Micro<{
1967
3083
  [K in N]: A;
1968
3084
  }, E, R>;
3085
+ /**
3086
+ * Bind the success value of this `Micro` effect to the provided name.
3087
+ *
3088
+ * @since 3.4.0
3089
+ * @experimental
3090
+ * @category do notation
3091
+ */
1969
3092
  <A, E, R, N extends string>(self: Micro<A, E, R>, name: N): Micro<{
1970
3093
  [K in N]: A;
1971
3094
  }, E, R>;
@@ -1978,9 +3101,23 @@ export declare const bindTo: {
1978
3101
  * @category do notation
1979
3102
  */
1980
3103
  export declare const bind: {
3104
+ /**
3105
+ * Bind the success value of this `Micro` effect to the provided name.
3106
+ *
3107
+ * @since 3.4.0
3108
+ * @experimental
3109
+ * @category do notation
3110
+ */
1981
3111
  <N extends string, A extends Record<string, any>, B, E2, R2>(name: N, f: (a: A) => Micro<B, E2, R2>): <E, R>(self: Micro<A, E, R>) => Micro<Simplify<Omit<A, N> & {
1982
3112
  [K in N]: B;
1983
3113
  }>, E | E2, R | R2>;
3114
+ /**
3115
+ * Bind the success value of this `Micro` effect to the provided name.
3116
+ *
3117
+ * @since 3.4.0
3118
+ * @experimental
3119
+ * @category do notation
3120
+ */
1984
3121
  <A extends Record<string, any>, E, R, B, E2, R2, N extends string>(self: Micro<A, E, R>, name: N, f: (a: A) => Micro<B, E2, R2>): Micro<Simplify<Omit<A, N> & {
1985
3122
  [K in N]: B;
1986
3123
  }>, E | E2, R | R2>;
@@ -2019,7 +3156,7 @@ export type HandleTypeId = typeof HandleTypeId;
2019
3156
  * @experimental
2020
3157
  * @category handle & forking
2021
3158
  */
2022
- export interface Handle<A, E = never> {
3159
+ export interface Handle<A, E = never> extends Micro<A, E> {
2023
3160
  readonly [HandleTypeId]: HandleTypeId;
2024
3161
  readonly await: Micro<MicroExit<A, E>>;
2025
3162
  readonly join: Micro<A, E>;
@@ -2028,6 +3165,27 @@ export interface Handle<A, E = never> {
2028
3165
  readonly addObserver: (observer: (exit: MicroExit<A, E>) => void) => void;
2029
3166
  readonly removeObserver: (observer: (exit: MicroExit<A, E>) => void) => void;
2030
3167
  readonly unsafePoll: () => MicroExit<A, E> | null;
3168
+ [Unify.typeSymbol]?: unknown;
3169
+ [Unify.unifySymbol]?: HandleUnify<this>;
3170
+ [Unify.ignoreSymbol]?: HandleUnifyIgnore;
3171
+ }
3172
+ /**
3173
+ * @category models
3174
+ * @since 3.8.4
3175
+ * @experimental
3176
+ */
3177
+ export interface HandleUnify<A extends {
3178
+ [Unify.typeSymbol]?: any;
3179
+ }> extends MicroUnify<A> {
3180
+ Handle?: () => A[Unify.typeSymbol] extends Handle<infer A0, infer E0> | infer _ ? Handle<A0, E0> : never;
3181
+ }
3182
+ /**
3183
+ * @category models
3184
+ * @since 3.8.4
3185
+ * @experimental
3186
+ */
3187
+ export interface HandleUnifyIgnore extends MicroUnifyIgnore {
3188
+ Micro?: true;
2031
3189
  }
2032
3190
  /**
2033
3191
  * @since 3.4.0
@@ -2068,7 +3226,27 @@ export declare const forkDaemon: <A, E, R>(self: Micro<A, E, R>) => Micro<Handle
2068
3226
  * @category handle & forking
2069
3227
  */
2070
3228
  export declare const forkIn: {
3229
+ /**
3230
+ * Run the `Micro` effect in a new `Handle` that can be awaited, joined, or
3231
+ * aborted.
3232
+ *
3233
+ * The lifetime of the handle will be attached to the provided `MicroScope`.
3234
+ *
3235
+ * @since 3.4.0
3236
+ * @experimental
3237
+ * @category handle & forking
3238
+ */
2071
3239
  (scope: MicroScope): <A, E, R>(self: Micro<A, E, R>) => Micro<Handle<A, E>, never, R>;
3240
+ /**
3241
+ * Run the `Micro` effect in a new `Handle` that can be awaited, joined, or
3242
+ * aborted.
3243
+ *
3244
+ * The lifetime of the handle will be attached to the provided `MicroScope`.
3245
+ *
3246
+ * @since 3.4.0
3247
+ * @experimental
3248
+ * @category handle & forking
3249
+ */
2072
3250
  <A, E, R>(self: Micro<A, E, R>, scope: MicroScope): Micro<Handle<A, E>, never, R>;
2073
3251
  };
2074
3252
  /**