effect 4.0.0-beta.74 → 4.0.0-beta.75

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 (796) hide show
  1. package/dist/Array.d.ts +729 -611
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +273 -213
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +37 -30
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +19 -16
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +34 -40
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +16 -16
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +8 -8
  14. package/dist/Boolean.js +4 -4
  15. package/dist/Brand.d.ts +13 -11
  16. package/dist/Brand.d.ts.map +1 -1
  17. package/dist/Brand.js +10 -8
  18. package/dist/Brand.js.map +1 -1
  19. package/dist/Cause.d.ts +21 -23
  20. package/dist/Cause.d.ts.map +1 -1
  21. package/dist/Cause.js +21 -23
  22. package/dist/Cause.js.map +1 -1
  23. package/dist/Channel.d.ts +219 -9
  24. package/dist/Channel.d.ts.map +1 -1
  25. package/dist/Channel.js +83 -3
  26. package/dist/Channel.js.map +1 -1
  27. package/dist/ChannelSchema.d.ts +11 -11
  28. package/dist/ChannelSchema.js +5 -5
  29. package/dist/Chunk.d.ts +69 -16
  30. package/dist/Chunk.d.ts.map +1 -1
  31. package/dist/Chunk.js +43 -8
  32. package/dist/Chunk.js.map +1 -1
  33. package/dist/Clock.d.ts +3 -3
  34. package/dist/Clock.js +3 -3
  35. package/dist/Combiner.d.ts +9 -13
  36. package/dist/Combiner.d.ts.map +1 -1
  37. package/dist/Combiner.js +9 -13
  38. package/dist/Combiner.js.map +1 -1
  39. package/dist/Config.d.ts +49 -56
  40. package/dist/Config.d.ts.map +1 -1
  41. package/dist/Config.js +40 -43
  42. package/dist/Config.js.map +1 -1
  43. package/dist/ConfigProvider.d.ts +34 -44
  44. package/dist/ConfigProvider.d.ts.map +1 -1
  45. package/dist/ConfigProvider.js +24 -32
  46. package/dist/ConfigProvider.js.map +1 -1
  47. package/dist/Console.d.ts +2 -2
  48. package/dist/Console.js +2 -2
  49. package/dist/Context.d.ts +60 -72
  50. package/dist/Context.d.ts.map +1 -1
  51. package/dist/Context.js +28 -32
  52. package/dist/Context.js.map +1 -1
  53. package/dist/Cron.d.ts +2 -2
  54. package/dist/Cron.js +2 -2
  55. package/dist/Crypto.d.ts +4 -4
  56. package/dist/Crypto.js +4 -4
  57. package/dist/Data.d.ts +21 -15
  58. package/dist/Data.d.ts.map +1 -1
  59. package/dist/Data.js +7 -7
  60. package/dist/Data.js.map +1 -1
  61. package/dist/DateTime.d.ts +35 -16
  62. package/dist/DateTime.d.ts.map +1 -1
  63. package/dist/DateTime.js +35 -8
  64. package/dist/DateTime.js.map +1 -1
  65. package/dist/Deferred.d.ts +24 -15
  66. package/dist/Deferred.d.ts.map +1 -1
  67. package/dist/Deferred.js +8 -5
  68. package/dist/Deferred.js.map +1 -1
  69. package/dist/Duration.d.ts +44 -31
  70. package/dist/Duration.d.ts.map +1 -1
  71. package/dist/Duration.js +22 -11
  72. package/dist/Duration.js.map +1 -1
  73. package/dist/Effect.d.ts +516 -416
  74. package/dist/Effect.d.ts.map +1 -1
  75. package/dist/Effect.js +234 -174
  76. package/dist/Effect.js.map +1 -1
  77. package/dist/Encoding.d.ts +5 -0
  78. package/dist/Encoding.d.ts.map +1 -1
  79. package/dist/Encoding.js +5 -0
  80. package/dist/Encoding.js.map +1 -1
  81. package/dist/Equal.d.ts +26 -39
  82. package/dist/Equal.d.ts.map +1 -1
  83. package/dist/Equal.js +10 -17
  84. package/dist/Equal.js.map +1 -1
  85. package/dist/Equivalence.d.ts +71 -99
  86. package/dist/Equivalence.d.ts.map +1 -1
  87. package/dist/Equivalence.js +53 -73
  88. package/dist/Equivalence.js.map +1 -1
  89. package/dist/ErrorReporter.d.ts +1 -1
  90. package/dist/ErrorReporter.js +1 -1
  91. package/dist/Exit.d.ts +79 -96
  92. package/dist/Exit.d.ts.map +1 -1
  93. package/dist/Exit.js +57 -64
  94. package/dist/Exit.js.map +1 -1
  95. package/dist/Fiber.d.ts +8 -6
  96. package/dist/Fiber.d.ts.map +1 -1
  97. package/dist/Fiber.js +8 -6
  98. package/dist/Fiber.js.map +1 -1
  99. package/dist/FiberHandle.d.ts +25 -0
  100. package/dist/FiberHandle.d.ts.map +1 -1
  101. package/dist/FiberHandle.js +15 -0
  102. package/dist/FiberHandle.js.map +1 -1
  103. package/dist/FiberMap.d.ts +35 -0
  104. package/dist/FiberMap.d.ts.map +1 -1
  105. package/dist/FiberMap.js +15 -0
  106. package/dist/FiberMap.js.map +1 -1
  107. package/dist/FiberSet.d.ts +20 -0
  108. package/dist/FiberSet.d.ts.map +1 -1
  109. package/dist/FiberSet.js +10 -0
  110. package/dist/FiberSet.js.map +1 -1
  111. package/dist/Filter.d.ts +4 -4
  112. package/dist/Filter.js +4 -4
  113. package/dist/Formatter.d.ts +14 -19
  114. package/dist/Formatter.d.ts.map +1 -1
  115. package/dist/Formatter.js +14 -19
  116. package/dist/Formatter.js.map +1 -1
  117. package/dist/Function.d.ts +15 -16
  118. package/dist/Function.d.ts.map +1 -1
  119. package/dist/Function.js +9 -10
  120. package/dist/Function.js.map +1 -1
  121. package/dist/Graph.d.ts +2 -2
  122. package/dist/Graph.js +2 -2
  123. package/dist/HKT.d.ts +2 -2
  124. package/dist/Hash.d.ts +2 -1
  125. package/dist/Hash.d.ts.map +1 -1
  126. package/dist/Hash.js +2 -1
  127. package/dist/Hash.js.map +1 -1
  128. package/dist/HashMap.d.ts +15 -0
  129. package/dist/HashMap.d.ts.map +1 -1
  130. package/dist/HashMap.js +5 -0
  131. package/dist/HashMap.js.map +1 -1
  132. package/dist/HashRing.d.ts +9 -9
  133. package/dist/HashRing.js +3 -3
  134. package/dist/Iterable.d.ts +24 -12
  135. package/dist/Iterable.d.ts.map +1 -1
  136. package/dist/Iterable.js +16 -6
  137. package/dist/Iterable.js.map +1 -1
  138. package/dist/JsonPatch.d.ts +2 -3
  139. package/dist/JsonPatch.d.ts.map +1 -1
  140. package/dist/JsonPatch.js +2 -3
  141. package/dist/JsonPatch.js.map +1 -1
  142. package/dist/JsonPointer.d.ts +2 -6
  143. package/dist/JsonPointer.d.ts.map +1 -1
  144. package/dist/JsonPointer.js +2 -6
  145. package/dist/JsonPointer.js.map +1 -1
  146. package/dist/JsonSchema.d.ts +17 -13
  147. package/dist/JsonSchema.d.ts.map +1 -1
  148. package/dist/JsonSchema.js +17 -13
  149. package/dist/JsonSchema.js.map +1 -1
  150. package/dist/Latch.d.ts +4 -3
  151. package/dist/Latch.d.ts.map +1 -1
  152. package/dist/Latch.js +4 -3
  153. package/dist/Latch.js.map +1 -1
  154. package/dist/Layer.d.ts +92 -114
  155. package/dist/Layer.d.ts.map +1 -1
  156. package/dist/Layer.js +38 -46
  157. package/dist/Layer.js.map +1 -1
  158. package/dist/Logger.d.ts +11 -14
  159. package/dist/Logger.d.ts.map +1 -1
  160. package/dist/Logger.js +11 -14
  161. package/dist/Logger.js.map +1 -1
  162. package/dist/Match.d.ts +2 -2
  163. package/dist/Match.js +2 -2
  164. package/dist/Metric.d.ts +89 -109
  165. package/dist/Metric.d.ts.map +1 -1
  166. package/dist/Metric.js +51 -61
  167. package/dist/Metric.js.map +1 -1
  168. package/dist/MutableHashMap.d.ts +21 -12
  169. package/dist/MutableHashMap.d.ts.map +1 -1
  170. package/dist/MutableHashMap.js +7 -4
  171. package/dist/MutableHashMap.js.map +1 -1
  172. package/dist/MutableList.d.ts +15 -0
  173. package/dist/MutableList.d.ts.map +1 -1
  174. package/dist/MutableList.js +15 -0
  175. package/dist/MutableList.js.map +1 -1
  176. package/dist/MutableRef.d.ts +56 -42
  177. package/dist/MutableRef.d.ts.map +1 -1
  178. package/dist/MutableRef.js +28 -22
  179. package/dist/MutableRef.js.map +1 -1
  180. package/dist/Newtype.d.ts +10 -7
  181. package/dist/Newtype.d.ts.map +1 -1
  182. package/dist/Newtype.js +10 -7
  183. package/dist/Newtype.js.map +1 -1
  184. package/dist/Number.d.ts +23 -11
  185. package/dist/Number.d.ts.map +1 -1
  186. package/dist/Number.js +9 -5
  187. package/dist/Number.js.map +1 -1
  188. package/dist/Optic.d.ts +16 -16
  189. package/dist/Optic.d.ts.map +1 -1
  190. package/dist/Optic.js +10 -9
  191. package/dist/Optic.js.map +1 -1
  192. package/dist/Option.d.ts +196 -168
  193. package/dist/Option.d.ts.map +1 -1
  194. package/dist/Option.js +96 -79
  195. package/dist/Option.js.map +1 -1
  196. package/dist/Order.d.ts +118 -179
  197. package/dist/Order.d.ts.map +1 -1
  198. package/dist/Order.js +92 -144
  199. package/dist/Order.js.map +1 -1
  200. package/dist/PartitionedSemaphore.d.ts +14 -14
  201. package/dist/PartitionedSemaphore.js +6 -6
  202. package/dist/Path.d.ts +2 -2
  203. package/dist/Path.js +2 -2
  204. package/dist/Pipeable.d.ts +2 -2
  205. package/dist/Pipeable.js +2 -2
  206. package/dist/PlatformError.d.ts +4 -4
  207. package/dist/PlatformError.js +4 -4
  208. package/dist/Pool.d.ts +7 -11
  209. package/dist/Pool.d.ts.map +1 -1
  210. package/dist/Pool.js +3 -5
  211. package/dist/Pool.js.map +1 -1
  212. package/dist/Predicate.d.ts +274 -263
  213. package/dist/Predicate.d.ts.map +1 -1
  214. package/dist/Predicate.js +128 -123
  215. package/dist/Predicate.js.map +1 -1
  216. package/dist/PubSub.d.ts +24 -14
  217. package/dist/PubSub.d.ts.map +1 -1
  218. package/dist/PubSub.js +16 -6
  219. package/dist/PubSub.js.map +1 -1
  220. package/dist/Pull.d.ts +4 -4
  221. package/dist/Pull.js +4 -4
  222. package/dist/Queue.d.ts +46 -7
  223. package/dist/Queue.d.ts.map +1 -1
  224. package/dist/Queue.js +46 -7
  225. package/dist/Queue.js.map +1 -1
  226. package/dist/RcRef.d.ts +0 -4
  227. package/dist/RcRef.d.ts.map +1 -1
  228. package/dist/RcRef.js.map +1 -1
  229. package/dist/Redactable.d.ts +2 -2
  230. package/dist/Redactable.js +2 -2
  231. package/dist/Redacted.d.ts +3 -3
  232. package/dist/Redacted.js +3 -3
  233. package/dist/Reducer.d.ts +2 -3
  234. package/dist/Reducer.d.ts.map +1 -1
  235. package/dist/Reducer.js +2 -3
  236. package/dist/Reducer.js.map +1 -1
  237. package/dist/Ref.d.ts +17 -16
  238. package/dist/Ref.d.ts.map +1 -1
  239. package/dist/Ref.js +15 -14
  240. package/dist/Ref.js.map +1 -1
  241. package/dist/References.d.ts +4 -4
  242. package/dist/References.js +4 -4
  243. package/dist/Request.d.ts +18 -18
  244. package/dist/Request.js +6 -6
  245. package/dist/Resource.d.ts +2 -2
  246. package/dist/Resource.js +2 -2
  247. package/dist/Result.d.ts +77 -33
  248. package/dist/Result.d.ts.map +1 -1
  249. package/dist/Result.js +42 -19
  250. package/dist/Result.js.map +1 -1
  251. package/dist/Runtime.d.ts +11 -8
  252. package/dist/Runtime.d.ts.map +1 -1
  253. package/dist/Runtime.js +11 -8
  254. package/dist/Runtime.js.map +1 -1
  255. package/dist/Schedule.d.ts +107 -45
  256. package/dist/Schedule.d.ts.map +1 -1
  257. package/dist/Schedule.js +41 -29
  258. package/dist/Schedule.js.map +1 -1
  259. package/dist/Scheduler.d.ts +6 -4
  260. package/dist/Scheduler.d.ts.map +1 -1
  261. package/dist/Scheduler.js +6 -4
  262. package/dist/Scheduler.js.map +1 -1
  263. package/dist/Schema.d.ts +443 -371
  264. package/dist/Schema.d.ts.map +1 -1
  265. package/dist/Schema.js +518 -427
  266. package/dist/Schema.js.map +1 -1
  267. package/dist/SchemaAST.d.ts +42 -21
  268. package/dist/SchemaAST.d.ts.map +1 -1
  269. package/dist/SchemaAST.js +80 -59
  270. package/dist/SchemaAST.js.map +1 -1
  271. package/dist/SchemaGetter.d.ts +126 -106
  272. package/dist/SchemaGetter.d.ts.map +1 -1
  273. package/dist/SchemaGetter.js +121 -101
  274. package/dist/SchemaGetter.js.map +1 -1
  275. package/dist/SchemaIssue.d.ts +37 -39
  276. package/dist/SchemaIssue.d.ts.map +1 -1
  277. package/dist/SchemaIssue.js +16 -17
  278. package/dist/SchemaIssue.js.map +1 -1
  279. package/dist/SchemaParser.d.ts +72 -153
  280. package/dist/SchemaParser.d.ts.map +1 -1
  281. package/dist/SchemaParser.js +72 -145
  282. package/dist/SchemaParser.js.map +1 -1
  283. package/dist/SchemaRepresentation.d.ts +30 -21
  284. package/dist/SchemaRepresentation.d.ts.map +1 -1
  285. package/dist/SchemaRepresentation.js +26 -22
  286. package/dist/SchemaRepresentation.js.map +1 -1
  287. package/dist/SchemaTransformation.d.ts +169 -145
  288. package/dist/SchemaTransformation.d.ts.map +1 -1
  289. package/dist/SchemaTransformation.js +183 -159
  290. package/dist/SchemaTransformation.js.map +1 -1
  291. package/dist/SchemaUtils.js +2 -2
  292. package/dist/SchemaUtils.js.map +1 -1
  293. package/dist/Scope.d.ts +15 -0
  294. package/dist/Scope.d.ts.map +1 -1
  295. package/dist/Scope.js +15 -0
  296. package/dist/Scope.js.map +1 -1
  297. package/dist/ScopedCache.d.ts +1 -1
  298. package/dist/ScopedCache.js +1 -1
  299. package/dist/ScopedRef.d.ts +14 -18
  300. package/dist/ScopedRef.d.ts.map +1 -1
  301. package/dist/ScopedRef.js +6 -8
  302. package/dist/ScopedRef.js.map +1 -1
  303. package/dist/Semaphore.d.ts +9 -9
  304. package/dist/Semaphore.js +3 -3
  305. package/dist/Sink.d.ts +13 -13
  306. package/dist/Sink.d.ts.map +1 -1
  307. package/dist/Sink.js +9 -9
  308. package/dist/Sink.js.map +1 -1
  309. package/dist/Stdio.d.ts +4 -5
  310. package/dist/Stdio.d.ts.map +1 -1
  311. package/dist/Stdio.js +4 -5
  312. package/dist/Stdio.js.map +1 -1
  313. package/dist/Stream.d.ts +321 -44
  314. package/dist/Stream.d.ts.map +1 -1
  315. package/dist/Stream.js +137 -22
  316. package/dist/Stream.js.map +1 -1
  317. package/dist/String.d.ts +6 -9
  318. package/dist/String.d.ts.map +1 -1
  319. package/dist/String.js +2 -3
  320. package/dist/String.js.map +1 -1
  321. package/dist/Struct.d.ts +15 -13
  322. package/dist/Struct.d.ts.map +1 -1
  323. package/dist/Struct.js +11 -9
  324. package/dist/Struct.js.map +1 -1
  325. package/dist/SubscriptionRef.d.ts +24 -19
  326. package/dist/SubscriptionRef.d.ts.map +1 -1
  327. package/dist/SubscriptionRef.js +12 -7
  328. package/dist/SubscriptionRef.js.map +1 -1
  329. package/dist/SynchronizedRef.d.ts +88 -63
  330. package/dist/SynchronizedRef.d.ts.map +1 -1
  331. package/dist/SynchronizedRef.js +32 -23
  332. package/dist/SynchronizedRef.js.map +1 -1
  333. package/dist/Tracer.d.ts +4 -4
  334. package/dist/Tracer.js +4 -4
  335. package/dist/Trie.d.ts +15 -0
  336. package/dist/Trie.d.ts.map +1 -1
  337. package/dist/Trie.js +5 -0
  338. package/dist/Trie.js.map +1 -1
  339. package/dist/Tuple.d.ts +25 -19
  340. package/dist/Tuple.d.ts.map +1 -1
  341. package/dist/Tuple.js +17 -13
  342. package/dist/Tuple.js.map +1 -1
  343. package/dist/TxReentrantLock.d.ts +6 -3
  344. package/dist/TxReentrantLock.d.ts.map +1 -1
  345. package/dist/TxReentrantLock.js +2 -1
  346. package/dist/TxReentrantLock.js.map +1 -1
  347. package/dist/TxRef.d.ts +16 -16
  348. package/dist/TxRef.js +8 -8
  349. package/dist/TxSubscriptionRef.d.ts +43 -27
  350. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  351. package/dist/TxSubscriptionRef.js +19 -13
  352. package/dist/TxSubscriptionRef.js.map +1 -1
  353. package/dist/Types.d.ts +12 -38
  354. package/dist/Types.d.ts.map +1 -1
  355. package/dist/Types.js +0 -2
  356. package/dist/UndefinedOr.d.ts +15 -14
  357. package/dist/UndefinedOr.d.ts.map +1 -1
  358. package/dist/UndefinedOr.js +11 -10
  359. package/dist/UndefinedOr.js.map +1 -1
  360. package/dist/Unify.d.ts +2 -2
  361. package/dist/internal/schema/annotations.js.map +1 -1
  362. package/dist/internal/schema/arbitrary.js +9 -9
  363. package/dist/internal/schema/arbitrary.js.map +1 -1
  364. package/dist/internal/schema/equivalence.js +9 -9
  365. package/dist/internal/schema/equivalence.js.map +1 -1
  366. package/dist/internal/schema/representation.js +14 -14
  367. package/dist/internal/schema/representation.js.map +1 -1
  368. package/dist/internal/schema/schema.js +11 -11
  369. package/dist/internal/schema/schema.js.map +1 -1
  370. package/dist/testing/TestSchema.d.ts +10 -10
  371. package/dist/testing/TestSchema.d.ts.map +1 -1
  372. package/dist/testing/TestSchema.js +9 -9
  373. package/dist/testing/TestSchema.js.map +1 -1
  374. package/dist/unstable/ai/AiError.d.ts +4 -2
  375. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  376. package/dist/unstable/ai/AiError.js +4 -2
  377. package/dist/unstable/ai/AiError.js.map +1 -1
  378. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +17 -20
  379. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
  380. package/dist/unstable/ai/AnthropicStructuredOutput.js +36 -39
  381. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  382. package/dist/unstable/ai/Chat.d.ts +4 -5
  383. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  384. package/dist/unstable/ai/Chat.js +4 -5
  385. package/dist/unstable/ai/Chat.js.map +1 -1
  386. package/dist/unstable/ai/EmbeddingModel.d.ts +4 -4
  387. package/dist/unstable/ai/EmbeddingModel.js +4 -4
  388. package/dist/unstable/ai/IdGenerator.d.ts +2 -3
  389. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  390. package/dist/unstable/ai/IdGenerator.js +2 -3
  391. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  392. package/dist/unstable/ai/LanguageModel.d.ts +3 -2
  393. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  394. package/dist/unstable/ai/LanguageModel.js +5 -4
  395. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  396. package/dist/unstable/ai/McpSchema.d.ts +14 -12
  397. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  398. package/dist/unstable/ai/McpSchema.js +19 -17
  399. package/dist/unstable/ai/McpSchema.js.map +1 -1
  400. package/dist/unstable/ai/McpServer.d.ts +11 -4
  401. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  402. package/dist/unstable/ai/McpServer.js +8 -5
  403. package/dist/unstable/ai/McpServer.js.map +1 -1
  404. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +20 -18
  405. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
  406. package/dist/unstable/ai/OpenAiStructuredOutput.js +45 -43
  407. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  408. package/dist/unstable/ai/Prompt.d.ts +2 -2
  409. package/dist/unstable/ai/Prompt.js +3 -3
  410. package/dist/unstable/ai/Prompt.js.map +1 -1
  411. package/dist/unstable/ai/ResponseIdTracker.d.ts +3 -2
  412. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  413. package/dist/unstable/ai/ResponseIdTracker.js +3 -2
  414. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  415. package/dist/unstable/ai/Telemetry.d.ts +21 -6
  416. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  417. package/dist/unstable/ai/Telemetry.js +7 -2
  418. package/dist/unstable/ai/Telemetry.js.map +1 -1
  419. package/dist/unstable/ai/Tool.d.ts +7 -6
  420. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  421. package/dist/unstable/ai/Tool.js +8 -7
  422. package/dist/unstable/ai/Tool.js.map +1 -1
  423. package/dist/unstable/ai/Toolkit.d.ts +2 -2
  424. package/dist/unstable/ai/Toolkit.js +2 -2
  425. package/dist/unstable/cli/Command.d.ts +37 -16
  426. package/dist/unstable/cli/Command.d.ts.map +1 -1
  427. package/dist/unstable/cli/Command.js +15 -8
  428. package/dist/unstable/cli/Command.js.map +1 -1
  429. package/dist/unstable/cli/Completions.d.ts +1 -1
  430. package/dist/unstable/cli/Completions.js +1 -1
  431. package/dist/unstable/cli/Flag.d.ts +7 -6
  432. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  433. package/dist/unstable/cli/Flag.js +7 -6
  434. package/dist/unstable/cli/Flag.js.map +1 -1
  435. package/dist/unstable/cli/GlobalFlag.d.ts +6 -1
  436. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  437. package/dist/unstable/cli/GlobalFlag.js +7 -2
  438. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  439. package/dist/unstable/cli/Param.d.ts +3 -3
  440. package/dist/unstable/cli/Param.d.ts.map +1 -1
  441. package/dist/unstable/cli/Param.js +13 -10
  442. package/dist/unstable/cli/Param.js.map +1 -1
  443. package/dist/unstable/cli/Primitive.d.ts +3 -2
  444. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  445. package/dist/unstable/cli/Primitive.js +3 -2
  446. package/dist/unstable/cli/Primitive.js.map +1 -1
  447. package/dist/unstable/cluster/ClusterCron.d.ts +1 -2
  448. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  449. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  450. package/dist/unstable/cluster/ClusterMetrics.d.ts +5 -0
  451. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  452. package/dist/unstable/cluster/ClusterMetrics.js +5 -0
  453. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  454. package/dist/unstable/cluster/ClusterSchema.d.ts +3 -3
  455. package/dist/unstable/cluster/ClusterSchema.js +3 -3
  456. package/dist/unstable/cluster/ClusterWorkflowEngine.js +15 -15
  457. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  458. package/dist/unstable/cluster/EntityResource.d.ts +10 -0
  459. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  460. package/dist/unstable/cluster/EntityResource.js +10 -0
  461. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  462. package/dist/unstable/cluster/Envelope.d.ts +2 -2
  463. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  464. package/dist/unstable/cluster/Envelope.js +2 -2
  465. package/dist/unstable/cluster/Envelope.js.map +1 -1
  466. package/dist/unstable/cluster/Reply.d.ts +2 -2
  467. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  468. package/dist/unstable/cluster/Reply.js +12 -12
  469. package/dist/unstable/cluster/Reply.js.map +1 -1
  470. package/dist/unstable/cluster/RunnerHealth.d.ts +2 -1
  471. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  472. package/dist/unstable/cluster/RunnerHealth.js +2 -1
  473. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  474. package/dist/unstable/cluster/RunnerServer.d.ts +2 -2
  475. package/dist/unstable/cluster/RunnerServer.js +2 -2
  476. package/dist/unstable/cluster/Runners.d.ts +3 -3
  477. package/dist/unstable/cluster/Runners.js +3 -3
  478. package/dist/unstable/cluster/ShardId.js +3 -3
  479. package/dist/unstable/cluster/ShardId.js.map +1 -1
  480. package/dist/unstable/cluster/Sharding.d.ts +3 -3
  481. package/dist/unstable/cluster/Sharding.js +3 -3
  482. package/dist/unstable/cluster/ShardingConfig.d.ts +4 -4
  483. package/dist/unstable/cluster/ShardingConfig.js +4 -4
  484. package/dist/unstable/cluster/Snowflake.d.ts +1 -1
  485. package/dist/unstable/cluster/Snowflake.js +3 -3
  486. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  487. package/dist/unstable/cluster/internal/entityManager.js +2 -2
  488. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  489. package/dist/unstable/encoding/Msgpack.d.ts +2 -2
  490. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  491. package/dist/unstable/encoding/Msgpack.js +5 -5
  492. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  493. package/dist/unstable/encoding/Ndjson.d.ts +5 -0
  494. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  495. package/dist/unstable/encoding/Ndjson.js +5 -0
  496. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  497. package/dist/unstable/encoding/Sse.d.ts +2 -2
  498. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  499. package/dist/unstable/encoding/Sse.js +2 -2
  500. package/dist/unstable/encoding/Sse.js.map +1 -1
  501. package/dist/unstable/eventlog/EventGroup.d.ts +2 -1
  502. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  503. package/dist/unstable/eventlog/EventGroup.js +2 -1
  504. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  505. package/dist/unstable/eventlog/EventJournal.d.ts +10 -0
  506. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  507. package/dist/unstable/eventlog/EventJournal.js +10 -0
  508. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  509. package/dist/unstable/eventlog/EventLog.d.ts +3 -3
  510. package/dist/unstable/eventlog/EventLog.js +3 -3
  511. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -3
  512. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  513. package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -3
  514. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  515. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -7
  516. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  517. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +5 -7
  518. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  519. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +4 -4
  520. package/dist/unstable/eventlog/EventLogSessionAuth.js +4 -4
  521. package/dist/unstable/http/Cookies.js +4 -4
  522. package/dist/unstable/http/Cookies.js.map +1 -1
  523. package/dist/unstable/http/Etag.d.ts +2 -3
  524. package/dist/unstable/http/Etag.d.ts.map +1 -1
  525. package/dist/unstable/http/Etag.js +2 -3
  526. package/dist/unstable/http/Etag.js.map +1 -1
  527. package/dist/unstable/http/Headers.js +2 -2
  528. package/dist/unstable/http/Headers.js.map +1 -1
  529. package/dist/unstable/http/HttpBody.js +2 -2
  530. package/dist/unstable/http/HttpBody.js.map +1 -1
  531. package/dist/unstable/http/HttpClient.d.ts +2 -2
  532. package/dist/unstable/http/HttpClient.js +2 -2
  533. package/dist/unstable/http/HttpClientRequest.d.ts +30 -3
  534. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  535. package/dist/unstable/http/HttpClientRequest.js +10 -1
  536. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  537. package/dist/unstable/http/HttpRouter.d.ts +1 -1
  538. package/dist/unstable/http/HttpRouter.js +1 -1
  539. package/dist/unstable/http/HttpServerResponse.d.ts +25 -20
  540. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  541. package/dist/unstable/http/HttpServerResponse.js +13 -8
  542. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  543. package/dist/unstable/http/Multipart.js +3 -3
  544. package/dist/unstable/http/Multipart.js.map +1 -1
  545. package/dist/unstable/http/UrlParams.d.ts +30 -0
  546. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  547. package/dist/unstable/http/UrlParams.js +16 -6
  548. package/dist/unstable/http/UrlParams.js.map +1 -1
  549. package/dist/unstable/httpapi/HttpApi.d.ts +3 -2
  550. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  551. package/dist/unstable/httpapi/HttpApi.js +3 -2
  552. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  553. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  554. package/dist/unstable/httpapi/HttpApiBuilder.js +10 -8
  555. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  556. package/dist/unstable/httpapi/HttpApiClient.js +15 -15
  557. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  558. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +3 -3
  559. package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -3
  560. package/dist/unstable/httpapi/HttpApiSchema.d.ts +2 -2
  561. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  562. package/dist/unstable/httpapi/HttpApiSchema.js +9 -9
  563. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  564. package/dist/unstable/httpapi/OpenApi.js +11 -11
  565. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  566. package/dist/unstable/observability/OtlpResource.d.ts +5 -0
  567. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  568. package/dist/unstable/observability/OtlpResource.js +5 -0
  569. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  570. package/dist/unstable/observability/PrometheusMetrics.d.ts +4 -2
  571. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  572. package/dist/unstable/observability/PrometheusMetrics.js +4 -2
  573. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  574. package/dist/unstable/reactivity/Atom.d.ts +3 -3
  575. package/dist/unstable/reactivity/Atom.js +3 -3
  576. package/dist/unstable/rpc/RpcSchema.d.ts +2 -2
  577. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  578. package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
  579. package/dist/unstable/rpc/RpcSerialization.js +2 -2
  580. package/dist/unstable/schema/Model.js +5 -5
  581. package/dist/unstable/schema/Model.js.map +1 -1
  582. package/dist/unstable/schema/VariantSchema.d.ts +2 -2
  583. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  584. package/dist/unstable/sql/SqlSchema.d.ts +4 -4
  585. package/dist/unstable/sql/SqlSchema.js +4 -4
  586. package/dist/unstable/workers/Transferable.d.ts +2 -2
  587. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  588. package/dist/unstable/workers/Transferable.js +5 -5
  589. package/dist/unstable/workers/Transferable.js.map +1 -1
  590. package/dist/unstable/workflow/DurableDeferred.js +7 -7
  591. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  592. package/dist/unstable/workflow/DurableQueue.d.ts +1 -2
  593. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  594. package/dist/unstable/workflow/DurableQueue.js +1 -2
  595. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  596. package/dist/unstable/workflow/Workflow.d.ts +35 -15
  597. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  598. package/dist/unstable/workflow/Workflow.js +94 -72
  599. package/dist/unstable/workflow/Workflow.js.map +1 -1
  600. package/dist/unstable/workflow/WorkflowEngine.d.ts +10 -2
  601. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  602. package/dist/unstable/workflow/WorkflowEngine.js +16 -8
  603. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  604. package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -4
  605. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  606. package/dist/unstable/workflow/WorkflowProxy.js +9 -11
  607. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  608. package/dist/unstable/workflow/WorkflowProxyServer.js +7 -7
  609. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  610. package/package.json +1 -1
  611. package/src/Array.ts +729 -611
  612. package/src/BigDecimal.ts +37 -30
  613. package/src/BigInt.ts +34 -40
  614. package/src/Boolean.ts +8 -8
  615. package/src/Brand.ts +16 -14
  616. package/src/Cause.ts +21 -23
  617. package/src/Channel.ts +249 -9
  618. package/src/ChannelSchema.ts +11 -11
  619. package/src/Chunk.ts +69 -16
  620. package/src/Clock.ts +3 -3
  621. package/src/Combiner.ts +9 -13
  622. package/src/Config.ts +60 -67
  623. package/src/ConfigProvider.ts +34 -44
  624. package/src/Console.ts +2 -2
  625. package/src/Context.ts +60 -72
  626. package/src/Cron.ts +2 -2
  627. package/src/Crypto.ts +4 -4
  628. package/src/Data.ts +21 -15
  629. package/src/DateTime.ts +35 -16
  630. package/src/Deferred.ts +24 -15
  631. package/src/Duration.ts +44 -31
  632. package/src/Effect.ts +516 -416
  633. package/src/Encoding.ts +5 -0
  634. package/src/Equal.ts +26 -39
  635. package/src/Equivalence.ts +71 -99
  636. package/src/ErrorReporter.ts +1 -1
  637. package/src/Exit.ts +79 -96
  638. package/src/Fiber.ts +8 -6
  639. package/src/FiberHandle.ts +25 -0
  640. package/src/FiberMap.ts +35 -0
  641. package/src/FiberSet.ts +20 -0
  642. package/src/Filter.ts +4 -4
  643. package/src/Formatter.ts +14 -19
  644. package/src/Function.ts +15 -16
  645. package/src/Graph.ts +2 -2
  646. package/src/HKT.ts +2 -2
  647. package/src/Hash.ts +2 -1
  648. package/src/HashMap.ts +15 -0
  649. package/src/HashRing.ts +9 -9
  650. package/src/Iterable.ts +24 -12
  651. package/src/JsonPatch.ts +2 -3
  652. package/src/JsonPointer.ts +2 -6
  653. package/src/JsonSchema.ts +17 -13
  654. package/src/Latch.ts +4 -3
  655. package/src/Layer.ts +92 -114
  656. package/src/Logger.ts +15 -18
  657. package/src/Match.ts +2 -2
  658. package/src/Metric.ts +109 -137
  659. package/src/MutableHashMap.ts +35 -20
  660. package/src/MutableList.ts +15 -0
  661. package/src/MutableRef.ts +56 -42
  662. package/src/Newtype.ts +10 -7
  663. package/src/Number.ts +23 -11
  664. package/src/Optic.ts +25 -22
  665. package/src/Option.ts +196 -168
  666. package/src/Order.ts +118 -179
  667. package/src/PartitionedSemaphore.ts +14 -14
  668. package/src/Path.ts +2 -2
  669. package/src/Pipeable.ts +2 -2
  670. package/src/PlatformError.ts +4 -4
  671. package/src/Pool.ts +7 -11
  672. package/src/Predicate.ts +274 -263
  673. package/src/PubSub.ts +24 -14
  674. package/src/Pull.ts +4 -4
  675. package/src/Queue.ts +46 -7
  676. package/src/RcRef.ts +0 -4
  677. package/src/Redactable.ts +2 -2
  678. package/src/Redacted.ts +3 -3
  679. package/src/Reducer.ts +2 -3
  680. package/src/Ref.ts +43 -40
  681. package/src/References.ts +4 -4
  682. package/src/Request.ts +18 -18
  683. package/src/Resource.ts +2 -2
  684. package/src/Result.ts +87 -33
  685. package/src/Runtime.ts +11 -8
  686. package/src/Schedule.ts +112 -45
  687. package/src/Scheduler.ts +6 -4
  688. package/src/Schema.ts +843 -649
  689. package/src/SchemaAST.ts +148 -117
  690. package/src/SchemaGetter.ts +142 -121
  691. package/src/SchemaIssue.ts +39 -41
  692. package/src/SchemaParser.ts +173 -229
  693. package/src/SchemaRepresentation.ts +38 -28
  694. package/src/SchemaTransformation.ts +233 -207
  695. package/src/SchemaUtils.ts +2 -2
  696. package/src/Scope.ts +15 -0
  697. package/src/ScopedCache.ts +1 -1
  698. package/src/ScopedRef.ts +14 -18
  699. package/src/Semaphore.ts +9 -9
  700. package/src/Sink.ts +13 -13
  701. package/src/Stdio.ts +4 -5
  702. package/src/Stream.ts +354 -57
  703. package/src/String.ts +6 -9
  704. package/src/Struct.ts +15 -13
  705. package/src/SubscriptionRef.ts +24 -19
  706. package/src/SynchronizedRef.ts +88 -63
  707. package/src/Tracer.ts +4 -4
  708. package/src/Trie.ts +15 -0
  709. package/src/Tuple.ts +25 -19
  710. package/src/TxReentrantLock.ts +6 -3
  711. package/src/TxRef.ts +16 -16
  712. package/src/TxSubscriptionRef.ts +43 -27
  713. package/src/Types.ts +12 -39
  714. package/src/UndefinedOr.ts +15 -14
  715. package/src/Unify.ts +2 -2
  716. package/src/internal/schema/annotations.ts +4 -4
  717. package/src/internal/schema/arbitrary.ts +16 -16
  718. package/src/internal/schema/equivalence.ts +11 -11
  719. package/src/internal/schema/representation.ts +23 -23
  720. package/src/internal/schema/schema.ts +17 -17
  721. package/src/testing/TestSchema.ts +20 -20
  722. package/src/unstable/ai/AiError.ts +4 -2
  723. package/src/unstable/ai/AnthropicStructuredOutput.ts +59 -56
  724. package/src/unstable/ai/Chat.ts +4 -5
  725. package/src/unstable/ai/EmbeddingModel.ts +4 -4
  726. package/src/unstable/ai/IdGenerator.ts +2 -3
  727. package/src/unstable/ai/LanguageModel.ts +5 -4
  728. package/src/unstable/ai/McpSchema.ts +19 -17
  729. package/src/unstable/ai/McpServer.ts +14 -7
  730. package/src/unstable/ai/OpenAiStructuredOutput.ts +72 -61
  731. package/src/unstable/ai/Prompt.ts +5 -5
  732. package/src/unstable/ai/ResponseIdTracker.ts +3 -2
  733. package/src/unstable/ai/Telemetry.ts +21 -6
  734. package/src/unstable/ai/Tool.ts +11 -10
  735. package/src/unstable/ai/Toolkit.ts +2 -2
  736. package/src/unstable/cli/Command.ts +37 -16
  737. package/src/unstable/cli/Completions.ts +1 -1
  738. package/src/unstable/cli/Flag.ts +7 -6
  739. package/src/unstable/cli/GlobalFlag.ts +7 -1
  740. package/src/unstable/cli/Param.ts +23 -18
  741. package/src/unstable/cli/Primitive.ts +3 -2
  742. package/src/unstable/cluster/ClusterCron.ts +1 -2
  743. package/src/unstable/cluster/ClusterMetrics.ts +5 -0
  744. package/src/unstable/cluster/ClusterSchema.ts +3 -3
  745. package/src/unstable/cluster/ClusterWorkflowEngine.ts +15 -15
  746. package/src/unstable/cluster/EntityResource.ts +10 -0
  747. package/src/unstable/cluster/Envelope.ts +3 -3
  748. package/src/unstable/cluster/Reply.ts +14 -12
  749. package/src/unstable/cluster/RunnerHealth.ts +2 -1
  750. package/src/unstable/cluster/RunnerServer.ts +2 -2
  751. package/src/unstable/cluster/Runners.ts +3 -3
  752. package/src/unstable/cluster/ShardId.ts +3 -3
  753. package/src/unstable/cluster/Sharding.ts +3 -3
  754. package/src/unstable/cluster/ShardingConfig.ts +4 -4
  755. package/src/unstable/cluster/Snowflake.ts +3 -3
  756. package/src/unstable/cluster/internal/entityManager.ts +2 -2
  757. package/src/unstable/encoding/Msgpack.ts +6 -6
  758. package/src/unstable/encoding/Ndjson.ts +5 -0
  759. package/src/unstable/encoding/Sse.ts +2 -2
  760. package/src/unstable/eventlog/EventGroup.ts +2 -1
  761. package/src/unstable/eventlog/EventJournal.ts +10 -0
  762. package/src/unstable/eventlog/EventLog.ts +3 -3
  763. package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -3
  764. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +5 -7
  765. package/src/unstable/eventlog/EventLogSessionAuth.ts +4 -4
  766. package/src/unstable/http/Cookies.ts +4 -4
  767. package/src/unstable/http/Etag.ts +2 -3
  768. package/src/unstable/http/Headers.ts +2 -2
  769. package/src/unstable/http/HttpBody.ts +2 -2
  770. package/src/unstable/http/HttpClient.ts +2 -2
  771. package/src/unstable/http/HttpClientRequest.ts +30 -3
  772. package/src/unstable/http/HttpRouter.ts +1 -1
  773. package/src/unstable/http/HttpServerResponse.ts +25 -20
  774. package/src/unstable/http/Multipart.ts +3 -3
  775. package/src/unstable/http/UrlParams.ts +36 -6
  776. package/src/unstable/httpapi/HttpApi.ts +5 -4
  777. package/src/unstable/httpapi/HttpApiBuilder.ts +14 -13
  778. package/src/unstable/httpapi/HttpApiClient.ts +16 -16
  779. package/src/unstable/httpapi/HttpApiMiddleware.ts +3 -3
  780. package/src/unstable/httpapi/HttpApiSchema.ts +15 -15
  781. package/src/unstable/httpapi/OpenApi.ts +18 -18
  782. package/src/unstable/observability/OtlpResource.ts +5 -0
  783. package/src/unstable/observability/PrometheusMetrics.ts +4 -2
  784. package/src/unstable/reactivity/Atom.ts +3 -3
  785. package/src/unstable/rpc/RpcSchema.ts +2 -2
  786. package/src/unstable/rpc/RpcSerialization.ts +2 -2
  787. package/src/unstable/schema/Model.ts +5 -5
  788. package/src/unstable/schema/VariantSchema.ts +2 -2
  789. package/src/unstable/sql/SqlSchema.ts +4 -4
  790. package/src/unstable/workers/Transferable.ts +6 -6
  791. package/src/unstable/workflow/DurableDeferred.ts +7 -7
  792. package/src/unstable/workflow/DurableQueue.ts +1 -2
  793. package/src/unstable/workflow/Workflow.ts +159 -114
  794. package/src/unstable/workflow/WorkflowEngine.ts +16 -8
  795. package/src/unstable/workflow/WorkflowProxy.ts +9 -11
  796. package/src/unstable/workflow/WorkflowProxyServer.ts +7 -7
package/src/Effect.ts CHANGED
@@ -598,10 +598,8 @@ export const all: <
598
598
  *
599
599
  * **Details**
600
600
  *
601
- * The returned tuple is `[excluded, satisfying]`, where:
602
- *
603
- * - `excluded` contains all failures.
604
- * - `satisfying` contains all successes.
601
+ * The returned tuple is `[excluded, satisfying]`, where `excluded` contains
602
+ * all failures and `satisfying` contains all successes.
605
603
  *
606
604
  * This function runs every effect and never fails. Use `concurrency` to control
607
605
  * parallelism.
@@ -629,10 +627,8 @@ export const partition: {
629
627
  *
630
628
  * **Details**
631
629
  *
632
- * The returned tuple is `[excluded, satisfying]`, where:
633
- *
634
- * - `excluded` contains all failures.
635
- * - `satisfying` contains all successes.
630
+ * The returned tuple is `[excluded, satisfying]`, where `excluded` contains
631
+ * all failures and `satisfying` contains all successes.
636
632
  *
637
633
  * This function runs every effect and never fails. Use `concurrency` to control
638
634
  * parallelism.
@@ -663,10 +659,8 @@ export const partition: {
663
659
  *
664
660
  * **Details**
665
661
  *
666
- * The returned tuple is `[excluded, satisfying]`, where:
667
- *
668
- * - `excluded` contains all failures.
669
- * - `satisfying` contains all successes.
662
+ * The returned tuple is `[excluded, satisfying]`, where `excluded` contains
663
+ * all failures and `satisfying` contains all successes.
670
664
  *
671
665
  * This function runs every effect and never fails. Use `concurrency` to control
672
666
  * parallelism.
@@ -1453,8 +1447,8 @@ export const tryPromise: <A, E = Cause.UnknownError>(
1453
1447
  *
1454
1448
  * **When to use**
1455
1449
  *
1456
- * Use when you use this function when you need an effect that completes successfully with a
1457
- * specific value without any errors or external dependencies.
1450
+ * Use when an effect should complete successfully with a specific value without any errors
1451
+ * or external dependencies.
1458
1452
  *
1459
1453
  * **Example** (Creating a successful effect)
1460
1454
  *
@@ -1517,14 +1511,16 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
1517
1511
  *
1518
1512
  * **When to use**
1519
1513
  *
1520
- * Use when you need to defer the evaluation of an effect until it is required. This is particularly useful for optimizing expensive computations, managing circular dependencies, or resolving type inference issues.
1514
+ * Use when you need to defer the evaluation of an effect until it is required.
1521
1515
  *
1522
1516
  * **Details**
1523
1517
  *
1524
- * `suspend` takes a thunk that represents the effect and wraps it in a suspended effect. This means the effect will not be created until it is explicitly needed, which is helpful in various scenarios:
1525
- * - **Lazy Evaluation**: Helps optimize performance by deferring computations, especially when the effect might not be needed, or when its computation is expensive. This also ensures that any side effects or scoped captures are re-executed on each invocation.
1526
- * - **Handling Circular Dependencies**: Useful in managing circular dependencies, such as recursive functions that need to avoid eager evaluation to prevent stack overflow.
1527
- * - **Unifying Return Types**: Can help TypeScript unify return types in situations where multiple branches of logic return different effects, simplifying type inference.
1518
+ * `suspend` takes a thunk that represents an effect and delays creating it
1519
+ * until the suspended effect is evaluated. This is useful for optimizing
1520
+ * expensive computations, managing circular dependencies such as recursive
1521
+ * functions, and helping TypeScript unify return types when branches construct
1522
+ * different effects. Any side effects or scoped captures inside the thunk are
1523
+ * re-executed on each invocation.
1528
1524
  *
1529
1525
  * **Example** (Lazily evaluating side effects)
1530
1526
  *
@@ -1607,7 +1603,8 @@ export const suspend: <A, E, R>(
1607
1603
  *
1608
1604
  * **When to use**
1609
1605
  *
1610
- * Use when you are sure the operation will not fail.
1606
+ * Use when you need to wrap a synchronous side-effectful operation that is not
1607
+ * expected to throw.
1611
1608
  *
1612
1609
  * **Details**
1613
1610
  *
@@ -1666,8 +1663,8 @@ export {
1666
1663
  *
1667
1664
  * **When to use**
1668
1665
  *
1669
- * Use when integrating APIs that complete through callbacks
1670
- * instead of returning a `Promise`.
1666
+ * Use when you need to integrate APIs that complete through callbacks instead
1667
+ * of returning a `Promise`.
1671
1668
  *
1672
1669
  * **Details**
1673
1670
  *
@@ -1934,14 +1931,13 @@ export const bind: {
1934
1931
  *
1935
1932
  * **When to use**
1936
1933
  *
1937
- * Use when `gen` allows you to write code that looks and behaves like synchronous
1938
- * code, but it can handle asynchronous tasks, errors, and complex control flow
1939
- * (like loops and conditions). It helps make asynchronous code more readable
1940
- * and easier to manage.
1934
+ * Use when you want to write effectful code that looks and behaves like
1935
+ * synchronous code, while still handling asynchronous tasks, errors, and complex
1936
+ * control flow such as loops and conditions.
1941
1937
  *
1942
- * The generator functions work similarly to `async/await` but with more
1943
- * explicit control over the execution of effects. You can `yield*` values from
1944
- * effects and return the final result at the end.
1938
+ * Generator functions work similarly to `async/await` but keep errors,
1939
+ * requirements, and interruption in the Effect type. You can `yield*` values
1940
+ * from effects and return the final result at the end.
1945
1941
  *
1946
1942
  * **Example** (Sequencing effects with generators)
1947
1943
  *
@@ -1986,14 +1982,13 @@ export const gen: {
1986
1982
  *
1987
1983
  * **When to use**
1988
1984
  *
1989
- * Use when `gen` allows you to write code that looks and behaves like synchronous
1990
- * code, but it can handle asynchronous tasks, errors, and complex control flow
1991
- * (like loops and conditions). It helps make asynchronous code more readable
1992
- * and easier to manage.
1985
+ * Use when you want to write effectful code that looks and behaves like
1986
+ * synchronous code, while still handling asynchronous tasks, errors, and complex
1987
+ * control flow such as loops and conditions.
1993
1988
  *
1994
- * The generator functions work similarly to `async/await` but with more
1995
- * explicit control over the execution of effects. You can `yield*` values from
1996
- * effects and return the final result at the end.
1989
+ * Generator functions work similarly to `async/await` but keep errors,
1990
+ * requirements, and interruption in the Effect type. You can `yield*` values
1991
+ * from effects and return the final result at the end.
1997
1992
  *
1998
1993
  * **Example** (Sequencing effects with generators)
1999
1994
  *
@@ -2046,14 +2041,13 @@ export const gen: {
2046
2041
  *
2047
2042
  * **When to use**
2048
2043
  *
2049
- * Use when `gen` allows you to write code that looks and behaves like synchronous
2050
- * code, but it can handle asynchronous tasks, errors, and complex control flow
2051
- * (like loops and conditions). It helps make asynchronous code more readable
2052
- * and easier to manage.
2044
+ * Use when you want to write effectful code that looks and behaves like
2045
+ * synchronous code, while still handling asynchronous tasks, errors, and complex
2046
+ * control flow such as loops and conditions.
2053
2047
  *
2054
- * The generator functions work similarly to `async/await` but with more
2055
- * explicit control over the execution of effects. You can `yield*` values from
2056
- * effects and return the final result at the end.
2048
+ * Generator functions work similarly to `async/await` but keep errors,
2049
+ * requirements, and interruption in the Effect type. You can `yield*` values
2050
+ * from effects and return the final result at the end.
2057
2051
  *
2058
2052
  * **Example** (Sequencing effects with generators)
2059
2053
  *
@@ -2127,9 +2121,12 @@ export declare namespace gen {
2127
2121
  *
2128
2122
  * **When to use**
2129
2123
  *
2130
- * Use to explicitly signal an error in an `Effect`. The error
2131
- * will keep propagating unless it is handled. You can handle the error with
2132
- * functions like {@link catchTag} or {@link catchTags}.
2124
+ * Use to explicitly signal a recoverable error in an `Effect`.
2125
+ *
2126
+ * **Details**
2127
+ *
2128
+ * The error keeps propagating unless it is handled. You can handle tagged
2129
+ * errors with functions like {@link catchTag} or {@link catchTags}.
2133
2130
  *
2134
2131
  * **Example** (Creating a failed effect)
2135
2132
  *
@@ -2183,6 +2180,12 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
2183
2180
  /**
2184
2181
  * Creates an `Effect` that represents a failure with a specific `Cause`.
2185
2182
  *
2183
+ * **When to use**
2184
+ *
2185
+ * Use when you already have a full `Cause` and need to preserve defects,
2186
+ * interruptions, annotations, or combined failures in the effect's failure
2187
+ * channel.
2188
+ *
2186
2189
  * **Details**
2187
2190
  *
2188
2191
  * This function allows you to create effects that fail with complex error
@@ -2242,8 +2245,8 @@ export const failCauseSync: <E>(
2242
2245
  *
2243
2246
  * **When to use**
2244
2247
  *
2245
- * Use when encountering unexpected conditions in your code that should
2246
- * not be handled as regular errors but instead represent unrecoverable defects.
2248
+ * Use when you need an `Effect` to report an unrecoverable defect instead of a
2249
+ * typed error.
2247
2250
  *
2248
2251
  * **Details**
2249
2252
  *
@@ -2291,10 +2294,8 @@ export {
2291
2294
  *
2292
2295
  * **When to use**
2293
2296
  *
2294
- * Use when in situations where you need to perform synchronous operations that might
2295
- * fail, such as parsing JSON, you can use the `try` constructor. This
2296
- * constructor is designed to handle operations that could throw exceptions by
2297
- * capturing those exceptions and transforming them into manageable errors.
2297
+ * Use when you need to perform synchronous operations that might throw, such
2298
+ * as parsing JSON, and convert thrown exceptions into typed Effect failures.
2298
2299
  *
2299
2300
  * **Details**
2300
2301
  *
@@ -2450,6 +2451,11 @@ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A, E> = i
2450
2451
  /**
2451
2452
  * Converts an `Option` into an `Effect`.
2452
2453
  *
2454
+ * **When to use**
2455
+ *
2456
+ * Use when absence should become a typed `NoSuchElementError` in the effect error
2457
+ * channel.
2458
+ *
2453
2459
  * **Details**
2454
2460
  *
2455
2461
  * `Option.some` becomes a successful effect with the contained value, while
@@ -2749,8 +2755,8 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
2749
2755
  *
2750
2756
  * **When to use**
2751
2757
  *
2752
- * Use when one effect must run after another and the second effect
2753
- * may depend on the first effect's success value.
2758
+ * Use when you need one effect to run after another and the second effect may
2759
+ * depend on the first effect's success value.
2754
2760
  *
2755
2761
  * **Details**
2756
2762
  *
@@ -2825,8 +2831,8 @@ export const andThen: {
2825
2831
  *
2826
2832
  * **When to use**
2827
2833
  *
2828
- * Use when one effect must run after another and the second effect
2829
- * may depend on the first effect's success value.
2834
+ * Use when you need one effect to run after another and the second effect may
2835
+ * depend on the first effect's success value.
2830
2836
  *
2831
2837
  * **Details**
2832
2838
  *
@@ -2901,8 +2907,8 @@ export const andThen: {
2901
2907
  *
2902
2908
  * **When to use**
2903
2909
  *
2904
- * Use when one effect must run after another and the second effect
2905
- * may depend on the first effect's success value.
2910
+ * Use when you need one effect to run after another and the second effect may
2911
+ * depend on the first effect's success value.
2906
2912
  *
2907
2913
  * **Details**
2908
2914
  *
@@ -2977,8 +2983,8 @@ export const andThen: {
2977
2983
  *
2978
2984
  * **When to use**
2979
2985
  *
2980
- * Use when one effect must run after another and the second effect
2981
- * may depend on the first effect's success value.
2986
+ * Use when you need one effect to run after another and the second effect may
2987
+ * depend on the first effect's success value.
2982
2988
  *
2983
2989
  * **Details**
2984
2990
  *
@@ -3053,8 +3059,8 @@ export const andThen: {
3053
3059
  *
3054
3060
  * **When to use**
3055
3061
  *
3056
- * Use when one effect must run after another and the second effect
3057
- * may depend on the first effect's success value.
3062
+ * Use when you need one effect to run after another and the second effect may
3063
+ * depend on the first effect's success value.
3058
3064
  *
3059
3065
  * **Details**
3060
3066
  *
@@ -3131,9 +3137,8 @@ export const andThen: {
3131
3137
  *
3132
3138
  * **When to use**
3133
3139
  *
3134
- * Use when you want to perform a side effect, like logging or tracking,
3135
- * without modifying the main value. This is useful when you need to observe or
3136
- * record an action but want the original value to be passed to the next step.
3140
+ * Use when you need to run an effectful observation, such as logging or
3141
+ * tracking, while passing the original success value to the next step.
3137
3142
  *
3138
3143
  * **Details**
3139
3144
  *
@@ -3185,9 +3190,8 @@ export const tap: {
3185
3190
  *
3186
3191
  * **When to use**
3187
3192
  *
3188
- * Use when you want to perform a side effect, like logging or tracking,
3189
- * without modifying the main value. This is useful when you need to observe or
3190
- * record an action but want the original value to be passed to the next step.
3193
+ * Use when you need to run an effectful observation, such as logging or
3194
+ * tracking, while passing the original success value to the next step.
3191
3195
  *
3192
3196
  * **Details**
3193
3197
  *
@@ -3239,9 +3243,8 @@ export const tap: {
3239
3243
  *
3240
3244
  * **When to use**
3241
3245
  *
3242
- * Use when you want to perform a side effect, like logging or tracking,
3243
- * without modifying the main value. This is useful when you need to observe or
3244
- * record an action but want the original value to be passed to the next step.
3246
+ * Use when you need to run an effectful observation, such as logging or
3247
+ * tracking, while passing the original success value to the next step.
3245
3248
  *
3246
3249
  * **Details**
3247
3250
  *
@@ -3293,9 +3296,8 @@ export const tap: {
3293
3296
  *
3294
3297
  * **When to use**
3295
3298
  *
3296
- * Use when you want to perform a side effect, like logging or tracking,
3297
- * without modifying the main value. This is useful when you need to observe or
3298
- * record an action but want the original value to be passed to the next step.
3299
+ * Use when you need to run an effectful observation, such as logging or
3300
+ * tracking, while passing the original success value to the next step.
3299
3301
  *
3300
3302
  * **Details**
3301
3303
  *
@@ -3347,9 +3349,8 @@ export const tap: {
3347
3349
  *
3348
3350
  * **When to use**
3349
3351
  *
3350
- * Use when you want to perform a side effect, like logging or tracking,
3351
- * without modifying the main value. This is useful when you need to observe or
3352
- * record an action but want the original value to be passed to the next step.
3352
+ * Use when you need to run an effectful observation, such as logging or
3353
+ * tracking, while passing the original success value to the next step.
3353
3354
  *
3354
3355
  * **Details**
3355
3356
  *
@@ -3402,16 +3403,15 @@ export const tap: {
3402
3403
  *
3403
3404
  * **When to use**
3404
3405
  *
3405
- * Use when you want to handle typed failures as data while preserving
3406
- * the original error value. Use `option` when you only care whether the effect
3407
- * succeeded, and `exit` when you need the full failure cause.
3406
+ * Use when you want an `Effect`'s typed failures to be handled as `Result`
3407
+ * data while preserving the original error value.
3408
3408
  *
3409
3409
  * **Details**
3410
3410
  *
3411
3411
  * This function converts an effect that may fail into an effect that always
3412
3412
  * succeeds, wrapping the outcome in a `Result` type. The result will be
3413
- * `Result.Err` if the effect fails, containing the recoverable error, or
3414
- * `Result.Ok` if it succeeds, containing the result.
3413
+ * `Result.Failure` if the effect fails, containing the recoverable error, or
3414
+ * `Result.Success` if it succeeds, containing the result.
3415
3415
  *
3416
3416
  * Using this function, you can handle recoverable errors explicitly without
3417
3417
  * causing the effect to fail. This is particularly useful in scenarios where
@@ -3458,9 +3458,8 @@ export const result: <A, E, R>(self: Effect<A, E, R>) => Effect<Result.Result<A,
3458
3458
  *
3459
3459
  * **When to use**
3460
3460
  *
3461
- * Use when the failure value is not important and absence is enough.
3462
- * Use `result` when you need the original typed failure, and `exit` when you
3463
- * need the full failure cause.
3461
+ * Use when you only care whether an effect succeeds and want recoverable
3462
+ * failures represented as `Option.none`.
3464
3463
  *
3465
3464
  * **Details**
3466
3465
  *
@@ -3508,9 +3507,8 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
3508
3507
  *
3509
3508
  * **When to use**
3510
3509
  *
3511
- * Use when you need to inspect the full outcome, including typed
3512
- * failures, defects, and interruptions. Use `result` or `option` when you only
3513
- * need to handle typed failures.
3510
+ * Use when you need to inspect the full outcome, including typed failures, defects,
3511
+ * and interruptions.
3514
3512
  *
3515
3513
  * **Details**
3516
3514
  *
@@ -3860,8 +3858,7 @@ export const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E, R> = in
3860
3858
  *
3861
3859
  * **When to use**
3862
3860
  *
3863
- * Use to handle the failure value as a success, or to move the success value
3864
- * into the failure channel.
3861
+ * Use to swap an `Effect`'s success and failure channels.
3865
3862
  *
3866
3863
  * **Details**
3867
3864
  *
@@ -4305,6 +4302,11 @@ export {
4305
4302
  /**
4306
4303
  * Handles all errors in an effect by providing a fallback effect.
4307
4304
  *
4305
+ * **When to use**
4306
+ *
4307
+ * Use when every recoverable error from an effect should be handled by the same
4308
+ * fallback function while unrecoverable defects remain defects.
4309
+ *
4308
4310
  * **Details**
4309
4311
  *
4310
4312
  * The `catch` function catches any errors that may occur during the
@@ -4312,8 +4314,10 @@ export {
4312
4314
  * effect. This ensures that the program continues without failing by recovering
4313
4315
  * from errors using the provided fallback logic.
4314
4316
  *
4315
- * **Note**: `catch` only handles recoverable errors. It will not recover
4316
- * from unrecoverable defects.
4317
+ * **Gotchas**
4318
+ *
4319
+ * `catch` only handles recoverable errors. It will not recover from
4320
+ * unrecoverable defects.
4317
4321
  *
4318
4322
  * @see {@link catchCause} for a version that can recover from both recoverable and unrecoverable errors.
4319
4323
  *
@@ -4329,8 +4333,8 @@ export {
4329
4333
  *
4330
4334
  * **When to use**
4331
4335
  *
4332
- * Use when recovering from one specific tagged error in an effect error
4333
- * channel.
4336
+ * Use when you need to recover from one specific tagged error in an effect
4337
+ * error channel.
4334
4338
  *
4335
4339
  * **Details**
4336
4340
  *
@@ -4374,8 +4378,8 @@ export const catchTag: {
4374
4378
  *
4375
4379
  * **When to use**
4376
4380
  *
4377
- * Use when recovering from one specific tagged error in an effect error
4378
- * channel.
4381
+ * Use when you need to recover from one specific tagged error in an effect
4382
+ * error channel.
4379
4383
  *
4380
4384
  * **Details**
4381
4385
  *
@@ -4442,8 +4446,8 @@ export const catchTag: {
4442
4446
  *
4443
4447
  * **When to use**
4444
4448
  *
4445
- * Use when recovering from one specific tagged error in an effect error
4446
- * channel.
4449
+ * Use when you need to recover from one specific tagged error in an effect
4450
+ * error channel.
4447
4451
  *
4448
4452
  * **Details**
4449
4453
  *
@@ -4513,10 +4517,14 @@ export const catchTag: {
4513
4517
  * **When to use**
4514
4518
  *
4515
4519
  * Use when one recovery step should handle several tagged error types by
4516
- * matching their readonly `_tag` fields. Pass a handler table whose keys are
4517
- * tags, plus an optional fallback for unmatched errors.
4520
+ * matching their readonly `_tag` fields.
4518
4521
  *
4519
- * The error type must have a readonly `_tag` field to use `catchTag`. This
4522
+ * **Details**
4523
+ *
4524
+ * Pass a handler table whose keys are tags, plus an optional fallback for
4525
+ * unmatched errors.
4526
+ *
4527
+ * The error type must have a readonly `_tag` field to use `catchTags`. This
4520
4528
  * field is used to identify and match errors.
4521
4529
  *
4522
4530
  * **Example** (Handling multiple tagged errors)
@@ -4554,10 +4562,14 @@ export const catchTags: {
4554
4562
  * **When to use**
4555
4563
  *
4556
4564
  * Use when one recovery step should handle several tagged error types by
4557
- * matching their readonly `_tag` fields. Pass a handler table whose keys are
4558
- * tags, plus an optional fallback for unmatched errors.
4565
+ * matching their readonly `_tag` fields.
4566
+ *
4567
+ * **Details**
4559
4568
  *
4560
- * The error type must have a readonly `_tag` field to use `catchTag`. This
4569
+ * Pass a handler table whose keys are tags, plus an optional fallback for
4570
+ * unmatched errors.
4571
+ *
4572
+ * The error type must have a readonly `_tag` field to use `catchTags`. This
4561
4573
  * field is used to identify and match errors.
4562
4574
  *
4563
4575
  * **Example** (Handling multiple tagged errors)
@@ -4624,10 +4636,14 @@ export const catchTags: {
4624
4636
  * **When to use**
4625
4637
  *
4626
4638
  * Use when one recovery step should handle several tagged error types by
4627
- * matching their readonly `_tag` fields. Pass a handler table whose keys are
4628
- * tags, plus an optional fallback for unmatched errors.
4639
+ * matching their readonly `_tag` fields.
4640
+ *
4641
+ * **Details**
4629
4642
  *
4630
- * The error type must have a readonly `_tag` field to use `catchTag`. This
4643
+ * Pass a handler table whose keys are tags, plus an optional fallback for
4644
+ * unmatched errors.
4645
+ *
4646
+ * The error type must have a readonly `_tag` field to use `catchTags`. This
4631
4647
  * field is used to identify and match errors.
4632
4648
  *
4633
4649
  * **Example** (Handling multiple tagged errors)
@@ -4696,8 +4712,8 @@ export const catchTags: {
4696
4712
  *
4697
4713
  * **When to use**
4698
4714
  *
4699
- * Use to handle one nested reason inside a tagged error while preserving the
4700
- * parent error shape for unmatched reasons.
4715
+ * Use to handle one nested reason inside an `Effect`'s tagged error while
4716
+ * preserving the parent error shape for unmatched reasons.
4701
4717
  *
4702
4718
  * **Details**
4703
4719
  *
@@ -4742,8 +4758,8 @@ export const catchReason: {
4742
4758
  *
4743
4759
  * **When to use**
4744
4760
  *
4745
- * Use to handle one nested reason inside a tagged error while preserving the
4746
- * parent error shape for unmatched reasons.
4761
+ * Use to handle one nested reason inside an `Effect`'s tagged error while
4762
+ * preserving the parent error shape for unmatched reasons.
4747
4763
  *
4748
4764
  * **Details**
4749
4765
  *
@@ -4817,8 +4833,8 @@ export const catchReason: {
4817
4833
  *
4818
4834
  * **When to use**
4819
4835
  *
4820
- * Use to handle one nested reason inside a tagged error while preserving the
4821
- * parent error shape for unmatched reasons.
4836
+ * Use to handle one nested reason inside an `Effect`'s tagged error while
4837
+ * preserving the parent error shape for unmatched reasons.
4822
4838
  *
4823
4839
  * **Details**
4824
4840
  *
@@ -5211,8 +5227,9 @@ export const unwrapReason: {
5211
5227
  *
5212
5228
  * **When to use**
5213
5229
  *
5214
- * Use when recovery needs the full `Cause`, including recoverable failures,
5215
- * defects, and interruptions, instead of only the typed error value.
5230
+ * Use when you need to recover from an `Effect` by inspecting the full `Cause`,
5231
+ * including recoverable failures, defects, and interruptions, instead of only
5232
+ * the typed error value.
5216
5233
  *
5217
5234
  * **Details**
5218
5235
  *
@@ -5251,8 +5268,9 @@ export const catchCause: {
5251
5268
  *
5252
5269
  * **When to use**
5253
5270
  *
5254
- * Use when recovery needs the full `Cause`, including recoverable failures,
5255
- * defects, and interruptions, instead of only the typed error value.
5271
+ * Use when you need to recover from an `Effect` by inspecting the full `Cause`,
5272
+ * including recoverable failures, defects, and interruptions, instead of only
5273
+ * the typed error value.
5256
5274
  *
5257
5275
  * **Details**
5258
5276
  *
@@ -5291,8 +5309,9 @@ export const catchCause: {
5291
5309
  *
5292
5310
  * **When to use**
5293
5311
  *
5294
- * Use when recovery needs the full `Cause`, including recoverable failures,
5295
- * defects, and interruptions, instead of only the typed error value.
5312
+ * Use when you need to recover from an `Effect` by inspecting the full `Cause`,
5313
+ * including recoverable failures, defects, and interruptions, instead of only
5314
+ * the typed error value.
5296
5315
  *
5297
5316
  * **Details**
5298
5317
  *
@@ -5332,8 +5351,7 @@ export const catchCause: {
5332
5351
  *
5333
5352
  * **When to use**
5334
5353
  *
5335
- * Use when you use this sparingly, usually at integration boundaries where defects must be
5336
- * reported or translated for an external system.
5354
+ * Use when you need to report or translate defects at integration boundaries.
5337
5355
  *
5338
5356
  * **Details**
5339
5357
  *
@@ -5373,8 +5391,7 @@ export const catchDefect: {
5373
5391
  *
5374
5392
  * **When to use**
5375
5393
  *
5376
- * Use when you use this sparingly, usually at integration boundaries where defects must be
5377
- * reported or translated for an external system.
5394
+ * Use when you need to report or translate defects at integration boundaries.
5378
5395
  *
5379
5396
  * **Details**
5380
5397
  *
@@ -5414,8 +5431,7 @@ export const catchDefect: {
5414
5431
  *
5415
5432
  * **When to use**
5416
5433
  *
5417
- * Use when you use this sparingly, usually at integration boundaries where defects must be
5418
- * reported or translated for an external system.
5434
+ * Use when you need to report or translate defects at integration boundaries.
5419
5435
  *
5420
5436
  * **Details**
5421
5437
  *
@@ -5457,8 +5473,11 @@ export const catchDefect: {
5457
5473
  *
5458
5474
  * **When to use**
5459
5475
  *
5460
- * Use when you need to recover from errors that match a condition. Use a
5461
- * `Refinement` for type narrowing or a `Predicate` for simple boolean
5476
+ * Use when you need to recover from errors that match a condition.
5477
+ *
5478
+ * **Details**
5479
+ *
5480
+ * Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
5462
5481
  * matching. Non-matching errors re-fail with the original cause. Defects and
5463
5482
  * interrupts are not caught.
5464
5483
  *
@@ -5497,8 +5516,11 @@ export const catchIf: {
5497
5516
  *
5498
5517
  * **When to use**
5499
5518
  *
5500
- * Use when you need to recover from errors that match a condition. Use a
5501
- * `Refinement` for type narrowing or a `Predicate` for simple boolean
5519
+ * Use when you need to recover from errors that match a condition.
5520
+ *
5521
+ * **Details**
5522
+ *
5523
+ * Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
5502
5524
  * matching. Non-matching errors re-fail with the original cause. Defects and
5503
5525
  * interrupts are not caught.
5504
5526
  *
@@ -5543,8 +5565,11 @@ export const catchIf: {
5543
5565
  *
5544
5566
  * **When to use**
5545
5567
  *
5546
- * Use when you need to recover from errors that match a condition. Use a
5547
- * `Refinement` for type narrowing or a `Predicate` for simple boolean
5568
+ * Use when you need to recover from errors that match a condition.
5569
+ *
5570
+ * **Details**
5571
+ *
5572
+ * Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
5548
5573
  * matching. Non-matching errors re-fail with the original cause. Defects and
5549
5574
  * interrupts are not caught.
5550
5575
  *
@@ -5589,8 +5614,11 @@ export const catchIf: {
5589
5614
  *
5590
5615
  * **When to use**
5591
5616
  *
5592
- * Use when you need to recover from errors that match a condition. Use a
5593
- * `Refinement` for type narrowing or a `Predicate` for simple boolean
5617
+ * Use when you need to recover from errors that match a condition.
5618
+ *
5619
+ * **Details**
5620
+ *
5621
+ * Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
5594
5622
  * matching. Non-matching errors re-fail with the original cause. Defects and
5595
5623
  * interrupts are not caught.
5596
5624
  *
@@ -5634,8 +5662,11 @@ export const catchIf: {
5634
5662
  *
5635
5663
  * **When to use**
5636
5664
  *
5637
- * Use when you need to recover from errors that match a condition. Use a
5638
- * `Refinement` for type narrowing or a `Predicate` for simple boolean
5665
+ * Use when you need to recover from errors that match a condition.
5666
+ *
5667
+ * **Details**
5668
+ *
5669
+ * Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
5639
5670
  * matching. Non-matching errors re-fail with the original cause. Defects and
5640
5671
  * interrupts are not caught.
5641
5672
  *
@@ -5769,7 +5800,8 @@ export const catchFilter: {
5769
5800
  *
5770
5801
  * **When to use**
5771
5802
  *
5772
- * Use to convert `NoSuchElementError` failures into `Option.none`.
5803
+ * Use when you expect missing-value failures and want them to become an
5804
+ * optional success while all other failures keep failing.
5773
5805
  *
5774
5806
  * **Details**
5775
5807
  *
@@ -5804,7 +5836,7 @@ export const catchNoSuchElement: <A, E, R>(
5804
5836
  *
5805
5837
  * **When to use**
5806
5838
  *
5807
- * Use to recover from full causes selected by a predicate.
5839
+ * Use to recover an `Effect` from full causes selected by a predicate.
5808
5840
  *
5809
5841
  * **Details**
5810
5842
  *
@@ -5848,7 +5880,7 @@ export const catchCauseIf: {
5848
5880
  *
5849
5881
  * **When to use**
5850
5882
  *
5851
- * Use to recover from full causes selected by a predicate.
5883
+ * Use to recover an `Effect` from full causes selected by a predicate.
5852
5884
  *
5853
5885
  * **Details**
5854
5886
  *
@@ -5895,7 +5927,7 @@ export const catchCauseIf: {
5895
5927
  *
5896
5928
  * **When to use**
5897
5929
  *
5898
- * Use to recover from full causes selected by a predicate.
5930
+ * Use to recover an `Effect` from full causes selected by a predicate.
5899
5931
  *
5900
5932
  * **Details**
5901
5933
  *
@@ -5945,8 +5977,9 @@ export const catchCauseIf: {
5945
5977
  *
5946
5978
  * **When to use**
5947
5979
  *
5948
- * Use when you need to recover only from causes selected by a `Filter`, and the
5949
- * recovery needs both the selected value and the original `Cause`.
5980
+ * Use when you need to recover an `Effect` only from causes selected by a
5981
+ * `Filter`, while giving the recovery both the selected value and the original
5982
+ * `Cause`.
5950
5983
  *
5951
5984
  * **Details**
5952
5985
  *
@@ -5967,8 +6000,9 @@ export const catchCauseFilter: {
5967
6000
  *
5968
6001
  * **When to use**
5969
6002
  *
5970
- * Use when you need to recover only from causes selected by a `Filter`, and the
5971
- * recovery needs both the selected value and the original `Cause`.
6003
+ * Use when you need to recover an `Effect` only from causes selected by a
6004
+ * `Filter`, while giving the recovery both the selected value and the original
6005
+ * `Cause`.
5972
6006
  *
5973
6007
  * **Details**
5974
6008
  *
@@ -5992,8 +6026,9 @@ export const catchCauseFilter: {
5992
6026
  *
5993
6027
  * **When to use**
5994
6028
  *
5995
- * Use when you need to recover only from causes selected by a `Filter`, and the
5996
- * recovery needs both the selected value and the original `Cause`.
6029
+ * Use when you need to recover an `Effect` only from causes selected by a
6030
+ * `Filter`, while giving the recovery both the selected value and the original
6031
+ * `Cause`.
5997
6032
  *
5998
6033
  * **Details**
5999
6034
  *
@@ -6020,7 +6055,8 @@ export const catchCauseFilter: {
6020
6055
  *
6021
6056
  * **When to use**
6022
6057
  *
6023
- * Use to translate typed failures while leaving successful values unchanged.
6058
+ * Use to translate an `Effect`'s typed failures while leaving successful values
6059
+ * unchanged.
6024
6060
  *
6025
6061
  * **Details**
6026
6062
  *
@@ -6058,7 +6094,8 @@ export const mapError: {
6058
6094
  *
6059
6095
  * **When to use**
6060
6096
  *
6061
- * Use to translate typed failures while leaving successful values unchanged.
6097
+ * Use to translate an `Effect`'s typed failures while leaving successful values
6098
+ * unchanged.
6062
6099
  *
6063
6100
  * **Details**
6064
6101
  *
@@ -6096,7 +6133,8 @@ export const mapError: {
6096
6133
  *
6097
6134
  * **When to use**
6098
6135
  *
6099
- * Use to translate typed failures while leaving successful values unchanged.
6136
+ * Use to translate an `Effect`'s typed failures while leaving successful values
6137
+ * unchanged.
6100
6138
  *
6101
6139
  * **Details**
6102
6140
  *
@@ -6136,8 +6174,8 @@ export const mapError: {
6136
6174
  *
6137
6175
  * **When to use**
6138
6176
  *
6139
- * Use to transform both success and failure values without changing whether the
6140
- * effect succeeds or fails.
6177
+ * Use to transform both success and failure channels of an `Effect` without
6178
+ * changing whether it succeeds or fails.
6141
6179
  *
6142
6180
  * **Details**
6143
6181
  *
@@ -6177,8 +6215,8 @@ export const mapBoth: {
6177
6215
  *
6178
6216
  * **When to use**
6179
6217
  *
6180
- * Use to transform both success and failure values without changing whether the
6181
- * effect succeeds or fails.
6218
+ * Use to transform both success and failure channels of an `Effect` without
6219
+ * changing whether it succeeds or fails.
6182
6220
  *
6183
6221
  * **Details**
6184
6222
  *
@@ -6220,8 +6258,8 @@ export const mapBoth: {
6220
6258
  *
6221
6259
  * **When to use**
6222
6260
  *
6223
- * Use to transform both success and failure values without changing whether the
6224
- * effect succeeds or fails.
6261
+ * Use to transform both success and failure channels of an `Effect` without
6262
+ * changing whether it succeeds or fails.
6225
6263
  *
6226
6264
  * **Details**
6227
6265
  *
@@ -6267,8 +6305,8 @@ export const mapBoth: {
6267
6305
  *
6268
6306
  * **When to use**
6269
6307
  *
6270
- * Use when a typed failure represents an unrecoverable bug or invalid
6271
- * state and should not be handled as a recoverable error.
6308
+ * Use when you need to turn an `Effect` typed failure that represents an
6309
+ * unrecoverable bug or invalid state into a defect.
6272
6310
  *
6273
6311
  * **Example** (Converting typed failures into defects)
6274
6312
  *
@@ -6533,6 +6571,11 @@ export const tapErrorTag: {
6533
6571
  * Runs an effectful operation with the full `Cause` when the source effect
6534
6572
  * fails.
6535
6573
  *
6574
+ * **When to use**
6575
+ *
6576
+ * Use when failure observation needs typed failures, defects, and interruptions
6577
+ * rather than only the typed error value.
6578
+ *
6536
6579
  * **Details**
6537
6580
  *
6538
6581
  * Use this to log or inspect typed failures, defects, and interruptions. When
@@ -6564,6 +6607,11 @@ export const tapCause: {
6564
6607
  * Runs an effectful operation with the full `Cause` when the source effect
6565
6608
  * fails.
6566
6609
  *
6610
+ * **When to use**
6611
+ *
6612
+ * Use when failure observation needs typed failures, defects, and interruptions
6613
+ * rather than only the typed error value.
6614
+ *
6567
6615
  * **Details**
6568
6616
  *
6569
6617
  * Use this to log or inspect typed failures, defects, and interruptions. When
@@ -6595,6 +6643,11 @@ export const tapCause: {
6595
6643
  * Runs an effectful operation with the full `Cause` when the source effect
6596
6644
  * fails.
6597
6645
  *
6646
+ * **When to use**
6647
+ *
6648
+ * Use when failure observation needs typed failures, defects, and interruptions
6649
+ * rather than only the typed error value.
6650
+ *
6598
6651
  * **Details**
6599
6652
  *
6600
6653
  * Use this to log or inspect typed failures, defects, and interruptions. When
@@ -6734,8 +6787,9 @@ export const tapCauseIf: {
6734
6787
  *
6735
6788
  * **When to use**
6736
6789
  *
6737
- * Use when you need to observe only failure causes selected by a `Filter`, and
6738
- * the side effect needs both the selected value and the original `Cause`.
6790
+ * Use when you need to observe only failure causes selected by a `Filter`,
6791
+ * while giving the side effect both the selected value and the original
6792
+ * `Cause`.
6739
6793
  *
6740
6794
  * **Details**
6741
6795
  *
@@ -6756,8 +6810,9 @@ export const tapCauseFilter: {
6756
6810
  *
6757
6811
  * **When to use**
6758
6812
  *
6759
- * Use when you need to observe only failure causes selected by a `Filter`, and
6760
- * the side effect needs both the selected value and the original `Cause`.
6813
+ * Use when you need to observe only failure causes selected by a `Filter`,
6814
+ * while giving the side effect both the selected value and the original
6815
+ * `Cause`.
6761
6816
  *
6762
6817
  * **Details**
6763
6818
  *
@@ -6781,8 +6836,9 @@ export const tapCauseFilter: {
6781
6836
  *
6782
6837
  * **When to use**
6783
6838
  *
6784
- * Use when you need to observe only failure causes selected by a `Filter`, and
6785
- * the side effect needs both the selected value and the original `Cause`.
6839
+ * Use when you need to observe only failure causes selected by a `Filter`,
6840
+ * while giving the side effect both the selected value and the original
6841
+ * `Cause`.
6786
6842
  *
6787
6843
  * **Details**
6788
6844
  *
@@ -7046,8 +7102,8 @@ export declare namespace Retry {
7046
7102
  *
7047
7103
  * **When to use**
7048
7104
  *
7049
- * Use when typed failures may be transient, such as network issues or
7050
- * temporary resource unavailability.
7105
+ * Use when you need to rerun an effect after transient typed failures, such as
7106
+ * network issues or temporary resource unavailability.
7051
7107
  *
7052
7108
  * **Details**
7053
7109
  *
@@ -7099,8 +7155,8 @@ export const retry: {
7099
7155
  *
7100
7156
  * **When to use**
7101
7157
  *
7102
- * Use when typed failures may be transient, such as network issues or
7103
- * temporary resource unavailability.
7158
+ * Use when you need to rerun an effect after transient typed failures, such as
7159
+ * network issues or temporary resource unavailability.
7104
7160
  *
7105
7161
  * **Details**
7106
7162
  *
@@ -7152,8 +7208,8 @@ export const retry: {
7152
7208
  *
7153
7209
  * **When to use**
7154
7210
  *
7155
- * Use when typed failures may be transient, such as network issues or
7156
- * temporary resource unavailability.
7211
+ * Use when you need to rerun an effect after transient typed failures, such as
7212
+ * network issues or temporary resource unavailability.
7157
7213
  *
7158
7214
  * **Details**
7159
7215
  *
@@ -7205,8 +7261,8 @@ export const retry: {
7205
7261
  *
7206
7262
  * **When to use**
7207
7263
  *
7208
- * Use when typed failures may be transient, such as network issues or
7209
- * temporary resource unavailability.
7264
+ * Use when you need to rerun an effect after transient typed failures, such as
7265
+ * network issues or temporary resource unavailability.
7210
7266
  *
7211
7267
  * **Details**
7212
7268
  *
@@ -7262,8 +7318,8 @@ export const retry: {
7262
7318
  *
7263
7319
  * **When to use**
7264
7320
  *
7265
- * Use when typed failures may be transient, such as network issues or
7266
- * temporary resource unavailability.
7321
+ * Use when you need to rerun an effect after transient typed failures, such as
7322
+ * network issues or temporary resource unavailability.
7267
7323
  *
7268
7324
  * **Details**
7269
7325
  *
@@ -7315,8 +7371,8 @@ export const retry: {
7315
7371
  *
7316
7372
  * **When to use**
7317
7373
  *
7318
- * Use when typed failures may be transient, such as network issues or
7319
- * temporary resource unavailability.
7374
+ * Use when you need to rerun an effect after transient typed failures, such as
7375
+ * network issues or temporary resource unavailability.
7320
7376
  *
7321
7377
  * **Details**
7322
7378
  *
@@ -7368,8 +7424,8 @@ export const retry: {
7368
7424
  *
7369
7425
  * **When to use**
7370
7426
  *
7371
- * Use when typed failures may be transient, such as network issues or
7372
- * temporary resource unavailability.
7427
+ * Use when you need to rerun an effect after transient typed failures, such as
7428
+ * network issues or temporary resource unavailability.
7373
7429
  *
7374
7430
  * **Details**
7375
7431
  *
@@ -7644,6 +7700,8 @@ export const sandbox: <A, E, R>(
7644
7700
  * Use when an effect should run for its side effects while both success and
7645
7701
  * failure values are discarded.
7646
7702
  *
7703
+ * **Details**
7704
+ *
7647
7705
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
7648
7706
  * and `message` to prepend a custom log message.
7649
7707
  *
@@ -7695,6 +7753,11 @@ export const ignore: <
7695
7753
  /**
7696
7754
  * Ignores the effect's failure cause, including defects and interruptions.
7697
7755
  *
7756
+ * **When to use**
7757
+ *
7758
+ * Use when a best-effort effect should never fail, even from defects or
7759
+ * interruption, and optional cause logging is enough.
7760
+ *
7698
7761
  * **Details**
7699
7762
  *
7700
7763
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
@@ -8003,9 +8066,9 @@ export const orElseSucceed: {
8003
8066
  *
8004
8067
  * **When to use**
8005
8068
  *
8006
- * Use when you have prioritized fallback strategies, such as
8007
- * attempting multiple APIs, reading configuration from several sources, or
8008
- * trying alternative resource locations in order.
8069
+ * Use when you have prioritized fallback `Effect`s, such as attempting
8070
+ * multiple APIs, reading configuration from several sources, or trying
8071
+ * alternative resource locations in order.
8009
8072
  *
8010
8073
  * **Details**
8011
8074
  *
@@ -8055,9 +8118,8 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
8055
8118
  *
8056
8119
  * **When to use**
8057
8120
  *
8058
- * Use when exceeding the time limit should be represented as a typed
8059
- * failure. Use `timeoutOption` when a timeout should become `Option.none`, and
8060
- * `timeoutOrElse` when you want to run a fallback effect.
8121
+ * Use when you need a timeout of an `Effect` to be represented as a typed
8122
+ * failure.
8061
8123
  *
8062
8124
  * **Details**
8063
8125
  *
@@ -8118,9 +8180,8 @@ export const timeout: {
8118
8180
  *
8119
8181
  * **When to use**
8120
8182
  *
8121
- * Use when exceeding the time limit should be represented as a typed
8122
- * failure. Use `timeoutOption` when a timeout should become `Option.none`, and
8123
- * `timeoutOrElse` when you want to run a fallback effect.
8183
+ * Use when you need a timeout of an `Effect` to be represented as a typed
8184
+ * failure.
8124
8185
  *
8125
8186
  * **Details**
8126
8187
  *
@@ -8181,9 +8242,8 @@ export const timeout: {
8181
8242
  *
8182
8243
  * **When to use**
8183
8244
  *
8184
- * Use when exceeding the time limit should be represented as a typed
8185
- * failure. Use `timeoutOption` when a timeout should become `Option.none`, and
8186
- * `timeoutOrElse` when you want to run a fallback effect.
8245
+ * Use when you need a timeout of an `Effect` to be represented as a typed
8246
+ * failure.
8187
8247
  *
8188
8248
  * **Details**
8189
8249
  *
@@ -8242,9 +8302,7 @@ export const timeout: {
8242
8302
  *
8243
8303
  * **When to use**
8244
8304
  *
8245
- * Use when a timeout should be handled as absence. Use
8246
- * `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
8247
- * you want to run a fallback effect.
8305
+ * Use when a timeout of an `Effect` should be handled as `Option.none`.
8248
8306
  *
8249
8307
  * **Details**
8250
8308
  *
@@ -8294,9 +8352,7 @@ export const timeoutOption: {
8294
8352
  *
8295
8353
  * **When to use**
8296
8354
  *
8297
- * Use when a timeout should be handled as absence. Use
8298
- * `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
8299
- * you want to run a fallback effect.
8355
+ * Use when a timeout of an `Effect` should be handled as `Option.none`.
8300
8356
  *
8301
8357
  * **Details**
8302
8358
  *
@@ -8346,9 +8402,7 @@ export const timeoutOption: {
8346
8402
  *
8347
8403
  * **When to use**
8348
8404
  *
8349
- * Use when a timeout should be handled as absence. Use
8350
- * `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
8351
- * you want to run a fallback effect.
8405
+ * Use when a timeout of an `Effect` should be handled as `Option.none`.
8352
8406
  *
8353
8407
  * **Details**
8354
8408
  *
@@ -8399,9 +8453,7 @@ export const timeoutOption: {
8399
8453
  *
8400
8454
  * **When to use**
8401
8455
  *
8402
- * Use when a timeout should switch to a fallback effect. Use
8403
- * `timeout` when a timeout should fail the effect, and `timeoutOption` when a
8404
- * timeout should become `Option.none`.
8456
+ * Use when a timeout of an `Effect` should switch to a fallback effect.
8405
8457
  *
8406
8458
  * **Details**
8407
8459
  *
@@ -8453,9 +8505,7 @@ export const timeoutOrElse: {
8453
8505
  *
8454
8506
  * **When to use**
8455
8507
  *
8456
- * Use when a timeout should switch to a fallback effect. Use
8457
- * `timeout` when a timeout should fail the effect, and `timeoutOption` when a
8458
- * timeout should become `Option.none`.
8508
+ * Use when a timeout of an `Effect` should switch to a fallback effect.
8459
8509
  *
8460
8510
  * **Details**
8461
8511
  *
@@ -8512,9 +8562,7 @@ export const timeoutOrElse: {
8512
8562
  *
8513
8563
  * **When to use**
8514
8564
  *
8515
- * Use when a timeout should switch to a fallback effect. Use
8516
- * `timeout` when a timeout should fail the effect, and `timeoutOption` when a
8517
- * timeout should become `Option.none`.
8565
+ * Use when a timeout of an `Effect` should switch to a fallback effect.
8518
8566
  *
8519
8567
  * **Details**
8520
8568
  *
@@ -8885,6 +8933,11 @@ export const race: {
8885
8933
  * Races two effects and returns the result of the first one to complete, whether
8886
8934
  * it succeeds or fails.
8887
8935
  *
8936
+ * **When to use**
8937
+ *
8938
+ * Use when any completion, including failure, should decide the race and
8939
+ * interrupt the losing effect.
8940
+ *
8888
8941
  * **Details**
8889
8942
  *
8890
8943
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
@@ -8917,6 +8970,11 @@ export const raceFirst: {
8917
8970
  * Races two effects and returns the result of the first one to complete, whether
8918
8971
  * it succeeds or fails.
8919
8972
  *
8973
+ * **When to use**
8974
+ *
8975
+ * Use when any completion, including failure, should decide the race and
8976
+ * interrupt the losing effect.
8977
+ *
8920
8978
  * **Details**
8921
8979
  *
8922
8980
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
@@ -8956,6 +9014,11 @@ export const raceFirst: {
8956
9014
  * Races two effects and returns the result of the first one to complete, whether
8957
9015
  * it succeeds or fails.
8958
9016
  *
9017
+ * **When to use**
9018
+ *
9019
+ * Use when any completion, including failure, should decide the race and
9020
+ * interrupt the losing effect.
9021
+ *
8959
9022
  * **Details**
8960
9023
  *
8961
9024
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
@@ -9190,8 +9253,8 @@ export const filter: {
9190
9253
  *
9191
9254
  * **When to use**
9192
9255
  *
9193
- * Use to keep only iterable elements accepted by a `Filter` and collect each
9194
- * filter success value.
9256
+ * Use when you need to filter an iterable with a `Filter` inside an `Effect`,
9257
+ * collecting each filter success value.
9195
9258
  *
9196
9259
  * **Details**
9197
9260
  *
@@ -9210,8 +9273,8 @@ export const filterMap: {
9210
9273
  *
9211
9274
  * **When to use**
9212
9275
  *
9213
- * Use to keep only iterable elements accepted by a `Filter` and collect each
9214
- * filter success value.
9276
+ * Use when you need to filter an iterable with a `Filter` inside an `Effect`,
9277
+ * collecting each filter success value.
9215
9278
  *
9216
9279
  * **Details**
9217
9280
  *
@@ -9230,8 +9293,8 @@ export const filterMap: {
9230
9293
  *
9231
9294
  * **When to use**
9232
9295
  *
9233
- * Use to keep only iterable elements accepted by a `Filter` and collect each
9234
- * filter success value.
9296
+ * Use when you need to filter an iterable with a `Filter` inside an `Effect`,
9297
+ * collecting each filter success value.
9235
9298
  *
9236
9299
  * **Details**
9237
9300
  *
@@ -9252,8 +9315,8 @@ export const filterMap: {
9252
9315
  *
9253
9316
  * **When to use**
9254
9317
  *
9255
- * Use when filtering each iterable element requires effects and accepted
9256
- * elements should be transformed into successful output values.
9318
+ * Use when you need to filter each iterable element effectfully and transform
9319
+ * accepted elements into successful output values.
9257
9320
  *
9258
9321
  * **Details**
9259
9322
  *
@@ -9277,8 +9340,8 @@ export const filterMapEffect: {
9277
9340
  *
9278
9341
  * **When to use**
9279
9342
  *
9280
- * Use when filtering each iterable element requires effects and accepted
9281
- * elements should be transformed into successful output values.
9343
+ * Use when you need to filter each iterable element effectfully and transform
9344
+ * accepted elements into successful output values.
9282
9345
  *
9283
9346
  * **Details**
9284
9347
  *
@@ -9305,8 +9368,8 @@ export const filterMapEffect: {
9305
9368
  *
9306
9369
  * **When to use**
9307
9370
  *
9308
- * Use when filtering each iterable element requires effects and accepted
9309
- * elements should be transformed into successful output values.
9371
+ * Use when you need to filter each iterable element effectfully and transform
9372
+ * accepted elements into successful output values.
9310
9373
  *
9311
9374
  * **Details**
9312
9375
  *
@@ -9334,6 +9397,11 @@ export const filterMapEffect: {
9334
9397
  /**
9335
9398
  * Filters an effect, providing an alternative effect if the predicate fails.
9336
9399
  *
9400
+ * **When to use**
9401
+ *
9402
+ * Use when a successful value that fails a predicate should continue with an
9403
+ * effectful fallback instead of failing the effect.
9404
+ *
9337
9405
  * **Details**
9338
9406
  *
9339
9407
  * This function applies a predicate to the result of an effect. If the
@@ -9366,6 +9434,11 @@ export const filterOrElse: {
9366
9434
  /**
9367
9435
  * Filters an effect, providing an alternative effect if the predicate fails.
9368
9436
  *
9437
+ * **When to use**
9438
+ *
9439
+ * Use when a successful value that fails a predicate should continue with an
9440
+ * effectful fallback instead of failing the effect.
9441
+ *
9369
9442
  * **Details**
9370
9443
  *
9371
9444
  * This function applies a predicate to the result of an effect. If the
@@ -9401,6 +9474,11 @@ export const filterOrElse: {
9401
9474
  /**
9402
9475
  * Filters an effect, providing an alternative effect if the predicate fails.
9403
9476
  *
9477
+ * **When to use**
9478
+ *
9479
+ * Use when a successful value that fails a predicate should continue with an
9480
+ * effectful fallback instead of failing the effect.
9481
+ *
9404
9482
  * **Details**
9405
9483
  *
9406
9484
  * This function applies a predicate to the result of an effect. If the
@@ -9436,6 +9514,11 @@ export const filterOrElse: {
9436
9514
  /**
9437
9515
  * Filters an effect, providing an alternative effect if the predicate fails.
9438
9516
  *
9517
+ * **When to use**
9518
+ *
9519
+ * Use when a successful value that fails a predicate should continue with an
9520
+ * effectful fallback instead of failing the effect.
9521
+ *
9439
9522
  * **Details**
9440
9523
  *
9441
9524
  * This function applies a predicate to the result of an effect. If the
@@ -9472,6 +9555,11 @@ export const filterOrElse: {
9472
9555
  /**
9473
9556
  * Filters an effect, providing an alternative effect if the predicate fails.
9474
9557
  *
9558
+ * **When to use**
9559
+ *
9560
+ * Use when a successful value that fails a predicate should continue with an
9561
+ * effectful fallback instead of failing the effect.
9562
+ *
9475
9563
  * **Details**
9476
9564
  *
9477
9565
  * This function applies a predicate to the result of an effect. If the
@@ -9995,8 +10083,8 @@ export const filterMapOrFail: {
9995
10083
  *
9996
10084
  * **When to use**
9997
10085
  *
9998
- * Use when an effectful check decides whether to run another effect while
9999
- * representing the skipped case explicitly.
10086
+ * Use when you need an effectful check to decide whether another effect should
10087
+ * run while representing the skipped case explicitly.
10000
10088
  *
10001
10089
  * **Details**
10002
10090
  *
@@ -10036,8 +10124,8 @@ export const when: {
10036
10124
  *
10037
10125
  * **When to use**
10038
10126
  *
10039
- * Use when an effectful check decides whether to run another effect while
10040
- * representing the skipped case explicitly.
10127
+ * Use when you need an effectful check to decide whether another effect should
10128
+ * run while representing the skipped case explicitly.
10041
10129
  *
10042
10130
  * **Details**
10043
10131
  *
@@ -10077,8 +10165,8 @@ export const when: {
10077
10165
  *
10078
10166
  * **When to use**
10079
10167
  *
10080
- * Use when an effectful check decides whether to run another effect while
10081
- * representing the skipped case explicitly.
10168
+ * Use when you need an effectful check to decide whether another effect should
10169
+ * run while representing the skipped case explicitly.
10082
10170
  *
10083
10171
  * **Details**
10084
10172
  *
@@ -10120,8 +10208,8 @@ export const when: {
10120
10208
  *
10121
10209
  * **When to use**
10122
10210
  *
10123
- * Use when this is useful for structuring your code to respond differently to success or
10124
- * failure without triggering side effects.
10211
+ * Use when you need to fold an `Effect` into a value by handling success and
10212
+ * failure differently without triggering side effects.
10125
10213
  *
10126
10214
  * **Details**
10127
10215
  *
@@ -10177,8 +10265,8 @@ export const match: {
10177
10265
  *
10178
10266
  * **When to use**
10179
10267
  *
10180
- * Use when this is useful for structuring your code to respond differently to success or
10181
- * failure without triggering side effects.
10268
+ * Use when you need to fold an `Effect` into a value by handling success and
10269
+ * failure differently without triggering side effects.
10182
10270
  *
10183
10271
  * **Details**
10184
10272
  *
@@ -10239,8 +10327,8 @@ export const match: {
10239
10327
  *
10240
10328
  * **When to use**
10241
10329
  *
10242
- * Use when this is useful for structuring your code to respond differently to success or
10243
- * failure without triggering side effects.
10330
+ * Use when you need to fold an `Effect` into a value by handling success and
10331
+ * failure differently without triggering side effects.
10244
10332
  *
10245
10333
  * **Details**
10246
10334
  *
@@ -10300,9 +10388,8 @@ export const match: {
10300
10388
  *
10301
10389
  * **When to use**
10302
10390
  *
10303
- * Use when you need to handle both success and failure cases and want
10304
- * optimal performance for resolved effects. This is particularly useful in
10305
- * scenarios where you frequently work with already computed values.
10391
+ * Use when you need to handle both success and failure cases of an
10392
+ * already-resolved `Effect` with optimized handling.
10306
10393
  *
10307
10394
  * **Details**
10308
10395
  *
@@ -10337,9 +10424,8 @@ export const matchEager: {
10337
10424
  *
10338
10425
  * **When to use**
10339
10426
  *
10340
- * Use when you need to handle both success and failure cases and want
10341
- * optimal performance for resolved effects. This is particularly useful in
10342
- * scenarios where you frequently work with already computed values.
10427
+ * Use when you need to handle both success and failure cases of an
10428
+ * already-resolved `Effect` with optimized handling.
10343
10429
  *
10344
10430
  * **Details**
10345
10431
  *
@@ -10379,9 +10465,8 @@ export const matchEager: {
10379
10465
  *
10380
10466
  * **When to use**
10381
10467
  *
10382
- * Use when you need to handle both success and failure cases and want
10383
- * optimal performance for resolved effects. This is particularly useful in
10384
- * scenarios where you frequently work with already computed values.
10468
+ * Use when you need to handle both success and failure cases of an
10469
+ * already-resolved `Effect` with optimized handling.
10385
10470
  *
10386
10471
  * **Details**
10387
10472
  *
@@ -10423,9 +10508,8 @@ export const matchEager: {
10423
10508
  *
10424
10509
  * **When to use**
10425
10510
  *
10426
- * Use when this is useful for differentiating between different types of errors, such as
10427
- * regular failures, defects, or interruptions. You can provide specific
10428
- * handling logic for each failure type based on the cause.
10511
+ * Use when you need to fold an `Effect` while the failure handler inspects the
10512
+ * full `Cause`.
10429
10513
  *
10430
10514
  * **Details**
10431
10515
  *
@@ -10460,9 +10544,8 @@ export const matchCause: {
10460
10544
  *
10461
10545
  * **When to use**
10462
10546
  *
10463
- * Use when this is useful for differentiating between different types of errors, such as
10464
- * regular failures, defects, or interruptions. You can provide specific
10465
- * handling logic for each failure type based on the cause.
10547
+ * Use when you need to fold an `Effect` while the failure handler inspects the
10548
+ * full `Cause`.
10466
10549
  *
10467
10550
  * **Details**
10468
10551
  *
@@ -10502,9 +10585,8 @@ export const matchCause: {
10502
10585
  *
10503
10586
  * **When to use**
10504
10587
  *
10505
- * Use when this is useful for differentiating between different types of errors, such as
10506
- * regular failures, defects, or interruptions. You can provide specific
10507
- * handling logic for each failure type based on the cause.
10588
+ * Use when you need to fold an `Effect` while the failure handler inspects the
10589
+ * full `Cause`.
10508
10590
  *
10509
10591
  * **Details**
10510
10592
  *
@@ -10547,9 +10629,8 @@ export const matchCause: {
10547
10629
  *
10548
10630
  * **When to use**
10549
10631
  *
10550
- * Use when this is useful when you have effects that are likely to be already resolved
10551
- * and you want to avoid the overhead of the effect pipeline. For pending effects,
10552
- * it automatically falls back to the regular `matchCause` behavior.
10632
+ * Use when you expect an `Effect` to already be resolved and want to match the
10633
+ * `Cause` without regular effect pipeline overhead.
10553
10634
  *
10554
10635
  * **Details**
10555
10636
  *
@@ -10577,9 +10658,8 @@ export const matchCauseEager: {
10577
10658
  *
10578
10659
  * **When to use**
10579
10660
  *
10580
- * Use when this is useful when you have effects that are likely to be already resolved
10581
- * and you want to avoid the overhead of the effect pipeline. For pending effects,
10582
- * it automatically falls back to the regular `matchCause` behavior.
10661
+ * Use when you expect an `Effect` to already be resolved and want to match the
10662
+ * `Cause` without regular effect pipeline overhead.
10583
10663
  *
10584
10664
  * **Details**
10585
10665
  *
@@ -10612,9 +10692,8 @@ export const matchCauseEager: {
10612
10692
  *
10613
10693
  * **When to use**
10614
10694
  *
10615
- * Use when this is useful when you have effects that are likely to be already resolved
10616
- * and you want to avoid the overhead of the effect pipeline. For pending effects,
10617
- * it automatically falls back to the regular `matchCause` behavior.
10695
+ * Use when you expect an `Effect` to already be resolved and want to match the
10696
+ * `Cause` without regular effect pipeline overhead.
10618
10697
  *
10619
10698
  * **Details**
10620
10699
  *
@@ -10650,9 +10729,8 @@ export const matchCauseEager: {
10650
10729
  *
10651
10730
  * **When to use**
10652
10731
  *
10653
- * Use when success and cause-aware failure handlers return effects and the
10654
- * input may already be resolved, so the selected handler can run immediately
10655
- * while unresolved inputs keep normal effectful matching behavior.
10732
+ * Use when you need effectful success and cause-aware failure handlers for
10733
+ * `Effect` inputs that may already be resolved.
10656
10734
  *
10657
10735
  * **Details**
10658
10736
  *
@@ -10672,9 +10750,8 @@ export const matchCauseEffectEager: {
10672
10750
  *
10673
10751
  * **When to use**
10674
10752
  *
10675
- * Use when success and cause-aware failure handlers return effects and the
10676
- * input may already be resolved, so the selected handler can run immediately
10677
- * while unresolved inputs keep normal effectful matching behavior.
10753
+ * Use when you need effectful success and cause-aware failure handlers for
10754
+ * `Effect` inputs that may already be resolved.
10678
10755
  *
10679
10756
  * **Details**
10680
10757
  *
@@ -10699,9 +10776,8 @@ export const matchCauseEffectEager: {
10699
10776
  *
10700
10777
  * **When to use**
10701
10778
  *
10702
- * Use when success and cause-aware failure handlers return effects and the
10703
- * input may already be resolved, so the selected handler can run immediately
10704
- * while unresolved inputs keep normal effectful matching behavior.
10779
+ * Use when you need effectful success and cause-aware failure handlers for
10780
+ * `Effect` inputs that may already be resolved.
10705
10781
  *
10706
10782
  * **Details**
10707
10783
  *
@@ -10729,8 +10805,8 @@ export const matchCauseEffectEager: {
10729
10805
  *
10730
10806
  * **When to use**
10731
10807
  *
10732
- * Use when both success and failure handling must return effects and the
10733
- * failure branch needs the full `Cause`.
10808
+ * Use when you need to fold an `Effect` with effectful success handlers and
10809
+ * `Cause`-aware failure handlers.
10734
10810
  *
10735
10811
  * **Details**
10736
10812
  *
@@ -10789,8 +10865,8 @@ export const matchCauseEffect: {
10789
10865
  *
10790
10866
  * **When to use**
10791
10867
  *
10792
- * Use when both success and failure handling must return effects and the
10793
- * failure branch needs the full `Cause`.
10868
+ * Use when you need to fold an `Effect` with effectful success handlers and
10869
+ * `Cause`-aware failure handlers.
10794
10870
  *
10795
10871
  * **Details**
10796
10872
  *
@@ -10854,8 +10930,8 @@ export const matchCauseEffect: {
10854
10930
  *
10855
10931
  * **When to use**
10856
10932
  *
10857
- * Use when both success and failure handling must return effects and the
10858
- * failure branch needs the full `Cause`.
10933
+ * Use when you need to fold an `Effect` with effectful success handlers and
10934
+ * `Cause`-aware failure handlers.
10859
10935
  *
10860
10936
  * **Details**
10861
10937
  *
@@ -10922,7 +10998,8 @@ export const matchCauseEffect: {
10922
10998
  *
10923
10999
  * **When to use**
10924
11000
  *
10925
- * Use when the failure or success branch must run additional effects.
11001
+ * Use when you need to handle an `Effect`'s failure or success with handlers
11002
+ * that return effects.
10926
11003
  *
10927
11004
  * **Details**
10928
11005
  *
@@ -10982,7 +11059,8 @@ export const matchEffect: {
10982
11059
  *
10983
11060
  * **When to use**
10984
11061
  *
10985
- * Use when the failure or success branch must run additional effects.
11062
+ * Use when you need to handle an `Effect`'s failure or success with handlers
11063
+ * that return effects.
10986
11064
  *
10987
11065
  * **Details**
10988
11066
  *
@@ -11047,7 +11125,8 @@ export const matchEffect: {
11047
11125
  *
11048
11126
  * **When to use**
11049
11127
  *
11050
- * Use when the failure or success branch must run additional effects.
11128
+ * Use when you need to handle an `Effect`'s failure or success with handlers
11129
+ * that return effects.
11051
11130
  *
11052
11131
  * **Details**
11053
11132
  *
@@ -12303,6 +12382,11 @@ export const provideService: {
12303
12382
  /**
12304
12383
  * Provides one service to an effect using an effectful acquisition.
12305
12384
  *
12385
+ * **When to use**
12386
+ *
12387
+ * Use when the service implementation must be created by an effect and its
12388
+ * acquisition failure should remain in the returned effect.
12389
+ *
12306
12390
  * **Details**
12307
12391
  *
12308
12392
  * `provideServiceEffect` runs the acquisition effect to produce the service
@@ -12357,6 +12441,11 @@ export const provideServiceEffect: {
12357
12441
  /**
12358
12442
  * Provides one service to an effect using an effectful acquisition.
12359
12443
  *
12444
+ * **When to use**
12445
+ *
12446
+ * Use when the service implementation must be created by an effect and its
12447
+ * acquisition failure should remain in the returned effect.
12448
+ *
12360
12449
  * **Details**
12361
12450
  *
12362
12451
  * `provideServiceEffect` runs the acquisition effect to produce the service
@@ -12411,6 +12500,11 @@ export const provideServiceEffect: {
12411
12500
  /**
12412
12501
  * Provides one service to an effect using an effectful acquisition.
12413
12502
  *
12503
+ * **When to use**
12504
+ *
12505
+ * Use when the service implementation must be created by an effect and its
12506
+ * acquisition failure should remain in the returned effect.
12507
+ *
12414
12508
  * **Details**
12415
12509
  *
12416
12510
  * `provideServiceEffect` runs the acquisition effect to produce the service
@@ -12665,6 +12759,11 @@ export const scoped: <A, E, R>(
12665
12759
  /**
12666
12760
  * Creates a scoped effect by providing access to the scope.
12667
12761
  *
12762
+ * **When to use**
12763
+ *
12764
+ * Use when resource acquisition needs direct access to the scope being created,
12765
+ * for example to register finalizers manually.
12766
+ *
12668
12767
  * **Example** (Working with an explicit scope)
12669
12768
  *
12670
12769
  * ```ts
@@ -12777,8 +12876,8 @@ export const acquireRelease: <A, E, R, R2>(
12777
12876
  *
12778
12877
  * **When to use**
12779
12878
  *
12780
- * Use with JavaScript `Disposable` or `AsyncDisposable` resources that should
12781
- * be closed with the surrounding scope.
12879
+ * Use when you work with JavaScript `Disposable` or `AsyncDisposable` resources
12880
+ * that should be closed with the surrounding scope.
12782
12881
  *
12783
12882
  * **Details**
12784
12883
  *
@@ -13595,10 +13694,8 @@ export const onExitFilter: {
13595
13694
  *
13596
13695
  * **When to use**
13597
13696
  *
13598
- * Use when you use this function when you have an expensive or time-consuming operation that
13599
- * you want to avoid repeating. The first evaluation will compute the result,
13600
- * and all following evaluations will immediately return the cached value,
13601
- * improving performance and reducing unnecessary work.
13697
+ * Use when you need an expensive or time-consuming operation to be evaluated
13698
+ * once and reused by later callers.
13602
13699
  *
13603
13700
  * **Details**
13604
13701
  *
@@ -13660,14 +13757,8 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
13660
13757
  *
13661
13758
  * **When to use**
13662
13759
  *
13663
- * Use when you use this function when you have an effect that involves costly operations or
13664
- * computations, and you want to avoid repeating them within a short time frame.
13665
- *
13666
- * It's ideal for scenarios where the result of an effect doesn't change
13667
- * frequently and can be reused for a specified duration.
13668
- *
13669
- * By caching the result, you can improve efficiency and reduce unnecessary
13670
- * computations, especially in performance-critical applications.
13760
+ * Use when you need a costly effect result to be reused for a bounded duration
13761
+ * before being recomputed.
13671
13762
  *
13672
13763
  * **Details**
13673
13764
  *
@@ -13727,14 +13818,8 @@ export const cachedWithTTL: {
13727
13818
  *
13728
13819
  * **When to use**
13729
13820
  *
13730
- * Use when you use this function when you have an effect that involves costly operations or
13731
- * computations, and you want to avoid repeating them within a short time frame.
13732
- *
13733
- * It's ideal for scenarios where the result of an effect doesn't change
13734
- * frequently and can be reused for a specified duration.
13735
- *
13736
- * By caching the result, you can improve efficiency and reduce unnecessary
13737
- * computations, especially in performance-critical applications.
13821
+ * Use when you need a costly effect result to be reused for a bounded duration
13822
+ * before being recomputed.
13738
13823
  *
13739
13824
  * **Details**
13740
13825
  *
@@ -13794,14 +13879,8 @@ export const cachedWithTTL: {
13794
13879
  *
13795
13880
  * **When to use**
13796
13881
  *
13797
- * Use when you use this function when you have an effect that involves costly operations or
13798
- * computations, and you want to avoid repeating them within a short time frame.
13799
- *
13800
- * It's ideal for scenarios where the result of an effect doesn't change
13801
- * frequently and can be reused for a specified duration.
13802
- *
13803
- * By caching the result, you can improve efficiency and reduce unnecessary
13804
- * computations, especially in performance-critical applications.
13882
+ * Use when you need a costly effect result to be reused for a bounded duration
13883
+ * before being recomputed.
13805
13884
  *
13806
13885
  * **Details**
13807
13886
  *
@@ -14969,6 +15048,11 @@ export const repeat: {
14969
15048
  * Repeats an effect according to a schedule and runs a fallback effect if
14970
15049
  * repetition fails before the schedule completes.
14971
15050
  *
15051
+ * **When to use**
15052
+ *
15053
+ * Use when successful repetitions should follow a schedule, but failures from
15054
+ * the repeated effect or schedule need an effectful fallback.
15055
+ *
14972
15056
  * **Details**
14973
15057
  *
14974
15058
  * If the repeated effect or schedule step fails, `orElse` receives the failure
@@ -15012,6 +15096,11 @@ export const repeatOrElse: {
15012
15096
  * Repeats an effect according to a schedule and runs a fallback effect if
15013
15097
  * repetition fails before the schedule completes.
15014
15098
  *
15099
+ * **When to use**
15100
+ *
15101
+ * Use when successful repetitions should follow a schedule, but failures from
15102
+ * the repeated effect or schedule need an effectful fallback.
15103
+ *
15015
15104
  * **Details**
15016
15105
  *
15017
15106
  * If the repeated effect or schedule step fails, `orElse` receives the failure
@@ -15058,6 +15147,11 @@ export const repeatOrElse: {
15058
15147
  * Repeats an effect according to a schedule and runs a fallback effect if
15059
15148
  * repetition fails before the schedule completes.
15060
15149
  *
15150
+ * **When to use**
15151
+ *
15152
+ * Use when successful repetitions should follow a schedule, but failures from
15153
+ * the repeated effect or schedule need an effectful fallback.
15154
+ *
15061
15155
  * **Details**
15062
15156
  *
15063
15157
  * If the repeated effect or schedule step fails, `orElse` receives the failure
@@ -15108,9 +15202,8 @@ export const repeatOrElse: {
15108
15202
  *
15109
15203
  * **When to use**
15110
15204
  *
15111
- * Use to create an array containing the same effect multiple times when you
15112
- * want to pass those effects to another collector or control execution
15113
- * separately.
15205
+ * Use when you need an array of identical effect values without running them
15206
+ * yet.
15114
15207
  *
15115
15208
  * **Details**
15116
15209
  *
@@ -15128,9 +15221,8 @@ export const replicate: {
15128
15221
  *
15129
15222
  * **When to use**
15130
15223
  *
15131
- * Use to create an array containing the same effect multiple times when you
15132
- * want to pass those effects to another collector or control execution
15133
- * separately.
15224
+ * Use when you need an array of identical effect values without running them
15225
+ * yet.
15134
15226
  *
15135
15227
  * **Details**
15136
15228
  *
@@ -15148,9 +15240,8 @@ export const replicate: {
15148
15240
  *
15149
15241
  * **When to use**
15150
15242
  *
15151
- * Use to create an array containing the same effect multiple times when you
15152
- * want to pass those effects to another collector or control execution
15153
- * separately.
15243
+ * Use when you need an array of identical effect values without running them
15244
+ * yet.
15154
15245
  *
15155
15246
  * **Details**
15156
15247
  *
@@ -15168,6 +15259,11 @@ export const replicate: {
15168
15259
  /**
15169
15260
  * Performs this effect `n` times and collects results with `Effect.all` semantics.
15170
15261
  *
15262
+ * **When to use**
15263
+ *
15264
+ * Use when you want to run the repeated effects immediately, with optional
15265
+ * concurrency control or result discarding.
15266
+ *
15171
15267
  * **Details**
15172
15268
  *
15173
15269
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
@@ -15190,6 +15286,11 @@ export const replicateEffect: {
15190
15286
  /**
15191
15287
  * Performs this effect `n` times and collects results with `Effect.all` semantics.
15192
15288
  *
15289
+ * **When to use**
15290
+ *
15291
+ * Use when you want to run the repeated effects immediately, with optional
15292
+ * concurrency control or result discarding.
15293
+ *
15193
15294
  * **Details**
15194
15295
  *
15195
15296
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
@@ -15215,6 +15316,11 @@ export const replicateEffect: {
15215
15316
  /**
15216
15317
  * Performs this effect `n` times and collects results with `Effect.all` semantics.
15217
15318
  *
15319
+ * **When to use**
15320
+ *
15321
+ * Use when you want to run the repeated effects immediately, with optional
15322
+ * concurrency control or result discarding.
15323
+ *
15218
15324
  * **Details**
15219
15325
  *
15220
15326
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
@@ -15240,6 +15346,11 @@ export const replicateEffect: {
15240
15346
  /**
15241
15347
  * Performs this effect `n` times and collects results with `Effect.all` semantics.
15242
15348
  *
15349
+ * **When to use**
15350
+ *
15351
+ * Use when you want to run the repeated effects immediately, with optional
15352
+ * concurrency control or result discarding.
15353
+ *
15243
15354
  * **Details**
15244
15355
  *
15245
15356
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
@@ -15266,6 +15377,11 @@ export const replicateEffect: {
15266
15377
  /**
15267
15378
  * Performs this effect `n` times and collects results with `Effect.all` semantics.
15268
15379
  *
15380
+ * **When to use**
15381
+ *
15382
+ * Use when you want to run the repeated effects immediately, with optional
15383
+ * concurrency control or result discarding.
15384
+ *
15269
15385
  * **Details**
15270
15386
  *
15271
15387
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
@@ -16668,9 +16784,7 @@ export const withParentSpan: {
16668
16784
  *
16669
16785
  * **When to use**
16670
16786
  *
16671
- * Use to execute a typed `Request` through a `RequestResolver` when you want
16672
- * concurrent requests made with the same resolver to be collected and completed
16673
- * by resolver logic.
16787
+ * Use when you need resolver-driven batching for a typed `Request`.
16674
16788
  *
16675
16789
  * **Example** (Executing a request through a resolver)
16676
16790
  *
@@ -16712,9 +16826,7 @@ export const request: {
16712
16826
  *
16713
16827
  * **When to use**
16714
16828
  *
16715
- * Use to execute a typed `Request` through a `RequestResolver` when you want
16716
- * concurrent requests made with the same resolver to be collected and completed
16717
- * by resolver logic.
16829
+ * Use when you need resolver-driven batching for a typed `Request`.
16718
16830
  *
16719
16831
  * **Example** (Executing a request through a resolver)
16720
16832
  *
@@ -16756,9 +16868,7 @@ export const request: {
16756
16868
  *
16757
16869
  * **When to use**
16758
16870
  *
16759
- * Use to execute a typed `Request` through a `RequestResolver` when you want
16760
- * concurrent requests made with the same resolver to be collected and completed
16761
- * by resolver logic.
16871
+ * Use when you need resolver-driven batching for a typed `Request`.
16762
16872
  *
16763
16873
  * **Example** (Executing a request through a resolver)
16764
16874
  *
@@ -17198,9 +17308,7 @@ export interface RunOptions {
17198
17308
  *
17199
17309
  * **When to use**
17200
17310
  *
17201
- * Use when an effect should start in the background and return a fiber that can
17202
- * be observed or interrupted. Prefer this when you do not need a `Promise` or
17203
- * synchronous result.
17311
+ * Use when you need to start an effect in the background and receive a fiber.
17204
17312
  *
17205
17313
  * **Example** (Running an effect in the background)
17206
17314
  *
@@ -17232,6 +17340,11 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
17232
17340
  /**
17233
17341
  * Runs an effect in the background with the provided services.
17234
17342
  *
17343
+ * **When to use**
17344
+ *
17345
+ * Use when an effect still requires services, you already have a `Context`, and
17346
+ * you want a background fiber.
17347
+ *
17235
17348
  * **Example** (Running with services in the background)
17236
17349
  *
17237
17350
  * ```ts
@@ -17266,6 +17379,11 @@ export const runForkWith: <R>(
17266
17379
  /**
17267
17380
  * Forks an effect with the provided services, registers `onExit` as a fiber observer, and returns an interruptor.
17268
17381
  *
17382
+ * **When to use**
17383
+ *
17384
+ * Use when embedding an effect into callback-style code with explicit services
17385
+ * and a synchronous interruptor.
17386
+ *
17269
17387
  * **Details**
17270
17388
  *
17271
17389
  * The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
@@ -17402,6 +17520,11 @@ export const runPromise: <A, E>(
17402
17520
  /**
17403
17521
  * Executes an effect as a Promise with the provided services.
17404
17522
  *
17523
+ * **When to use**
17524
+ *
17525
+ * Use when you already have a `Context` and need Promise interop that rejects on
17526
+ * effect failure.
17527
+ *
17405
17528
  * **Example** (Running with services as a promise)
17406
17529
  *
17407
17530
  * ```ts
@@ -17443,10 +17566,9 @@ export const runPromiseWith: <R>(
17443
17566
  *
17444
17567
  * **Details**
17445
17568
  *
17446
- * The `Exit` type represents the result of the effect:
17447
- * - If the effect succeeds, the result is wrapped in a `Success`.
17448
- * - If it fails, the failure information is provided as a `Failure` containing
17449
- * a `Cause` type.
17569
+ * The `Exit` type represents the result of the effect. Successful effects are
17570
+ * wrapped in `Success`, and failed effects are wrapped in `Failure` with a
17571
+ * `Cause`.
17450
17572
  *
17451
17573
  * **Example** (Observing promise results as Exit)
17452
17574
  *
@@ -17489,6 +17611,11 @@ export const runPromiseExit: <A, E>(
17489
17611
  /**
17490
17612
  * Runs an effect and returns a Promise of Exit with provided services.
17491
17613
  *
17614
+ * **When to use**
17615
+ *
17616
+ * Use when you already have a `Context` and need Promise interop that preserves
17617
+ * success and failure as an `Exit`.
17618
+ *
17492
17619
  * **Example** (Running with services as an Exit promise)
17493
17620
  *
17494
17621
  * ```ts
@@ -17589,6 +17716,11 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
17589
17716
  /**
17590
17717
  * Executes an effect synchronously with provided services.
17591
17718
  *
17719
+ * **When to use**
17720
+ *
17721
+ * Use when you already have a `Context`, the effect is known to complete
17722
+ * synchronously, and failures should throw.
17723
+ *
17592
17724
  * **Example** (Running synchronously with services)
17593
17725
  *
17594
17726
  * ```ts
@@ -17631,10 +17763,9 @@ export const runSyncWith: <R>(
17631
17763
  *
17632
17764
  * **Details**
17633
17765
  *
17634
- * The `Exit` type represents the result of the effect:
17635
- * - If the effect succeeds, the result is wrapped in a `Success`.
17636
- * - If it fails, the failure information is provided as a `Failure` containing
17637
- * a `Cause` type.
17766
+ * The `Exit` type represents the result of the effect. Successful effects are
17767
+ * wrapped in `Success`, and failed effects are wrapped in `Failure` with a
17768
+ * `Cause`.
17638
17769
  *
17639
17770
  * If the effect contains asynchronous operations, `runSyncExit` will
17640
17771
  * return an `Failure` with a `Die` cause, indicating that the effect cannot be
@@ -17698,6 +17829,11 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
17698
17829
  /**
17699
17830
  * Runs an effect synchronously with provided services, returning an Exit result safely.
17700
17831
  *
17832
+ * **When to use**
17833
+ *
17834
+ * Use when you already have a `Context` and need a synchronous `Exit` instead of
17835
+ * throwing on failure.
17836
+ *
17701
17837
  * **Example** (Running synchronously with services as Exit)
17702
17838
  *
17703
17839
  * ```ts
@@ -24015,13 +24151,10 @@ export class Transaction extends Context.Service<
24015
24151
  * If called inside an active transaction, `tx` composes with the current transaction and reuses
24016
24152
  * its journal and retry state instead of creating a nested boundary.
24017
24153
  *
24018
- * In Effect transactions are optimistic with retry, that means transactions are retried when:
24019
- *
24020
- * - the body of the transaction explicitely calls to `Effect.txRetry` and any of the
24021
- * accessed transactional values changes.
24022
- *
24023
- * - any of the accessed transactional values change during the execution of the transaction
24024
- * due to a different transaction committing before the current.
24154
+ * Effect transactions are optimistic with retry. A transaction is retried when
24155
+ * its body explicitly calls `Effect.txRetry` and any accessed transactional
24156
+ * value changes, or when any accessed transactional value changes because a
24157
+ * different transaction commits before the current one.
24025
24158
  *
24026
24159
  * The outermost `tx` call creates the transaction boundary and commits or rolls back the full
24027
24160
  * composed transaction.
@@ -24758,11 +24891,8 @@ export const satisfiesServicesType = <R>() => <A, E, R2 extends R>(effect: Effec
24758
24891
  *
24759
24892
  * **Details**
24760
24893
  *
24761
- * Behavior:
24762
- *
24763
- * - For **Success effects**: Applies the mapping function immediately to the value
24764
- * - For **Failure effects**: Returns the failure as-is without applying the mapping
24765
- * - For **Pending effects**: Falls back to the regular `map` behavior
24894
+ * Success effects apply the mapping function immediately. Failure effects pass
24895
+ * through unchanged, and pending effects fall back to regular `map` behavior.
24766
24896
  *
24767
24897
  * **Example** (Mapping already completed effects)
24768
24898
  *
@@ -24792,11 +24922,8 @@ export const mapEager: {
24792
24922
  *
24793
24923
  * **Details**
24794
24924
  *
24795
- * Behavior:
24796
- *
24797
- * - For **Success effects**: Applies the mapping function immediately to the value
24798
- * - For **Failure effects**: Returns the failure as-is without applying the mapping
24799
- * - For **Pending effects**: Falls back to the regular `map` behavior
24925
+ * Success effects apply the mapping function immediately. Failure effects pass
24926
+ * through unchanged, and pending effects fall back to regular `map` behavior.
24800
24927
  *
24801
24928
  * **Example** (Mapping already completed effects)
24802
24929
  *
@@ -24826,11 +24953,8 @@ export const mapEager: {
24826
24953
  *
24827
24954
  * **Details**
24828
24955
  *
24829
- * Behavior:
24830
- *
24831
- * - For **Success effects**: Applies the mapping function immediately to the value
24832
- * - For **Failure effects**: Returns the failure as-is without applying the mapping
24833
- * - For **Pending effects**: Falls back to the regular `map` behavior
24956
+ * Success effects apply the mapping function immediately. Failure effects pass
24957
+ * through unchanged, and pending effects fall back to regular `map` behavior.
24834
24958
  *
24835
24959
  * **Example** (Mapping already completed effects)
24836
24960
  *
@@ -24863,11 +24987,9 @@ export const mapEager: {
24863
24987
  *
24864
24988
  * **Details**
24865
24989
  *
24866
- * Behavior:
24867
- *
24868
- * - For **Success effects**: Returns the success as-is (no error to transform)
24869
- * - For **Failure effects**: Applies the mapping function immediately to the error
24870
- * - For **Pending effects**: Falls back to the regular `mapError` behavior
24990
+ * Success effects pass through unchanged because there is no error to
24991
+ * transform. Failure effects apply the mapping function immediately, and
24992
+ * pending effects fall back to regular `mapError` behavior.
24871
24993
  *
24872
24994
  * **Example** (Mapping errors eagerly when possible)
24873
24995
  *
@@ -24901,11 +25023,9 @@ export const mapErrorEager: {
24901
25023
  *
24902
25024
  * **Details**
24903
25025
  *
24904
- * Behavior:
24905
- *
24906
- * - For **Success effects**: Returns the success as-is (no error to transform)
24907
- * - For **Failure effects**: Applies the mapping function immediately to the error
24908
- * - For **Pending effects**: Falls back to the regular `mapError` behavior
25026
+ * Success effects pass through unchanged because there is no error to
25027
+ * transform. Failure effects apply the mapping function immediately, and
25028
+ * pending effects fall back to regular `mapError` behavior.
24909
25029
  *
24910
25030
  * **Example** (Mapping errors eagerly when possible)
24911
25031
  *
@@ -24939,11 +25059,9 @@ export const mapErrorEager: {
24939
25059
  *
24940
25060
  * **Details**
24941
25061
  *
24942
- * Behavior:
24943
- *
24944
- * - For **Success effects**: Returns the success as-is (no error to transform)
24945
- * - For **Failure effects**: Applies the mapping function immediately to the error
24946
- * - For **Pending effects**: Falls back to the regular `mapError` behavior
25062
+ * Success effects pass through unchanged because there is no error to
25063
+ * transform. Failure effects apply the mapping function immediately, and
25064
+ * pending effects fall back to regular `mapError` behavior.
24947
25065
  *
24948
25066
  * **Example** (Mapping errors eagerly when possible)
24949
25067
  *
@@ -24978,11 +25096,9 @@ export const mapErrorEager: {
24978
25096
  *
24979
25097
  * **Details**
24980
25098
  *
24981
- * Behavior:
24982
- *
24983
- * - For **Success effects**: Applies the `onSuccess` function immediately to the value
24984
- * - For **Failure effects**: Applies the `onFailure` function immediately to the error
24985
- * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
25099
+ * Success effects apply `onSuccess` immediately, and failure effects apply
25100
+ * `onFailure` immediately. Pending effects fall back to regular `mapBoth`
25101
+ * behavior.
24986
25102
  *
24987
25103
  * **Example** (Mapping both channels eagerly when possible)
24988
25104
  *
@@ -25017,11 +25133,9 @@ export const mapBothEager: {
25017
25133
  *
25018
25134
  * **Details**
25019
25135
  *
25020
- * Behavior:
25021
- *
25022
- * - For **Success effects**: Applies the `onSuccess` function immediately to the value
25023
- * - For **Failure effects**: Applies the `onFailure` function immediately to the error
25024
- * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
25136
+ * Success effects apply `onSuccess` immediately, and failure effects apply
25137
+ * `onFailure` immediately. Pending effects fall back to regular `mapBoth`
25138
+ * behavior.
25025
25139
  *
25026
25140
  * **Example** (Mapping both channels eagerly when possible)
25027
25141
  *
@@ -25058,11 +25172,9 @@ export const mapBothEager: {
25058
25172
  *
25059
25173
  * **Details**
25060
25174
  *
25061
- * Behavior:
25062
- *
25063
- * - For **Success effects**: Applies the `onSuccess` function immediately to the value
25064
- * - For **Failure effects**: Applies the `onFailure` function immediately to the error
25065
- * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
25175
+ * Success effects apply `onSuccess` immediately, and failure effects apply
25176
+ * `onFailure` immediately. Pending effects fall back to regular `mapBoth`
25177
+ * behavior.
25066
25178
  *
25067
25179
  * **Example** (Mapping both channels eagerly when possible)
25068
25180
  *
@@ -25102,11 +25214,9 @@ export const mapBothEager: {
25102
25214
  *
25103
25215
  * **Details**
25104
25216
  *
25105
- * Behavior:
25106
- *
25107
- * - For **Success effects**: Applies the flatMap function immediately to the value
25108
- * - For **Failure effects**: Returns the failure as-is without applying the flatMap
25109
- * - For **Pending effects**: Falls back to the regular `flatMap` behavior
25217
+ * Success effects apply the flatMap function immediately. Failure effects pass
25218
+ * through unchanged, and pending effects fall back to regular `flatMap`
25219
+ * behavior.
25110
25220
  *
25111
25221
  * **Example** (Flat mapping eagerly when possible)
25112
25222
  *
@@ -25139,11 +25249,9 @@ export const flatMapEager: {
25139
25249
  *
25140
25250
  * **Details**
25141
25251
  *
25142
- * Behavior:
25143
- *
25144
- * - For **Success effects**: Applies the flatMap function immediately to the value
25145
- * - For **Failure effects**: Returns the failure as-is without applying the flatMap
25146
- * - For **Pending effects**: Falls back to the regular `flatMap` behavior
25252
+ * Success effects apply the flatMap function immediately. Failure effects pass
25253
+ * through unchanged, and pending effects fall back to regular `flatMap`
25254
+ * behavior.
25147
25255
  *
25148
25256
  * **Example** (Flat mapping eagerly when possible)
25149
25257
  *
@@ -25176,11 +25284,9 @@ export const flatMapEager: {
25176
25284
  *
25177
25285
  * **Details**
25178
25286
  *
25179
- * Behavior:
25180
- *
25181
- * - For **Success effects**: Applies the flatMap function immediately to the value
25182
- * - For **Failure effects**: Returns the failure as-is without applying the flatMap
25183
- * - For **Pending effects**: Falls back to the regular `flatMap` behavior
25287
+ * Success effects apply the flatMap function immediately. Failure effects pass
25288
+ * through unchanged, and pending effects fall back to regular `flatMap`
25289
+ * behavior.
25184
25290
  *
25185
25291
  * **Example** (Flat mapping eagerly when possible)
25186
25292
  *
@@ -25215,11 +25321,9 @@ export const flatMapEager: {
25215
25321
  *
25216
25322
  * **Details**
25217
25323
  *
25218
- * Behavior:
25219
- *
25220
- * - For **Success effects**: Returns the success as-is (no error to catch)
25221
- * - For **Failure effects**: Applies the catch function immediately to the error
25222
- * - For **Pending effects**: Falls back to the regular `catch` behavior
25324
+ * Success effects pass through unchanged because there is no error to catch.
25325
+ * Failure effects apply the catch function immediately, and pending effects
25326
+ * fall back to regular `catch` behavior.
25223
25327
  *
25224
25328
  * **Example** (Catching failures eagerly when possible)
25225
25329
  *
@@ -25262,11 +25366,9 @@ export const catchEager: {
25262
25366
  *
25263
25367
  * **Details**
25264
25368
  *
25265
- * Behavior:
25266
- *
25267
- * - For **Success effects**: Returns the success as-is (no error to catch)
25268
- * - For **Failure effects**: Applies the catch function immediately to the error
25269
- * - For **Pending effects**: Falls back to the regular `catch` behavior
25369
+ * Success effects pass through unchanged because there is no error to catch.
25370
+ * Failure effects apply the catch function immediately, and pending effects
25371
+ * fall back to regular `catch` behavior.
25270
25372
  *
25271
25373
  * **Example** (Catching failures eagerly when possible)
25272
25374
  *
@@ -25309,11 +25411,9 @@ export const catchEager: {
25309
25411
  *
25310
25412
  * **Details**
25311
25413
  *
25312
- * Behavior:
25313
- *
25314
- * - For **Success effects**: Returns the success as-is (no error to catch)
25315
- * - For **Failure effects**: Applies the catch function immediately to the error
25316
- * - For **Pending effects**: Falls back to the regular `catch` behavior
25414
+ * Success effects pass through unchanged because there is no error to catch.
25415
+ * Failure effects apply the catch function immediately, and pending effects
25416
+ * fall back to regular `catch` behavior.
25317
25417
  *
25318
25418
  * **Example** (Catching failures eagerly when possible)
25319
25419
  *