effect 4.0.0-beta.102 → 4.0.0-beta.104

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 (1637) hide show
  1. package/dist/Array.d.ts +971 -1037
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +381 -407
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +433 -756
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +200 -325
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +207 -267
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +107 -135
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +146 -188
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +64 -84
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.js.map +1 -1
  18. package/dist/Cache.d.ts +405 -254
  19. package/dist/Cache.d.ts.map +1 -1
  20. package/dist/Cache.js +167 -102
  21. package/dist/Cache.js.map +1 -1
  22. package/dist/Cause.d.ts +167 -277
  23. package/dist/Cause.d.ts.map +1 -1
  24. package/dist/Cause.js +122 -176
  25. package/dist/Cause.js.map +1 -1
  26. package/dist/Channel.d.ts +730 -769
  27. package/dist/Channel.d.ts.map +1 -1
  28. package/dist/Channel.js +514 -440
  29. package/dist/Channel.js.map +1 -1
  30. package/dist/ChannelSchema.d.ts +1 -1
  31. package/dist/ChannelSchema.d.ts.map +1 -1
  32. package/dist/ChannelSchema.js.map +1 -1
  33. package/dist/Chunk.d.ts +834 -1173
  34. package/dist/Chunk.d.ts.map +1 -1
  35. package/dist/Chunk.js +326 -439
  36. package/dist/Chunk.js.map +1 -1
  37. package/dist/Clock.d.ts +180 -49
  38. package/dist/Clock.d.ts.map +1 -1
  39. package/dist/Clock.js +96 -31
  40. package/dist/Clock.js.map +1 -1
  41. package/dist/Combiner.d.ts +20 -33
  42. package/dist/Combiner.d.ts.map +1 -1
  43. package/dist/Combiner.js +18 -30
  44. package/dist/Combiner.js.map +1 -1
  45. package/dist/Config.d.ts +225 -173
  46. package/dist/Config.d.ts.map +1 -1
  47. package/dist/Config.js +357 -265
  48. package/dist/Config.js.map +1 -1
  49. package/dist/ConfigProvider.d.ts +194 -68
  50. package/dist/ConfigProvider.d.ts.map +1 -1
  51. package/dist/ConfigProvider.js +117 -81
  52. package/dist/ConfigProvider.js.map +1 -1
  53. package/dist/Console.d.ts +233 -33
  54. package/dist/Console.d.ts.map +1 -1
  55. package/dist/Console.js +232 -32
  56. package/dist/Console.js.map +1 -1
  57. package/dist/Context.d.ts +153 -276
  58. package/dist/Context.d.ts.map +1 -1
  59. package/dist/Context.js +171 -214
  60. package/dist/Context.js.map +1 -1
  61. package/dist/Cron.d.ts +68 -77
  62. package/dist/Cron.d.ts.map +1 -1
  63. package/dist/Cron.js +57 -66
  64. package/dist/Cron.js.map +1 -1
  65. package/dist/Crypto.d.ts +13 -15
  66. package/dist/Crypto.d.ts.map +1 -1
  67. package/dist/Crypto.js +22 -15
  68. package/dist/Crypto.js.map +1 -1
  69. package/dist/Data.d.ts +60 -80
  70. package/dist/Data.d.ts.map +1 -1
  71. package/dist/Data.js +16 -23
  72. package/dist/Data.js.map +1 -1
  73. package/dist/DateTime.d.ts +562 -660
  74. package/dist/DateTime.d.ts.map +1 -1
  75. package/dist/DateTime.js +307 -362
  76. package/dist/DateTime.js.map +1 -1
  77. package/dist/Deferred.d.ts +253 -256
  78. package/dist/Deferred.d.ts.map +1 -1
  79. package/dist/Deferred.js +104 -96
  80. package/dist/Deferred.js.map +1 -1
  81. package/dist/Duration.d.ts +216 -308
  82. package/dist/Duration.d.ts.map +1 -1
  83. package/dist/Duration.js +144 -187
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2993 -3281
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +1360 -1546
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.js.map +1 -1
  90. package/dist/Encoding.d.ts +22 -40
  91. package/dist/Encoding.d.ts.map +1 -1
  92. package/dist/Encoding.js +22 -40
  93. package/dist/Encoding.js.map +1 -1
  94. package/dist/Equal.d.ts +33 -37
  95. package/dist/Equal.d.ts.map +1 -1
  96. package/dist/Equal.js +39 -23
  97. package/dist/Equal.js.map +1 -1
  98. package/dist/Equivalence.d.ts +103 -105
  99. package/dist/Equivalence.d.ts.map +1 -1
  100. package/dist/Equivalence.js +77 -79
  101. package/dist/Equivalence.js.map +1 -1
  102. package/dist/ErrorReporter.d.ts +51 -27
  103. package/dist/ErrorReporter.d.ts.map +1 -1
  104. package/dist/ErrorReporter.js +50 -26
  105. package/dist/ErrorReporter.js.map +1 -1
  106. package/dist/ExecutionPlan.d.ts +86 -55
  107. package/dist/ExecutionPlan.d.ts.map +1 -1
  108. package/dist/ExecutionPlan.js +8 -29
  109. package/dist/ExecutionPlan.js.map +1 -1
  110. package/dist/Exit.d.ts +116 -192
  111. package/dist/Exit.d.ts.map +1 -1
  112. package/dist/Exit.js +82 -130
  113. package/dist/Exit.js.map +1 -1
  114. package/dist/Fiber.d.ts +82 -146
  115. package/dist/Fiber.d.ts.map +1 -1
  116. package/dist/Fiber.js +48 -87
  117. package/dist/Fiber.js.map +1 -1
  118. package/dist/FiberHandle.d.ts +152 -105
  119. package/dist/FiberHandle.d.ts.map +1 -1
  120. package/dist/FiberHandle.js +106 -73
  121. package/dist/FiberHandle.js.map +1 -1
  122. package/dist/FiberMap.d.ts +213 -168
  123. package/dist/FiberMap.d.ts.map +1 -1
  124. package/dist/FiberMap.js +114 -89
  125. package/dist/FiberMap.js.map +1 -1
  126. package/dist/FiberSet.d.ts +123 -81
  127. package/dist/FiberSet.d.ts.map +1 -1
  128. package/dist/FiberSet.js +86 -60
  129. package/dist/FiberSet.js.map +1 -1
  130. package/dist/FileSystem.d.ts +154 -265
  131. package/dist/FileSystem.d.ts.map +1 -1
  132. package/dist/FileSystem.js +42 -147
  133. package/dist/FileSystem.js.map +1 -1
  134. package/dist/Filter.d.ts +61 -33
  135. package/dist/Filter.d.ts.map +1 -1
  136. package/dist/Filter.js +26 -15
  137. package/dist/Filter.js.map +1 -1
  138. package/dist/Formatter.d.ts +25 -33
  139. package/dist/Formatter.d.ts.map +1 -1
  140. package/dist/Formatter.js +48 -49
  141. package/dist/Formatter.js.map +1 -1
  142. package/dist/Function.d.ts +80 -148
  143. package/dist/Function.d.ts.map +1 -1
  144. package/dist/Function.js +45 -62
  145. package/dist/Function.js.map +1 -1
  146. package/dist/Graph.d.ts +360 -714
  147. package/dist/Graph.d.ts.map +1 -1
  148. package/dist/Graph.js +168 -297
  149. package/dist/Graph.js.map +1 -1
  150. package/dist/HKT.d.ts +12 -6
  151. package/dist/HKT.d.ts.map +1 -1
  152. package/dist/Hash.d.ts +47 -83
  153. package/dist/Hash.d.ts.map +1 -1
  154. package/dist/Hash.js +46 -68
  155. package/dist/Hash.js.map +1 -1
  156. package/dist/HashMap.d.ts +319 -411
  157. package/dist/HashMap.d.ts.map +1 -1
  158. package/dist/HashMap.js +122 -166
  159. package/dist/HashMap.js.map +1 -1
  160. package/dist/HashRing.d.ts.map +1 -1
  161. package/dist/HashRing.js +1 -0
  162. package/dist/HashRing.js.map +1 -1
  163. package/dist/HashSet.d.ts +177 -284
  164. package/dist/HashSet.d.ts.map +1 -1
  165. package/dist/HashSet.js +68 -109
  166. package/dist/HashSet.js.map +1 -1
  167. package/dist/Inspectable.d.ts +12 -12
  168. package/dist/Inspectable.js +8 -8
  169. package/dist/Inspectable.js.map +1 -1
  170. package/dist/Iterable.d.ts +620 -786
  171. package/dist/Iterable.d.ts.map +1 -1
  172. package/dist/Iterable.js +239 -316
  173. package/dist/Iterable.js.map +1 -1
  174. package/dist/JsonPatch.d.ts +11 -13
  175. package/dist/JsonPatch.d.ts.map +1 -1
  176. package/dist/JsonPatch.js +44 -102
  177. package/dist/JsonPatch.js.map +1 -1
  178. package/dist/JsonPointer.d.ts +8 -8
  179. package/dist/JsonPointer.js +8 -8
  180. package/dist/JsonPointer.js.map +1 -1
  181. package/dist/JsonSchema.d.ts +98 -44
  182. package/dist/JsonSchema.d.ts.map +1 -1
  183. package/dist/JsonSchema.js +297 -234
  184. package/dist/JsonSchema.js.map +1 -1
  185. package/dist/Latch.d.ts +23 -35
  186. package/dist/Latch.d.ts.map +1 -1
  187. package/dist/Latch.js +16 -28
  188. package/dist/Latch.js.map +1 -1
  189. package/dist/Layer.d.ts +359 -260
  190. package/dist/Layer.d.ts.map +1 -1
  191. package/dist/Layer.js +202 -180
  192. package/dist/Layer.js.map +1 -1
  193. package/dist/LayerMap.d.ts +42 -29
  194. package/dist/LayerMap.d.ts.map +1 -1
  195. package/dist/LayerMap.js +31 -21
  196. package/dist/LayerMap.js.map +1 -1
  197. package/dist/LayerRef.d.ts +6 -2
  198. package/dist/LayerRef.d.ts.map +1 -1
  199. package/dist/LayerRef.js +6 -2
  200. package/dist/LayerRef.js.map +1 -1
  201. package/dist/LogLevel.d.ts +114 -214
  202. package/dist/LogLevel.d.ts.map +1 -1
  203. package/dist/LogLevel.js +41 -76
  204. package/dist/LogLevel.js.map +1 -1
  205. package/dist/Logger.d.ts +218 -467
  206. package/dist/Logger.d.ts.map +1 -1
  207. package/dist/Logger.js +204 -450
  208. package/dist/Logger.js.map +1 -1
  209. package/dist/ManagedRuntime.d.ts +7 -5
  210. package/dist/ManagedRuntime.d.ts.map +1 -1
  211. package/dist/ManagedRuntime.js +7 -5
  212. package/dist/ManagedRuntime.js.map +1 -1
  213. package/dist/Match.d.ts +217 -252
  214. package/dist/Match.d.ts.map +1 -1
  215. package/dist/Match.js +150 -183
  216. package/dist/Match.js.map +1 -1
  217. package/dist/Metric.d.ts +442 -993
  218. package/dist/Metric.d.ts.map +1 -1
  219. package/dist/Metric.js +198 -642
  220. package/dist/Metric.js.map +1 -1
  221. package/dist/MutableHashMap.d.ts +144 -173
  222. package/dist/MutableHashMap.d.ts.map +1 -1
  223. package/dist/MutableHashMap.js +68 -79
  224. package/dist/MutableHashMap.js.map +1 -1
  225. package/dist/MutableHashSet.d.ts +84 -89
  226. package/dist/MutableHashSet.d.ts.map +1 -1
  227. package/dist/MutableHashSet.js +44 -47
  228. package/dist/MutableHashSet.js.map +1 -1
  229. package/dist/MutableList.d.ts +71 -370
  230. package/dist/MutableList.d.ts.map +1 -1
  231. package/dist/MutableList.js +59 -284
  232. package/dist/MutableList.js.map +1 -1
  233. package/dist/MutableRef.d.ts +420 -243
  234. package/dist/MutableRef.d.ts.map +1 -1
  235. package/dist/MutableRef.js +209 -120
  236. package/dist/MutableRef.js.map +1 -1
  237. package/dist/Newtype.d.ts +21 -14
  238. package/dist/Newtype.d.ts.map +1 -1
  239. package/dist/Newtype.js +15 -13
  240. package/dist/Newtype.js.map +1 -1
  241. package/dist/NonEmptyIterable.d.ts +7 -137
  242. package/dist/NonEmptyIterable.d.ts.map +1 -1
  243. package/dist/NonEmptyIterable.js +5 -93
  244. package/dist/NonEmptyIterable.js.map +1 -1
  245. package/dist/Number.d.ts +196 -233
  246. package/dist/Number.d.ts.map +1 -1
  247. package/dist/Number.js +90 -109
  248. package/dist/Number.js.map +1 -1
  249. package/dist/Optic.d.ts +97 -189
  250. package/dist/Optic.d.ts.map +1 -1
  251. package/dist/Optic.js +187 -290
  252. package/dist/Optic.js.map +1 -1
  253. package/dist/Option.d.ts +447 -812
  254. package/dist/Option.d.ts.map +1 -1
  255. package/dist/Option.js +211 -392
  256. package/dist/Option.js.map +1 -1
  257. package/dist/Order.d.ts +109 -109
  258. package/dist/Order.js +91 -91
  259. package/dist/Order.js.map +1 -1
  260. package/dist/Ordering.d.ts +20 -23
  261. package/dist/Ordering.d.ts.map +1 -1
  262. package/dist/Ordering.js +8 -9
  263. package/dist/Ordering.js.map +1 -1
  264. package/dist/PartitionedSemaphore.js.map +1 -1
  265. package/dist/Path.d.ts +38 -41
  266. package/dist/Path.d.ts.map +1 -1
  267. package/dist/Path.js +3 -4
  268. package/dist/Path.js.map +1 -1
  269. package/dist/Pipeable.d.ts +6 -5
  270. package/dist/Pipeable.d.ts.map +1 -1
  271. package/dist/Pipeable.js +2 -2
  272. package/dist/Pipeable.js.map +1 -1
  273. package/dist/PlatformError.d.ts +4 -4
  274. package/dist/PlatformError.js +3 -3
  275. package/dist/PlatformError.js.map +1 -1
  276. package/dist/Pool.d.ts +4 -2
  277. package/dist/Pool.d.ts.map +1 -1
  278. package/dist/Pool.js +4 -2
  279. package/dist/Pool.js.map +1 -1
  280. package/dist/Predicate.d.ts +200 -181
  281. package/dist/Predicate.d.ts.map +1 -1
  282. package/dist/Predicate.js +100 -108
  283. package/dist/Predicate.js.map +1 -1
  284. package/dist/PrimaryKey.d.ts +7 -7
  285. package/dist/PrimaryKey.js +5 -5
  286. package/dist/PrimaryKey.js.map +1 -1
  287. package/dist/PubSub.d.ts +425 -494
  288. package/dist/PubSub.d.ts.map +1 -1
  289. package/dist/PubSub.js +373 -362
  290. package/dist/PubSub.js.map +1 -1
  291. package/dist/Pull.d.ts +24 -18
  292. package/dist/Pull.d.ts.map +1 -1
  293. package/dist/Pull.js +11 -9
  294. package/dist/Pull.js.map +1 -1
  295. package/dist/Queue.d.ts +200 -159
  296. package/dist/Queue.d.ts.map +1 -1
  297. package/dist/Queue.js +162 -132
  298. package/dist/Queue.js.map +1 -1
  299. package/dist/Random.d.ts +49 -74
  300. package/dist/Random.d.ts.map +1 -1
  301. package/dist/Random.js +35 -54
  302. package/dist/Random.js.map +1 -1
  303. package/dist/RcMap.d.ts +121 -63
  304. package/dist/RcMap.d.ts.map +1 -1
  305. package/dist/RcMap.js +42 -21
  306. package/dist/RcMap.js.map +1 -1
  307. package/dist/RcRef.d.ts +24 -13
  308. package/dist/RcRef.d.ts.map +1 -1
  309. package/dist/RcRef.js +15 -9
  310. package/dist/RcRef.js.map +1 -1
  311. package/dist/Record.d.ts +291 -488
  312. package/dist/Record.d.ts.map +1 -1
  313. package/dist/Record.js +111 -202
  314. package/dist/Record.js.map +1 -1
  315. package/dist/Redactable.d.ts +6 -2
  316. package/dist/Redactable.d.ts.map +1 -1
  317. package/dist/Redactable.js +7 -2
  318. package/dist/Redactable.js.map +1 -1
  319. package/dist/Redacted.d.ts +25 -25
  320. package/dist/Redacted.d.ts.map +1 -1
  321. package/dist/Redacted.js +19 -20
  322. package/dist/Redacted.js.map +1 -1
  323. package/dist/Reducer.d.ts +8 -15
  324. package/dist/Reducer.d.ts.map +1 -1
  325. package/dist/Reducer.js +6 -12
  326. package/dist/Reducer.js.map +1 -1
  327. package/dist/Ref.d.ts +95 -165
  328. package/dist/Ref.d.ts.map +1 -1
  329. package/dist/Ref.js +75 -122
  330. package/dist/Ref.js.map +1 -1
  331. package/dist/References.d.ts +102 -168
  332. package/dist/References.d.ts.map +1 -1
  333. package/dist/References.js +102 -168
  334. package/dist/References.js.map +1 -1
  335. package/dist/RegExp.d.ts +10 -14
  336. package/dist/RegExp.d.ts.map +1 -1
  337. package/dist/RegExp.js +10 -14
  338. package/dist/RegExp.js.map +1 -1
  339. package/dist/Request.d.ts +31 -21
  340. package/dist/Request.d.ts.map +1 -1
  341. package/dist/Request.js +16 -13
  342. package/dist/Request.js.map +1 -1
  343. package/dist/RequestResolver.d.ts +201 -90
  344. package/dist/RequestResolver.d.ts.map +1 -1
  345. package/dist/RequestResolver.js +87 -41
  346. package/dist/RequestResolver.js.map +1 -1
  347. package/dist/Resource.js.map +1 -1
  348. package/dist/Result.d.ts +302 -470
  349. package/dist/Result.d.ts.map +1 -1
  350. package/dist/Result.js +133 -217
  351. package/dist/Result.js.map +1 -1
  352. package/dist/Runtime.d.ts +50 -75
  353. package/dist/Runtime.d.ts.map +1 -1
  354. package/dist/Runtime.js +39 -60
  355. package/dist/Runtime.js.map +1 -1
  356. package/dist/Schedule.d.ts +292 -1638
  357. package/dist/Schedule.d.ts.map +1 -1
  358. package/dist/Schedule.js +164 -805
  359. package/dist/Schedule.js.map +1 -1
  360. package/dist/Scheduler.d.ts +5 -5
  361. package/dist/Scheduler.d.ts.map +1 -1
  362. package/dist/Scheduler.js +18 -6
  363. package/dist/Scheduler.js.map +1 -1
  364. package/dist/Schema.d.ts +676 -674
  365. package/dist/Schema.d.ts.map +1 -1
  366. package/dist/Schema.js +513 -544
  367. package/dist/Schema.js.map +1 -1
  368. package/dist/SchemaAST.d.ts +30 -53
  369. package/dist/SchemaAST.d.ts.map +1 -1
  370. package/dist/SchemaAST.js +404 -301
  371. package/dist/SchemaAST.js.map +1 -1
  372. package/dist/SchemaError.d.ts +7 -6
  373. package/dist/SchemaError.d.ts.map +1 -1
  374. package/dist/SchemaError.js +7 -6
  375. package/dist/SchemaError.js.map +1 -1
  376. package/dist/SchemaGetter.d.ts +217 -174
  377. package/dist/SchemaGetter.d.ts.map +1 -1
  378. package/dist/SchemaGetter.js +218 -185
  379. package/dist/SchemaGetter.js.map +1 -1
  380. package/dist/SchemaIssue.d.ts +62 -190
  381. package/dist/SchemaIssue.d.ts.map +1 -1
  382. package/dist/SchemaIssue.js +73 -265
  383. package/dist/SchemaIssue.js.map +1 -1
  384. package/dist/SchemaParser.d.ts +2 -2
  385. package/dist/SchemaParser.d.ts.map +1 -1
  386. package/dist/SchemaParser.js +137 -107
  387. package/dist/SchemaParser.js.map +1 -1
  388. package/dist/SchemaRepresentation.d.ts +22 -36
  389. package/dist/SchemaRepresentation.d.ts.map +1 -1
  390. package/dist/SchemaRepresentation.js +20 -26
  391. package/dist/SchemaRepresentation.js.map +1 -1
  392. package/dist/SchemaTransformation.d.ts +114 -74
  393. package/dist/SchemaTransformation.d.ts.map +1 -1
  394. package/dist/SchemaTransformation.js +120 -85
  395. package/dist/SchemaTransformation.js.map +1 -1
  396. package/dist/Scope.d.ts +123 -151
  397. package/dist/Scope.d.ts.map +1 -1
  398. package/dist/Scope.js +72 -92
  399. package/dist/Scope.js.map +1 -1
  400. package/dist/ScopedCache.js +1 -1
  401. package/dist/ScopedCache.js.map +1 -1
  402. package/dist/ScopedRef.d.ts +3 -3
  403. package/dist/ScopedRef.js +2 -2
  404. package/dist/ScopedRef.js.map +1 -1
  405. package/dist/Semaphore.d.ts +96 -10
  406. package/dist/Semaphore.d.ts.map +1 -1
  407. package/dist/Semaphore.js +78 -39
  408. package/dist/Semaphore.js.map +1 -1
  409. package/dist/Sink.d.ts +118 -108
  410. package/dist/Sink.d.ts.map +1 -1
  411. package/dist/Sink.js +107 -100
  412. package/dist/Sink.js.map +1 -1
  413. package/dist/Stdio.d.ts +1 -1
  414. package/dist/Stdio.js.map +1 -1
  415. package/dist/Stream.d.ts +2442 -2953
  416. package/dist/Stream.d.ts.map +1 -1
  417. package/dist/Stream.js +1105 -1383
  418. package/dist/Stream.js.map +1 -1
  419. package/dist/String.d.ts +262 -308
  420. package/dist/String.d.ts.map +1 -1
  421. package/dist/String.js +184 -215
  422. package/dist/String.js.map +1 -1
  423. package/dist/Struct.d.ts +109 -114
  424. package/dist/Struct.d.ts.map +1 -1
  425. package/dist/Struct.js +41 -50
  426. package/dist/Struct.js.map +1 -1
  427. package/dist/SubscriptionRef.d.ts +282 -250
  428. package/dist/SubscriptionRef.d.ts.map +1 -1
  429. package/dist/SubscriptionRef.js +104 -92
  430. package/dist/SubscriptionRef.js.map +1 -1
  431. package/dist/Symbol.d.ts +3 -3
  432. package/dist/Symbol.js +3 -3
  433. package/dist/Symbol.js.map +1 -1
  434. package/dist/SynchronizedRef.js +1 -1
  435. package/dist/SynchronizedRef.js.map +1 -1
  436. package/dist/Take.js.map +1 -1
  437. package/dist/Terminal.d.ts +2 -2
  438. package/dist/Terminal.js +2 -2
  439. package/dist/Terminal.js.map +1 -1
  440. package/dist/Tracer.d.ts +100 -54
  441. package/dist/Tracer.d.ts.map +1 -1
  442. package/dist/Tracer.js +41 -24
  443. package/dist/Tracer.js.map +1 -1
  444. package/dist/Trie.d.ts +287 -679
  445. package/dist/Trie.d.ts.map +1 -1
  446. package/dist/Trie.js +109 -251
  447. package/dist/Trie.js.map +1 -1
  448. package/dist/Tuple.d.ts +98 -131
  449. package/dist/Tuple.d.ts.map +1 -1
  450. package/dist/Tuple.js +42 -57
  451. package/dist/Tuple.js.map +1 -1
  452. package/dist/TxChunk.d.ts +201 -121
  453. package/dist/TxChunk.d.ts.map +1 -1
  454. package/dist/TxChunk.js +85 -56
  455. package/dist/TxChunk.js.map +1 -1
  456. package/dist/TxDeferred.d.ts +62 -46
  457. package/dist/TxDeferred.d.ts.map +1 -1
  458. package/dist/TxDeferred.js +30 -22
  459. package/dist/TxDeferred.js.map +1 -1
  460. package/dist/TxHashMap.d.ts +631 -779
  461. package/dist/TxHashMap.d.ts.map +1 -1
  462. package/dist/TxHashMap.js +268 -330
  463. package/dist/TxHashMap.js.map +1 -1
  464. package/dist/TxHashSet.d.ts +297 -236
  465. package/dist/TxHashSet.d.ts.map +1 -1
  466. package/dist/TxHashSet.js +130 -100
  467. package/dist/TxHashSet.js.map +1 -1
  468. package/dist/TxPriorityQueue.d.ts +126 -95
  469. package/dist/TxPriorityQueue.d.ts.map +1 -1
  470. package/dist/TxPriorityQueue.js +74 -56
  471. package/dist/TxPriorityQueue.js.map +1 -1
  472. package/dist/TxPubSub.d.ts +101 -88
  473. package/dist/TxPubSub.d.ts.map +1 -1
  474. package/dist/TxPubSub.js +87 -66
  475. package/dist/TxPubSub.js.map +1 -1
  476. package/dist/TxQueue.d.ts +200 -180
  477. package/dist/TxQueue.d.ts.map +1 -1
  478. package/dist/TxQueue.js +160 -136
  479. package/dist/TxQueue.js.map +1 -1
  480. package/dist/TxReentrantLock.d.ts +89 -114
  481. package/dist/TxReentrantLock.d.ts.map +1 -1
  482. package/dist/TxReentrantLock.js +75 -53
  483. package/dist/TxReentrantLock.js.map +1 -1
  484. package/dist/TxRef.d.ts +51 -32
  485. package/dist/TxRef.d.ts.map +1 -1
  486. package/dist/TxRef.js +23 -15
  487. package/dist/TxRef.js.map +1 -1
  488. package/dist/TxSemaphore.d.ts +129 -95
  489. package/dist/TxSemaphore.d.ts.map +1 -1
  490. package/dist/TxSemaphore.js +85 -70
  491. package/dist/TxSemaphore.js.map +1 -1
  492. package/dist/TxSubscriptionRef.d.ts +97 -70
  493. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  494. package/dist/TxSubscriptionRef.js +44 -34
  495. package/dist/TxSubscriptionRef.js.map +1 -1
  496. package/dist/Types.d.ts +126 -67
  497. package/dist/Types.d.ts.map +1 -1
  498. package/dist/UndefinedOr.js.map +1 -1
  499. package/dist/Unify.d.ts +45 -65
  500. package/dist/Unify.d.ts.map +1 -1
  501. package/dist/Unify.js +6 -9
  502. package/dist/Unify.js.map +1 -1
  503. package/dist/Utils.d.ts +23 -16
  504. package/dist/Utils.d.ts.map +1 -1
  505. package/dist/Utils.js +3 -7
  506. package/dist/Utils.js.map +1 -1
  507. package/dist/index.js.map +1 -1
  508. package/dist/internal/array.js.map +1 -1
  509. package/dist/internal/core.js +1 -1
  510. package/dist/internal/core.js.map +1 -1
  511. package/dist/internal/dateTime.js +5 -1
  512. package/dist/internal/dateTime.js.map +1 -1
  513. package/dist/internal/doNotation.js.map +1 -1
  514. package/dist/internal/effect.js +77 -40
  515. package/dist/internal/effect.js.map +1 -1
  516. package/dist/internal/equal.js.map +1 -1
  517. package/dist/internal/errors.js.map +1 -1
  518. package/dist/internal/executionPlan.js +51 -3
  519. package/dist/internal/executionPlan.js.map +1 -1
  520. package/dist/internal/hashMap.js +12 -8
  521. package/dist/internal/hashMap.js.map +1 -1
  522. package/dist/internal/hashSet.js.map +1 -1
  523. package/dist/internal/layer.js.map +1 -1
  524. package/dist/internal/matcher.js +1 -1
  525. package/dist/internal/matcher.js.map +1 -1
  526. package/dist/internal/metric.js.map +1 -1
  527. package/dist/internal/option.js.map +1 -1
  528. package/dist/internal/persistence.d.ts +2 -0
  529. package/dist/internal/persistence.d.ts.map +1 -0
  530. package/dist/internal/persistence.js +3 -0
  531. package/dist/internal/persistence.js.map +1 -0
  532. package/dist/internal/random.js.map +1 -1
  533. package/dist/internal/rcRef.js.map +1 -1
  534. package/dist/internal/record.js.map +1 -1
  535. package/dist/internal/redacted.js.map +1 -1
  536. package/dist/internal/references.js +3 -0
  537. package/dist/internal/references.js.map +1 -1
  538. package/dist/internal/request.js.map +1 -1
  539. package/dist/internal/result.js.map +1 -1
  540. package/dist/internal/schedule.js.map +1 -1
  541. package/dist/internal/schema/annotations.js +2 -0
  542. package/dist/internal/schema/annotations.js.map +1 -1
  543. package/dist/internal/schema/cause.js.map +1 -1
  544. package/dist/internal/schema/fromJsonSchemaDocument.js +13 -11
  545. package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
  546. package/dist/internal/schema/fromRepresentation.js +8 -15
  547. package/dist/internal/schema/fromRepresentation.js.map +1 -1
  548. package/dist/internal/schema/parser.d.ts +14 -0
  549. package/dist/internal/schema/parser.d.ts.map +1 -0
  550. package/dist/internal/schema/parser.js +13 -0
  551. package/dist/internal/schema/parser.js.map +1 -0
  552. package/dist/internal/schema/schema.js.map +1 -1
  553. package/dist/internal/schema/toArbitrary.js +1 -1
  554. package/dist/internal/schema/toArbitrary.js.map +1 -1
  555. package/dist/internal/schema/toCodeDocument.js.map +1 -1
  556. package/dist/internal/schema/toEquivalence.js.map +1 -1
  557. package/dist/internal/schema/toJsonSchemaDocument.js +48 -6
  558. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
  559. package/dist/internal/schema/toRepresentation.js +87 -107
  560. package/dist/internal/schema/toRepresentation.js.map +1 -1
  561. package/dist/internal/stackTraceLimit.js.map +1 -1
  562. package/dist/internal/stream.js.map +1 -1
  563. package/dist/internal/tracer.js.map +1 -1
  564. package/dist/internal/trie.js +24 -10
  565. package/dist/internal/trie.js.map +1 -1
  566. package/dist/testing/FastCheck.d.ts +8 -7
  567. package/dist/testing/FastCheck.d.ts.map +1 -1
  568. package/dist/testing/FastCheck.js +8 -7
  569. package/dist/testing/FastCheck.js.map +1 -1
  570. package/dist/testing/TestClock.d.ts +57 -28
  571. package/dist/testing/TestClock.d.ts.map +1 -1
  572. package/dist/testing/TestClock.js +61 -19
  573. package/dist/testing/TestClock.js.map +1 -1
  574. package/dist/testing/TestConsole.d.ts +32 -31
  575. package/dist/testing/TestConsole.d.ts.map +1 -1
  576. package/dist/testing/TestConsole.js +24 -22
  577. package/dist/testing/TestConsole.js.map +1 -1
  578. package/dist/testing/TestSchema.d.ts +30 -30
  579. package/dist/testing/TestSchema.d.ts.map +1 -1
  580. package/dist/testing/TestSchema.js +25 -25
  581. package/dist/testing/TestSchema.js.map +1 -1
  582. package/dist/testing/index.js.map +1 -1
  583. package/dist/unstable/ai/AiError.d.ts +95 -118
  584. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  585. package/dist/unstable/ai/AiError.js +113 -136
  586. package/dist/unstable/ai/AiError.js.map +1 -1
  587. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  588. package/dist/unstable/ai/AnthropicStructuredOutput.js +1 -1
  589. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  590. package/dist/unstable/ai/Chat.d.ts +132 -97
  591. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  592. package/dist/unstable/ai/Chat.js +56 -52
  593. package/dist/unstable/ai/Chat.js.map +1 -1
  594. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  595. package/dist/unstable/ai/IdGenerator.d.ts +32 -28
  596. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  597. package/dist/unstable/ai/IdGenerator.js +26 -21
  598. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  599. package/dist/unstable/ai/LanguageModel.d.ts +107 -67
  600. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  601. package/dist/unstable/ai/LanguageModel.js +108 -66
  602. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  603. package/dist/unstable/ai/McpProtocol.d.ts +30 -0
  604. package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
  605. package/dist/unstable/ai/McpProtocol.js +20 -0
  606. package/dist/unstable/ai/McpProtocol.js.map +1 -0
  607. package/dist/unstable/ai/McpSchema.d.ts +251 -185
  608. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  609. package/dist/unstable/ai/McpSchema.js +66 -58
  610. package/dist/unstable/ai/McpSchema.js.map +1 -1
  611. package/dist/unstable/ai/McpServer.d.ts +68 -59
  612. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  613. package/dist/unstable/ai/McpServer.js +695 -242
  614. package/dist/unstable/ai/McpServer.js.map +1 -1
  615. package/dist/unstable/ai/Model.d.ts +8 -19
  616. package/dist/unstable/ai/Model.d.ts.map +1 -1
  617. package/dist/unstable/ai/Model.js +9 -20
  618. package/dist/unstable/ai/Model.js.map +1 -1
  619. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  620. package/dist/unstable/ai/OpenAiStructuredOutput.js +1 -1
  621. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  622. package/dist/unstable/ai/Prompt.d.ts +127 -41
  623. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  624. package/dist/unstable/ai/Prompt.js +59 -20
  625. package/dist/unstable/ai/Prompt.js.map +1 -1
  626. package/dist/unstable/ai/Response.d.ts +28 -14
  627. package/dist/unstable/ai/Response.d.ts.map +1 -1
  628. package/dist/unstable/ai/Response.js +9 -4
  629. package/dist/unstable/ai/Response.js.map +1 -1
  630. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  631. package/dist/unstable/ai/Telemetry.d.ts +46 -13
  632. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  633. package/dist/unstable/ai/Telemetry.js +18 -7
  634. package/dist/unstable/ai/Telemetry.js.map +1 -1
  635. package/dist/unstable/ai/Tokenizer.d.ts +14 -3
  636. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  637. package/dist/unstable/ai/Tokenizer.js +10 -2
  638. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  639. package/dist/unstable/ai/Tool.d.ts +59 -44
  640. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  641. package/dist/unstable/ai/Tool.js +48 -39
  642. package/dist/unstable/ai/Tool.js.map +1 -1
  643. package/dist/unstable/ai/Toolkit.d.ts +26 -8
  644. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  645. package/dist/unstable/ai/Toolkit.js +18 -4
  646. package/dist/unstable/ai/Toolkit.js.map +1 -1
  647. package/dist/unstable/ai/index.d.ts +4 -0
  648. package/dist/unstable/ai/index.d.ts.map +1 -1
  649. package/dist/unstable/ai/index.js +4 -0
  650. package/dist/unstable/ai/index.js.map +1 -1
  651. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  652. package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
  653. package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
  654. package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
  655. package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
  656. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
  657. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
  658. package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
  659. package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
  660. package/dist/unstable/ai/internal/structured-output.js +14 -15
  661. package/dist/unstable/ai/internal/structured-output.js.map +1 -1
  662. package/dist/unstable/cli/Argument.d.ts +273 -69
  663. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  664. package/dist/unstable/cli/Argument.js +111 -33
  665. package/dist/unstable/cli/Argument.js.map +1 -1
  666. package/dist/unstable/cli/CliConfig.js.map +1 -1
  667. package/dist/unstable/cli/CliError.d.ts +70 -77
  668. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  669. package/dist/unstable/cli/CliError.js +66 -70
  670. package/dist/unstable/cli/CliError.js.map +1 -1
  671. package/dist/unstable/cli/CliOutput.d.ts +35 -54
  672. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  673. package/dist/unstable/cli/CliOutput.js +26 -42
  674. package/dist/unstable/cli/CliOutput.js.map +1 -1
  675. package/dist/unstable/cli/Command.d.ts +713 -115
  676. package/dist/unstable/cli/Command.d.ts.map +1 -1
  677. package/dist/unstable/cli/Command.js +245 -47
  678. package/dist/unstable/cli/Command.js.map +1 -1
  679. package/dist/unstable/cli/Completions.js.map +1 -1
  680. package/dist/unstable/cli/Flag.d.ts +418 -138
  681. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  682. package/dist/unstable/cli/Flag.js +197 -71
  683. package/dist/unstable/cli/Flag.js.map +1 -1
  684. package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
  685. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  686. package/dist/unstable/cli/HelpDoc.d.ts +12 -4
  687. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  688. package/dist/unstable/cli/Param.d.ts +299 -83
  689. package/dist/unstable/cli/Param.d.ts.map +1 -1
  690. package/dist/unstable/cli/Param.js +143 -57
  691. package/dist/unstable/cli/Param.js.map +1 -1
  692. package/dist/unstable/cli/Primitive.d.ts +370 -149
  693. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  694. package/dist/unstable/cli/Primitive.js +375 -160
  695. package/dist/unstable/cli/Primitive.js.map +1 -1
  696. package/dist/unstable/cli/Prompt.d.ts +23 -14
  697. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  698. package/dist/unstable/cli/Prompt.js +54 -31
  699. package/dist/unstable/cli/Prompt.js.map +1 -1
  700. package/dist/unstable/cli/index.js.map +1 -1
  701. package/dist/unstable/cli/internal/ansi.js +2 -2
  702. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  703. package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
  704. package/dist/unstable/cli/internal/command.d.ts +2 -2
  705. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  706. package/dist/unstable/cli/internal/command.js +10 -9
  707. package/dist/unstable/cli/internal/command.js.map +1 -1
  708. package/dist/unstable/cli/internal/completions/bash.js +69 -9
  709. package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
  710. package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
  711. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  712. package/dist/unstable/cli/internal/completions/fish.js +5 -5
  713. package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
  714. package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
  715. package/dist/unstable/cli/internal/config.js.map +1 -1
  716. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  717. package/dist/unstable/cli/internal/help.js +4 -2
  718. package/dist/unstable/cli/internal/help.js.map +1 -1
  719. package/dist/unstable/cli/internal/lexer.js +17 -7
  720. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  721. package/dist/unstable/cli/internal/parser.js +5 -5
  722. package/dist/unstable/cli/internal/parser.js.map +1 -1
  723. package/dist/unstable/cli/internal/wizard.js +2 -2
  724. package/dist/unstable/cli/internal/wizard.js.map +1 -1
  725. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  726. package/dist/unstable/cluster/ClusterError.js +7 -7
  727. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  728. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  729. package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
  730. package/dist/unstable/cluster/ClusterSchema.js +8 -8
  731. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  732. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  733. package/dist/unstable/cluster/ClusterWorkflowEngine.js +6 -2
  734. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  735. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  736. package/dist/unstable/cluster/Entity.d.ts +10 -10
  737. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  738. package/dist/unstable/cluster/Entity.js +8 -8
  739. package/dist/unstable/cluster/Entity.js.map +1 -1
  740. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  741. package/dist/unstable/cluster/EntityId.js.map +1 -1
  742. package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
  743. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  744. package/dist/unstable/cluster/EntityProxy.js +4 -2
  745. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  746. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  747. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  748. package/dist/unstable/cluster/EntityResource.js +2 -2
  749. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  750. package/dist/unstable/cluster/EntityType.js.map +1 -1
  751. package/dist/unstable/cluster/Envelope.d.ts +3 -3
  752. package/dist/unstable/cluster/Envelope.js +3 -3
  753. package/dist/unstable/cluster/Envelope.js.map +1 -1
  754. package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
  755. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  756. package/dist/unstable/cluster/HttpRunner.js +6 -4
  757. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  758. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  759. package/dist/unstable/cluster/MachineId.js.map +1 -1
  760. package/dist/unstable/cluster/Message.d.ts +9 -9
  761. package/dist/unstable/cluster/Message.js +6 -6
  762. package/dist/unstable/cluster/Message.js.map +1 -1
  763. package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
  764. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  765. package/dist/unstable/cluster/MessageStorage.js +13 -6
  766. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  767. package/dist/unstable/cluster/Reply.d.ts +8 -0
  768. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  769. package/dist/unstable/cluster/Reply.js +16 -4
  770. package/dist/unstable/cluster/Reply.js.map +1 -1
  771. package/dist/unstable/cluster/Runner.js.map +1 -1
  772. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  773. package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
  774. package/dist/unstable/cluster/RunnerHealth.js +1 -1
  775. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  776. package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
  777. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  778. package/dist/unstable/cluster/RunnerServer.js +18 -16
  779. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  780. package/dist/unstable/cluster/RunnerStorage.d.ts +3 -4
  781. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  782. package/dist/unstable/cluster/RunnerStorage.js +8 -7
  783. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  784. package/dist/unstable/cluster/Runners.d.ts +6 -6
  785. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  786. package/dist/unstable/cluster/Runners.js +19 -10
  787. package/dist/unstable/cluster/Runners.js.map +1 -1
  788. package/dist/unstable/cluster/ShardId.js.map +1 -1
  789. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  790. package/dist/unstable/cluster/Sharding.js +25 -6
  791. package/dist/unstable/cluster/Sharding.js.map +1 -1
  792. package/dist/unstable/cluster/ShardingConfig.d.ts +3 -3
  793. package/dist/unstable/cluster/ShardingConfig.js +3 -3
  794. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  795. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  796. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  797. package/dist/unstable/cluster/Singleton.js.map +1 -1
  798. package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
  799. package/dist/unstable/cluster/SingletonAddress.js +1 -1
  800. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  801. package/dist/unstable/cluster/Snowflake.d.ts +8 -8
  802. package/dist/unstable/cluster/Snowflake.js +8 -8
  803. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  804. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  805. package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
  806. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  807. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  808. package/dist/unstable/cluster/SqlRunnerStorage.js +20 -5
  809. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  810. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  811. package/dist/unstable/cluster/index.js.map +1 -1
  812. package/dist/unstable/cluster/internal/entityManager.js +6 -6
  813. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  814. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  815. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  816. package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
  817. package/dist/unstable/cluster/internal/resourceMap.js +2 -2
  818. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  819. package/dist/unstable/cluster/internal/resourceRef.js +17 -0
  820. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  821. package/dist/unstable/cluster/internal/shardLock.js.map +1 -1
  822. package/dist/unstable/devtools/DevTools.js.map +1 -1
  823. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  824. package/dist/unstable/devtools/DevToolsClient.js +7 -2
  825. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  826. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  827. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  828. package/dist/unstable/devtools/index.js.map +1 -1
  829. package/dist/unstable/encoding/Ini.d.ts +20 -0
  830. package/dist/unstable/encoding/Ini.d.ts.map +1 -0
  831. package/dist/unstable/encoding/Ini.js +153 -0
  832. package/dist/unstable/encoding/Ini.js.map +1 -0
  833. package/dist/unstable/encoding/Msgpack.d.ts +2 -1
  834. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  835. package/dist/unstable/encoding/Msgpack.js +27 -15
  836. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  837. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  838. package/dist/unstable/encoding/Ndjson.js +7 -1
  839. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  840. package/dist/unstable/encoding/Sse.d.ts +72 -8
  841. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  842. package/dist/unstable/encoding/Sse.js +72 -31
  843. package/dist/unstable/encoding/Sse.js.map +1 -1
  844. package/dist/unstable/encoding/Toml.d.ts +19 -0
  845. package/dist/unstable/encoding/Toml.d.ts.map +1 -0
  846. package/dist/unstable/encoding/Toml.js +434 -0
  847. package/dist/unstable/encoding/Toml.js.map +1 -0
  848. package/dist/unstable/encoding/Yaml.d.ts +19 -0
  849. package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
  850. package/dist/unstable/encoding/Yaml.js +461 -0
  851. package/dist/unstable/encoding/Yaml.js.map +1 -0
  852. package/dist/unstable/encoding/index.d.ts +12 -0
  853. package/dist/unstable/encoding/index.d.ts.map +1 -1
  854. package/dist/unstable/encoding/index.js +12 -0
  855. package/dist/unstable/encoding/index.js.map +1 -1
  856. package/dist/unstable/eventlog/Event.d.ts +20 -20
  857. package/dist/unstable/eventlog/Event.js.map +1 -1
  858. package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
  859. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  860. package/dist/unstable/eventlog/EventJournal.d.ts +16 -16
  861. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  862. package/dist/unstable/eventlog/EventJournal.js +26 -18
  863. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  864. package/dist/unstable/eventlog/EventLog.d.ts +3 -3
  865. package/dist/unstable/eventlog/EventLog.js +3 -3
  866. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  867. package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
  868. package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
  869. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  870. package/dist/unstable/eventlog/EventLogMessage.d.ts +2 -2
  871. package/dist/unstable/eventlog/EventLogMessage.js +2 -2
  872. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  873. package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
  874. package/dist/unstable/eventlog/EventLogRemote.js +1 -1
  875. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  876. package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
  877. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  878. package/dist/unstable/eventlog/EventLogServer.js +45 -21
  879. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  880. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
  881. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  882. package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
  883. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  884. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
  885. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  886. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +15 -7
  887. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  888. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
  889. package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
  890. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  891. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  892. package/dist/unstable/eventlog/SqlEventJournal.js +1 -4
  893. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  894. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  895. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  896. package/dist/unstable/eventlog/index.js.map +1 -1
  897. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
  898. package/dist/unstable/http/Cookies.d.ts +2 -2
  899. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  900. package/dist/unstable/http/Cookies.js +30 -18
  901. package/dist/unstable/http/Cookies.js.map +1 -1
  902. package/dist/unstable/http/Etag.d.ts +1 -1
  903. package/dist/unstable/http/Etag.js +1 -1
  904. package/dist/unstable/http/Etag.js.map +1 -1
  905. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  906. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  907. package/dist/unstable/http/FindMyWay/internal/queryString.d.ts +11 -0
  908. package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
  909. package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
  910. package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
  911. package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
  912. package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
  913. package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
  914. package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
  915. package/dist/unstable/http/FindMyWay.d.ts +33 -8
  916. package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
  917. package/dist/unstable/http/FindMyWay.js +4 -7
  918. package/dist/unstable/http/FindMyWay.js.map +1 -1
  919. package/dist/unstable/http/Headers.d.ts +2 -2
  920. package/dist/unstable/http/Headers.js +2 -2
  921. package/dist/unstable/http/Headers.js.map +1 -1
  922. package/dist/unstable/http/HttpBody.d.ts +5 -3
  923. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  924. package/dist/unstable/http/HttpBody.js +11 -5
  925. package/dist/unstable/http/HttpBody.js.map +1 -1
  926. package/dist/unstable/http/HttpClient.d.ts +51 -44
  927. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  928. package/dist/unstable/http/HttpClient.js +46 -17
  929. package/dist/unstable/http/HttpClient.js.map +1 -1
  930. package/dist/unstable/http/HttpClientError.js +1 -1
  931. package/dist/unstable/http/HttpClientError.js.map +1 -1
  932. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  933. package/dist/unstable/http/HttpClientRequest.js +2 -12
  934. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  935. package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
  936. package/dist/unstable/http/HttpClientResponse.js +3 -18
  937. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  938. package/dist/unstable/http/HttpEffect.d.ts +6 -6
  939. package/dist/unstable/http/HttpEffect.js +3 -3
  940. package/dist/unstable/http/HttpEffect.js.map +1 -1
  941. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  942. package/dist/unstable/http/HttpMethod.d.ts +6 -9
  943. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  944. package/dist/unstable/http/HttpMethod.js +6 -9
  945. package/dist/unstable/http/HttpMethod.js.map +1 -1
  946. package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
  947. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  948. package/dist/unstable/http/HttpMiddleware.js +164 -39
  949. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  950. package/dist/unstable/http/HttpPlatform.d.ts +76 -0
  951. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  952. package/dist/unstable/http/HttpPlatform.js +53 -3
  953. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  954. package/dist/unstable/http/HttpRouter.d.ts +88 -89
  955. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  956. package/dist/unstable/http/HttpRouter.js +78 -79
  957. package/dist/unstable/http/HttpRouter.js.map +1 -1
  958. package/dist/unstable/http/HttpServer.d.ts +13 -13
  959. package/dist/unstable/http/HttpServer.js +6 -6
  960. package/dist/unstable/http/HttpServer.js.map +1 -1
  961. package/dist/unstable/http/HttpServerError.d.ts +2 -2
  962. package/dist/unstable/http/HttpServerError.js +2 -2
  963. package/dist/unstable/http/HttpServerError.js.map +1 -1
  964. package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
  965. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  966. package/dist/unstable/http/HttpServerRequest.js +11 -10
  967. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  968. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  969. package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
  970. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  971. package/dist/unstable/http/HttpServerResponse.js +17 -5
  972. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  973. package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
  974. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  975. package/dist/unstable/http/HttpStaticServer.js +35 -7
  976. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  977. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  978. package/dist/unstable/http/Multipart.d.ts +7 -7
  979. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  980. package/dist/unstable/http/Multipart.js +14 -7
  981. package/dist/unstable/http/Multipart.js.map +1 -1
  982. package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
  983. package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
  984. package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
  985. package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
  986. package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
  987. package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
  988. package/dist/unstable/http/MultipartParser/Search.js +14 -0
  989. package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
  990. package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
  991. package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
  992. package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
  993. package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
  994. package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
  995. package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
  996. package/dist/unstable/http/MultipartParser/internal/headers.js +194 -0
  997. package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
  998. package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
  999. package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
  1000. package/dist/unstable/http/MultipartParser/internal/multipart.js +226 -0
  1001. package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
  1002. package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
  1003. package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
  1004. package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
  1005. package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
  1006. package/dist/unstable/http/MultipartParser.d.ts +98 -0
  1007. package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
  1008. package/dist/unstable/http/MultipartParser.js +23 -0
  1009. package/dist/unstable/http/MultipartParser.js.map +1 -0
  1010. package/dist/unstable/http/Template.d.ts.map +1 -1
  1011. package/dist/unstable/http/Template.js +2 -2
  1012. package/dist/unstable/http/Template.js.map +1 -1
  1013. package/dist/unstable/http/Url.d.ts +33 -63
  1014. package/dist/unstable/http/Url.d.ts.map +1 -1
  1015. package/dist/unstable/http/Url.js +14 -28
  1016. package/dist/unstable/http/Url.js.map +1 -1
  1017. package/dist/unstable/http/UrlParams.d.ts +10 -18
  1018. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  1019. package/dist/unstable/http/UrlParams.js +9 -17
  1020. package/dist/unstable/http/UrlParams.js.map +1 -1
  1021. package/dist/unstable/http/index.d.ts +1 -1
  1022. package/dist/unstable/http/index.d.ts.map +1 -1
  1023. package/dist/unstable/http/index.js +1 -1
  1024. package/dist/unstable/http/index.js.map +1 -1
  1025. package/dist/unstable/http/internal/compression.d.ts +2 -0
  1026. package/dist/unstable/http/internal/compression.d.ts.map +1 -0
  1027. package/dist/unstable/http/internal/compression.js +155 -0
  1028. package/dist/unstable/http/internal/compression.js.map +1 -0
  1029. package/dist/unstable/http/internal/httpBody.d.ts +2 -0
  1030. package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
  1031. package/dist/unstable/http/internal/httpBody.js +10 -0
  1032. package/dist/unstable/http/internal/httpBody.js.map +1 -0
  1033. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
  1034. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  1035. package/dist/unstable/httpapi/HttpApi.js +5 -5
  1036. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  1037. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
  1038. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  1039. package/dist/unstable/httpapi/HttpApiBuilder.js +78 -26
  1040. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  1041. package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
  1042. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  1043. package/dist/unstable/httpapi/HttpApiClient.js +76 -38
  1044. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  1045. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +48 -46
  1046. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  1047. package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
  1048. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1049. package/dist/unstable/httpapi/HttpApiError.d.ts +18 -18
  1050. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1051. package/dist/unstable/httpapi/HttpApiError.js +30 -30
  1052. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1053. package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
  1054. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1055. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
  1056. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1057. package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
  1058. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1059. package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
  1060. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1061. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1062. package/dist/unstable/httpapi/HttpApiSchema.d.ts +225 -6
  1063. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1064. package/dist/unstable/httpapi/HttpApiSchema.js +174 -4
  1065. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1066. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1067. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1068. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1069. package/dist/unstable/httpapi/OpenApi.d.ts +21 -13
  1070. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1071. package/dist/unstable/httpapi/OpenApi.js +58 -31
  1072. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1073. package/dist/unstable/httpapi/index.js.map +1 -1
  1074. package/dist/unstable/httpapi/internal/html.js.map +1 -1
  1075. package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
  1076. package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
  1077. package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
  1078. package/dist/unstable/observability/Otlp.js.map +1 -1
  1079. package/dist/unstable/observability/OtlpExporter.d.ts +13 -15
  1080. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1081. package/dist/unstable/observability/OtlpExporter.js +19 -5
  1082. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1083. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1084. package/dist/unstable/observability/OtlpLogger.js +2 -2
  1085. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1086. package/dist/unstable/observability/OtlpMetrics.d.ts +6 -3
  1087. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1088. package/dist/unstable/observability/OtlpMetrics.js +28 -15
  1089. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1090. package/dist/unstable/observability/OtlpResource.d.ts +16 -7
  1091. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1092. package/dist/unstable/observability/OtlpResource.js +21 -12
  1093. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1094. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1095. package/dist/unstable/observability/OtlpTracer.js +1 -1
  1096. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1097. package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
  1098. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1099. package/dist/unstable/observability/PrometheusMetrics.js +10 -3
  1100. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1101. package/dist/unstable/observability/index.js.map +1 -1
  1102. package/dist/unstable/observability/internal/otlpEnv.js +1 -1
  1103. package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
  1104. package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
  1105. package/dist/unstable/observability/internal/protobuf.js +3 -0
  1106. package/dist/unstable/observability/internal/protobuf.js.map +1 -1
  1107. package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
  1108. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1109. package/dist/unstable/persistence/KeyValueStore.js +22 -13
  1110. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1111. package/dist/unstable/persistence/Persistable.d.ts +8 -8
  1112. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1113. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1114. package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
  1115. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1116. package/dist/unstable/persistence/PersistedQueue.js +15 -15
  1117. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1118. package/dist/unstable/persistence/Persistence.d.ts +3 -3
  1119. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1120. package/dist/unstable/persistence/Persistence.js +108 -22
  1121. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1122. package/dist/unstable/persistence/RateLimiter.d.ts +45 -24
  1123. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1124. package/dist/unstable/persistence/RateLimiter.js +29 -45
  1125. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1126. package/dist/unstable/persistence/Redis.d.ts +2 -2
  1127. package/dist/unstable/persistence/Redis.js +2 -2
  1128. package/dist/unstable/persistence/Redis.js.map +1 -1
  1129. package/dist/unstable/persistence/index.js.map +1 -1
  1130. package/dist/unstable/process/ChildProcess.d.ts +64 -21
  1131. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1132. package/dist/unstable/process/ChildProcess.js +14 -5
  1133. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1134. package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
  1135. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1136. package/dist/unstable/process/ChildProcessSpawner.js +1 -1
  1137. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1138. package/dist/unstable/process/index.js.map +1 -1
  1139. package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
  1140. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1141. package/dist/unstable/reactivity/AsyncResult.js +10 -10
  1142. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1143. package/dist/unstable/reactivity/Atom.d.ts +25 -22
  1144. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1145. package/dist/unstable/reactivity/Atom.js +14 -13
  1146. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1147. package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
  1148. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1149. package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
  1150. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1151. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1152. package/dist/unstable/reactivity/AtomRegistry.js +24 -3
  1153. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1154. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
  1155. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1156. package/dist/unstable/reactivity/AtomRpc.js +4 -1
  1157. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1158. package/dist/unstable/reactivity/Hydration.d.ts +1 -1
  1159. package/dist/unstable/reactivity/Hydration.js +1 -1
  1160. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1161. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1162. package/dist/unstable/reactivity/index.js.map +1 -1
  1163. package/dist/unstable/rpc/Rpc.d.ts +35 -33
  1164. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1165. package/dist/unstable/rpc/Rpc.js +4 -2
  1166. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1167. package/dist/unstable/rpc/RpcClient.d.ts +26 -12
  1168. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1169. package/dist/unstable/rpc/RpcClient.js +30 -20
  1170. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1171. package/dist/unstable/rpc/RpcClientError.js +2 -2
  1172. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1173. package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
  1174. package/dist/unstable/rpc/RpcGroup.js +1 -1
  1175. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1176. package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
  1177. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1178. package/dist/unstable/rpc/RpcMessage.js +6 -6
  1179. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1180. package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
  1181. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  1182. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1183. package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
  1184. package/dist/unstable/rpc/RpcSchema.js +3 -3
  1185. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1186. package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
  1187. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1188. package/dist/unstable/rpc/RpcSerialization.js +177 -96
  1189. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1190. package/dist/unstable/rpc/RpcServer.d.ts +13 -13
  1191. package/dist/unstable/rpc/RpcServer.js +17 -13
  1192. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1193. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1194. package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
  1195. package/dist/unstable/rpc/RpcWorker.js +4 -4
  1196. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1197. package/dist/unstable/rpc/Utils.js.map +1 -1
  1198. package/dist/unstable/rpc/index.js.map +1 -1
  1199. package/dist/unstable/schema/Model.d.ts +53 -51
  1200. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1201. package/dist/unstable/schema/Model.js +35 -33
  1202. package/dist/unstable/schema/Model.js.map +1 -1
  1203. package/dist/unstable/schema/VariantSchema.d.ts +10 -10
  1204. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1205. package/dist/unstable/schema/VariantSchema.js +19 -11
  1206. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1207. package/dist/unstable/schema/index.js.map +1 -1
  1208. package/dist/unstable/socket/Socket.d.ts +11 -3
  1209. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1210. package/dist/unstable/socket/Socket.js +37 -16
  1211. package/dist/unstable/socket/Socket.js.map +1 -1
  1212. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1213. package/dist/unstable/socket/index.js.map +1 -1
  1214. package/dist/unstable/sql/Migrator.js.map +1 -1
  1215. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  1216. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1217. package/dist/unstable/sql/SqlClient.js +8 -4
  1218. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1219. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1220. package/dist/unstable/sql/SqlError.js +13 -13
  1221. package/dist/unstable/sql/SqlError.js.map +1 -1
  1222. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  1223. package/dist/unstable/sql/SqlModel.js +2 -2
  1224. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1225. package/dist/unstable/sql/SqlResolver.d.ts +5 -5
  1226. package/dist/unstable/sql/SqlResolver.js +10 -8
  1227. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1228. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1229. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1230. package/dist/unstable/sql/Statement.d.ts +6 -6
  1231. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1232. package/dist/unstable/sql/Statement.js +23 -21
  1233. package/dist/unstable/sql/Statement.js.map +1 -1
  1234. package/dist/unstable/sql/index.js.map +1 -1
  1235. package/dist/unstable/workers/Transferable.d.ts +1 -1
  1236. package/dist/unstable/workers/Transferable.js +1 -1
  1237. package/dist/unstable/workers/Transferable.js.map +1 -1
  1238. package/dist/unstable/workers/Worker.d.ts +2 -2
  1239. package/dist/unstable/workers/Worker.js +2 -2
  1240. package/dist/unstable/workers/Worker.js.map +1 -1
  1241. package/dist/unstable/workers/WorkerError.d.ts +7 -7
  1242. package/dist/unstable/workers/WorkerError.js +11 -11
  1243. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1244. package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
  1245. package/dist/unstable/workers/WorkerRunner.js +1 -1
  1246. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1247. package/dist/unstable/workers/index.js.map +1 -1
  1248. package/dist/unstable/workflow/Activity.d.ts +2 -2
  1249. package/dist/unstable/workflow/Activity.js +2 -2
  1250. package/dist/unstable/workflow/Activity.js.map +1 -1
  1251. package/dist/unstable/workflow/DurableClock.d.ts +1 -1
  1252. package/dist/unstable/workflow/DurableClock.js +1 -1
  1253. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1254. package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
  1255. package/dist/unstable/workflow/DurableDeferred.js +5 -5
  1256. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1257. package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
  1258. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1259. package/dist/unstable/workflow/DurableQueue.js +22 -20
  1260. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1261. package/dist/unstable/workflow/Workflow.d.ts +21 -21
  1262. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1263. package/dist/unstable/workflow/Workflow.js +13 -14
  1264. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1265. package/dist/unstable/workflow/WorkflowEngine.d.ts +2 -2
  1266. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1267. package/dist/unstable/workflow/WorkflowEngine.js +3 -3
  1268. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1269. package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
  1270. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1271. package/dist/unstable/workflow/WorkflowProxy.js +4 -2
  1272. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1273. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1274. package/dist/unstable/workflow/index.js.map +1 -1
  1275. package/dist/unstable/workflow/internal/crypto.js.map +1 -1
  1276. package/package.json +6 -13
  1277. package/src/Array.ts +982 -1045
  1278. package/src/BigDecimal.ts +433 -756
  1279. package/src/BigInt.ts +213 -269
  1280. package/src/Boolean.ts +146 -188
  1281. package/src/Cache.ts +410 -256
  1282. package/src/Cause.ts +167 -277
  1283. package/src/Channel.ts +892 -817
  1284. package/src/ChannelSchema.ts +1 -1
  1285. package/src/Chunk.ts +841 -1181
  1286. package/src/Clock.ts +181 -49
  1287. package/src/Combiner.ts +20 -33
  1288. package/src/Config.ts +636 -332
  1289. package/src/ConfigProvider.ts +218 -121
  1290. package/src/Console.ts +289 -39
  1291. package/src/Context.ts +322 -381
  1292. package/src/Cron.ts +68 -77
  1293. package/src/Crypto.ts +30 -23
  1294. package/src/Data.ts +60 -80
  1295. package/src/DateTime.ts +564 -660
  1296. package/src/Deferred.ts +253 -256
  1297. package/src/Duration.ts +232 -310
  1298. package/src/Effect.ts +3034 -3296
  1299. package/src/Encoding.ts +22 -40
  1300. package/src/Equal.ts +59 -41
  1301. package/src/Equivalence.ts +103 -105
  1302. package/src/ErrorReporter.ts +51 -27
  1303. package/src/ExecutionPlan.ts +91 -56
  1304. package/src/Exit.ts +116 -192
  1305. package/src/Fiber.ts +81 -148
  1306. package/src/FiberHandle.ts +152 -105
  1307. package/src/FiberMap.ts +225 -174
  1308. package/src/FiberSet.ts +125 -83
  1309. package/src/FileSystem.ts +156 -264
  1310. package/src/Filter.ts +61 -33
  1311. package/src/Formatter.ts +54 -56
  1312. package/src/Function.ts +82 -151
  1313. package/src/Graph.ts +416 -770
  1314. package/src/HKT.ts +12 -6
  1315. package/src/Hash.ts +52 -83
  1316. package/src/HashMap.ts +319 -411
  1317. package/src/HashRing.ts +1 -0
  1318. package/src/HashSet.ts +177 -284
  1319. package/src/Inspectable.ts +12 -12
  1320. package/src/Iterable.ts +631 -796
  1321. package/src/JsonPatch.ts +58 -112
  1322. package/src/JsonPointer.ts +8 -8
  1323. package/src/JsonSchema.ts +402 -244
  1324. package/src/Latch.ts +23 -35
  1325. package/src/Layer.ts +366 -265
  1326. package/src/LayerMap.ts +49 -29
  1327. package/src/LayerRef.ts +6 -2
  1328. package/src/LogLevel.ts +114 -214
  1329. package/src/Logger.ts +344 -697
  1330. package/src/ManagedRuntime.ts +7 -5
  1331. package/src/Match.ts +217 -252
  1332. package/src/Metric.ts +516 -1089
  1333. package/src/MutableHashMap.ts +218 -255
  1334. package/src/MutableHashSet.ts +84 -89
  1335. package/src/MutableList.ts +73 -370
  1336. package/src/MutableRef.ts +420 -243
  1337. package/src/Newtype.ts +21 -14
  1338. package/src/NonEmptyIterable.ts +7 -137
  1339. package/src/Number.ts +196 -233
  1340. package/src/Optic.ts +243 -383
  1341. package/src/Option.ts +447 -812
  1342. package/src/Order.ts +109 -109
  1343. package/src/Ordering.ts +20 -23
  1344. package/src/Path.ts +38 -41
  1345. package/src/Pipeable.ts +6 -5
  1346. package/src/PlatformError.ts +4 -4
  1347. package/src/Pool.ts +4 -2
  1348. package/src/Predicate.ts +200 -181
  1349. package/src/PrimaryKey.ts +7 -7
  1350. package/src/PubSub.ts +526 -552
  1351. package/src/Pull.ts +24 -18
  1352. package/src/Queue.ts +200 -159
  1353. package/src/Random.ts +49 -74
  1354. package/src/RcMap.ts +121 -63
  1355. package/src/RcRef.ts +24 -13
  1356. package/src/Record.ts +291 -488
  1357. package/src/Redactable.ts +10 -3
  1358. package/src/Redacted.ts +25 -25
  1359. package/src/Reducer.ts +8 -15
  1360. package/src/Ref.ts +221 -361
  1361. package/src/References.ts +102 -168
  1362. package/src/RegExp.ts +10 -14
  1363. package/src/Request.ts +31 -21
  1364. package/src/RequestResolver.ts +202 -91
  1365. package/src/Result.ts +312 -484
  1366. package/src/Runtime.ts +50 -75
  1367. package/src/Schedule.ts +311 -1737
  1368. package/src/Scheduler.ts +20 -7
  1369. package/src/Schema.ts +766 -786
  1370. package/src/SchemaAST.ts +522 -382
  1371. package/src/SchemaError.ts +7 -6
  1372. package/src/SchemaGetter.ts +242 -190
  1373. package/src/SchemaIssue.ts +89 -275
  1374. package/src/SchemaParser.ts +217 -124
  1375. package/src/SchemaRepresentation.ts +22 -40
  1376. package/src/SchemaTransformation.ts +129 -88
  1377. package/src/Scope.ts +123 -151
  1378. package/src/ScopedCache.ts +1 -1
  1379. package/src/ScopedRef.ts +4 -4
  1380. package/src/Semaphore.ts +152 -51
  1381. package/src/Sink.ts +129 -114
  1382. package/src/Stdio.ts +1 -1
  1383. package/src/Stream.ts +2679 -3133
  1384. package/src/String.ts +275 -312
  1385. package/src/Struct.ts +109 -114
  1386. package/src/SubscriptionRef.ts +284 -252
  1387. package/src/Symbol.ts +3 -3
  1388. package/src/SynchronizedRef.ts +1 -1
  1389. package/src/Terminal.ts +3 -3
  1390. package/src/Tracer.ts +102 -55
  1391. package/src/Trie.ts +287 -679
  1392. package/src/Tuple.ts +99 -131
  1393. package/src/TxChunk.ts +201 -121
  1394. package/src/TxDeferred.ts +62 -46
  1395. package/src/TxHashMap.ts +645 -799
  1396. package/src/TxHashSet.ts +443 -356
  1397. package/src/TxPriorityQueue.ts +130 -98
  1398. package/src/TxPubSub.ts +107 -80
  1399. package/src/TxQueue.ts +214 -183
  1400. package/src/TxReentrantLock.ts +136 -101
  1401. package/src/TxRef.ts +51 -32
  1402. package/src/TxSemaphore.ts +129 -95
  1403. package/src/TxSubscriptionRef.ts +97 -70
  1404. package/src/Types.ts +126 -67
  1405. package/src/Unify.ts +45 -65
  1406. package/src/Utils.ts +23 -16
  1407. package/src/internal/core.ts +2 -2
  1408. package/src/internal/dateTime.ts +7 -1
  1409. package/src/internal/effect.ts +93 -48
  1410. package/src/internal/executionPlan.ts +105 -10
  1411. package/src/internal/hashMap.ts +20 -14
  1412. package/src/internal/matcher.ts +2 -2
  1413. package/src/internal/persistence.ts +2 -0
  1414. package/src/internal/references.ts +3 -2
  1415. package/src/internal/schedule.ts +4 -4
  1416. package/src/internal/schema/annotations.ts +3 -0
  1417. package/src/internal/schema/fromJsonSchemaDocument.ts +15 -13
  1418. package/src/internal/schema/fromRepresentation.ts +10 -16
  1419. package/src/internal/schema/parser.ts +22 -0
  1420. package/src/internal/schema/toArbitrary.ts +3 -1
  1421. package/src/internal/schema/toJsonSchemaDocument.ts +60 -6
  1422. package/src/internal/schema/toRepresentation.ts +104 -119
  1423. package/src/internal/trie.ts +21 -12
  1424. package/src/testing/FastCheck.ts +8 -7
  1425. package/src/testing/TestClock.ts +85 -31
  1426. package/src/testing/TestConsole.ts +32 -31
  1427. package/src/testing/TestSchema.ts +30 -30
  1428. package/src/unstable/ai/AiError.ts +114 -137
  1429. package/src/unstable/ai/AnthropicStructuredOutput.ts +1 -1
  1430. package/src/unstable/ai/Chat.ts +133 -98
  1431. package/src/unstable/ai/IdGenerator.ts +32 -28
  1432. package/src/unstable/ai/LanguageModel.ts +111 -69
  1433. package/src/unstable/ai/McpProtocol.ts +48 -0
  1434. package/src/unstable/ai/McpSchema.ts +77 -66
  1435. package/src/unstable/ai/McpServer.ts +931 -305
  1436. package/src/unstable/ai/Model.ts +9 -20
  1437. package/src/unstable/ai/OpenAiStructuredOutput.ts +1 -1
  1438. package/src/unstable/ai/Prompt.ts +166 -49
  1439. package/src/unstable/ai/Response.ts +28 -14
  1440. package/src/unstable/ai/Telemetry.ts +46 -13
  1441. package/src/unstable/ai/Tokenizer.ts +14 -3
  1442. package/src/unstable/ai/Tool.ts +59 -44
  1443. package/src/unstable/ai/Toolkit.ts +26 -8
  1444. package/src/unstable/ai/index.ts +5 -0
  1445. package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
  1446. package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
  1447. package/src/unstable/ai/internal/structured-output.ts +13 -18
  1448. package/src/unstable/cli/Argument.ts +273 -69
  1449. package/src/unstable/cli/CliError.ts +79 -86
  1450. package/src/unstable/cli/CliOutput.ts +44 -58
  1451. package/src/unstable/cli/Command.ts +716 -116
  1452. package/src/unstable/cli/Flag.ts +418 -138
  1453. package/src/unstable/cli/GlobalFlag.ts +1 -1
  1454. package/src/unstable/cli/HelpDoc.ts +12 -4
  1455. package/src/unstable/cli/Param.ts +333 -97
  1456. package/src/unstable/cli/Primitive.ts +381 -154
  1457. package/src/unstable/cli/Prompt.ts +64 -34
  1458. package/src/unstable/cli/internal/ansi.ts +2 -2
  1459. package/src/unstable/cli/internal/command.ts +15 -10
  1460. package/src/unstable/cli/internal/completions/bash.ts +59 -9
  1461. package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
  1462. package/src/unstable/cli/internal/completions/fish.ts +5 -7
  1463. package/src/unstable/cli/internal/help.ts +4 -2
  1464. package/src/unstable/cli/internal/lexer.ts +8 -2
  1465. package/src/unstable/cli/internal/parser.ts +5 -5
  1466. package/src/unstable/cli/internal/wizard.ts +2 -2
  1467. package/src/unstable/cluster/ClusterError.ts +7 -7
  1468. package/src/unstable/cluster/ClusterSchema.ts +8 -8
  1469. package/src/unstable/cluster/ClusterWorkflowEngine.ts +9 -2
  1470. package/src/unstable/cluster/Entity.ts +15 -16
  1471. package/src/unstable/cluster/EntityProxy.ts +4 -2
  1472. package/src/unstable/cluster/EntityResource.ts +2 -2
  1473. package/src/unstable/cluster/Envelope.ts +3 -3
  1474. package/src/unstable/cluster/HttpRunner.ts +6 -4
  1475. package/src/unstable/cluster/Message.ts +9 -9
  1476. package/src/unstable/cluster/MessageStorage.ts +24 -20
  1477. package/src/unstable/cluster/Reply.ts +25 -6
  1478. package/src/unstable/cluster/RunnerHealth.ts +1 -1
  1479. package/src/unstable/cluster/RunnerServer.ts +35 -8
  1480. package/src/unstable/cluster/RunnerStorage.ts +11 -9
  1481. package/src/unstable/cluster/Runners.ts +23 -12
  1482. package/src/unstable/cluster/Sharding.ts +42 -15
  1483. package/src/unstable/cluster/ShardingConfig.ts +3 -3
  1484. package/src/unstable/cluster/SingletonAddress.ts +1 -1
  1485. package/src/unstable/cluster/Snowflake.ts +8 -8
  1486. package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
  1487. package/src/unstable/cluster/SqlRunnerStorage.ts +21 -5
  1488. package/src/unstable/cluster/internal/entityManager.ts +12 -16
  1489. package/src/unstable/cluster/internal/resourceMap.ts +5 -2
  1490. package/src/unstable/cluster/internal/resourceRef.ts +27 -5
  1491. package/src/unstable/devtools/DevToolsClient.ts +3 -2
  1492. package/src/unstable/encoding/Ini.ts +174 -0
  1493. package/src/unstable/encoding/Msgpack.ts +53 -36
  1494. package/src/unstable/encoding/Ndjson.ts +9 -1
  1495. package/src/unstable/encoding/Sse.ts +109 -37
  1496. package/src/unstable/encoding/Toml.ts +504 -0
  1497. package/src/unstable/encoding/Yaml.ts +541 -0
  1498. package/src/unstable/encoding/index.ts +15 -0
  1499. package/src/unstable/eventlog/Event.ts +20 -20
  1500. package/src/unstable/eventlog/EventGroup.ts +4 -4
  1501. package/src/unstable/eventlog/EventJournal.ts +29 -21
  1502. package/src/unstable/eventlog/EventLog.ts +3 -3
  1503. package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
  1504. package/src/unstable/eventlog/EventLogMessage.ts +3 -3
  1505. package/src/unstable/eventlog/EventLogRemote.ts +1 -1
  1506. package/src/unstable/eventlog/EventLogServer.ts +41 -7
  1507. package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
  1508. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +15 -7
  1509. package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
  1510. package/src/unstable/eventlog/SqlEventJournal.ts +6 -4
  1511. package/src/unstable/http/Cookies.ts +35 -21
  1512. package/src/unstable/http/Etag.ts +1 -1
  1513. package/src/unstable/http/FetchHttpClient.ts +3 -1
  1514. package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
  1515. package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
  1516. package/src/unstable/http/FindMyWay.ts +65 -6
  1517. package/src/unstable/http/Headers.ts +2 -2
  1518. package/src/unstable/http/HttpBody.ts +20 -5
  1519. package/src/unstable/http/HttpClient.ts +83 -55
  1520. package/src/unstable/http/HttpClientError.ts +1 -1
  1521. package/src/unstable/http/HttpClientRequest.ts +2 -12
  1522. package/src/unstable/http/HttpClientResponse.ts +5 -21
  1523. package/src/unstable/http/HttpEffect.ts +8 -8
  1524. package/src/unstable/http/HttpMethod.ts +6 -9
  1525. package/src/unstable/http/HttpMiddleware.ts +202 -39
  1526. package/src/unstable/http/HttpPlatform.ts +129 -6
  1527. package/src/unstable/http/HttpRouter.ts +102 -98
  1528. package/src/unstable/http/HttpServer.ts +13 -13
  1529. package/src/unstable/http/HttpServerError.ts +2 -2
  1530. package/src/unstable/http/HttpServerRequest.ts +18 -10
  1531. package/src/unstable/http/HttpServerResponse.ts +38 -6
  1532. package/src/unstable/http/HttpStaticServer.ts +35 -7
  1533. package/src/unstable/http/Multipart.ts +15 -8
  1534. package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
  1535. package/src/unstable/http/MultipartParser/Search.ts +17 -0
  1536. package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
  1537. package/src/unstable/http/MultipartParser/internal/headers.ts +615 -0
  1538. package/src/unstable/http/MultipartParser/internal/multipart.ts +262 -0
  1539. package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
  1540. package/src/unstable/http/MultipartParser.ts +115 -0
  1541. package/src/unstable/http/Template.ts +6 -5
  1542. package/src/unstable/http/Url.ts +33 -63
  1543. package/src/unstable/http/UrlParams.ts +10 -18
  1544. package/src/unstable/http/index.ts +1 -1
  1545. package/src/unstable/http/internal/compression.ts +196 -0
  1546. package/src/unstable/http/internal/httpBody.ts +15 -0
  1547. package/src/unstable/httpapi/HttpApi.ts +6 -7
  1548. package/src/unstable/httpapi/HttpApiBuilder.ts +129 -30
  1549. package/src/unstable/httpapi/HttpApiClient.ts +117 -54
  1550. package/src/unstable/httpapi/HttpApiEndpoint.ts +159 -71
  1551. package/src/unstable/httpapi/HttpApiError.ts +46 -52
  1552. package/src/unstable/httpapi/HttpApiGroup.ts +15 -15
  1553. package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
  1554. package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
  1555. package/src/unstable/httpapi/HttpApiSchema.ts +359 -6
  1556. package/src/unstable/httpapi/OpenApi.ts +83 -33
  1557. package/src/unstable/observability/OtlpExporter.ts +35 -21
  1558. package/src/unstable/observability/OtlpLogger.ts +3 -1
  1559. package/src/unstable/observability/OtlpMetrics.ts +36 -19
  1560. package/src/unstable/observability/OtlpResource.ts +26 -17
  1561. package/src/unstable/observability/OtlpTracer.ts +1 -1
  1562. package/src/unstable/observability/PrometheusMetrics.ts +13 -4
  1563. package/src/unstable/observability/internal/otlpEnv.ts +1 -1
  1564. package/src/unstable/observability/internal/protobuf.ts +3 -0
  1565. package/src/unstable/persistence/KeyValueStore.ts +72 -49
  1566. package/src/unstable/persistence/Persistable.ts +8 -8
  1567. package/src/unstable/persistence/PersistedQueue.ts +18 -15
  1568. package/src/unstable/persistence/Persistence.ts +153 -26
  1569. package/src/unstable/persistence/RateLimiter.ts +77 -43
  1570. package/src/unstable/persistence/Redis.ts +3 -3
  1571. package/src/unstable/process/ChildProcess.ts +64 -21
  1572. package/src/unstable/process/ChildProcessSpawner.ts +21 -10
  1573. package/src/unstable/reactivity/AsyncResult.ts +12 -13
  1574. package/src/unstable/reactivity/Atom.ts +28 -25
  1575. package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
  1576. package/src/unstable/reactivity/AtomRegistry.ts +24 -3
  1577. package/src/unstable/reactivity/AtomRpc.ts +5 -4
  1578. package/src/unstable/reactivity/Hydration.ts +1 -1
  1579. package/src/unstable/rpc/Rpc.ts +35 -33
  1580. package/src/unstable/rpc/RpcClient.ts +54 -27
  1581. package/src/unstable/rpc/RpcClientError.ts +2 -2
  1582. package/src/unstable/rpc/RpcGroup.ts +8 -8
  1583. package/src/unstable/rpc/RpcMessage.ts +31 -30
  1584. package/src/unstable/rpc/RpcMiddleware.ts +10 -10
  1585. package/src/unstable/rpc/RpcSchema.ts +4 -4
  1586. package/src/unstable/rpc/RpcSerialization.ts +167 -68
  1587. package/src/unstable/rpc/RpcServer.ts +18 -15
  1588. package/src/unstable/rpc/RpcWorker.ts +5 -5
  1589. package/src/unstable/schema/Model.ts +52 -50
  1590. package/src/unstable/schema/VariantSchema.ts +41 -23
  1591. package/src/unstable/socket/Socket.ts +41 -18
  1592. package/src/unstable/sql/SqlClient.ts +64 -56
  1593. package/src/unstable/sql/SqlError.ts +13 -13
  1594. package/src/unstable/sql/SqlModel.ts +2 -2
  1595. package/src/unstable/sql/SqlResolver.ts +13 -11
  1596. package/src/unstable/sql/Statement.ts +37 -31
  1597. package/src/unstable/workers/Transferable.ts +1 -1
  1598. package/src/unstable/workers/Worker.ts +2 -2
  1599. package/src/unstable/workers/WorkerError.ts +12 -12
  1600. package/src/unstable/workers/WorkerRunner.ts +1 -1
  1601. package/src/unstable/workflow/Activity.ts +2 -2
  1602. package/src/unstable/workflow/DurableClock.ts +1 -1
  1603. package/src/unstable/workflow/DurableDeferred.ts +10 -10
  1604. package/src/unstable/workflow/DurableQueue.ts +22 -20
  1605. package/src/unstable/workflow/Workflow.ts +23 -23
  1606. package/src/unstable/workflow/WorkflowEngine.ts +9 -4
  1607. package/src/unstable/workflow/WorkflowProxy.ts +4 -2
  1608. package/dist/internal/version.d.ts +0 -3
  1609. package/dist/internal/version.d.ts.map +0 -1
  1610. package/dist/internal/version.js +0 -2
  1611. package/dist/internal/version.js.map +0 -1
  1612. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
  1613. package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
  1614. package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
  1615. package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
  1616. package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
  1617. package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
  1618. package/dist/unstable/http/Multipasta/Node.js +0 -14
  1619. package/dist/unstable/http/Multipasta/Node.js.map +0 -1
  1620. package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
  1621. package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
  1622. package/dist/unstable/http/Multipasta/Search.js +0 -14
  1623. package/dist/unstable/http/Multipasta/Search.js.map +0 -1
  1624. package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
  1625. package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
  1626. package/dist/unstable/http/Multipasta/Web.js +0 -14
  1627. package/dist/unstable/http/Multipasta/Web.js.map +0 -1
  1628. package/dist/unstable/http/Multipasta.d.ts +0 -15
  1629. package/dist/unstable/http/Multipasta.d.ts.map +0 -1
  1630. package/dist/unstable/http/Multipasta.js +0 -15
  1631. package/dist/unstable/http/Multipasta.js.map +0 -1
  1632. package/src/internal/version.ts +0 -2
  1633. package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
  1634. package/src/unstable/http/Multipasta/Node.ts +0 -14
  1635. package/src/unstable/http/Multipasta/Search.ts +0 -14
  1636. package/src/unstable/http/Multipasta/Web.ts +0 -14
  1637. package/src/unstable/http/Multipasta.ts +0 -15
package/src/Iterable.ts CHANGED
@@ -33,21 +33,21 @@ import type { NoInfer } from "./Types.ts"
33
33
  *
34
34
  * **Example** (Generating values by index)
35
35
  *
36
- * ```ts
36
+ * ```ts import.meta.vitest
37
37
  * import { Iterable } from "effect"
38
38
  *
39
39
  * // Generate first 5 even numbers
40
40
  * const evens = Iterable.makeBy((n) => n * 2, { length: 5 })
41
- * console.log(Array.from(evens)) // [0, 2, 4, 6, 8]
41
+ * Array.from(evens) // => [0, 2, 4, 6, 8]
42
42
  *
43
43
  * // Generate squares
44
44
  * const squares = Iterable.makeBy((n) => n * n, { length: 4 })
45
- * console.log(Array.from(squares)) // [0, 1, 4, 9]
45
+ * Array.from(squares) // => [0, 1, 4, 9]
46
46
  *
47
47
  * // Infinite sequence (be careful when consuming!)
48
48
  * const naturals = Iterable.makeBy((n) => n)
49
49
  * const first10 = Iterable.take(naturals, 10)
50
- * console.log(Array.from(first10)) // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
50
+ * Array.from(first10) // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
51
51
  * ```
52
52
  *
53
53
  * @category constructors
@@ -83,11 +83,10 @@ export const makeBy = <A>(f: (i: number) => A, options?: {
83
83
  *
84
84
  * **Example** (Creating a range)
85
85
  *
86
- * ```ts
86
+ * ```ts import.meta.vitest
87
87
  * import { Iterable } from "effect"
88
- * import * as assert from "node:assert"
89
88
  *
90
- * assert.deepStrictEqual(Array.from(Iterable.range(1, 3)), [1, 2, 3])
89
+ * Array.from(Iterable.range(1, 3)) // => [1, 2, 3]
91
90
  * ```
92
91
  *
93
92
  * @category constructors
@@ -111,11 +110,10 @@ export const range = (start: number, end?: number): Iterable<number> => {
111
110
  *
112
111
  * **Example** (Repeating a value)
113
112
  *
114
- * ```ts
113
+ * ```ts import.meta.vitest
115
114
  * import { Iterable } from "effect"
116
- * import * as assert from "node:assert"
117
115
  *
118
- * assert.deepStrictEqual(Array.from(Iterable.replicate("a", 3)), ["a", "a", "a"])
116
+ * Array.from(Iterable.replicate("a", 3)) // => ["a", "a", "a"]
119
117
  * ```
120
118
  *
121
119
  * @category constructors
@@ -131,11 +129,10 @@ export const replicate: {
131
129
  *
132
130
  * **Example** (Repeating a value)
133
131
  *
134
- * ```ts
132
+ * ```ts import.meta.vitest
135
133
  * import { Iterable } from "effect"
136
- * import * as assert from "node:assert"
137
134
  *
138
- * assert.deepStrictEqual(Array.from(Iterable.replicate("a", 3)), ["a", "a", "a"])
135
+ * Array.from(Iterable.replicate("a", 3)) // => ["a", "a", "a"]
139
136
  * ```
140
137
  *
141
138
  * @category constructors
@@ -151,11 +148,10 @@ export const replicate: {
151
148
  *
152
149
  * **Example** (Repeating a value)
153
150
  *
154
- * ```ts
151
+ * ```ts import.meta.vitest
155
152
  * import { Iterable } from "effect"
156
- * import * as assert from "node:assert"
157
153
  *
158
- * assert.deepStrictEqual(Array.from(Iterable.replicate("a", 3)), ["a", "a", "a"])
154
+ * Array.from(Iterable.replicate("a", 3)) // => ["a", "a", "a"]
159
155
  * ```
160
156
  *
161
157
  * @category constructors
@@ -246,15 +242,11 @@ export const forever = <A>(self: Iterable<A>): Iterable<A> => repeat(self, Infin
246
242
  *
247
243
  * **Example** (Converting a record to entries)
248
244
  *
249
- * ```ts
245
+ * ```ts import.meta.vitest
250
246
  * import { Iterable } from "effect"
251
- * import * as assert from "node:assert"
252
247
  *
253
248
  * const x = { a: 1, b: 2, c: 3 }
254
- * assert.deepStrictEqual(Array.from(Iterable.fromRecord(x)), [["a", 1], ["b", 2], [
255
- * "c",
256
- * 3
257
- * ]])
249
+ * Array.from(Iterable.fromRecord(x)) // => [["a", 1], ["b", 2], ["c", 3]]
258
250
  * ```
259
251
  *
260
252
  * @category converting
@@ -275,17 +267,17 @@ export const fromRecord = <K extends string, A>(self: Readonly<Record<K, A>>): I
275
267
  *
276
268
  * **Example** (Prepending an element)
277
269
  *
278
- * ```ts
270
+ * ```ts import.meta.vitest
279
271
  * import { Iterable } from "effect"
280
272
  *
281
273
  * const numbers = [2, 3, 4]
282
274
  * const withOne = Iterable.prepend(numbers, 1)
283
- * console.log(Array.from(withOne)) // [1, 2, 3, 4]
275
+ * Array.from(withOne) // => [1, 2, 3, 4]
284
276
  *
285
277
  * // Works with any iterable
286
278
  * const letters = "abc"
287
279
  * const withZ = Iterable.prepend(letters, "z")
288
- * console.log(Array.from(withZ)) // ["z", "a", "b", "c"]
280
+ * Array.from(withZ) // => ["z", "a", "b", "c"]
289
281
  * ```
290
282
  *
291
283
  * @category combining
@@ -297,17 +289,17 @@ export const prepend: {
297
289
  *
298
290
  * **Example** (Prepending an element)
299
291
  *
300
- * ```ts
292
+ * ```ts import.meta.vitest
301
293
  * import { Iterable } from "effect"
302
294
  *
303
295
  * const numbers = [2, 3, 4]
304
296
  * const withOne = Iterable.prepend(numbers, 1)
305
- * console.log(Array.from(withOne)) // [1, 2, 3, 4]
297
+ * Array.from(withOne) // => [1, 2, 3, 4]
306
298
  *
307
299
  * // Works with any iterable
308
300
  * const letters = "abc"
309
301
  * const withZ = Iterable.prepend(letters, "z")
310
- * console.log(Array.from(withZ)) // ["z", "a", "b", "c"]
302
+ * Array.from(withZ) // => ["z", "a", "b", "c"]
311
303
  * ```
312
304
  *
313
305
  * @category combining
@@ -319,17 +311,17 @@ export const prepend: {
319
311
  *
320
312
  * **Example** (Prepending an element)
321
313
  *
322
- * ```ts
314
+ * ```ts import.meta.vitest
323
315
  * import { Iterable } from "effect"
324
316
  *
325
317
  * const numbers = [2, 3, 4]
326
318
  * const withOne = Iterable.prepend(numbers, 1)
327
- * console.log(Array.from(withOne)) // [1, 2, 3, 4]
319
+ * Array.from(withOne) // => [1, 2, 3, 4]
328
320
  *
329
321
  * // Works with any iterable
330
322
  * const letters = "abc"
331
323
  * const withZ = Iterable.prepend(letters, "z")
332
- * console.log(Array.from(withZ)) // ["z", "a", "b", "c"]
324
+ * Array.from(withZ) // => ["z", "a", "b", "c"]
333
325
  * ```
334
326
  *
335
327
  * @category combining
@@ -343,14 +335,10 @@ export const prepend: {
343
335
  *
344
336
  * **Example** (Prepending another iterable)
345
337
  *
346
- * ```ts
338
+ * ```ts import.meta.vitest
347
339
  * import { Iterable } from "effect"
348
- * import * as assert from "node:assert"
349
340
  *
350
- * assert.deepStrictEqual(
351
- * Array.from(Iterable.prependAll([1, 2], ["a", "b"])),
352
- * ["a", "b", 1, 2]
353
- * )
341
+ * Array.from(Iterable.prependAll([1, 2], ["a", "b"])) // => ["a", "b", 1, 2]
354
342
  * ```
355
343
  *
356
344
  * @category combining
@@ -362,14 +350,10 @@ export const prependAll: {
362
350
  *
363
351
  * **Example** (Prepending another iterable)
364
352
  *
365
- * ```ts
353
+ * ```ts import.meta.vitest
366
354
  * import { Iterable } from "effect"
367
- * import * as assert from "node:assert"
368
355
  *
369
- * assert.deepStrictEqual(
370
- * Array.from(Iterable.prependAll([1, 2], ["a", "b"])),
371
- * ["a", "b", 1, 2]
372
- * )
356
+ * Array.from(Iterable.prependAll([1, 2], ["a", "b"])) // => ["a", "b", 1, 2]
373
357
  * ```
374
358
  *
375
359
  * @category combining
@@ -381,14 +365,10 @@ export const prependAll: {
381
365
  *
382
366
  * **Example** (Prepending another iterable)
383
367
  *
384
- * ```ts
368
+ * ```ts import.meta.vitest
385
369
  * import { Iterable } from "effect"
386
- * import * as assert from "node:assert"
387
370
  *
388
- * assert.deepStrictEqual(
389
- * Array.from(Iterable.prependAll([1, 2], ["a", "b"])),
390
- * ["a", "b", 1, 2]
391
- * )
371
+ * Array.from(Iterable.prependAll([1, 2], ["a", "b"])) // => ["a", "b", 1, 2]
392
372
  * ```
393
373
  *
394
374
  * @category combining
@@ -420,19 +400,11 @@ export const prependAll: {
420
400
  *
421
401
  * **Example** (Appending an element)
422
402
  *
423
- * ```ts
403
+ * ```ts import.meta.vitest
424
404
  * import { Iterable } from "effect"
425
405
  *
426
406
  * const numbers = [1, 2, 3]
427
- * const withFour = Iterable.append(numbers, 4)
428
- * console.log(Array.from(withFour)) // [1, 2, 3, 4]
429
- *
430
- * // Chain multiple appends
431
- * const result = Iterable.append(
432
- * Iterable.append([1, 2], 3),
433
- * 4
434
- * )
435
- * console.log(Array.from(result)) // [1, 2, 3, 4]
407
+ * Array.from(Iterable.append(numbers, 4)) // => [1, 2, 3, 4]
436
408
  * ```
437
409
  *
438
410
  * @see {@link prepend} for adding one element before the existing elements
@@ -462,19 +434,11 @@ export const append: {
462
434
  *
463
435
  * **Example** (Appending an element)
464
436
  *
465
- * ```ts
437
+ * ```ts import.meta.vitest
466
438
  * import { Iterable } from "effect"
467
439
  *
468
440
  * const numbers = [1, 2, 3]
469
- * const withFour = Iterable.append(numbers, 4)
470
- * console.log(Array.from(withFour)) // [1, 2, 3, 4]
471
- *
472
- * // Chain multiple appends
473
- * const result = Iterable.append(
474
- * Iterable.append([1, 2], 3),
475
- * 4
476
- * )
477
- * console.log(Array.from(result)) // [1, 2, 3, 4]
441
+ * Array.from(Iterable.append(numbers, 4)) // => [1, 2, 3, 4]
478
442
  * ```
479
443
  *
480
444
  * @see {@link prepend} for adding one element before the existing elements
@@ -504,19 +468,11 @@ export const append: {
504
468
  *
505
469
  * **Example** (Appending an element)
506
470
  *
507
- * ```ts
471
+ * ```ts import.meta.vitest
508
472
  * import { Iterable } from "effect"
509
473
  *
510
474
  * const numbers = [1, 2, 3]
511
- * const withFour = Iterable.append(numbers, 4)
512
- * console.log(Array.from(withFour)) // [1, 2, 3, 4]
513
- *
514
- * // Chain multiple appends
515
- * const result = Iterable.append(
516
- * Iterable.append([1, 2], 3),
517
- * 4
518
- * )
519
- * console.log(Array.from(result)) // [1, 2, 3, 4]
475
+ * Array.from(Iterable.append(numbers, 4)) // => [1, 2, 3, 4]
520
476
  * ```
521
477
  *
522
478
  * @see {@link prepend} for adding one element before the existing elements
@@ -547,25 +503,21 @@ export const append: {
547
503
  *
548
504
  * **Example** (Concatenating iterables)
549
505
  *
550
- * ```ts
506
+ * ```ts import.meta.vitest
551
507
  * import { Iterable } from "effect"
552
508
  *
553
- * const first = [1, 2, 3]
554
- * const second = [4, 5, 6]
555
- * const combined = Iterable.appendAll(first, second)
556
- * console.log(Array.from(combined)) // [1, 2, 3, 4, 5, 6]
509
+ * Array.from(Iterable.appendAll([1, 2, 3], [4, 5, 6])) // => [1, 2, 3, 4, 5, 6]
557
510
  *
558
511
  * // Works with different iterable types
559
512
  * const numbers = [1, 2]
560
513
  * const letters = "abc"
561
514
  * const mixed = Iterable.appendAll(numbers, letters)
562
- * console.log(Array.from(mixed)) // [1, 2, "a", "b", "c"]
515
+ * Array.from(mixed) // => [1, 2, "a", "b", "c"]
563
516
  *
564
517
  * // Lazy evaluation - only consumes what's needed
565
518
  * const infinite = Iterable.range(1)
566
519
  * const finite = [0, -1, -2]
567
- * const result = Iterable.take(Iterable.appendAll(finite, infinite), 5)
568
- * console.log(Array.from(result)) // [0, -1, -2, 1, 2]
520
+ * Array.from(Iterable.take(Iterable.appendAll(finite, infinite), 5)) // => [0, -1, -2, 1, 2]
569
521
  * ```
570
522
  *
571
523
  * @see {@link append} for appending one value instead of another iterable
@@ -594,25 +546,21 @@ export const appendAll: {
594
546
  *
595
547
  * **Example** (Concatenating iterables)
596
548
  *
597
- * ```ts
549
+ * ```ts import.meta.vitest
598
550
  * import { Iterable } from "effect"
599
551
  *
600
- * const first = [1, 2, 3]
601
- * const second = [4, 5, 6]
602
- * const combined = Iterable.appendAll(first, second)
603
- * console.log(Array.from(combined)) // [1, 2, 3, 4, 5, 6]
552
+ * Array.from(Iterable.appendAll([1, 2, 3], [4, 5, 6])) // => [1, 2, 3, 4, 5, 6]
604
553
  *
605
554
  * // Works with different iterable types
606
555
  * const numbers = [1, 2]
607
556
  * const letters = "abc"
608
557
  * const mixed = Iterable.appendAll(numbers, letters)
609
- * console.log(Array.from(mixed)) // [1, 2, "a", "b", "c"]
558
+ * Array.from(mixed) // => [1, 2, "a", "b", "c"]
610
559
  *
611
560
  * // Lazy evaluation - only consumes what's needed
612
561
  * const infinite = Iterable.range(1)
613
562
  * const finite = [0, -1, -2]
614
- * const result = Iterable.take(Iterable.appendAll(finite, infinite), 5)
615
- * console.log(Array.from(result)) // [0, -1, -2, 1, 2]
563
+ * Array.from(Iterable.take(Iterable.appendAll(finite, infinite), 5)) // => [0, -1, -2, 1, 2]
616
564
  * ```
617
565
  *
618
566
  * @see {@link append} for appending one value instead of another iterable
@@ -641,25 +589,21 @@ export const appendAll: {
641
589
  *
642
590
  * **Example** (Concatenating iterables)
643
591
  *
644
- * ```ts
592
+ * ```ts import.meta.vitest
645
593
  * import { Iterable } from "effect"
646
594
  *
647
- * const first = [1, 2, 3]
648
- * const second = [4, 5, 6]
649
- * const combined = Iterable.appendAll(first, second)
650
- * console.log(Array.from(combined)) // [1, 2, 3, 4, 5, 6]
595
+ * Array.from(Iterable.appendAll([1, 2, 3], [4, 5, 6])) // => [1, 2, 3, 4, 5, 6]
651
596
  *
652
597
  * // Works with different iterable types
653
598
  * const numbers = [1, 2]
654
599
  * const letters = "abc"
655
600
  * const mixed = Iterable.appendAll(numbers, letters)
656
- * console.log(Array.from(mixed)) // [1, 2, "a", "b", "c"]
601
+ * Array.from(mixed) // => [1, 2, "a", "b", "c"]
657
602
  *
658
603
  * // Lazy evaluation - only consumes what's needed
659
604
  * const infinite = Iterable.range(1)
660
605
  * const finite = [0, -1, -2]
661
- * const result = Iterable.take(Iterable.appendAll(finite, infinite), 5)
662
- * console.log(Array.from(result)) // [0, -1, -2, 1, 2]
606
+ * Array.from(Iterable.take(Iterable.appendAll(finite, infinite), 5)) // => [0, -1, -2, 1, 2]
663
607
  * ```
664
608
  *
665
609
  * @see {@link append} for appending one value instead of another iterable
@@ -699,23 +643,23 @@ export const appendAll: {
699
643
  *
700
644
  * **Example** (Tracking running results)
701
645
  *
702
- * ```ts
646
+ * ```ts import.meta.vitest
703
647
  * import { Iterable } from "effect"
704
648
  *
705
649
  * // Running sum of numbers
706
650
  * const numbers = [1, 2, 3, 4, 5]
707
651
  * const runningSum = Iterable.scan(numbers, 0, (acc, n) => acc + n)
708
- * console.log(Array.from(runningSum)) // [0, 1, 3, 6, 10, 15]
652
+ * Array.from(runningSum) // => [0, 1, 3, 6, 10, 15]
709
653
  *
710
654
  * // Build strings progressively
711
655
  * const letters = ["a", "b", "c"]
712
656
  * const progressive = Iterable.scan(letters, "", (acc, letter) => acc + letter)
713
- * console.log(Array.from(progressive)) // ["", "a", "ab", "abc"]
657
+ * Array.from(progressive) // => ["", "a", "ab", "abc"]
714
658
  *
715
659
  * // Track maximum values seen so far
716
660
  * const values = [3, 1, 4, 1, 5, 9, 2]
717
661
  * const runningMax = Iterable.scan(values, -Infinity, Math.max)
718
- * console.log(Array.from(runningMax)) // [-Infinity, 3, 3, 4, 4, 5, 9, 9]
662
+ * Array.from(runningMax) // => [-Infinity, 3, 3, 4, 4, 5, 9, 9]
719
663
  * ```
720
664
  *
721
665
  * @category folding
@@ -727,23 +671,23 @@ export const scan: {
727
671
  *
728
672
  * **Example** (Tracking running results)
729
673
  *
730
- * ```ts
674
+ * ```ts import.meta.vitest
731
675
  * import { Iterable } from "effect"
732
676
  *
733
677
  * // Running sum of numbers
734
678
  * const numbers = [1, 2, 3, 4, 5]
735
679
  * const runningSum = Iterable.scan(numbers, 0, (acc, n) => acc + n)
736
- * console.log(Array.from(runningSum)) // [0, 1, 3, 6, 10, 15]
680
+ * Array.from(runningSum) // => [0, 1, 3, 6, 10, 15]
737
681
  *
738
682
  * // Build strings progressively
739
683
  * const letters = ["a", "b", "c"]
740
684
  * const progressive = Iterable.scan(letters, "", (acc, letter) => acc + letter)
741
- * console.log(Array.from(progressive)) // ["", "a", "ab", "abc"]
685
+ * Array.from(progressive) // => ["", "a", "ab", "abc"]
742
686
  *
743
687
  * // Track maximum values seen so far
744
688
  * const values = [3, 1, 4, 1, 5, 9, 2]
745
689
  * const runningMax = Iterable.scan(values, -Infinity, Math.max)
746
- * console.log(Array.from(runningMax)) // [-Infinity, 3, 3, 4, 4, 5, 9, 9]
690
+ * Array.from(runningMax) // => [-Infinity, 3, 3, 4, 4, 5, 9, 9]
747
691
  * ```
748
692
  *
749
693
  * @category folding
@@ -755,23 +699,23 @@ export const scan: {
755
699
  *
756
700
  * **Example** (Tracking running results)
757
701
  *
758
- * ```ts
702
+ * ```ts import.meta.vitest
759
703
  * import { Iterable } from "effect"
760
704
  *
761
705
  * // Running sum of numbers
762
706
  * const numbers = [1, 2, 3, 4, 5]
763
707
  * const runningSum = Iterable.scan(numbers, 0, (acc, n) => acc + n)
764
- * console.log(Array.from(runningSum)) // [0, 1, 3, 6, 10, 15]
708
+ * Array.from(runningSum) // => [0, 1, 3, 6, 10, 15]
765
709
  *
766
710
  * // Build strings progressively
767
711
  * const letters = ["a", "b", "c"]
768
712
  * const progressive = Iterable.scan(letters, "", (acc, letter) => acc + letter)
769
- * console.log(Array.from(progressive)) // ["", "a", "ab", "abc"]
713
+ * Array.from(progressive) // => ["", "a", "ab", "abc"]
770
714
  *
771
715
  * // Track maximum values seen so far
772
716
  * const values = [3, 1, 4, 1, 5, 9, 2]
773
717
  * const runningMax = Iterable.scan(values, -Infinity, Math.max)
774
- * console.log(Array.from(runningMax)) // [-Infinity, 3, 3, 4, 4, 5, 9, 9]
718
+ * Array.from(runningMax) // => [-Infinity, 3, 3, 4, 4, 5, 9, 9]
775
719
  * ```
776
720
  *
777
721
  * @category folding
@@ -803,12 +747,11 @@ export const scan: {
803
747
  *
804
748
  * **Example** (Checking for emptiness)
805
749
  *
806
- * ```ts
750
+ * ```ts import.meta.vitest
807
751
  * import { Iterable } from "effect"
808
- * import * as assert from "node:assert"
809
752
  *
810
- * assert.deepStrictEqual(Iterable.isEmpty([]), true)
811
- * assert.deepStrictEqual(Iterable.isEmpty([1, 2, 3]), false)
753
+ * Iterable.isEmpty([]) // => true
754
+ * Iterable.isEmpty([1, 2, 3]) // => false
812
755
  * ```
813
756
  *
814
757
  * @category guards
@@ -824,22 +767,22 @@ export const isEmpty = <A>(self: Iterable<A>): self is Iterable<never> => {
824
767
  *
825
768
  * **Example** (Counting iterable elements)
826
769
  *
827
- * ```ts
770
+ * ```ts import.meta.vitest
828
771
  * import { Iterable } from "effect"
829
772
  *
830
773
  * const numbers = [1, 2, 3, 4, 5]
831
- * console.log(Iterable.size(numbers)) // 5
774
+ * Iterable.size(numbers) // => 5
832
775
  *
833
776
  * const empty = Iterable.empty<number>()
834
- * console.log(Iterable.size(empty)) // 0
777
+ * Iterable.size(empty) // => 0
835
778
  *
836
779
  * // Works with any iterable
837
780
  * const letters = "hello"
838
- * console.log(Iterable.size(letters)) // 5
781
+ * Iterable.size(letters) // => 5
839
782
  *
840
783
  * // Note: This consumes the entire iterable
841
784
  * const range = Iterable.range(1, 100)
842
- * console.log(Iterable.size(range)) // 100
785
+ * Iterable.size(range) // => 100
843
786
  * ```
844
787
  *
845
788
  * @category getters
@@ -859,24 +802,24 @@ export const size = <A>(self: Iterable<A>): number => {
859
802
  *
860
803
  * **Example** (Getting the first element)
861
804
  *
862
- * ```ts
805
+ * ```ts import.meta.vitest
863
806
  * import { Iterable, Option } from "effect"
864
807
  *
865
808
  * const numbers = [1, 2, 3]
866
- * console.log(Iterable.head(numbers)) // Option.some(1)
809
+ * Iterable.head(numbers) // => Option.some(1)
867
810
  *
868
811
  * const empty = Iterable.empty<number>()
869
- * console.log(Iterable.head(empty)) // Option.none()
812
+ * Iterable.head(empty) // => Option.none()
870
813
  *
871
814
  * // Safe way to get first element
872
815
  * const firstEven = Iterable.head(
873
816
  * Iterable.filter([1, 3, 4, 5], (x) => x % 2 === 0)
874
817
  * )
875
- * console.log(firstEven) // Option.some(4)
818
+ * firstEven // => Option.some(4)
876
819
  *
877
820
  * // Use with Option methods
878
821
  * const doubled = Option.map(Iterable.head([5, 10, 15]), (x) => x * 2)
879
- * console.log(doubled) // Option.some(10)
822
+ * doubled // => Option.some(10)
880
823
  * ```
881
824
  *
882
825
  * @category getters
@@ -902,21 +845,21 @@ export const head = <A>(self: Iterable<A>): Option<A> => {
902
845
  *
903
846
  * **Example** (Getting the first element unsafely)
904
847
  *
905
- * ```ts
848
+ * ```ts import.meta.vitest
906
849
  * import { Iterable } from "effect"
907
850
  *
908
851
  * const numbers = [1, 2, 3]
909
- * console.log(Iterable.headUnsafe(numbers)) // 1
852
+ * Iterable.headUnsafe(numbers) // => 1
910
853
  *
911
854
  * const letters = "hello"
912
- * console.log(Iterable.headUnsafe(letters)) // "h"
855
+ * Iterable.headUnsafe(letters) // => "h"
913
856
  *
914
857
  * // Iterable.headUnsafe(Iterable.empty<number>())
915
858
  * // throws Error: "headUnsafe: empty iterable"
916
859
  *
917
860
  * // Use only when you're certain the iterable is non-empty
918
861
  * const nonEmpty = Iterable.range(1, 10)
919
- * console.log(Iterable.headUnsafe(nonEmpty)) // 1
862
+ * Iterable.headUnsafe(nonEmpty) // => 1
920
863
  * ```
921
864
  *
922
865
  * @category getters
@@ -938,25 +881,25 @@ export const headUnsafe = <A>(self: Iterable<A>): A => {
938
881
  *
939
882
  * **Example** (Taking from the start)
940
883
  *
941
- * ```ts
884
+ * ```ts import.meta.vitest
942
885
  * import { Iterable } from "effect"
943
886
  *
944
887
  * const numbers = [1, 2, 3, 4, 5]
945
888
  * const firstThree = Iterable.take(numbers, 3)
946
- * console.log(Array.from(firstThree)) // [1, 2, 3]
889
+ * Array.from(firstThree) // => [1, 2, 3]
947
890
  *
948
891
  * // Taking more than available returns all elements
949
892
  * const firstTen = Iterable.take(numbers, 10)
950
- * console.log(Array.from(firstTen)) // [1, 2, 3, 4, 5]
893
+ * Array.from(firstTen) // => [1, 2, 3, 4, 5]
951
894
  *
952
895
  * // Taking 0 or negative returns empty
953
896
  * const none = Iterable.take(numbers, 0)
954
- * console.log(Array.from(none)) // []
897
+ * Array.from(none) // => []
955
898
  *
956
899
  * // Useful with infinite iterables
957
900
  * const naturals = Iterable.range(1)
958
901
  * const firstFive = Iterable.take(naturals, 5)
959
- * console.log(Array.from(firstFive)) // [1, 2, 3, 4, 5]
902
+ * Array.from(firstFive) // => [1, 2, 3, 4, 5]
960
903
  * ```
961
904
  *
962
905
  * @category getters
@@ -972,25 +915,25 @@ export const take: {
972
915
  *
973
916
  * **Example** (Taking from the start)
974
917
  *
975
- * ```ts
918
+ * ```ts import.meta.vitest
976
919
  * import { Iterable } from "effect"
977
920
  *
978
921
  * const numbers = [1, 2, 3, 4, 5]
979
922
  * const firstThree = Iterable.take(numbers, 3)
980
- * console.log(Array.from(firstThree)) // [1, 2, 3]
923
+ * Array.from(firstThree) // => [1, 2, 3]
981
924
  *
982
925
  * // Taking more than available returns all elements
983
926
  * const firstTen = Iterable.take(numbers, 10)
984
- * console.log(Array.from(firstTen)) // [1, 2, 3, 4, 5]
927
+ * Array.from(firstTen) // => [1, 2, 3, 4, 5]
985
928
  *
986
929
  * // Taking 0 or negative returns empty
987
930
  * const none = Iterable.take(numbers, 0)
988
- * console.log(Array.from(none)) // []
931
+ * Array.from(none) // => []
989
932
  *
990
933
  * // Useful with infinite iterables
991
934
  * const naturals = Iterable.range(1)
992
935
  * const firstFive = Iterable.take(naturals, 5)
993
- * console.log(Array.from(firstFive)) // [1, 2, 3, 4, 5]
936
+ * Array.from(firstFive) // => [1, 2, 3, 4, 5]
994
937
  * ```
995
938
  *
996
939
  * @category getters
@@ -1006,25 +949,25 @@ export const take: {
1006
949
  *
1007
950
  * **Example** (Taking from the start)
1008
951
  *
1009
- * ```ts
952
+ * ```ts import.meta.vitest
1010
953
  * import { Iterable } from "effect"
1011
954
  *
1012
955
  * const numbers = [1, 2, 3, 4, 5]
1013
956
  * const firstThree = Iterable.take(numbers, 3)
1014
- * console.log(Array.from(firstThree)) // [1, 2, 3]
957
+ * Array.from(firstThree) // => [1, 2, 3]
1015
958
  *
1016
959
  * // Taking more than available returns all elements
1017
960
  * const firstTen = Iterable.take(numbers, 10)
1018
- * console.log(Array.from(firstTen)) // [1, 2, 3, 4, 5]
961
+ * Array.from(firstTen) // => [1, 2, 3, 4, 5]
1019
962
  *
1020
963
  * // Taking 0 or negative returns empty
1021
964
  * const none = Iterable.take(numbers, 0)
1022
- * console.log(Array.from(none)) // []
965
+ * Array.from(none) // => []
1023
966
  *
1024
967
  * // Useful with infinite iterables
1025
968
  * const naturals = Iterable.range(1)
1026
969
  * const firstFive = Iterable.take(naturals, 5)
1027
- * console.log(Array.from(firstFive)) // [1, 2, 3, 4, 5]
970
+ * Array.from(firstFive) // => [1, 2, 3, 4, 5]
1028
971
  * ```
1029
972
  *
1030
973
  * @category getters
@@ -1053,22 +996,22 @@ export const take: {
1053
996
  *
1054
997
  * **Example** (Taking while a predicate holds)
1055
998
  *
1056
- * ```ts
999
+ * ```ts import.meta.vitest
1057
1000
  * import { Iterable } from "effect"
1058
1001
  *
1059
1002
  * const numbers = [2, 4, 6, 8, 3, 10, 12]
1060
1003
  * const evenPrefix = Iterable.takeWhile(numbers, (x) => x % 2 === 0)
1061
- * console.log(Array.from(evenPrefix)) // [2, 4, 6, 8]
1004
+ * Array.from(evenPrefix) // => [2, 4, 6, 8]
1062
1005
  *
1063
1006
  * // With index
1064
1007
  * const letters = ["a", "b", "c", "d", "e"]
1065
1008
  * const firstThreeByIndex = Iterable.takeWhile(letters, (_, i) => i < 3)
1066
- * console.log(Array.from(firstThreeByIndex)) // ["a", "b", "c"]
1009
+ * Array.from(firstThreeByIndex) // => ["a", "b", "c"]
1067
1010
  *
1068
1011
  * // Stops at first non-matching element
1069
1012
  * const mixed = [1, 3, 5, 4, 7, 9]
1070
1013
  * const oddPrefix = Iterable.takeWhile(mixed, (x) => x % 2 === 1)
1071
- * console.log(Array.from(oddPrefix)) // [1, 3, 5]
1014
+ * Array.from(oddPrefix) // => [1, 3, 5]
1072
1015
  *
1073
1016
  * // Type refinement
1074
1017
  * const values: Array<string | number> = ["a", "b", "c", 1, "d"]
@@ -1076,7 +1019,7 @@ export const take: {
1076
1019
  * values,
1077
1020
  * (x): x is string => typeof x === "string"
1078
1021
  * )
1079
- * console.log(Array.from(stringPrefix)) // ["a", "b", "c"] (typed as string[])
1022
+ * Array.from(stringPrefix) // => ["a", "b", "c"]
1080
1023
  * ```
1081
1024
  *
1082
1025
  * @category getters
@@ -1089,22 +1032,22 @@ export const takeWhile: {
1089
1032
  *
1090
1033
  * **Example** (Taking while a predicate holds)
1091
1034
  *
1092
- * ```ts
1035
+ * ```ts import.meta.vitest
1093
1036
  * import { Iterable } from "effect"
1094
1037
  *
1095
1038
  * const numbers = [2, 4, 6, 8, 3, 10, 12]
1096
1039
  * const evenPrefix = Iterable.takeWhile(numbers, (x) => x % 2 === 0)
1097
- * console.log(Array.from(evenPrefix)) // [2, 4, 6, 8]
1040
+ * Array.from(evenPrefix) // => [2, 4, 6, 8]
1098
1041
  *
1099
1042
  * // With index
1100
1043
  * const letters = ["a", "b", "c", "d", "e"]
1101
1044
  * const firstThreeByIndex = Iterable.takeWhile(letters, (_, i) => i < 3)
1102
- * console.log(Array.from(firstThreeByIndex)) // ["a", "b", "c"]
1045
+ * Array.from(firstThreeByIndex) // => ["a", "b", "c"]
1103
1046
  *
1104
1047
  * // Stops at first non-matching element
1105
1048
  * const mixed = [1, 3, 5, 4, 7, 9]
1106
1049
  * const oddPrefix = Iterable.takeWhile(mixed, (x) => x % 2 === 1)
1107
- * console.log(Array.from(oddPrefix)) // [1, 3, 5]
1050
+ * Array.from(oddPrefix) // => [1, 3, 5]
1108
1051
  *
1109
1052
  * // Type refinement
1110
1053
  * const values: Array<string | number> = ["a", "b", "c", 1, "d"]
@@ -1112,7 +1055,7 @@ export const takeWhile: {
1112
1055
  * values,
1113
1056
  * (x): x is string => typeof x === "string"
1114
1057
  * )
1115
- * console.log(Array.from(stringPrefix)) // ["a", "b", "c"] (typed as string[])
1058
+ * Array.from(stringPrefix) // => ["a", "b", "c"]
1116
1059
  * ```
1117
1060
  *
1118
1061
  * @category getters
@@ -1125,22 +1068,22 @@ export const takeWhile: {
1125
1068
  *
1126
1069
  * **Example** (Taking while a predicate holds)
1127
1070
  *
1128
- * ```ts
1071
+ * ```ts import.meta.vitest
1129
1072
  * import { Iterable } from "effect"
1130
1073
  *
1131
1074
  * const numbers = [2, 4, 6, 8, 3, 10, 12]
1132
1075
  * const evenPrefix = Iterable.takeWhile(numbers, (x) => x % 2 === 0)
1133
- * console.log(Array.from(evenPrefix)) // [2, 4, 6, 8]
1076
+ * Array.from(evenPrefix) // => [2, 4, 6, 8]
1134
1077
  *
1135
1078
  * // With index
1136
1079
  * const letters = ["a", "b", "c", "d", "e"]
1137
1080
  * const firstThreeByIndex = Iterable.takeWhile(letters, (_, i) => i < 3)
1138
- * console.log(Array.from(firstThreeByIndex)) // ["a", "b", "c"]
1081
+ * Array.from(firstThreeByIndex) // => ["a", "b", "c"]
1139
1082
  *
1140
1083
  * // Stops at first non-matching element
1141
1084
  * const mixed = [1, 3, 5, 4, 7, 9]
1142
1085
  * const oddPrefix = Iterable.takeWhile(mixed, (x) => x % 2 === 1)
1143
- * console.log(Array.from(oddPrefix)) // [1, 3, 5]
1086
+ * Array.from(oddPrefix) // => [1, 3, 5]
1144
1087
  *
1145
1088
  * // Type refinement
1146
1089
  * const values: Array<string | number> = ["a", "b", "c", 1, "d"]
@@ -1148,7 +1091,7 @@ export const takeWhile: {
1148
1091
  * values,
1149
1092
  * (x): x is string => typeof x === "string"
1150
1093
  * )
1151
- * console.log(Array.from(stringPrefix)) // ["a", "b", "c"] (typed as string[])
1094
+ * Array.from(stringPrefix) // => ["a", "b", "c"]
1152
1095
  * ```
1153
1096
  *
1154
1097
  * @category getters
@@ -1161,22 +1104,22 @@ export const takeWhile: {
1161
1104
  *
1162
1105
  * **Example** (Taking while a predicate holds)
1163
1106
  *
1164
- * ```ts
1107
+ * ```ts import.meta.vitest
1165
1108
  * import { Iterable } from "effect"
1166
1109
  *
1167
1110
  * const numbers = [2, 4, 6, 8, 3, 10, 12]
1168
1111
  * const evenPrefix = Iterable.takeWhile(numbers, (x) => x % 2 === 0)
1169
- * console.log(Array.from(evenPrefix)) // [2, 4, 6, 8]
1112
+ * Array.from(evenPrefix) // => [2, 4, 6, 8]
1170
1113
  *
1171
1114
  * // With index
1172
1115
  * const letters = ["a", "b", "c", "d", "e"]
1173
1116
  * const firstThreeByIndex = Iterable.takeWhile(letters, (_, i) => i < 3)
1174
- * console.log(Array.from(firstThreeByIndex)) // ["a", "b", "c"]
1117
+ * Array.from(firstThreeByIndex) // => ["a", "b", "c"]
1175
1118
  *
1176
1119
  * // Stops at first non-matching element
1177
1120
  * const mixed = [1, 3, 5, 4, 7, 9]
1178
1121
  * const oddPrefix = Iterable.takeWhile(mixed, (x) => x % 2 === 1)
1179
- * console.log(Array.from(oddPrefix)) // [1, 3, 5]
1122
+ * Array.from(oddPrefix) // => [1, 3, 5]
1180
1123
  *
1181
1124
  * // Type refinement
1182
1125
  * const values: Array<string | number> = ["a", "b", "c", 1, "d"]
@@ -1184,7 +1127,7 @@ export const takeWhile: {
1184
1127
  * values,
1185
1128
  * (x): x is string => typeof x === "string"
1186
1129
  * )
1187
- * console.log(Array.from(stringPrefix)) // ["a", "b", "c"] (typed as string[])
1130
+ * Array.from(stringPrefix) // => ["a", "b", "c"]
1188
1131
  * ```
1189
1132
  *
1190
1133
  * @category getters
@@ -1197,22 +1140,22 @@ export const takeWhile: {
1197
1140
  *
1198
1141
  * **Example** (Taking while a predicate holds)
1199
1142
  *
1200
- * ```ts
1143
+ * ```ts import.meta.vitest
1201
1144
  * import { Iterable } from "effect"
1202
1145
  *
1203
1146
  * const numbers = [2, 4, 6, 8, 3, 10, 12]
1204
1147
  * const evenPrefix = Iterable.takeWhile(numbers, (x) => x % 2 === 0)
1205
- * console.log(Array.from(evenPrefix)) // [2, 4, 6, 8]
1148
+ * Array.from(evenPrefix) // => [2, 4, 6, 8]
1206
1149
  *
1207
1150
  * // With index
1208
1151
  * const letters = ["a", "b", "c", "d", "e"]
1209
1152
  * const firstThreeByIndex = Iterable.takeWhile(letters, (_, i) => i < 3)
1210
- * console.log(Array.from(firstThreeByIndex)) // ["a", "b", "c"]
1153
+ * Array.from(firstThreeByIndex) // => ["a", "b", "c"]
1211
1154
  *
1212
1155
  * // Stops at first non-matching element
1213
1156
  * const mixed = [1, 3, 5, 4, 7, 9]
1214
1157
  * const oddPrefix = Iterable.takeWhile(mixed, (x) => x % 2 === 1)
1215
- * console.log(Array.from(oddPrefix)) // [1, 3, 5]
1158
+ * Array.from(oddPrefix) // => [1, 3, 5]
1216
1159
  *
1217
1160
  * // Type refinement
1218
1161
  * const values: Array<string | number> = ["a", "b", "c", 1, "d"]
@@ -1220,7 +1163,7 @@ export const takeWhile: {
1220
1163
  * values,
1221
1164
  * (x): x is string => typeof x === "string"
1222
1165
  * )
1223
- * console.log(Array.from(stringPrefix)) // ["a", "b", "c"] (typed as string[])
1166
+ * Array.from(stringPrefix) // => ["a", "b", "c"]
1224
1167
  * ```
1225
1168
  *
1226
1169
  * @category getters
@@ -1252,24 +1195,24 @@ export const takeWhile: {
1252
1195
  *
1253
1196
  * **Example** (Dropping from the start)
1254
1197
  *
1255
- * ```ts
1198
+ * ```ts import.meta.vitest
1256
1199
  * import { Iterable } from "effect"
1257
1200
  *
1258
1201
  * const numbers = [1, 2, 3, 4, 5]
1259
1202
  * const withoutFirstTwo = Iterable.drop(numbers, 2)
1260
- * console.log(Array.from(withoutFirstTwo)) // [3, 4, 5]
1203
+ * Array.from(withoutFirstTwo) // => [3, 4, 5]
1261
1204
  *
1262
1205
  * // Dropping more than available returns empty
1263
1206
  * const withoutFirstTen = Iterable.drop(numbers, 10)
1264
- * console.log(Array.from(withoutFirstTen)) // []
1207
+ * Array.from(withoutFirstTen) // => []
1265
1208
  *
1266
1209
  * // Dropping 0 or negative returns all elements
1267
1210
  * const all = Iterable.drop(numbers, 0)
1268
- * console.log(Array.from(all)) // [1, 2, 3, 4, 5]
1211
+ * Array.from(all) // => [1, 2, 3, 4, 5]
1269
1212
  *
1270
1213
  * // Combine with take for slicing
1271
1214
  * const slice = Iterable.take(Iterable.drop(numbers, 1), 3)
1272
- * console.log(Array.from(slice)) // [2, 3, 4]
1215
+ * Array.from(slice) // => [2, 3, 4]
1273
1216
  * ```
1274
1217
  *
1275
1218
  * @category getters
@@ -1285,24 +1228,24 @@ export const drop: {
1285
1228
  *
1286
1229
  * **Example** (Dropping from the start)
1287
1230
  *
1288
- * ```ts
1231
+ * ```ts import.meta.vitest
1289
1232
  * import { Iterable } from "effect"
1290
1233
  *
1291
1234
  * const numbers = [1, 2, 3, 4, 5]
1292
1235
  * const withoutFirstTwo = Iterable.drop(numbers, 2)
1293
- * console.log(Array.from(withoutFirstTwo)) // [3, 4, 5]
1236
+ * Array.from(withoutFirstTwo) // => [3, 4, 5]
1294
1237
  *
1295
1238
  * // Dropping more than available returns empty
1296
1239
  * const withoutFirstTen = Iterable.drop(numbers, 10)
1297
- * console.log(Array.from(withoutFirstTen)) // []
1240
+ * Array.from(withoutFirstTen) // => []
1298
1241
  *
1299
1242
  * // Dropping 0 or negative returns all elements
1300
1243
  * const all = Iterable.drop(numbers, 0)
1301
- * console.log(Array.from(all)) // [1, 2, 3, 4, 5]
1244
+ * Array.from(all) // => [1, 2, 3, 4, 5]
1302
1245
  *
1303
1246
  * // Combine with take for slicing
1304
1247
  * const slice = Iterable.take(Iterable.drop(numbers, 1), 3)
1305
- * console.log(Array.from(slice)) // [2, 3, 4]
1248
+ * Array.from(slice) // => [2, 3, 4]
1306
1249
  * ```
1307
1250
  *
1308
1251
  * @category getters
@@ -1318,24 +1261,24 @@ export const drop: {
1318
1261
  *
1319
1262
  * **Example** (Dropping from the start)
1320
1263
  *
1321
- * ```ts
1264
+ * ```ts import.meta.vitest
1322
1265
  * import { Iterable } from "effect"
1323
1266
  *
1324
1267
  * const numbers = [1, 2, 3, 4, 5]
1325
1268
  * const withoutFirstTwo = Iterable.drop(numbers, 2)
1326
- * console.log(Array.from(withoutFirstTwo)) // [3, 4, 5]
1269
+ * Array.from(withoutFirstTwo) // => [3, 4, 5]
1327
1270
  *
1328
1271
  * // Dropping more than available returns empty
1329
1272
  * const withoutFirstTen = Iterable.drop(numbers, 10)
1330
- * console.log(Array.from(withoutFirstTen)) // []
1273
+ * Array.from(withoutFirstTen) // => []
1331
1274
  *
1332
1275
  * // Dropping 0 or negative returns all elements
1333
1276
  * const all = Iterable.drop(numbers, 0)
1334
- * console.log(Array.from(all)) // [1, 2, 3, 4, 5]
1277
+ * Array.from(all) // => [1, 2, 3, 4, 5]
1335
1278
  *
1336
1279
  * // Combine with take for slicing
1337
1280
  * const slice = Iterable.take(Iterable.drop(numbers, 1), 3)
1338
- * console.log(Array.from(slice)) // [2, 3, 4]
1281
+ * Array.from(slice) // => [2, 3, 4]
1339
1282
  * ```
1340
1283
  *
1341
1284
  * @category getters
@@ -1367,20 +1310,20 @@ export const drop: {
1367
1310
  *
1368
1311
  * **Example** (Finding the first match)
1369
1312
  *
1370
- * ```ts
1313
+ * ```ts import.meta.vitest
1371
1314
  * import { Iterable, Option } from "effect"
1372
1315
  *
1373
1316
  * const numbers = [1, 3, 4, 6, 8]
1374
1317
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1375
- * console.log(firstEven) // Option.some(4)
1318
+ * firstEven // => Option.some(4)
1376
1319
  *
1377
1320
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1378
- * console.log(firstGreaterThan10) // Option.none()
1321
+ * firstGreaterThan10 // => Option.none()
1379
1322
  *
1380
1323
  * // With index
1381
1324
  * const letters = ["a", "b", "c", "d"]
1382
1325
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1383
- * console.log(atEvenIndex) // Option.some("a")
1326
+ * atEvenIndex // => Option.some("a")
1384
1327
  *
1385
1328
  * // Type refinement
1386
1329
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1388,17 +1331,17 @@ export const drop: {
1388
1331
  * mixed,
1389
1332
  * (x): x is string => typeof x === "string"
1390
1333
  * )
1391
- * console.log(firstString) // Option.some("hello")
1334
+ * firstString // => Option.some("hello")
1392
1335
  *
1393
1336
  * // Transform during search
1394
1337
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1395
1338
  * const sqrt = Math.sqrt(x)
1396
1339
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1397
1340
  * })
1398
- * console.log(findSquareRoot) // Option.some(1)
1341
+ * findSquareRoot // => Option.some(1)
1399
1342
  * ```
1400
1343
  *
1401
- * @category elements
1344
+ * @category searching
1402
1345
  * @since 2.0.0
1403
1346
  */
1404
1347
  export const findFirst: {
@@ -1408,20 +1351,20 @@ export const findFirst: {
1408
1351
  *
1409
1352
  * **Example** (Finding the first match)
1410
1353
  *
1411
- * ```ts
1354
+ * ```ts import.meta.vitest
1412
1355
  * import { Iterable, Option } from "effect"
1413
1356
  *
1414
1357
  * const numbers = [1, 3, 4, 6, 8]
1415
1358
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1416
- * console.log(firstEven) // Option.some(4)
1359
+ * firstEven // => Option.some(4)
1417
1360
  *
1418
1361
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1419
- * console.log(firstGreaterThan10) // Option.none()
1362
+ * firstGreaterThan10 // => Option.none()
1420
1363
  *
1421
1364
  * // With index
1422
1365
  * const letters = ["a", "b", "c", "d"]
1423
1366
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1424
- * console.log(atEvenIndex) // Option.some("a")
1367
+ * atEvenIndex // => Option.some("a")
1425
1368
  *
1426
1369
  * // Type refinement
1427
1370
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1429,17 +1372,17 @@ export const findFirst: {
1429
1372
  * mixed,
1430
1373
  * (x): x is string => typeof x === "string"
1431
1374
  * )
1432
- * console.log(firstString) // Option.some("hello")
1375
+ * firstString // => Option.some("hello")
1433
1376
  *
1434
1377
  * // Transform during search
1435
1378
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1436
1379
  * const sqrt = Math.sqrt(x)
1437
1380
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1438
1381
  * })
1439
- * console.log(findSquareRoot) // Option.some(1)
1382
+ * findSquareRoot // => Option.some(1)
1440
1383
  * ```
1441
1384
  *
1442
- * @category elements
1385
+ * @category searching
1443
1386
  * @since 2.0.0
1444
1387
  */
1445
1388
  <A, B>(f: (a: NoInfer<A>, i: number) => Option<B>): (self: Iterable<A>) => Option<B>
@@ -1449,20 +1392,20 @@ export const findFirst: {
1449
1392
  *
1450
1393
  * **Example** (Finding the first match)
1451
1394
  *
1452
- * ```ts
1395
+ * ```ts import.meta.vitest
1453
1396
  * import { Iterable, Option } from "effect"
1454
1397
  *
1455
1398
  * const numbers = [1, 3, 4, 6, 8]
1456
1399
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1457
- * console.log(firstEven) // Option.some(4)
1400
+ * firstEven // => Option.some(4)
1458
1401
  *
1459
1402
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1460
- * console.log(firstGreaterThan10) // Option.none()
1403
+ * firstGreaterThan10 // => Option.none()
1461
1404
  *
1462
1405
  * // With index
1463
1406
  * const letters = ["a", "b", "c", "d"]
1464
1407
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1465
- * console.log(atEvenIndex) // Option.some("a")
1408
+ * atEvenIndex // => Option.some("a")
1466
1409
  *
1467
1410
  * // Type refinement
1468
1411
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1470,17 +1413,17 @@ export const findFirst: {
1470
1413
  * mixed,
1471
1414
  * (x): x is string => typeof x === "string"
1472
1415
  * )
1473
- * console.log(firstString) // Option.some("hello")
1416
+ * firstString // => Option.some("hello")
1474
1417
  *
1475
1418
  * // Transform during search
1476
1419
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1477
1420
  * const sqrt = Math.sqrt(x)
1478
1421
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1479
1422
  * })
1480
- * console.log(findSquareRoot) // Option.some(1)
1423
+ * findSquareRoot // => Option.some(1)
1481
1424
  * ```
1482
1425
  *
1483
- * @category elements
1426
+ * @category searching
1484
1427
  * @since 2.0.0
1485
1428
  */
1486
1429
  <A, B extends A>(refinement: (a: NoInfer<A>, i: number) => a is B): (self: Iterable<A>) => Option<B>
@@ -1490,20 +1433,20 @@ export const findFirst: {
1490
1433
  *
1491
1434
  * **Example** (Finding the first match)
1492
1435
  *
1493
- * ```ts
1436
+ * ```ts import.meta.vitest
1494
1437
  * import { Iterable, Option } from "effect"
1495
1438
  *
1496
1439
  * const numbers = [1, 3, 4, 6, 8]
1497
1440
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1498
- * console.log(firstEven) // Option.some(4)
1441
+ * firstEven // => Option.some(4)
1499
1442
  *
1500
1443
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1501
- * console.log(firstGreaterThan10) // Option.none()
1444
+ * firstGreaterThan10 // => Option.none()
1502
1445
  *
1503
1446
  * // With index
1504
1447
  * const letters = ["a", "b", "c", "d"]
1505
1448
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1506
- * console.log(atEvenIndex) // Option.some("a")
1449
+ * atEvenIndex // => Option.some("a")
1507
1450
  *
1508
1451
  * // Type refinement
1509
1452
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1511,17 +1454,17 @@ export const findFirst: {
1511
1454
  * mixed,
1512
1455
  * (x): x is string => typeof x === "string"
1513
1456
  * )
1514
- * console.log(firstString) // Option.some("hello")
1457
+ * firstString // => Option.some("hello")
1515
1458
  *
1516
1459
  * // Transform during search
1517
1460
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1518
1461
  * const sqrt = Math.sqrt(x)
1519
1462
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1520
1463
  * })
1521
- * console.log(findSquareRoot) // Option.some(1)
1464
+ * findSquareRoot // => Option.some(1)
1522
1465
  * ```
1523
1466
  *
1524
- * @category elements
1467
+ * @category searching
1525
1468
  * @since 2.0.0
1526
1469
  */
1527
1470
  <A>(predicate: (a: NoInfer<A>, i: number) => boolean): (self: Iterable<A>) => Option<A>
@@ -1531,20 +1474,20 @@ export const findFirst: {
1531
1474
  *
1532
1475
  * **Example** (Finding the first match)
1533
1476
  *
1534
- * ```ts
1477
+ * ```ts import.meta.vitest
1535
1478
  * import { Iterable, Option } from "effect"
1536
1479
  *
1537
1480
  * const numbers = [1, 3, 4, 6, 8]
1538
1481
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1539
- * console.log(firstEven) // Option.some(4)
1482
+ * firstEven // => Option.some(4)
1540
1483
  *
1541
1484
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1542
- * console.log(firstGreaterThan10) // Option.none()
1485
+ * firstGreaterThan10 // => Option.none()
1543
1486
  *
1544
1487
  * // With index
1545
1488
  * const letters = ["a", "b", "c", "d"]
1546
1489
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1547
- * console.log(atEvenIndex) // Option.some("a")
1490
+ * atEvenIndex // => Option.some("a")
1548
1491
  *
1549
1492
  * // Type refinement
1550
1493
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1552,17 +1495,17 @@ export const findFirst: {
1552
1495
  * mixed,
1553
1496
  * (x): x is string => typeof x === "string"
1554
1497
  * )
1555
- * console.log(firstString) // Option.some("hello")
1498
+ * firstString // => Option.some("hello")
1556
1499
  *
1557
1500
  * // Transform during search
1558
1501
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1559
1502
  * const sqrt = Math.sqrt(x)
1560
1503
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1561
1504
  * })
1562
- * console.log(findSquareRoot) // Option.some(1)
1505
+ * findSquareRoot // => Option.some(1)
1563
1506
  * ```
1564
1507
  *
1565
- * @category elements
1508
+ * @category searching
1566
1509
  * @since 2.0.0
1567
1510
  */
1568
1511
  <A, B>(self: Iterable<A>, f: (a: A, i: number) => Option<B>): Option<B>
@@ -1572,20 +1515,20 @@ export const findFirst: {
1572
1515
  *
1573
1516
  * **Example** (Finding the first match)
1574
1517
  *
1575
- * ```ts
1518
+ * ```ts import.meta.vitest
1576
1519
  * import { Iterable, Option } from "effect"
1577
1520
  *
1578
1521
  * const numbers = [1, 3, 4, 6, 8]
1579
1522
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1580
- * console.log(firstEven) // Option.some(4)
1523
+ * firstEven // => Option.some(4)
1581
1524
  *
1582
1525
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1583
- * console.log(firstGreaterThan10) // Option.none()
1526
+ * firstGreaterThan10 // => Option.none()
1584
1527
  *
1585
1528
  * // With index
1586
1529
  * const letters = ["a", "b", "c", "d"]
1587
1530
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1588
- * console.log(atEvenIndex) // Option.some("a")
1531
+ * atEvenIndex // => Option.some("a")
1589
1532
  *
1590
1533
  * // Type refinement
1591
1534
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1593,17 +1536,17 @@ export const findFirst: {
1593
1536
  * mixed,
1594
1537
  * (x): x is string => typeof x === "string"
1595
1538
  * )
1596
- * console.log(firstString) // Option.some("hello")
1539
+ * firstString // => Option.some("hello")
1597
1540
  *
1598
1541
  * // Transform during search
1599
1542
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1600
1543
  * const sqrt = Math.sqrt(x)
1601
1544
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1602
1545
  * })
1603
- * console.log(findSquareRoot) // Option.some(1)
1546
+ * findSquareRoot // => Option.some(1)
1604
1547
  * ```
1605
1548
  *
1606
- * @category elements
1549
+ * @category searching
1607
1550
  * @since 2.0.0
1608
1551
  */
1609
1552
  <A, B extends A>(self: Iterable<A>, refinement: (a: A, i: number) => a is B): Option<B>
@@ -1613,20 +1556,20 @@ export const findFirst: {
1613
1556
  *
1614
1557
  * **Example** (Finding the first match)
1615
1558
  *
1616
- * ```ts
1559
+ * ```ts import.meta.vitest
1617
1560
  * import { Iterable, Option } from "effect"
1618
1561
  *
1619
1562
  * const numbers = [1, 3, 4, 6, 8]
1620
1563
  * const firstEven = Iterable.findFirst(numbers, (x) => x % 2 === 0)
1621
- * console.log(firstEven) // Option.some(4)
1564
+ * firstEven // => Option.some(4)
1622
1565
  *
1623
1566
  * const firstGreaterThan10 = Iterable.findFirst(numbers, (x) => x > 10)
1624
- * console.log(firstGreaterThan10) // Option.none()
1567
+ * firstGreaterThan10 // => Option.none()
1625
1568
  *
1626
1569
  * // With index
1627
1570
  * const letters = ["a", "b", "c", "d"]
1628
1571
  * const atEvenIndex = Iterable.findFirst(letters, (_, i) => i % 2 === 0)
1629
- * console.log(atEvenIndex) // Option.some("a")
1572
+ * atEvenIndex // => Option.some("a")
1630
1573
  *
1631
1574
  * // Type refinement
1632
1575
  * const mixed: Array<string | number> = [1, "hello", 2, "world"]
@@ -1634,17 +1577,17 @@ export const findFirst: {
1634
1577
  * mixed,
1635
1578
  * (x): x is string => typeof x === "string"
1636
1579
  * )
1637
- * console.log(firstString) // Option.some("hello")
1580
+ * firstString // => Option.some("hello")
1638
1581
  *
1639
1582
  * // Transform during search
1640
1583
  * const findSquareRoot = Iterable.findFirst([1, 4, 9, 16], (x) => {
1641
1584
  * const sqrt = Math.sqrt(x)
1642
1585
  * return Number.isInteger(sqrt) ? Option.some(sqrt) : Option.none()
1643
1586
  * })
1644
- * console.log(findSquareRoot) // Option.some(1)
1587
+ * findSquareRoot // => Option.some(1)
1645
1588
  * ```
1646
1589
  *
1647
- * @category elements
1590
+ * @category searching
1648
1591
  * @since 2.0.0
1649
1592
  */
1650
1593
  <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): Option<A>
@@ -1674,20 +1617,20 @@ export const findFirst: {
1674
1617
  *
1675
1618
  * **Example** (Finding the last match)
1676
1619
  *
1677
- * ```ts
1678
- * import { Iterable } from "effect"
1620
+ * ```ts import.meta.vitest
1621
+ * import { Iterable, Option } from "effect"
1679
1622
  *
1680
1623
  * const numbers = [1, 3, 4, 6, 8, 2]
1681
1624
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1682
- * console.log(lastEven) // Option.some(2)
1625
+ * lastEven // => Option.some(2)
1683
1626
  *
1684
1627
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1685
- * console.log(lastGreaterThan10) // Option.none()
1628
+ * lastGreaterThan10 // => Option.none()
1686
1629
  *
1687
1630
  * // With index
1688
1631
  * const letters = ["a", "b", "c", "d", "e"]
1689
1632
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1690
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1633
+ * lastAtEvenIndex // => Option.some("e")
1691
1634
  *
1692
1635
  * // Type refinement
1693
1636
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1695,10 +1638,10 @@ export const findFirst: {
1695
1638
  * mixed,
1696
1639
  * (x): x is string => typeof x === "string"
1697
1640
  * )
1698
- * console.log(lastString) // Option.some("world")
1641
+ * lastString // => Option.some("world")
1699
1642
  * ```
1700
1643
  *
1701
- * @category elements
1644
+ * @category searching
1702
1645
  * @since 2.0.0
1703
1646
  */
1704
1647
  export const findLast: {
@@ -1707,20 +1650,20 @@ export const findLast: {
1707
1650
  *
1708
1651
  * **Example** (Finding the last match)
1709
1652
  *
1710
- * ```ts
1711
- * import { Iterable } from "effect"
1653
+ * ```ts import.meta.vitest
1654
+ * import { Iterable, Option } from "effect"
1712
1655
  *
1713
1656
  * const numbers = [1, 3, 4, 6, 8, 2]
1714
1657
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1715
- * console.log(lastEven) // Option.some(2)
1658
+ * lastEven // => Option.some(2)
1716
1659
  *
1717
1660
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1718
- * console.log(lastGreaterThan10) // Option.none()
1661
+ * lastGreaterThan10 // => Option.none()
1719
1662
  *
1720
1663
  * // With index
1721
1664
  * const letters = ["a", "b", "c", "d", "e"]
1722
1665
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1723
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1666
+ * lastAtEvenIndex // => Option.some("e")
1724
1667
  *
1725
1668
  * // Type refinement
1726
1669
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1728,10 +1671,10 @@ export const findLast: {
1728
1671
  * mixed,
1729
1672
  * (x): x is string => typeof x === "string"
1730
1673
  * )
1731
- * console.log(lastString) // Option.some("world")
1674
+ * lastString // => Option.some("world")
1732
1675
  * ```
1733
1676
  *
1734
- * @category elements
1677
+ * @category searching
1735
1678
  * @since 2.0.0
1736
1679
  */
1737
1680
  <A, B>(f: (a: NoInfer<A>, i: number) => Option<B>): (self: Iterable<A>) => Option<B>
@@ -1740,20 +1683,20 @@ export const findLast: {
1740
1683
  *
1741
1684
  * **Example** (Finding the last match)
1742
1685
  *
1743
- * ```ts
1744
- * import { Iterable } from "effect"
1686
+ * ```ts import.meta.vitest
1687
+ * import { Iterable, Option } from "effect"
1745
1688
  *
1746
1689
  * const numbers = [1, 3, 4, 6, 8, 2]
1747
1690
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1748
- * console.log(lastEven) // Option.some(2)
1691
+ * lastEven // => Option.some(2)
1749
1692
  *
1750
1693
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1751
- * console.log(lastGreaterThan10) // Option.none()
1694
+ * lastGreaterThan10 // => Option.none()
1752
1695
  *
1753
1696
  * // With index
1754
1697
  * const letters = ["a", "b", "c", "d", "e"]
1755
1698
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1756
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1699
+ * lastAtEvenIndex // => Option.some("e")
1757
1700
  *
1758
1701
  * // Type refinement
1759
1702
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1761,10 +1704,10 @@ export const findLast: {
1761
1704
  * mixed,
1762
1705
  * (x): x is string => typeof x === "string"
1763
1706
  * )
1764
- * console.log(lastString) // Option.some("world")
1707
+ * lastString // => Option.some("world")
1765
1708
  * ```
1766
1709
  *
1767
- * @category elements
1710
+ * @category searching
1768
1711
  * @since 2.0.0
1769
1712
  */
1770
1713
  <A, B extends A>(refinement: (a: NoInfer<A>, i: number) => a is B): (self: Iterable<A>) => Option<B>
@@ -1773,20 +1716,20 @@ export const findLast: {
1773
1716
  *
1774
1717
  * **Example** (Finding the last match)
1775
1718
  *
1776
- * ```ts
1777
- * import { Iterable } from "effect"
1719
+ * ```ts import.meta.vitest
1720
+ * import { Iterable, Option } from "effect"
1778
1721
  *
1779
1722
  * const numbers = [1, 3, 4, 6, 8, 2]
1780
1723
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1781
- * console.log(lastEven) // Option.some(2)
1724
+ * lastEven // => Option.some(2)
1782
1725
  *
1783
1726
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1784
- * console.log(lastGreaterThan10) // Option.none()
1727
+ * lastGreaterThan10 // => Option.none()
1785
1728
  *
1786
1729
  * // With index
1787
1730
  * const letters = ["a", "b", "c", "d", "e"]
1788
1731
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1789
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1732
+ * lastAtEvenIndex // => Option.some("e")
1790
1733
  *
1791
1734
  * // Type refinement
1792
1735
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1794,10 +1737,10 @@ export const findLast: {
1794
1737
  * mixed,
1795
1738
  * (x): x is string => typeof x === "string"
1796
1739
  * )
1797
- * console.log(lastString) // Option.some("world")
1740
+ * lastString // => Option.some("world")
1798
1741
  * ```
1799
1742
  *
1800
- * @category elements
1743
+ * @category searching
1801
1744
  * @since 2.0.0
1802
1745
  */
1803
1746
  <A>(predicate: (a: NoInfer<A>, i: number) => boolean): (self: Iterable<A>) => Option<A>
@@ -1806,20 +1749,20 @@ export const findLast: {
1806
1749
  *
1807
1750
  * **Example** (Finding the last match)
1808
1751
  *
1809
- * ```ts
1810
- * import { Iterable } from "effect"
1752
+ * ```ts import.meta.vitest
1753
+ * import { Iterable, Option } from "effect"
1811
1754
  *
1812
1755
  * const numbers = [1, 3, 4, 6, 8, 2]
1813
1756
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1814
- * console.log(lastEven) // Option.some(2)
1757
+ * lastEven // => Option.some(2)
1815
1758
  *
1816
1759
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1817
- * console.log(lastGreaterThan10) // Option.none()
1760
+ * lastGreaterThan10 // => Option.none()
1818
1761
  *
1819
1762
  * // With index
1820
1763
  * const letters = ["a", "b", "c", "d", "e"]
1821
1764
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1822
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1765
+ * lastAtEvenIndex // => Option.some("e")
1823
1766
  *
1824
1767
  * // Type refinement
1825
1768
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1827,10 +1770,10 @@ export const findLast: {
1827
1770
  * mixed,
1828
1771
  * (x): x is string => typeof x === "string"
1829
1772
  * )
1830
- * console.log(lastString) // Option.some("world")
1773
+ * lastString // => Option.some("world")
1831
1774
  * ```
1832
1775
  *
1833
- * @category elements
1776
+ * @category searching
1834
1777
  * @since 2.0.0
1835
1778
  */
1836
1779
  <A, B>(self: Iterable<A>, f: (a: A, i: number) => Option<B>): Option<B>
@@ -1839,20 +1782,20 @@ export const findLast: {
1839
1782
  *
1840
1783
  * **Example** (Finding the last match)
1841
1784
  *
1842
- * ```ts
1843
- * import { Iterable } from "effect"
1785
+ * ```ts import.meta.vitest
1786
+ * import { Iterable, Option } from "effect"
1844
1787
  *
1845
1788
  * const numbers = [1, 3, 4, 6, 8, 2]
1846
1789
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1847
- * console.log(lastEven) // Option.some(2)
1790
+ * lastEven // => Option.some(2)
1848
1791
  *
1849
1792
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1850
- * console.log(lastGreaterThan10) // Option.none()
1793
+ * lastGreaterThan10 // => Option.none()
1851
1794
  *
1852
1795
  * // With index
1853
1796
  * const letters = ["a", "b", "c", "d", "e"]
1854
1797
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1855
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1798
+ * lastAtEvenIndex // => Option.some("e")
1856
1799
  *
1857
1800
  * // Type refinement
1858
1801
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1860,10 +1803,10 @@ export const findLast: {
1860
1803
  * mixed,
1861
1804
  * (x): x is string => typeof x === "string"
1862
1805
  * )
1863
- * console.log(lastString) // Option.some("world")
1806
+ * lastString // => Option.some("world")
1864
1807
  * ```
1865
1808
  *
1866
- * @category elements
1809
+ * @category searching
1867
1810
  * @since 2.0.0
1868
1811
  */
1869
1812
  <A, B extends A>(self: Iterable<A>, refinement: (a: A, i: number) => a is B): Option<B>
@@ -1872,20 +1815,20 @@ export const findLast: {
1872
1815
  *
1873
1816
  * **Example** (Finding the last match)
1874
1817
  *
1875
- * ```ts
1876
- * import { Iterable } from "effect"
1818
+ * ```ts import.meta.vitest
1819
+ * import { Iterable, Option } from "effect"
1877
1820
  *
1878
1821
  * const numbers = [1, 3, 4, 6, 8, 2]
1879
1822
  * const lastEven = Iterable.findLast(numbers, (x) => x % 2 === 0)
1880
- * console.log(lastEven) // Option.some(2)
1823
+ * lastEven // => Option.some(2)
1881
1824
  *
1882
1825
  * const lastGreaterThan10 = Iterable.findLast(numbers, (x) => x > 10)
1883
- * console.log(lastGreaterThan10) // Option.none()
1826
+ * lastGreaterThan10 // => Option.none()
1884
1827
  *
1885
1828
  * // With index
1886
1829
  * const letters = ["a", "b", "c", "d", "e"]
1887
1830
  * const lastAtEvenIndex = Iterable.findLast(letters, (_, i) => i % 2 === 0)
1888
- * console.log(lastAtEvenIndex) // Option.some("e") (index 4)
1831
+ * lastAtEvenIndex // => Option.some("e")
1889
1832
  *
1890
1833
  * // Type refinement
1891
1834
  * const mixed: Array<string | number> = [1, "hello", 2, "world", 3]
@@ -1893,10 +1836,10 @@ export const findLast: {
1893
1836
  * mixed,
1894
1837
  * (x): x is string => typeof x === "string"
1895
1838
  * )
1896
- * console.log(lastString) // Option.some("world")
1839
+ * lastString // => Option.some("world")
1897
1840
  * ```
1898
1841
  *
1899
- * @category elements
1842
+ * @category searching
1900
1843
  * @since 2.0.0
1901
1844
  */
1902
1845
  <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): Option<A>
@@ -1927,31 +1870,31 @@ export const findLast: {
1927
1870
  *
1928
1871
  * **Example** (Zipping iterables)
1929
1872
  *
1930
- * ```ts
1873
+ * ```ts import.meta.vitest
1931
1874
  * import { Iterable } from "effect"
1932
1875
  *
1933
1876
  * const numbers = [1, 2, 3]
1934
1877
  * const letters = ["a", "b", "c"]
1935
1878
  * const zipped = Iterable.zip(numbers, letters)
1936
- * console.log(Array.from(zipped)) // [[1, "a"], [2, "b"], [3, "c"]]
1879
+ * Array.from(zipped) // => [[1, "a"], [2, "b"], [3, "c"]]
1937
1880
  *
1938
1881
  * // Different lengths - shorter one determines result length
1939
1882
  * const short = [1, 2]
1940
1883
  * const long = ["a", "b", "c", "d"]
1941
1884
  * const partial = Iterable.zip(short, long)
1942
- * console.log(Array.from(partial)) // [[1, "a"], [2, "b"]]
1885
+ * Array.from(partial) // => [[1, "a"], [2, "b"]]
1943
1886
  *
1944
1887
  * // Works with any iterables
1945
1888
  * const range = Iterable.range(1, 3)
1946
1889
  * const word = "abc"
1947
1890
  * const mixed = Iterable.zip(range, word)
1948
- * console.log(Array.from(mixed)) // [[1, "a"], [2, "b"], [3, "c"]]
1891
+ * Array.from(mixed) // => [[1, "a"], [2, "b"], [3, "c"]]
1949
1892
  *
1950
1893
  * // Create indexed pairs
1951
1894
  * const values = ["apple", "banana", "cherry"]
1952
1895
  * const indices = Iterable.range(0, 2)
1953
1896
  * const indexed = Iterable.zip(indices, values)
1954
- * console.log(Array.from(indexed)) // [[0, "apple"], [1, "banana"], [2, "cherry"]]
1897
+ * Array.from(indexed) // => [[0, "apple"], [1, "banana"], [2, "cherry"]]
1955
1898
  * ```
1956
1899
  *
1957
1900
  * @category zipping
@@ -1963,31 +1906,31 @@ export const zip: {
1963
1906
  *
1964
1907
  * **Example** (Zipping iterables)
1965
1908
  *
1966
- * ```ts
1909
+ * ```ts import.meta.vitest
1967
1910
  * import { Iterable } from "effect"
1968
1911
  *
1969
1912
  * const numbers = [1, 2, 3]
1970
1913
  * const letters = ["a", "b", "c"]
1971
1914
  * const zipped = Iterable.zip(numbers, letters)
1972
- * console.log(Array.from(zipped)) // [[1, "a"], [2, "b"], [3, "c"]]
1915
+ * Array.from(zipped) // => [[1, "a"], [2, "b"], [3, "c"]]
1973
1916
  *
1974
1917
  * // Different lengths - shorter one determines result length
1975
1918
  * const short = [1, 2]
1976
1919
  * const long = ["a", "b", "c", "d"]
1977
1920
  * const partial = Iterable.zip(short, long)
1978
- * console.log(Array.from(partial)) // [[1, "a"], [2, "b"]]
1921
+ * Array.from(partial) // => [[1, "a"], [2, "b"]]
1979
1922
  *
1980
1923
  * // Works with any iterables
1981
1924
  * const range = Iterable.range(1, 3)
1982
1925
  * const word = "abc"
1983
1926
  * const mixed = Iterable.zip(range, word)
1984
- * console.log(Array.from(mixed)) // [[1, "a"], [2, "b"], [3, "c"]]
1927
+ * Array.from(mixed) // => [[1, "a"], [2, "b"], [3, "c"]]
1985
1928
  *
1986
1929
  * // Create indexed pairs
1987
1930
  * const values = ["apple", "banana", "cherry"]
1988
1931
  * const indices = Iterable.range(0, 2)
1989
1932
  * const indexed = Iterable.zip(indices, values)
1990
- * console.log(Array.from(indexed)) // [[0, "apple"], [1, "banana"], [2, "cherry"]]
1933
+ * Array.from(indexed) // => [[0, "apple"], [1, "banana"], [2, "cherry"]]
1991
1934
  * ```
1992
1935
  *
1993
1936
  * @category zipping
@@ -1999,31 +1942,31 @@ export const zip: {
1999
1942
  *
2000
1943
  * **Example** (Zipping iterables)
2001
1944
  *
2002
- * ```ts
1945
+ * ```ts import.meta.vitest
2003
1946
  * import { Iterable } from "effect"
2004
1947
  *
2005
1948
  * const numbers = [1, 2, 3]
2006
1949
  * const letters = ["a", "b", "c"]
2007
1950
  * const zipped = Iterable.zip(numbers, letters)
2008
- * console.log(Array.from(zipped)) // [[1, "a"], [2, "b"], [3, "c"]]
1951
+ * Array.from(zipped) // => [[1, "a"], [2, "b"], [3, "c"]]
2009
1952
  *
2010
1953
  * // Different lengths - shorter one determines result length
2011
1954
  * const short = [1, 2]
2012
1955
  * const long = ["a", "b", "c", "d"]
2013
1956
  * const partial = Iterable.zip(short, long)
2014
- * console.log(Array.from(partial)) // [[1, "a"], [2, "b"]]
1957
+ * Array.from(partial) // => [[1, "a"], [2, "b"]]
2015
1958
  *
2016
1959
  * // Works with any iterables
2017
1960
  * const range = Iterable.range(1, 3)
2018
1961
  * const word = "abc"
2019
1962
  * const mixed = Iterable.zip(range, word)
2020
- * console.log(Array.from(mixed)) // [[1, "a"], [2, "b"], [3, "c"]]
1963
+ * Array.from(mixed) // => [[1, "a"], [2, "b"], [3, "c"]]
2021
1964
  *
2022
1965
  * // Create indexed pairs
2023
1966
  * const values = ["apple", "banana", "cherry"]
2024
1967
  * const indices = Iterable.range(0, 2)
2025
1968
  * const indexed = Iterable.zip(indices, values)
2026
- * console.log(Array.from(indexed)) // [[0, "apple"], [1, "banana"], [2, "cherry"]]
1969
+ * Array.from(indexed) // => [[0, "apple"], [1, "banana"], [2, "cherry"]]
2027
1970
  * ```
2028
1971
  *
2029
1972
  * @category zipping
@@ -2041,14 +1984,14 @@ export const zip: {
2041
1984
  *
2042
1985
  * **Example** (Zipping with a combining function)
2043
1986
  *
2044
- * ```ts
1987
+ * ```ts import.meta.vitest
2045
1988
  * import { Iterable } from "effect"
2046
1989
  *
2047
1990
  * // Add corresponding elements
2048
1991
  * const a = [1, 2, 3, 4]
2049
1992
  * const b = [10, 20, 30, 40]
2050
1993
  * const sums = Iterable.zipWith(a, b, (x, y) => x + y)
2051
- * console.log(Array.from(sums)) // [11, 22, 33, 44]
1994
+ * Array.from(sums) // => [11, 22, 33, 44]
2052
1995
  *
2053
1996
  * // Combine strings
2054
1997
  * const firstNames = ["John", "Jane", "Bob"]
@@ -2058,7 +2001,7 @@ export const zip: {
2058
2001
  * lastNames,
2059
2002
  * (first, last) => `${first} ${last}`
2060
2003
  * )
2061
- * console.log(Array.from(fullNames)) // ["John Doe", "Jane Smith", "Bob Johnson"]
2004
+ * Array.from(fullNames) // => ["John Doe", "Jane Smith", "Bob Johnson"]
2062
2005
  *
2063
2006
  * // Different lengths - stops at shorter
2064
2007
  * const short = [1, 2]
@@ -2068,7 +2011,7 @@ export const zip: {
2068
2011
  * long,
2069
2012
  * (num, letter) => `${num}${letter}`
2070
2013
  * )
2071
- * console.log(Array.from(combined)) // ["1a", "2b"]
2014
+ * Array.from(combined) // => ["1a", "2b"]
2072
2015
  *
2073
2016
  * // Complex transformations
2074
2017
  * const prices = [10.99, 25.50, 5.00]
@@ -2076,7 +2019,7 @@ export const zip: {
2076
2019
  * const totals = Iterable.zipWith(prices, quantities, (price, qty) => {
2077
2020
  * return Math.round(price * qty * 100) / 100 // round to 2 decimal places
2078
2021
  * })
2079
- * console.log(Array.from(totals)) // [21.98, 25.5, 15]
2022
+ * Array.from(totals) // => [21.98, 25.5, 15]
2080
2023
  * ```
2081
2024
  *
2082
2025
  * @category zipping
@@ -2089,14 +2032,14 @@ export const zipWith: {
2089
2032
  *
2090
2033
  * **Example** (Zipping with a combining function)
2091
2034
  *
2092
- * ```ts
2035
+ * ```ts import.meta.vitest
2093
2036
  * import { Iterable } from "effect"
2094
2037
  *
2095
2038
  * // Add corresponding elements
2096
2039
  * const a = [1, 2, 3, 4]
2097
2040
  * const b = [10, 20, 30, 40]
2098
2041
  * const sums = Iterable.zipWith(a, b, (x, y) => x + y)
2099
- * console.log(Array.from(sums)) // [11, 22, 33, 44]
2042
+ * Array.from(sums) // => [11, 22, 33, 44]
2100
2043
  *
2101
2044
  * // Combine strings
2102
2045
  * const firstNames = ["John", "Jane", "Bob"]
@@ -2106,7 +2049,7 @@ export const zipWith: {
2106
2049
  * lastNames,
2107
2050
  * (first, last) => `${first} ${last}`
2108
2051
  * )
2109
- * console.log(Array.from(fullNames)) // ["John Doe", "Jane Smith", "Bob Johnson"]
2052
+ * Array.from(fullNames) // => ["John Doe", "Jane Smith", "Bob Johnson"]
2110
2053
  *
2111
2054
  * // Different lengths - stops at shorter
2112
2055
  * const short = [1, 2]
@@ -2116,7 +2059,7 @@ export const zipWith: {
2116
2059
  * long,
2117
2060
  * (num, letter) => `${num}${letter}`
2118
2061
  * )
2119
- * console.log(Array.from(combined)) // ["1a", "2b"]
2062
+ * Array.from(combined) // => ["1a", "2b"]
2120
2063
  *
2121
2064
  * // Complex transformations
2122
2065
  * const prices = [10.99, 25.50, 5.00]
@@ -2124,7 +2067,7 @@ export const zipWith: {
2124
2067
  * const totals = Iterable.zipWith(prices, quantities, (price, qty) => {
2125
2068
  * return Math.round(price * qty * 100) / 100 // round to 2 decimal places
2126
2069
  * })
2127
- * console.log(Array.from(totals)) // [21.98, 25.5, 15]
2070
+ * Array.from(totals) // => [21.98, 25.5, 15]
2128
2071
  * ```
2129
2072
  *
2130
2073
  * @category zipping
@@ -2137,14 +2080,14 @@ export const zipWith: {
2137
2080
  *
2138
2081
  * **Example** (Zipping with a combining function)
2139
2082
  *
2140
- * ```ts
2083
+ * ```ts import.meta.vitest
2141
2084
  * import { Iterable } from "effect"
2142
2085
  *
2143
2086
  * // Add corresponding elements
2144
2087
  * const a = [1, 2, 3, 4]
2145
2088
  * const b = [10, 20, 30, 40]
2146
2089
  * const sums = Iterable.zipWith(a, b, (x, y) => x + y)
2147
- * console.log(Array.from(sums)) // [11, 22, 33, 44]
2090
+ * Array.from(sums) // => [11, 22, 33, 44]
2148
2091
  *
2149
2092
  * // Combine strings
2150
2093
  * const firstNames = ["John", "Jane", "Bob"]
@@ -2154,7 +2097,7 @@ export const zipWith: {
2154
2097
  * lastNames,
2155
2098
  * (first, last) => `${first} ${last}`
2156
2099
  * )
2157
- * console.log(Array.from(fullNames)) // ["John Doe", "Jane Smith", "Bob Johnson"]
2100
+ * Array.from(fullNames) // => ["John Doe", "Jane Smith", "Bob Johnson"]
2158
2101
  *
2159
2102
  * // Different lengths - stops at shorter
2160
2103
  * const short = [1, 2]
@@ -2164,7 +2107,7 @@ export const zipWith: {
2164
2107
  * long,
2165
2108
  * (num, letter) => `${num}${letter}`
2166
2109
  * )
2167
- * console.log(Array.from(combined)) // ["1a", "2b"]
2110
+ * Array.from(combined) // => ["1a", "2b"]
2168
2111
  *
2169
2112
  * // Complex transformations
2170
2113
  * const prices = [10.99, 25.50, 5.00]
@@ -2172,7 +2115,7 @@ export const zipWith: {
2172
2115
  * const totals = Iterable.zipWith(prices, quantities, (price, qty) => {
2173
2116
  * return Math.round(price * qty * 100) / 100 // round to 2 decimal places
2174
2117
  * })
2175
- * console.log(Array.from(totals)) // [21.98, 25.5, 15]
2118
+ * Array.from(totals) // => [21.98, 25.5, 15]
2176
2119
  * ```
2177
2120
  *
2178
2121
  * @category zipping
@@ -2209,33 +2152,33 @@ export const zipWith: {
2209
2152
  *
2210
2153
  * **Example** (Interspersing separators)
2211
2154
  *
2212
- * ```ts
2155
+ * ```ts import.meta.vitest
2213
2156
  * import { Iterable } from "effect"
2214
2157
  *
2215
2158
  * // Join numbers with separator
2216
2159
  * const numbers = [1, 2, 3, 4]
2217
2160
  * const withCommas = Iterable.intersperse(numbers, ",")
2218
- * console.log(Array.from(withCommas)) // [1, ",", 2, ",", 3, ",", 4]
2161
+ * Array.from(withCommas) // => [1, ",", 2, ",", 3, ",", 4]
2219
2162
  *
2220
2163
  * // Join words with spaces
2221
2164
  * const words = ["hello", "world", "from", "effect"]
2222
2165
  * const sentence = Iterable.intersperse(words, " ")
2223
- * console.log(Array.from(sentence).join("")) // "hello world from effect"
2166
+ * Array.from(sentence).join("") // => "hello world from effect"
2224
2167
  *
2225
2168
  * // Empty iterable remains empty
2226
2169
  * const empty = Iterable.empty<string>()
2227
2170
  * const stillEmpty = Iterable.intersperse(empty, "-")
2228
- * console.log(Array.from(stillEmpty)) // []
2171
+ * Array.from(stillEmpty) // => []
2229
2172
  *
2230
2173
  * // Single element has no separators added
2231
2174
  * const single = [42]
2232
2175
  * const noSeparator = Iterable.intersperse(single, "|")
2233
- * console.log(Array.from(noSeparator)) // [42]
2176
+ * Array.from(noSeparator) // => [42]
2234
2177
  *
2235
2178
  * // Build CSS-like strings
2236
2179
  * const styles = ["color: red", "font-size: 14px", "margin: 10px"]
2237
2180
  * const css = Iterable.intersperse(styles, "; ")
2238
- * console.log(Array.from(css).join("")) // "color: red; font-size: 14px; margin: 10px"
2181
+ * Array.from(css).join("") // => "color: red; font-size: 14px; margin: 10px"
2239
2182
  * ```
2240
2183
  *
2241
2184
  * @category combining
@@ -2255,33 +2198,33 @@ export const intersperse: {
2255
2198
  *
2256
2199
  * **Example** (Interspersing separators)
2257
2200
  *
2258
- * ```ts
2201
+ * ```ts import.meta.vitest
2259
2202
  * import { Iterable } from "effect"
2260
2203
  *
2261
2204
  * // Join numbers with separator
2262
2205
  * const numbers = [1, 2, 3, 4]
2263
2206
  * const withCommas = Iterable.intersperse(numbers, ",")
2264
- * console.log(Array.from(withCommas)) // [1, ",", 2, ",", 3, ",", 4]
2207
+ * Array.from(withCommas) // => [1, ",", 2, ",", 3, ",", 4]
2265
2208
  *
2266
2209
  * // Join words with spaces
2267
2210
  * const words = ["hello", "world", "from", "effect"]
2268
2211
  * const sentence = Iterable.intersperse(words, " ")
2269
- * console.log(Array.from(sentence).join("")) // "hello world from effect"
2212
+ * Array.from(sentence).join("") // => "hello world from effect"
2270
2213
  *
2271
2214
  * // Empty iterable remains empty
2272
2215
  * const empty = Iterable.empty<string>()
2273
2216
  * const stillEmpty = Iterable.intersperse(empty, "-")
2274
- * console.log(Array.from(stillEmpty)) // []
2217
+ * Array.from(stillEmpty) // => []
2275
2218
  *
2276
2219
  * // Single element has no separators added
2277
2220
  * const single = [42]
2278
2221
  * const noSeparator = Iterable.intersperse(single, "|")
2279
- * console.log(Array.from(noSeparator)) // [42]
2222
+ * Array.from(noSeparator) // => [42]
2280
2223
  *
2281
2224
  * // Build CSS-like strings
2282
2225
  * const styles = ["color: red", "font-size: 14px", "margin: 10px"]
2283
2226
  * const css = Iterable.intersperse(styles, "; ")
2284
- * console.log(Array.from(css).join("")) // "color: red; font-size: 14px; margin: 10px"
2227
+ * Array.from(css).join("") // => "color: red; font-size: 14px; margin: 10px"
2285
2228
  * ```
2286
2229
  *
2287
2230
  * @category combining
@@ -2301,33 +2244,33 @@ export const intersperse: {
2301
2244
  *
2302
2245
  * **Example** (Interspersing separators)
2303
2246
  *
2304
- * ```ts
2247
+ * ```ts import.meta.vitest
2305
2248
  * import { Iterable } from "effect"
2306
2249
  *
2307
2250
  * // Join numbers with separator
2308
2251
  * const numbers = [1, 2, 3, 4]
2309
2252
  * const withCommas = Iterable.intersperse(numbers, ",")
2310
- * console.log(Array.from(withCommas)) // [1, ",", 2, ",", 3, ",", 4]
2253
+ * Array.from(withCommas) // => [1, ",", 2, ",", 3, ",", 4]
2311
2254
  *
2312
2255
  * // Join words with spaces
2313
2256
  * const words = ["hello", "world", "from", "effect"]
2314
2257
  * const sentence = Iterable.intersperse(words, " ")
2315
- * console.log(Array.from(sentence).join("")) // "hello world from effect"
2258
+ * Array.from(sentence).join("") // => "hello world from effect"
2316
2259
  *
2317
2260
  * // Empty iterable remains empty
2318
2261
  * const empty = Iterable.empty<string>()
2319
2262
  * const stillEmpty = Iterable.intersperse(empty, "-")
2320
- * console.log(Array.from(stillEmpty)) // []
2263
+ * Array.from(stillEmpty) // => []
2321
2264
  *
2322
2265
  * // Single element has no separators added
2323
2266
  * const single = [42]
2324
2267
  * const noSeparator = Iterable.intersperse(single, "|")
2325
- * console.log(Array.from(noSeparator)) // [42]
2268
+ * Array.from(noSeparator) // => [42]
2326
2269
  *
2327
2270
  * // Build CSS-like strings
2328
2271
  * const styles = ["color: red", "font-size: 14px", "margin: 10px"]
2329
2272
  * const css = Iterable.intersperse(styles, "; ")
2330
- * console.log(Array.from(css).join("")) // "color: red; font-size: 14px; margin: 10px"
2273
+ * Array.from(css).join("") // => "color: red; font-size: 14px; margin: 10px"
2331
2274
  * ```
2332
2275
  *
2333
2276
  * @category combining
@@ -2361,7 +2304,7 @@ export const intersperse: {
2361
2304
  *
2362
2305
  * **Example** (Checking membership with custom equivalence)
2363
2306
  *
2364
- * ```ts
2307
+ * ```ts import.meta.vitest
2365
2308
  * import { Iterable } from "effect"
2366
2309
  *
2367
2310
  * // Custom equivalence for objects
@@ -2370,7 +2313,7 @@ export const intersperse: {
2370
2313
  *
2371
2314
  * const users = [{ id: 1 }, { id: 2 }]
2372
2315
  * const hasUser1 = containsById(users, { id: 1 })
2373
- * console.log(hasUser1) // true (same id)
2316
+ * hasUser1 // => true
2374
2317
  *
2375
2318
  * // Case-insensitive string comparison
2376
2319
  * const caseInsensitive = (a: string, b: string) =>
@@ -2379,7 +2322,7 @@ export const intersperse: {
2379
2322
  *
2380
2323
  * const words = ["Hello", "World"]
2381
2324
  * const hasHello = containsCaseInsensitive(words, "hello")
2382
- * console.log(hasHello) // true
2325
+ * hasHello // => true
2383
2326
  *
2384
2327
  * // Approximate number comparison
2385
2328
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
@@ -2387,10 +2330,10 @@ export const intersperse: {
2387
2330
  *
2388
2331
  * const values = [1.0, 2.0, 3.0]
2389
2332
  * const hasAlmostTwo = containsApprox(values, 2.05)
2390
- * console.log(hasAlmostTwo) // true
2333
+ * hasAlmostTwo // => true
2391
2334
  * ```
2392
2335
  *
2393
- * @category elements
2336
+ * @category predicates
2394
2337
  * @since 2.0.0
2395
2338
  */
2396
2339
  export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
@@ -2417,29 +2360,29 @@ export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
2417
2360
  *
2418
2361
  * **Example** (Checking membership)
2419
2362
  *
2420
- * ```ts
2363
+ * ```ts import.meta.vitest
2421
2364
  * import { Iterable } from "effect"
2422
2365
  *
2423
2366
  * const numbers = [1, 2, 3, 4, 5]
2424
- * console.log(Iterable.contains(numbers, 3)) // true
2425
- * console.log(Iterable.contains(numbers, 6)) // false
2367
+ * Iterable.contains(numbers, 3) // => true
2368
+ * Iterable.contains(numbers, 6) // => false
2426
2369
  *
2427
2370
  * const letters = "hello"
2428
- * console.log(Iterable.contains(letters, "l")) // true
2429
- * console.log(Iterable.contains(letters, "x")) // false
2371
+ * Iterable.contains(letters, "l") // => true
2372
+ * Iterable.contains(letters, "x") // => false
2430
2373
  *
2431
2374
  * // Works with any iterable
2432
2375
  * const range = Iterable.range(1, 100)
2433
- * console.log(Iterable.contains(range, 50)) // true
2434
- * console.log(Iterable.contains(range, 150)) // false
2376
+ * Iterable.contains(range, 50) // => true
2377
+ * Iterable.contains(range, 150) // => false
2435
2378
  *
2436
2379
  * // Curried version
2437
2380
  * const containsThree = Iterable.contains(3)
2438
- * console.log(containsThree([1, 2, 3])) // true
2439
- * console.log(containsThree([4, 5, 6])) // false
2381
+ * containsThree([1, 2, 3]) // => true
2382
+ * containsThree([4, 5, 6]) // => false
2440
2383
  * ```
2441
2384
  *
2442
- * @category elements
2385
+ * @category predicates
2443
2386
  * @since 2.0.0
2444
2387
  */
2445
2388
  export const contains: {
@@ -2454,29 +2397,29 @@ export const contains: {
2454
2397
  *
2455
2398
  * **Example** (Checking membership)
2456
2399
  *
2457
- * ```ts
2400
+ * ```ts import.meta.vitest
2458
2401
  * import { Iterable } from "effect"
2459
2402
  *
2460
2403
  * const numbers = [1, 2, 3, 4, 5]
2461
- * console.log(Iterable.contains(numbers, 3)) // true
2462
- * console.log(Iterable.contains(numbers, 6)) // false
2404
+ * Iterable.contains(numbers, 3) // => true
2405
+ * Iterable.contains(numbers, 6) // => false
2463
2406
  *
2464
2407
  * const letters = "hello"
2465
- * console.log(Iterable.contains(letters, "l")) // true
2466
- * console.log(Iterable.contains(letters, "x")) // false
2408
+ * Iterable.contains(letters, "l") // => true
2409
+ * Iterable.contains(letters, "x") // => false
2467
2410
  *
2468
2411
  * // Works with any iterable
2469
2412
  * const range = Iterable.range(1, 100)
2470
- * console.log(Iterable.contains(range, 50)) // true
2471
- * console.log(Iterable.contains(range, 150)) // false
2413
+ * Iterable.contains(range, 50) // => true
2414
+ * Iterable.contains(range, 150) // => false
2472
2415
  *
2473
2416
  * // Curried version
2474
2417
  * const containsThree = Iterable.contains(3)
2475
- * console.log(containsThree([1, 2, 3])) // true
2476
- * console.log(containsThree([4, 5, 6])) // false
2418
+ * containsThree([1, 2, 3]) // => true
2419
+ * containsThree([4, 5, 6]) // => false
2477
2420
  * ```
2478
2421
  *
2479
- * @category elements
2422
+ * @category predicates
2480
2423
  * @since 2.0.0
2481
2424
  */
2482
2425
  <A>(a: A): (self: Iterable<A>) => boolean
@@ -2491,29 +2434,29 @@ export const contains: {
2491
2434
  *
2492
2435
  * **Example** (Checking membership)
2493
2436
  *
2494
- * ```ts
2437
+ * ```ts import.meta.vitest
2495
2438
  * import { Iterable } from "effect"
2496
2439
  *
2497
2440
  * const numbers = [1, 2, 3, 4, 5]
2498
- * console.log(Iterable.contains(numbers, 3)) // true
2499
- * console.log(Iterable.contains(numbers, 6)) // false
2441
+ * Iterable.contains(numbers, 3) // => true
2442
+ * Iterable.contains(numbers, 6) // => false
2500
2443
  *
2501
2444
  * const letters = "hello"
2502
- * console.log(Iterable.contains(letters, "l")) // true
2503
- * console.log(Iterable.contains(letters, "x")) // false
2445
+ * Iterable.contains(letters, "l") // => true
2446
+ * Iterable.contains(letters, "x") // => false
2504
2447
  *
2505
2448
  * // Works with any iterable
2506
2449
  * const range = Iterable.range(1, 100)
2507
- * console.log(Iterable.contains(range, 50)) // true
2508
- * console.log(Iterable.contains(range, 150)) // false
2450
+ * Iterable.contains(range, 50) // => true
2451
+ * Iterable.contains(range, 150) // => false
2509
2452
  *
2510
2453
  * // Curried version
2511
2454
  * const containsThree = Iterable.contains(3)
2512
- * console.log(containsThree([1, 2, 3])) // true
2513
- * console.log(containsThree([4, 5, 6])) // false
2455
+ * containsThree([1, 2, 3]) // => true
2456
+ * containsThree([4, 5, 6]) // => false
2514
2457
  * ```
2515
2458
  *
2516
- * @category elements
2459
+ * @category predicates
2517
2460
  * @since 2.0.0
2518
2461
  */
2519
2462
  <A>(self: Iterable<A>, a: A): boolean
@@ -2525,25 +2468,22 @@ export const contains: {
2525
2468
  *
2526
2469
  * **Example** (Chunking an iterable)
2527
2470
  *
2528
- * ```ts
2471
+ * ```ts import.meta.vitest
2529
2472
  * import { Iterable } from "effect"
2530
2473
  *
2531
2474
  * const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
2532
2475
  * const chunks = Iterable.chunksOf(numbers, 3)
2533
- * console.log(Array.from(chunks).map((chunk) => Array.from(chunk)))
2534
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2476
+ * Array.from(chunks) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2535
2477
  *
2536
2478
  * // Last chunk can be shorter
2537
2479
  * const uneven = [1, 2, 3, 4, 5, 6, 7]
2538
2480
  * const chunks2 = Iterable.chunksOf(uneven, 3)
2539
- * console.log(Array.from(chunks2).map((chunk) => Array.from(chunk)))
2540
- * // [[1, 2, 3], [4, 5, 6], [7]]
2481
+ * Array.from(chunks2) // => [[1, 2, 3], [4, 5, 6], [7]]
2541
2482
  *
2542
2483
  * // Chunk size larger than iterable
2543
2484
  * const small = [1, 2]
2544
2485
  * const chunks3 = Iterable.chunksOf(small, 5)
2545
- * console.log(Array.from(chunks3).map((chunk) => Array.from(chunk)))
2546
- * // [[1, 2]]
2486
+ * Array.from(chunks3) // => [[1, 2]]
2547
2487
  *
2548
2488
  * // Process data in batches
2549
2489
  * const data = Iterable.range(1, 100)
@@ -2552,7 +2492,7 @@ export const contains: {
2552
2492
  * batches,
2553
2493
  * (batch) => Iterable.reduce(batch, 0, (sum, n) => sum + n)
2554
2494
  * )
2555
- * console.log(Array.from(Iterable.take(batchSums, 3))) // [55, 155, 255]
2495
+ * Array.from(Iterable.take(batchSums, 3)) // => [55, 155, 255]
2556
2496
  * ```
2557
2497
  *
2558
2498
  * @category splitting
@@ -2565,25 +2505,22 @@ export const chunksOf: {
2565
2505
  *
2566
2506
  * **Example** (Chunking an iterable)
2567
2507
  *
2568
- * ```ts
2508
+ * ```ts import.meta.vitest
2569
2509
  * import { Iterable } from "effect"
2570
2510
  *
2571
2511
  * const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
2572
2512
  * const chunks = Iterable.chunksOf(numbers, 3)
2573
- * console.log(Array.from(chunks).map((chunk) => Array.from(chunk)))
2574
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2513
+ * Array.from(chunks) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2575
2514
  *
2576
2515
  * // Last chunk can be shorter
2577
2516
  * const uneven = [1, 2, 3, 4, 5, 6, 7]
2578
2517
  * const chunks2 = Iterable.chunksOf(uneven, 3)
2579
- * console.log(Array.from(chunks2).map((chunk) => Array.from(chunk)))
2580
- * // [[1, 2, 3], [4, 5, 6], [7]]
2518
+ * Array.from(chunks2) // => [[1, 2, 3], [4, 5, 6], [7]]
2581
2519
  *
2582
2520
  * // Chunk size larger than iterable
2583
2521
  * const small = [1, 2]
2584
2522
  * const chunks3 = Iterable.chunksOf(small, 5)
2585
- * console.log(Array.from(chunks3).map((chunk) => Array.from(chunk)))
2586
- * // [[1, 2]]
2523
+ * Array.from(chunks3) // => [[1, 2]]
2587
2524
  *
2588
2525
  * // Process data in batches
2589
2526
  * const data = Iterable.range(1, 100)
@@ -2592,7 +2529,7 @@ export const chunksOf: {
2592
2529
  * batches,
2593
2530
  * (batch) => Iterable.reduce(batch, 0, (sum, n) => sum + n)
2594
2531
  * )
2595
- * console.log(Array.from(Iterable.take(batchSums, 3))) // [55, 155, 255]
2532
+ * Array.from(Iterable.take(batchSums, 3)) // => [55, 155, 255]
2596
2533
  * ```
2597
2534
  *
2598
2535
  * @category splitting
@@ -2605,25 +2542,22 @@ export const chunksOf: {
2605
2542
  *
2606
2543
  * **Example** (Chunking an iterable)
2607
2544
  *
2608
- * ```ts
2545
+ * ```ts import.meta.vitest
2609
2546
  * import { Iterable } from "effect"
2610
2547
  *
2611
2548
  * const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
2612
2549
  * const chunks = Iterable.chunksOf(numbers, 3)
2613
- * console.log(Array.from(chunks).map((chunk) => Array.from(chunk)))
2614
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2550
+ * Array.from(chunks) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2615
2551
  *
2616
2552
  * // Last chunk can be shorter
2617
2553
  * const uneven = [1, 2, 3, 4, 5, 6, 7]
2618
2554
  * const chunks2 = Iterable.chunksOf(uneven, 3)
2619
- * console.log(Array.from(chunks2).map((chunk) => Array.from(chunk)))
2620
- * // [[1, 2, 3], [4, 5, 6], [7]]
2555
+ * Array.from(chunks2) // => [[1, 2, 3], [4, 5, 6], [7]]
2621
2556
  *
2622
2557
  * // Chunk size larger than iterable
2623
2558
  * const small = [1, 2]
2624
2559
  * const chunks3 = Iterable.chunksOf(small, 5)
2625
- * console.log(Array.from(chunks3).map((chunk) => Array.from(chunk)))
2626
- * // [[1, 2]]
2560
+ * Array.from(chunks3) // => [[1, 2]]
2627
2561
  *
2628
2562
  * // Process data in batches
2629
2563
  * const data = Iterable.range(1, 100)
@@ -2632,7 +2566,7 @@ export const chunksOf: {
2632
2566
  * batches,
2633
2567
  * (batch) => Iterable.reduce(batch, 0, (sum, n) => sum + n)
2634
2568
  * )
2635
- * console.log(Array.from(Iterable.take(batchSums, 3))) // [55, 155, 255]
2569
+ * Array.from(Iterable.take(batchSums, 3)) // => [55, 155, 255]
2636
2570
  * ```
2637
2571
  *
2638
2572
  * @category splitting
@@ -2672,35 +2606,31 @@ export const chunksOf: {
2672
2606
  *
2673
2607
  * **Example** (Grouping consecutive elements with custom equivalence)
2674
2608
  *
2675
- * ```ts
2609
+ * ```ts import.meta.vitest
2676
2610
  * import { Iterable } from "effect"
2677
2611
  *
2678
2612
  * // Group consecutive equal numbers
2679
2613
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
2680
2614
  * const grouped = Iterable.groupWith(numbers, (a, b) => a === b)
2681
- * console.log(Array.from(grouped))
2682
- * // [[1, 1], [2, 2, 2], [3], [1, 1]]
2615
+ * Array.from(grouped) // => [[1, 1], [2, 2, 2], [3], [1, 1]]
2683
2616
  *
2684
2617
  * // Case-insensitive grouping of strings
2685
2618
  * const words = ["Apple", "APPLE", "banana", "Banana", "cherry"]
2686
2619
  * const caseInsensitive = (a: string, b: string) =>
2687
2620
  * a.toLowerCase() === b.toLowerCase()
2688
2621
  * const groupedWords = Iterable.groupWith(words, caseInsensitive)
2689
- * console.log(Array.from(groupedWords))
2690
- * // [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2622
+ * Array.from(groupedWords) // => [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2691
2623
  *
2692
2624
  * // Group by approximate equality
2693
2625
  * const floats = [1.1, 1.12, 1.9, 2.01, 2.05, 3.5]
2694
2626
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.2
2695
2627
  * const groupedFloats = Iterable.groupWith(floats, approxEqual)
2696
- * console.log(Array.from(groupedFloats))
2697
- * // [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2628
+ * Array.from(groupedFloats) // => [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2698
2629
  *
2699
2630
  * // Only groups consecutive elements
2700
2631
  * const scattered = [1, 2, 1, 2, 1]
2701
2632
  * const scatteredGroups = Iterable.groupWith(scattered, (a, b) => a === b)
2702
- * console.log(Array.from(scatteredGroups))
2703
- * // [[1], [2], [1], [2], [1]] (no grouping since none are consecutive)
2633
+ * Array.from(scatteredGroups) // => [[1], [2], [1], [2], [1]]
2704
2634
  * ```
2705
2635
  *
2706
2636
  * @category grouping
@@ -2712,35 +2642,31 @@ export const groupWith: {
2712
2642
  *
2713
2643
  * **Example** (Grouping consecutive elements with custom equivalence)
2714
2644
  *
2715
- * ```ts
2645
+ * ```ts import.meta.vitest
2716
2646
  * import { Iterable } from "effect"
2717
2647
  *
2718
2648
  * // Group consecutive equal numbers
2719
2649
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
2720
2650
  * const grouped = Iterable.groupWith(numbers, (a, b) => a === b)
2721
- * console.log(Array.from(grouped))
2722
- * // [[1, 1], [2, 2, 2], [3], [1, 1]]
2651
+ * Array.from(grouped) // => [[1, 1], [2, 2, 2], [3], [1, 1]]
2723
2652
  *
2724
2653
  * // Case-insensitive grouping of strings
2725
2654
  * const words = ["Apple", "APPLE", "banana", "Banana", "cherry"]
2726
2655
  * const caseInsensitive = (a: string, b: string) =>
2727
2656
  * a.toLowerCase() === b.toLowerCase()
2728
2657
  * const groupedWords = Iterable.groupWith(words, caseInsensitive)
2729
- * console.log(Array.from(groupedWords))
2730
- * // [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2658
+ * Array.from(groupedWords) // => [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2731
2659
  *
2732
2660
  * // Group by approximate equality
2733
2661
  * const floats = [1.1, 1.12, 1.9, 2.01, 2.05, 3.5]
2734
2662
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.2
2735
2663
  * const groupedFloats = Iterable.groupWith(floats, approxEqual)
2736
- * console.log(Array.from(groupedFloats))
2737
- * // [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2664
+ * Array.from(groupedFloats) // => [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2738
2665
  *
2739
2666
  * // Only groups consecutive elements
2740
2667
  * const scattered = [1, 2, 1, 2, 1]
2741
2668
  * const scatteredGroups = Iterable.groupWith(scattered, (a, b) => a === b)
2742
- * console.log(Array.from(scatteredGroups))
2743
- * // [[1], [2], [1], [2], [1]] (no grouping since none are consecutive)
2669
+ * Array.from(scatteredGroups) // => [[1], [2], [1], [2], [1]]
2744
2670
  * ```
2745
2671
  *
2746
2672
  * @category grouping
@@ -2752,35 +2678,31 @@ export const groupWith: {
2752
2678
  *
2753
2679
  * **Example** (Grouping consecutive elements with custom equivalence)
2754
2680
  *
2755
- * ```ts
2681
+ * ```ts import.meta.vitest
2756
2682
  * import { Iterable } from "effect"
2757
2683
  *
2758
2684
  * // Group consecutive equal numbers
2759
2685
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
2760
2686
  * const grouped = Iterable.groupWith(numbers, (a, b) => a === b)
2761
- * console.log(Array.from(grouped))
2762
- * // [[1, 1], [2, 2, 2], [3], [1, 1]]
2687
+ * Array.from(grouped) // => [[1, 1], [2, 2, 2], [3], [1, 1]]
2763
2688
  *
2764
2689
  * // Case-insensitive grouping of strings
2765
2690
  * const words = ["Apple", "APPLE", "banana", "Banana", "cherry"]
2766
2691
  * const caseInsensitive = (a: string, b: string) =>
2767
2692
  * a.toLowerCase() === b.toLowerCase()
2768
2693
  * const groupedWords = Iterable.groupWith(words, caseInsensitive)
2769
- * console.log(Array.from(groupedWords))
2770
- * // [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2694
+ * Array.from(groupedWords) // => [["Apple", "APPLE"], ["banana", "Banana"], ["cherry"]]
2771
2695
  *
2772
2696
  * // Group by approximate equality
2773
2697
  * const floats = [1.1, 1.12, 1.9, 2.01, 2.05, 3.5]
2774
2698
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.2
2775
2699
  * const groupedFloats = Iterable.groupWith(floats, approxEqual)
2776
- * console.log(Array.from(groupedFloats))
2777
- * // [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2700
+ * Array.from(groupedFloats) // => [[1.1, 1.12], [1.9, 2.01, 2.05], [3.5]]
2778
2701
  *
2779
2702
  * // Only groups consecutive elements
2780
2703
  * const scattered = [1, 2, 1, 2, 1]
2781
2704
  * const scatteredGroups = Iterable.groupWith(scattered, (a, b) => a === b)
2782
- * console.log(Array.from(scatteredGroups))
2783
- * // [[1], [2], [1], [2], [1]] (no grouping since none are consecutive)
2705
+ * Array.from(scatteredGroups) // => [[1], [2], [1], [2], [1]]
2784
2706
  * ```
2785
2707
  *
2786
2708
  * @category grouping
@@ -2829,18 +2751,16 @@ export const groupWith: {
2829
2751
  *
2830
2752
  * **Example** (Grouping consecutive elements)
2831
2753
  *
2832
- * ```ts
2754
+ * ```ts import.meta.vitest
2833
2755
  * import { Iterable } from "effect"
2834
2756
  *
2835
2757
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
2836
2758
  * const grouped = Iterable.group(numbers)
2837
- * console.log(Array.from(grouped))
2838
- * // [[1, 1], [2, 2, 2], [3], [1, 1]]
2759
+ * Array.from(grouped) // => [[1, 1], [2, 2, 2], [3], [1, 1]]
2839
2760
  *
2840
2761
  * const letters = "aabbccaa"
2841
2762
  * const groupedLetters = Iterable.group(letters)
2842
- * console.log(Array.from(groupedLetters))
2843
- * // [["a", "a"], ["b", "b"], ["c", "c"], ["a", "a"]]
2763
+ * Array.from(groupedLetters) // => [["a", "a"], ["b", "b"], ["c", "c"], ["a", "a"]]
2844
2764
  *
2845
2765
  * // Works with objects using deep equality
2846
2766
  * const objects = [
@@ -2850,7 +2770,7 @@ export const groupWith: {
2850
2770
  * { type: "A", value: 1 }
2851
2771
  * ]
2852
2772
  * const groupedObjects = Iterable.group(objects)
2853
- * console.log(Array.from(groupedObjects).length) // 3 groups
2773
+ * Array.from(groupedObjects).length // => 3
2854
2774
  * // Note: Only consecutive equal objects are grouped together
2855
2775
  * ```
2856
2776
  *
@@ -2872,20 +2792,18 @@ export const group: <A>(self: Iterable<A>) => Iterable<NonEmptyArray<A>> = group
2872
2792
  *
2873
2793
  * **Example** (Grouping by a key)
2874
2794
  *
2875
- * ```ts
2795
+ * ```ts import.meta.vitest
2876
2796
  * import { Iterable } from "effect"
2877
2797
  *
2878
2798
  * // Group by string length
2879
2799
  * const words = ["a", "bb", "ccc", "dd", "eee", "f"]
2880
2800
  * const byLength = Iterable.groupBy(words, (word) => word.length.toString())
2881
- * console.log(byLength)
2882
- * // { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2801
+ * byLength // => { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2883
2802
  *
2884
2803
  * // Group by first letter
2885
2804
  * const names = ["Alice", "Bob", "Charlie", "David", "Anna", "Betty"]
2886
2805
  * const byFirstLetter = Iterable.groupBy(names, (name) => name[0])
2887
- * console.log(byFirstLetter)
2888
- * // { "A": ["Alice", "Anna"], "B": ["Bob", "Betty"], "C": ["Charlie"], "D": ["David"] }
2806
+ * byFirstLetter // => { A: ["Alice", "Anna"], B: ["Bob", "Betty"], C: ["Charlie"], D: ["David"] }
2889
2807
  *
2890
2808
  * // Group by category
2891
2809
  * const items = [
@@ -2895,17 +2813,12 @@ export const group: <A>(self: Iterable<A>) => Iterable<NonEmptyArray<A>> = group
2895
2813
  * { name: "broccoli", category: "vegetable" }
2896
2814
  * ]
2897
2815
  * const byCategory = Iterable.groupBy(items, (item) => item.category)
2898
- * console.log(byCategory)
2899
- * // {
2900
- * // "fruit": [{ name: "apple", category: "fruit" }, { name: "banana", category: "fruit" }],
2901
- * // "vegetable": [{ name: "carrot", category: "vegetable" }, { name: "broccoli", category: "vegetable" }]
2902
- * // }
2816
+ * Object.keys(byCategory) // => ["fruit", "vegetable"]
2903
2817
  *
2904
2818
  * // Group numbers by even/odd
2905
2819
  * const numbers = [1, 2, 3, 4, 5, 6]
2906
2820
  * const evenOdd = Iterable.groupBy(numbers, (n) => n % 2 === 0 ? "even" : "odd")
2907
- * console.log(evenOdd)
2908
- * // { "odd": [1, 3, 5], "even": [2, 4, 6] }
2821
+ * evenOdd // => { odd: [1, 3, 5], even: [2, 4, 6] }
2909
2822
  * ```
2910
2823
  *
2911
2824
  * @category grouping
@@ -2923,20 +2836,18 @@ export const groupBy: {
2923
2836
  *
2924
2837
  * **Example** (Grouping by a key)
2925
2838
  *
2926
- * ```ts
2839
+ * ```ts import.meta.vitest
2927
2840
  * import { Iterable } from "effect"
2928
2841
  *
2929
2842
  * // Group by string length
2930
2843
  * const words = ["a", "bb", "ccc", "dd", "eee", "f"]
2931
2844
  * const byLength = Iterable.groupBy(words, (word) => word.length.toString())
2932
- * console.log(byLength)
2933
- * // { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2845
+ * byLength // => { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2934
2846
  *
2935
2847
  * // Group by first letter
2936
2848
  * const names = ["Alice", "Bob", "Charlie", "David", "Anna", "Betty"]
2937
2849
  * const byFirstLetter = Iterable.groupBy(names, (name) => name[0])
2938
- * console.log(byFirstLetter)
2939
- * // { "A": ["Alice", "Anna"], "B": ["Bob", "Betty"], "C": ["Charlie"], "D": ["David"] }
2850
+ * byFirstLetter // => { A: ["Alice", "Anna"], B: ["Bob", "Betty"], C: ["Charlie"], D: ["David"] }
2940
2851
  *
2941
2852
  * // Group by category
2942
2853
  * const items = [
@@ -2946,17 +2857,12 @@ export const groupBy: {
2946
2857
  * { name: "broccoli", category: "vegetable" }
2947
2858
  * ]
2948
2859
  * const byCategory = Iterable.groupBy(items, (item) => item.category)
2949
- * console.log(byCategory)
2950
- * // {
2951
- * // "fruit": [{ name: "apple", category: "fruit" }, { name: "banana", category: "fruit" }],
2952
- * // "vegetable": [{ name: "carrot", category: "vegetable" }, { name: "broccoli", category: "vegetable" }]
2953
- * // }
2860
+ * Object.keys(byCategory) // => ["fruit", "vegetable"]
2954
2861
  *
2955
2862
  * // Group numbers by even/odd
2956
2863
  * const numbers = [1, 2, 3, 4, 5, 6]
2957
2864
  * const evenOdd = Iterable.groupBy(numbers, (n) => n % 2 === 0 ? "even" : "odd")
2958
- * console.log(evenOdd)
2959
- * // { "odd": [1, 3, 5], "even": [2, 4, 6] }
2865
+ * evenOdd // => { odd: [1, 3, 5], even: [2, 4, 6] }
2960
2866
  * ```
2961
2867
  *
2962
2868
  * @category grouping
@@ -2974,20 +2880,18 @@ export const groupBy: {
2974
2880
  *
2975
2881
  * **Example** (Grouping by a key)
2976
2882
  *
2977
- * ```ts
2883
+ * ```ts import.meta.vitest
2978
2884
  * import { Iterable } from "effect"
2979
2885
  *
2980
2886
  * // Group by string length
2981
2887
  * const words = ["a", "bb", "ccc", "dd", "eee", "f"]
2982
2888
  * const byLength = Iterable.groupBy(words, (word) => word.length.toString())
2983
- * console.log(byLength)
2984
- * // { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2889
+ * byLength // => { "1": ["a", "f"], "2": ["bb", "dd"], "3": ["ccc", "eee"] }
2985
2890
  *
2986
2891
  * // Group by first letter
2987
2892
  * const names = ["Alice", "Bob", "Charlie", "David", "Anna", "Betty"]
2988
2893
  * const byFirstLetter = Iterable.groupBy(names, (name) => name[0])
2989
- * console.log(byFirstLetter)
2990
- * // { "A": ["Alice", "Anna"], "B": ["Bob", "Betty"], "C": ["Charlie"], "D": ["David"] }
2894
+ * byFirstLetter // => { A: ["Alice", "Anna"], B: ["Bob", "Betty"], C: ["Charlie"], D: ["David"] }
2991
2895
  *
2992
2896
  * // Group by category
2993
2897
  * const items = [
@@ -2997,17 +2901,12 @@ export const groupBy: {
2997
2901
  * { name: "broccoli", category: "vegetable" }
2998
2902
  * ]
2999
2903
  * const byCategory = Iterable.groupBy(items, (item) => item.category)
3000
- * console.log(byCategory)
3001
- * // {
3002
- * // "fruit": [{ name: "apple", category: "fruit" }, { name: "banana", category: "fruit" }],
3003
- * // "vegetable": [{ name: "carrot", category: "vegetable" }, { name: "broccoli", category: "vegetable" }]
3004
- * // }
2904
+ * Object.keys(byCategory) // => ["fruit", "vegetable"]
3005
2905
  *
3006
2906
  * // Group numbers by even/odd
3007
2907
  * const numbers = [1, 2, 3, 4, 5, 6]
3008
2908
  * const evenOdd = Iterable.groupBy(numbers, (n) => n % 2 === 0 ? "even" : "odd")
3009
- * console.log(evenOdd)
3010
- * // { "odd": [1, 3, 5], "even": [2, 4, 6] }
2909
+ * evenOdd // => { odd: [1, 3, 5], even: [2, 4, 6] }
3011
2910
  * ```
3012
2911
  *
3013
2912
  * @category grouping
@@ -3051,18 +2950,10 @@ const constEmptyIterator: Iterator<never> = {
3051
2950
  *
3052
2951
  * **Example** (Creating an empty iterable)
3053
2952
  *
3054
- * ```ts
2953
+ * ```ts import.meta.vitest
3055
2954
  * import { Iterable } from "effect"
3056
2955
  *
3057
- * const empty = Iterable.empty<string>()
3058
- * console.log(Array.from(empty)) // []
3059
- * console.log(Iterable.isEmpty(empty)) // true
3060
- *
3061
- * // Useful as base case for reductions
3062
- * const hasData = true
3063
- * const result = hasData
3064
- * ? Iterable.range(1, 5)
3065
- * : Iterable.empty<number>()
2956
+ * Array.from(Iterable.empty<string>()) // => []
3066
2957
  * ```
3067
2958
  *
3068
2959
  * @category constructors
@@ -3080,11 +2971,11 @@ export const empty = <A = never>(): Iterable<A> => constEmpty
3080
2971
  *
3081
2972
  * **Example** (Wrapping a single value)
3082
2973
  *
3083
- * ```ts
2974
+ * ```ts import.meta.vitest
3084
2975
  * import { Iterable } from "effect"
3085
2976
  *
3086
2977
  * const single = Iterable.of(42)
3087
- * console.log(Array.from(single)) // [42]
2978
+ * Array.from(single) // => [42]
3088
2979
  *
3089
2980
  * // Useful for creating homogeneous sequences
3090
2981
  * const sequences = [
@@ -3099,7 +2990,7 @@ export const empty = <A = never>(): Iterable<A> => constEmpty
3099
2990
  * numbers,
3100
2991
  * (n) => n % 2 === 0 ? Iterable.of(n) : Iterable.empty()
3101
2992
  * )
3102
- * console.log(Array.from(evensOnly)) // [2, 4]
2993
+ * Array.from(evensOnly) // => [2, 4]
3103
2994
  * ```
3104
2995
  *
3105
2996
  * @category constructors
@@ -3119,24 +3010,22 @@ export const of = <A>(a: A): Iterable<A> => [a]
3119
3010
  *
3120
3011
  * **Example** (Mapping elements)
3121
3012
  *
3122
- * ```ts
3013
+ * ```ts import.meta.vitest
3123
3014
  * import { Iterable } from "effect"
3124
3015
  *
3125
3016
  * // Transform numbers to their squares
3126
3017
  * const numbers = [1, 2, 3, 4, 5]
3127
3018
  * const squares = Iterable.map(numbers, (x) => x * x)
3128
- * console.log(Array.from(squares)) // [1, 4, 9, 16, 25]
3019
+ * Array.from(squares) // => [1, 4, 9, 16, 25]
3129
3020
  *
3130
3021
  * // Use index in transformation
3131
3022
  * const indexed = Iterable.map(["a", "b", "c"], (char, i) => `${i}: ${char}`)
3132
- * console.log(Array.from(indexed)) // ["0: a", "1: b", "2: c"]
3023
+ * Array.from(indexed) // => ["0: a", "1: b", "2: c"]
3133
3024
  *
3134
- * // Chain transformations
3135
- * const result = Iterable.map(
3025
+ * Array.from(Iterable.map(
3136
3026
  * Iterable.map([1, 2, 3], (x) => x * 2),
3137
3027
  * (x) => x + 1
3138
- * )
3139
- * console.log(Array.from(result)) // [3, 5, 7]
3028
+ * )) // => [3, 5, 7]
3140
3029
  * ```
3141
3030
  *
3142
3031
  * @category mapping
@@ -3155,24 +3044,22 @@ export const map: {
3155
3044
  *
3156
3045
  * **Example** (Mapping elements)
3157
3046
  *
3158
- * ```ts
3047
+ * ```ts import.meta.vitest
3159
3048
  * import { Iterable } from "effect"
3160
3049
  *
3161
3050
  * // Transform numbers to their squares
3162
3051
  * const numbers = [1, 2, 3, 4, 5]
3163
3052
  * const squares = Iterable.map(numbers, (x) => x * x)
3164
- * console.log(Array.from(squares)) // [1, 4, 9, 16, 25]
3053
+ * Array.from(squares) // => [1, 4, 9, 16, 25]
3165
3054
  *
3166
3055
  * // Use index in transformation
3167
3056
  * const indexed = Iterable.map(["a", "b", "c"], (char, i) => `${i}: ${char}`)
3168
- * console.log(Array.from(indexed)) // ["0: a", "1: b", "2: c"]
3057
+ * Array.from(indexed) // => ["0: a", "1: b", "2: c"]
3169
3058
  *
3170
- * // Chain transformations
3171
- * const result = Iterable.map(
3059
+ * Array.from(Iterable.map(
3172
3060
  * Iterable.map([1, 2, 3], (x) => x * 2),
3173
3061
  * (x) => x + 1
3174
- * )
3175
- * console.log(Array.from(result)) // [3, 5, 7]
3062
+ * )) // => [3, 5, 7]
3176
3063
  * ```
3177
3064
  *
3178
3065
  * @category mapping
@@ -3191,24 +3078,22 @@ export const map: {
3191
3078
  *
3192
3079
  * **Example** (Mapping elements)
3193
3080
  *
3194
- * ```ts
3081
+ * ```ts import.meta.vitest
3195
3082
  * import { Iterable } from "effect"
3196
3083
  *
3197
3084
  * // Transform numbers to their squares
3198
3085
  * const numbers = [1, 2, 3, 4, 5]
3199
3086
  * const squares = Iterable.map(numbers, (x) => x * x)
3200
- * console.log(Array.from(squares)) // [1, 4, 9, 16, 25]
3087
+ * Array.from(squares) // => [1, 4, 9, 16, 25]
3201
3088
  *
3202
3089
  * // Use index in transformation
3203
3090
  * const indexed = Iterable.map(["a", "b", "c"], (char, i) => `${i}: ${char}`)
3204
- * console.log(Array.from(indexed)) // ["0: a", "1: b", "2: c"]
3091
+ * Array.from(indexed) // => ["0: a", "1: b", "2: c"]
3205
3092
  *
3206
- * // Chain transformations
3207
- * const result = Iterable.map(
3093
+ * Array.from(Iterable.map(
3208
3094
  * Iterable.map([1, 2, 3], (x) => x * 2),
3209
3095
  * (x) => x + 1
3210
- * )
3211
- * console.log(Array.from(result)) // [3, 5, 7]
3096
+ * )) // => [3, 5, 7]
3212
3097
  * ```
3213
3098
  *
3214
3099
  * @category mapping
@@ -3236,18 +3121,18 @@ export const map: {
3236
3121
  *
3237
3122
  * **Example** (Flat mapping iterables)
3238
3123
  *
3239
- * ```ts
3124
+ * ```ts import.meta.vitest
3240
3125
  * import { Iterable } from "effect"
3241
3126
  *
3242
3127
  * // Expand each number to a range
3243
3128
  * const numbers = [1, 2, 3]
3244
3129
  * const expanded = Iterable.flatMap(numbers, (n) => Iterable.range(1, n))
3245
- * console.log(Array.from(expanded)) // [1, 1, 2, 1, 2, 3]
3130
+ * Array.from(expanded) // => [1, 1, 2, 1, 2, 3]
3246
3131
  *
3247
3132
  * // Split strings into characters
3248
3133
  * const words = ["hi", "bye"]
3249
3134
  * const chars = Iterable.flatMap(words, (word) => word)
3250
- * console.log(Array.from(chars)) // ["h", "i", "b", "y", "e"]
3135
+ * Array.from(chars) // => ["h", "i", "b", "y", "e"]
3251
3136
  *
3252
3137
  * // Conditional expansion with empty iterables
3253
3138
  * const values = [1, 2, 3, 4, 5]
@@ -3255,7 +3140,7 @@ export const map: {
3255
3140
  * values,
3256
3141
  * (n) => n % 2 === 0 ? [n, n * 2, n * 3] : []
3257
3142
  * )
3258
- * console.log(Array.from(evenMultiples)) // [2, 4, 6, 4, 8, 12]
3143
+ * Array.from(evenMultiples) // => [2, 4, 6, 4, 8, 12]
3259
3144
  *
3260
3145
  * // Use index in transformation
3261
3146
  * const letters = ["a", "b", "c"]
@@ -3263,7 +3148,7 @@ export const map: {
3263
3148
  * letters,
3264
3149
  * (letter, i) => Iterable.replicate(letter, i + 1)
3265
3150
  * )
3266
- * console.log(Array.from(indexed)) // ["a", "b", "b", "c", "c", "c"]
3151
+ * Array.from(indexed) // => ["a", "b", "b", "c", "c", "c"]
3267
3152
  * ```
3268
3153
  *
3269
3154
  * @category sequencing
@@ -3275,18 +3160,18 @@ export const flatMap: {
3275
3160
  *
3276
3161
  * **Example** (Flat mapping iterables)
3277
3162
  *
3278
- * ```ts
3163
+ * ```ts import.meta.vitest
3279
3164
  * import { Iterable } from "effect"
3280
3165
  *
3281
3166
  * // Expand each number to a range
3282
3167
  * const numbers = [1, 2, 3]
3283
3168
  * const expanded = Iterable.flatMap(numbers, (n) => Iterable.range(1, n))
3284
- * console.log(Array.from(expanded)) // [1, 1, 2, 1, 2, 3]
3169
+ * Array.from(expanded) // => [1, 1, 2, 1, 2, 3]
3285
3170
  *
3286
3171
  * // Split strings into characters
3287
3172
  * const words = ["hi", "bye"]
3288
3173
  * const chars = Iterable.flatMap(words, (word) => word)
3289
- * console.log(Array.from(chars)) // ["h", "i", "b", "y", "e"]
3174
+ * Array.from(chars) // => ["h", "i", "b", "y", "e"]
3290
3175
  *
3291
3176
  * // Conditional expansion with empty iterables
3292
3177
  * const values = [1, 2, 3, 4, 5]
@@ -3294,7 +3179,7 @@ export const flatMap: {
3294
3179
  * values,
3295
3180
  * (n) => n % 2 === 0 ? [n, n * 2, n * 3] : []
3296
3181
  * )
3297
- * console.log(Array.from(evenMultiples)) // [2, 4, 6, 4, 8, 12]
3182
+ * Array.from(evenMultiples) // => [2, 4, 6, 4, 8, 12]
3298
3183
  *
3299
3184
  * // Use index in transformation
3300
3185
  * const letters = ["a", "b", "c"]
@@ -3302,7 +3187,7 @@ export const flatMap: {
3302
3187
  * letters,
3303
3188
  * (letter, i) => Iterable.replicate(letter, i + 1)
3304
3189
  * )
3305
- * console.log(Array.from(indexed)) // ["a", "b", "b", "c", "c", "c"]
3190
+ * Array.from(indexed) // => ["a", "b", "b", "c", "c", "c"]
3306
3191
  * ```
3307
3192
  *
3308
3193
  * @category sequencing
@@ -3314,18 +3199,18 @@ export const flatMap: {
3314
3199
  *
3315
3200
  * **Example** (Flat mapping iterables)
3316
3201
  *
3317
- * ```ts
3202
+ * ```ts import.meta.vitest
3318
3203
  * import { Iterable } from "effect"
3319
3204
  *
3320
3205
  * // Expand each number to a range
3321
3206
  * const numbers = [1, 2, 3]
3322
3207
  * const expanded = Iterable.flatMap(numbers, (n) => Iterable.range(1, n))
3323
- * console.log(Array.from(expanded)) // [1, 1, 2, 1, 2, 3]
3208
+ * Array.from(expanded) // => [1, 1, 2, 1, 2, 3]
3324
3209
  *
3325
3210
  * // Split strings into characters
3326
3211
  * const words = ["hi", "bye"]
3327
3212
  * const chars = Iterable.flatMap(words, (word) => word)
3328
- * console.log(Array.from(chars)) // ["h", "i", "b", "y", "e"]
3213
+ * Array.from(chars) // => ["h", "i", "b", "y", "e"]
3329
3214
  *
3330
3215
  * // Conditional expansion with empty iterables
3331
3216
  * const values = [1, 2, 3, 4, 5]
@@ -3333,7 +3218,7 @@ export const flatMap: {
3333
3218
  * values,
3334
3219
  * (n) => n % 2 === 0 ? [n, n * 2, n * 3] : []
3335
3220
  * )
3336
- * console.log(Array.from(evenMultiples)) // [2, 4, 6, 4, 8, 12]
3221
+ * Array.from(evenMultiples) // => [2, 4, 6, 4, 8, 12]
3337
3222
  *
3338
3223
  * // Use index in transformation
3339
3224
  * const letters = ["a", "b", "c"]
@@ -3341,7 +3226,7 @@ export const flatMap: {
3341
3226
  * letters,
3342
3227
  * (letter, i) => Iterable.replicate(letter, i + 1)
3343
3228
  * )
3344
- * console.log(Array.from(indexed)) // ["a", "b", "b", "c", "c", "c"]
3229
+ * Array.from(indexed) // => ["a", "b", "b", "c", "c", "c"]
3345
3230
  * ```
3346
3231
  *
3347
3232
  * @category sequencing
@@ -3358,29 +3243,29 @@ export const flatMap: {
3358
3243
  *
3359
3244
  * **Example** (Flattening nested iterables)
3360
3245
  *
3361
- * ```ts
3246
+ * ```ts import.meta.vitest
3362
3247
  * import { Iterable } from "effect"
3363
3248
  *
3364
3249
  * // Flatten nested arrays
3365
3250
  * const nested = [[1, 2], [3, 4], [5, 6]]
3366
3251
  * const flat = Iterable.flatten(nested)
3367
- * console.log(Array.from(flat)) // [1, 2, 3, 4, 5, 6]
3252
+ * Array.from(flat) // => [1, 2, 3, 4, 5, 6]
3368
3253
  *
3369
3254
  * // Flatten different iterable types
3370
3255
  * const mixed: Array<Iterable<string>> = ["ab", "cd"]
3371
3256
  * const flatMixed = Iterable.flatten(mixed)
3372
- * console.log(Array.from(flatMixed)) // ["a", "b", "c", "d"]
3257
+ * Array.from(flatMixed) // => ["a", "b", "c", "d"]
3373
3258
  *
3374
3259
  * // Flatten deeply nested (only one level)
3375
3260
  * const deepNested = [[[1, 2]], [[3, 4]]]
3376
3261
  * const oneLevelFlat = Iterable.flatten(deepNested)
3377
- * console.log(Array.from(oneLevelFlat).map((arr) => Array.from(arr)))
3262
+ * Array.from(oneLevelFlat) // => [[1, 2], [3, 4]]
3378
3263
  * // [[1, 2], [3, 4]] (still contains arrays)
3379
3264
  *
3380
3265
  * // Empty iterables are handled correctly
3381
3266
  * const withEmpty = [[1, 2], [], [3, 4], []]
3382
3267
  * const flatWithEmpty = Iterable.flatten(withEmpty)
3383
- * console.log(Array.from(flatWithEmpty)) // [1, 2, 3, 4]
3268
+ * Array.from(flatWithEmpty) // => [1, 2, 3, 4]
3384
3269
  * ```
3385
3270
  *
3386
3271
  * @category sequencing
@@ -3391,19 +3276,20 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3391
3276
  const outerIterator = self[Symbol.iterator]()
3392
3277
  let innerIterator: Iterator<A> | undefined
3393
3278
  function next() {
3394
- if (innerIterator === undefined) {
3395
- const next = outerIterator.next()
3396
- if (next.done) {
3397
- return next
3279
+ while (true) {
3280
+ if (innerIterator === undefined) {
3281
+ const next = outerIterator.next()
3282
+ if (next.done) {
3283
+ return next
3284
+ }
3285
+ innerIterator = next.value[Symbol.iterator]()
3286
+ }
3287
+ const result = innerIterator.next()
3288
+ if (!result.done) {
3289
+ return result
3398
3290
  }
3399
- innerIterator = next.value[Symbol.iterator]()
3400
- }
3401
- const result = innerIterator.next()
3402
- if (result.done) {
3403
3291
  innerIterator = undefined
3404
- return next()
3405
3292
  }
3406
- return result
3407
3293
  }
3408
3294
  return { next }
3409
3295
  }
@@ -3420,7 +3306,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3420
3306
  *
3421
3307
  * **Example** (Filtering and transforming Result values)
3422
3308
  *
3423
- * ```ts
3309
+ * ```ts import.meta.vitest
3424
3310
  * import { Iterable, Result } from "effect"
3425
3311
  *
3426
3312
  * // Parse strings to numbers, keeping only valid ones
@@ -3429,7 +3315,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3429
3315
  * const num = parseInt(s)
3430
3316
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3431
3317
  * })
3432
- * console.log(Array.from(numbers)) // [1, 2, 4]
3318
+ * Array.from(numbers) // => [1, 2, 4]
3433
3319
  *
3434
3320
  * // Extract specific properties from objects
3435
3321
  * const users = [
@@ -3443,7 +3329,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3443
3329
  * (user) =>
3444
3330
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3445
3331
  * )
3446
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3332
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3447
3333
  *
3448
3334
  * // Use index in transformation
3449
3335
  * const items = ["a", "b", "c", "d", "e"]
@@ -3451,7 +3337,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3451
3337
  * items,
3452
3338
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3453
3339
  * )
3454
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3340
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3455
3341
  * ```
3456
3342
  *
3457
3343
  * @category filtering
@@ -3469,7 +3355,7 @@ export const filterMap: {
3469
3355
  *
3470
3356
  * **Example** (Filtering and transforming Result values)
3471
3357
  *
3472
- * ```ts
3358
+ * ```ts import.meta.vitest
3473
3359
  * import { Iterable, Result } from "effect"
3474
3360
  *
3475
3361
  * // Parse strings to numbers, keeping only valid ones
@@ -3478,7 +3364,7 @@ export const filterMap: {
3478
3364
  * const num = parseInt(s)
3479
3365
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3480
3366
  * })
3481
- * console.log(Array.from(numbers)) // [1, 2, 4]
3367
+ * Array.from(numbers) // => [1, 2, 4]
3482
3368
  *
3483
3369
  * // Extract specific properties from objects
3484
3370
  * const users = [
@@ -3492,7 +3378,7 @@ export const filterMap: {
3492
3378
  * (user) =>
3493
3379
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3494
3380
  * )
3495
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3381
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3496
3382
  *
3497
3383
  * // Use index in transformation
3498
3384
  * const items = ["a", "b", "c", "d", "e"]
@@ -3500,7 +3386,7 @@ export const filterMap: {
3500
3386
  * items,
3501
3387
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3502
3388
  * )
3503
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3389
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3504
3390
  * ```
3505
3391
  *
3506
3392
  * @category filtering
@@ -3518,7 +3404,7 @@ export const filterMap: {
3518
3404
  *
3519
3405
  * **Example** (Filtering and transforming Result values)
3520
3406
  *
3521
- * ```ts
3407
+ * ```ts import.meta.vitest
3522
3408
  * import { Iterable, Result } from "effect"
3523
3409
  *
3524
3410
  * // Parse strings to numbers, keeping only valid ones
@@ -3527,7 +3413,7 @@ export const filterMap: {
3527
3413
  * const num = parseInt(s)
3528
3414
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3529
3415
  * })
3530
- * console.log(Array.from(numbers)) // [1, 2, 4]
3416
+ * Array.from(numbers) // => [1, 2, 4]
3531
3417
  *
3532
3418
  * // Extract specific properties from objects
3533
3419
  * const users = [
@@ -3541,7 +3427,7 @@ export const filterMap: {
3541
3427
  * (user) =>
3542
3428
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3543
3429
  * )
3544
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3430
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3545
3431
  *
3546
3432
  * // Use index in transformation
3547
3433
  * const items = ["a", "b", "c", "d", "e"]
@@ -3549,7 +3435,7 @@ export const filterMap: {
3549
3435
  * items,
3550
3436
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3551
3437
  * )
3552
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3438
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3553
3439
  * ```
3554
3440
  *
3555
3441
  * @category filtering
@@ -3584,7 +3470,7 @@ export const filterMap: {
3584
3470
  *
3585
3471
  * **Example** (Filtering and transforming until failure)
3586
3472
  *
3587
- * ```ts
3473
+ * ```ts import.meta.vitest
3588
3474
  * import { Iterable, Result } from "effect"
3589
3475
  *
3590
3476
  * // Parse numbers until we hit an invalid one
@@ -3593,7 +3479,7 @@ export const filterMap: {
3593
3479
  * const num = parseInt(s)
3594
3480
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3595
3481
  * })
3596
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3482
+ * Array.from(numbers) // => [1, 2, 3]
3597
3483
  *
3598
3484
  * // Take elements while they meet a condition and transform them
3599
3485
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3601,7 +3487,7 @@ export const filterMap: {
3601
3487
  * values,
3602
3488
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3603
3489
  * )
3604
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3490
+ * Array.from(doubledEvens) // => [4, 8, 12]
3605
3491
  *
3606
3492
  * // Process with index until condition fails
3607
3493
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3609,7 +3495,7 @@ export const filterMap: {
3609
3495
  * letters,
3610
3496
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3611
3497
  * )
3612
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3498
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3613
3499
  * ```
3614
3500
  *
3615
3501
  * @category filtering
@@ -3621,7 +3507,7 @@ export const filterMapWhile: {
3621
3507
  *
3622
3508
  * **Example** (Filtering and transforming until failure)
3623
3509
  *
3624
- * ```ts
3510
+ * ```ts import.meta.vitest
3625
3511
  * import { Iterable, Result } from "effect"
3626
3512
  *
3627
3513
  * // Parse numbers until we hit an invalid one
@@ -3630,7 +3516,7 @@ export const filterMapWhile: {
3630
3516
  * const num = parseInt(s)
3631
3517
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3632
3518
  * })
3633
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3519
+ * Array.from(numbers) // => [1, 2, 3]
3634
3520
  *
3635
3521
  * // Take elements while they meet a condition and transform them
3636
3522
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3638,7 +3524,7 @@ export const filterMapWhile: {
3638
3524
  * values,
3639
3525
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3640
3526
  * )
3641
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3527
+ * Array.from(doubledEvens) // => [4, 8, 12]
3642
3528
  *
3643
3529
  * // Process with index until condition fails
3644
3530
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3646,7 +3532,7 @@ export const filterMapWhile: {
3646
3532
  * letters,
3647
3533
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3648
3534
  * )
3649
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3535
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3650
3536
  * ```
3651
3537
  *
3652
3538
  * @category filtering
@@ -3658,7 +3544,7 @@ export const filterMapWhile: {
3658
3544
  *
3659
3545
  * **Example** (Filtering and transforming until failure)
3660
3546
  *
3661
- * ```ts
3547
+ * ```ts import.meta.vitest
3662
3548
  * import { Iterable, Result } from "effect"
3663
3549
  *
3664
3550
  * // Parse numbers until we hit an invalid one
@@ -3667,7 +3553,7 @@ export const filterMapWhile: {
3667
3553
  * const num = parseInt(s)
3668
3554
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3669
3555
  * })
3670
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3556
+ * Array.from(numbers) // => [1, 2, 3]
3671
3557
  *
3672
3558
  * // Take elements while they meet a condition and transform them
3673
3559
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3675,7 +3561,7 @@ export const filterMapWhile: {
3675
3561
  * values,
3676
3562
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3677
3563
  * )
3678
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3564
+ * Array.from(doubledEvens) // => [4, 8, 12]
3679
3565
  *
3680
3566
  * // Process with index until condition fails
3681
3567
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3683,7 +3569,7 @@ export const filterMapWhile: {
3683
3569
  * letters,
3684
3570
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3685
3571
  * )
3686
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3572
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3687
3573
  * ```
3688
3574
  *
3689
3575
  * @category filtering
@@ -3715,16 +3601,10 @@ export const filterMapWhile: {
3715
3601
  *
3716
3602
  * **Example** (Extracting Some values)
3717
3603
  *
3718
- * ```ts
3604
+ * ```ts import.meta.vitest
3719
3605
  * import { Iterable, Option } from "effect"
3720
- * import * as assert from "node:assert"
3721
3606
  *
3722
- * assert.deepStrictEqual(
3723
- * Array.from(
3724
- * Iterable.getSomes([Option.some(1), Option.none(), Option.some(2)])
3725
- * ),
3726
- * [1, 2]
3727
- * )
3607
+ * Array.from(Iterable.getSomes([Option.some(1), Option.none(), Option.some(2)])) // => [1, 2]
3728
3608
  * ```
3729
3609
  *
3730
3610
  * @category filtering
@@ -3756,20 +3636,14 @@ export const getSomes = <A>(self: Iterable<Option<A>>): Iterable<A> => {
3756
3636
  *
3757
3637
  * **Example** (Extracting failures)
3758
3638
  *
3759
- * ```ts
3639
+ * ```ts import.meta.vitest
3760
3640
  * import { Iterable, Result } from "effect"
3761
- * import * as assert from "node:assert"
3762
- *
3763
- * assert.deepStrictEqual(
3764
- * Array.from(
3765
- * Iterable.getFailures([
3766
- * Result.succeed(1),
3767
- * Result.fail("err"),
3768
- * Result.succeed(2)
3769
- * ])
3770
- * ),
3771
- * ["err"]
3772
- * )
3641
+ *
3642
+ * Array.from(Iterable.getFailures([
3643
+ * Result.succeed(1),
3644
+ * Result.fail("err"),
3645
+ * Result.succeed(2)
3646
+ * ])) // => ["err"]
3773
3647
  * ```
3774
3648
  *
3775
3649
  * @category filtering
@@ -3801,20 +3675,14 @@ export const getFailures = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<L> =
3801
3675
  *
3802
3676
  * **Example** (Extracting successes)
3803
3677
  *
3804
- * ```ts
3678
+ * ```ts import.meta.vitest
3805
3679
  * import { Iterable, Result } from "effect"
3806
- * import * as assert from "node:assert"
3807
- *
3808
- * assert.deepStrictEqual(
3809
- * Array.from(
3810
- * Iterable.getSuccesses([
3811
- * Result.succeed(1),
3812
- * Result.fail("err"),
3813
- * Result.succeed(2)
3814
- * ])
3815
- * ),
3816
- * [1, 2]
3817
- * )
3680
+ *
3681
+ * Array.from(Iterable.getSuccesses([
3682
+ * Result.succeed(1),
3683
+ * Result.fail("err"),
3684
+ * Result.succeed(2)
3685
+ * ])) // => [1, 2]
3818
3686
  * ```
3819
3687
  *
3820
3688
  * @category filtering
@@ -3851,18 +3719,18 @@ export const getSuccesses = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<R0>
3851
3719
  *
3852
3720
  * **Example** (Filtering elements)
3853
3721
  *
3854
- * ```ts
3722
+ * ```ts import.meta.vitest
3855
3723
  * import { Iterable } from "effect"
3856
3724
  *
3857
3725
  * // Filter even numbers
3858
3726
  * const numbers = [1, 2, 3, 4, 5, 6]
3859
3727
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3860
- * console.log(Array.from(evens)) // [2, 4, 6]
3728
+ * Array.from(evens) // => [2, 4, 6]
3861
3729
  *
3862
3730
  * // Filter with index
3863
3731
  * const items = ["a", "b", "c", "d"]
3864
3732
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3865
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3733
+ * Array.from(oddPositions) // => ["b", "d"]
3866
3734
  *
3867
3735
  * // Type refinement
3868
3736
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3870,14 +3738,14 @@ export const getSuccesses = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<R0>
3870
3738
  * mixed,
3871
3739
  * (x): x is string => typeof x === "string"
3872
3740
  * )
3873
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3741
+ * Array.from(onlyStrings) // => ["hello", "world"]
3874
3742
  *
3875
3743
  * // Combine with map
3876
3744
  * const processed = Iterable.map(
3877
3745
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3878
3746
  * (x) => x * 10
3879
3747
  * )
3880
- * console.log(Array.from(processed)) // [30, 40, 50]
3748
+ * Array.from(processed) // => [30, 40, 50]
3881
3749
  * ```
3882
3750
  *
3883
3751
  * @category filtering
@@ -3895,18 +3763,18 @@ export const filter: {
3895
3763
  *
3896
3764
  * **Example** (Filtering elements)
3897
3765
  *
3898
- * ```ts
3766
+ * ```ts import.meta.vitest
3899
3767
  * import { Iterable } from "effect"
3900
3768
  *
3901
3769
  * // Filter even numbers
3902
3770
  * const numbers = [1, 2, 3, 4, 5, 6]
3903
3771
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3904
- * console.log(Array.from(evens)) // [2, 4, 6]
3772
+ * Array.from(evens) // => [2, 4, 6]
3905
3773
  *
3906
3774
  * // Filter with index
3907
3775
  * const items = ["a", "b", "c", "d"]
3908
3776
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3909
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3777
+ * Array.from(oddPositions) // => ["b", "d"]
3910
3778
  *
3911
3779
  * // Type refinement
3912
3780
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3914,14 +3782,14 @@ export const filter: {
3914
3782
  * mixed,
3915
3783
  * (x): x is string => typeof x === "string"
3916
3784
  * )
3917
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3785
+ * Array.from(onlyStrings) // => ["hello", "world"]
3918
3786
  *
3919
3787
  * // Combine with map
3920
3788
  * const processed = Iterable.map(
3921
3789
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3922
3790
  * (x) => x * 10
3923
3791
  * )
3924
- * console.log(Array.from(processed)) // [30, 40, 50]
3792
+ * Array.from(processed) // => [30, 40, 50]
3925
3793
  * ```
3926
3794
  *
3927
3795
  * @category filtering
@@ -3939,18 +3807,18 @@ export const filter: {
3939
3807
  *
3940
3808
  * **Example** (Filtering elements)
3941
3809
  *
3942
- * ```ts
3810
+ * ```ts import.meta.vitest
3943
3811
  * import { Iterable } from "effect"
3944
3812
  *
3945
3813
  * // Filter even numbers
3946
3814
  * const numbers = [1, 2, 3, 4, 5, 6]
3947
3815
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3948
- * console.log(Array.from(evens)) // [2, 4, 6]
3816
+ * Array.from(evens) // => [2, 4, 6]
3949
3817
  *
3950
3818
  * // Filter with index
3951
3819
  * const items = ["a", "b", "c", "d"]
3952
3820
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3953
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3821
+ * Array.from(oddPositions) // => ["b", "d"]
3954
3822
  *
3955
3823
  * // Type refinement
3956
3824
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3958,14 +3826,14 @@ export const filter: {
3958
3826
  * mixed,
3959
3827
  * (x): x is string => typeof x === "string"
3960
3828
  * )
3961
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3829
+ * Array.from(onlyStrings) // => ["hello", "world"]
3962
3830
  *
3963
3831
  * // Combine with map
3964
3832
  * const processed = Iterable.map(
3965
3833
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3966
3834
  * (x) => x * 10
3967
3835
  * )
3968
- * console.log(Array.from(processed)) // [30, 40, 50]
3836
+ * Array.from(processed) // => [30, 40, 50]
3969
3837
  * ```
3970
3838
  *
3971
3839
  * @category filtering
@@ -3983,18 +3851,18 @@ export const filter: {
3983
3851
  *
3984
3852
  * **Example** (Filtering elements)
3985
3853
  *
3986
- * ```ts
3854
+ * ```ts import.meta.vitest
3987
3855
  * import { Iterable } from "effect"
3988
3856
  *
3989
3857
  * // Filter even numbers
3990
3858
  * const numbers = [1, 2, 3, 4, 5, 6]
3991
3859
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3992
- * console.log(Array.from(evens)) // [2, 4, 6]
3860
+ * Array.from(evens) // => [2, 4, 6]
3993
3861
  *
3994
3862
  * // Filter with index
3995
3863
  * const items = ["a", "b", "c", "d"]
3996
3864
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3997
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3865
+ * Array.from(oddPositions) // => ["b", "d"]
3998
3866
  *
3999
3867
  * // Type refinement
4000
3868
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -4002,14 +3870,14 @@ export const filter: {
4002
3870
  * mixed,
4003
3871
  * (x): x is string => typeof x === "string"
4004
3872
  * )
4005
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3873
+ * Array.from(onlyStrings) // => ["hello", "world"]
4006
3874
  *
4007
3875
  * // Combine with map
4008
3876
  * const processed = Iterable.map(
4009
3877
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
4010
3878
  * (x) => x * 10
4011
3879
  * )
4012
- * console.log(Array.from(processed)) // [30, 40, 50]
3880
+ * Array.from(processed) // => [30, 40, 50]
4013
3881
  * ```
4014
3882
  *
4015
3883
  * @category filtering
@@ -4027,18 +3895,18 @@ export const filter: {
4027
3895
  *
4028
3896
  * **Example** (Filtering elements)
4029
3897
  *
4030
- * ```ts
3898
+ * ```ts import.meta.vitest
4031
3899
  * import { Iterable } from "effect"
4032
3900
  *
4033
3901
  * // Filter even numbers
4034
3902
  * const numbers = [1, 2, 3, 4, 5, 6]
4035
3903
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
4036
- * console.log(Array.from(evens)) // [2, 4, 6]
3904
+ * Array.from(evens) // => [2, 4, 6]
4037
3905
  *
4038
3906
  * // Filter with index
4039
3907
  * const items = ["a", "b", "c", "d"]
4040
3908
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
4041
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3909
+ * Array.from(oddPositions) // => ["b", "d"]
4042
3910
  *
4043
3911
  * // Type refinement
4044
3912
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -4046,14 +3914,14 @@ export const filter: {
4046
3914
  * mixed,
4047
3915
  * (x): x is string => typeof x === "string"
4048
3916
  * )
4049
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3917
+ * Array.from(onlyStrings) // => ["hello", "world"]
4050
3918
  *
4051
3919
  * // Combine with map
4052
3920
  * const processed = Iterable.map(
4053
3921
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
4054
3922
  * (x) => x * 10
4055
3923
  * )
4056
- * console.log(Array.from(processed)) // [30, 40, 50]
3924
+ * Array.from(processed) // => [30, 40, 50]
4057
3925
  * ```
4058
3926
  *
4059
3927
  * @category filtering
@@ -4092,7 +3960,7 @@ export const filter: {
4092
3960
  *
4093
3961
  * **Example** (Flat mapping nullable results)
4094
3962
  *
4095
- * ```ts
3963
+ * ```ts import.meta.vitest
4096
3964
  * import { Iterable } from "effect"
4097
3965
  *
4098
3966
  * // Extract valid elements from nullable function results
@@ -4101,7 +3969,7 @@ export const filter: {
4101
3969
  * const num = parseInt(s)
4102
3970
  * return isNaN(num) ? null : num * 2
4103
3971
  * })
4104
- * console.log(Array.from(parsed)) // [2, 4, 8]
3972
+ * Array.from(parsed) // => [2, 4, 8]
4105
3973
  *
4106
3974
  * // Safe property access
4107
3975
  * const objects = [
@@ -4111,7 +3979,7 @@ export const filter: {
4111
3979
  * {}
4112
3980
  * ]
4113
3981
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4114
- * console.log(Array.from(values)) // [10, 20]
3982
+ * Array.from(values) // => [10, 20]
4115
3983
  *
4116
3984
  * // Working with Map.get (returns undefined for missing keys)
4117
3985
  * const map = new Map([
@@ -4121,7 +3989,7 @@ export const filter: {
4121
3989
  * ])
4122
3990
  * const keys = ["a", "x", "b", "y", "c"]
4123
3991
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4124
- * console.log(Array.from(foundValues)) // [1, 2, 3]
3992
+ * Array.from(foundValues) // => [1, 2, 3]
4125
3993
  * ```
4126
3994
  *
4127
3995
  * @category sequencing
@@ -4138,7 +4006,7 @@ export const flatMapNullishOr: {
4138
4006
  *
4139
4007
  * **Example** (Flat mapping nullable results)
4140
4008
  *
4141
- * ```ts
4009
+ * ```ts import.meta.vitest
4142
4010
  * import { Iterable } from "effect"
4143
4011
  *
4144
4012
  * // Extract valid elements from nullable function results
@@ -4147,7 +4015,7 @@ export const flatMapNullishOr: {
4147
4015
  * const num = parseInt(s)
4148
4016
  * return isNaN(num) ? null : num * 2
4149
4017
  * })
4150
- * console.log(Array.from(parsed)) // [2, 4, 8]
4018
+ * Array.from(parsed) // => [2, 4, 8]
4151
4019
  *
4152
4020
  * // Safe property access
4153
4021
  * const objects = [
@@ -4157,7 +4025,7 @@ export const flatMapNullishOr: {
4157
4025
  * {}
4158
4026
  * ]
4159
4027
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4160
- * console.log(Array.from(values)) // [10, 20]
4028
+ * Array.from(values) // => [10, 20]
4161
4029
  *
4162
4030
  * // Working with Map.get (returns undefined for missing keys)
4163
4031
  * const map = new Map([
@@ -4167,7 +4035,7 @@ export const flatMapNullishOr: {
4167
4035
  * ])
4168
4036
  * const keys = ["a", "x", "b", "y", "c"]
4169
4037
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4170
- * console.log(Array.from(foundValues)) // [1, 2, 3]
4038
+ * Array.from(foundValues) // => [1, 2, 3]
4171
4039
  * ```
4172
4040
  *
4173
4041
  * @category sequencing
@@ -4184,7 +4052,7 @@ export const flatMapNullishOr: {
4184
4052
  *
4185
4053
  * **Example** (Flat mapping nullable results)
4186
4054
  *
4187
- * ```ts
4055
+ * ```ts import.meta.vitest
4188
4056
  * import { Iterable } from "effect"
4189
4057
  *
4190
4058
  * // Extract valid elements from nullable function results
@@ -4193,7 +4061,7 @@ export const flatMapNullishOr: {
4193
4061
  * const num = parseInt(s)
4194
4062
  * return isNaN(num) ? null : num * 2
4195
4063
  * })
4196
- * console.log(Array.from(parsed)) // [2, 4, 8]
4064
+ * Array.from(parsed) // => [2, 4, 8]
4197
4065
  *
4198
4066
  * // Safe property access
4199
4067
  * const objects = [
@@ -4203,7 +4071,7 @@ export const flatMapNullishOr: {
4203
4071
  * {}
4204
4072
  * ]
4205
4073
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4206
- * console.log(Array.from(values)) // [10, 20]
4074
+ * Array.from(values) // => [10, 20]
4207
4075
  *
4208
4076
  * // Working with Map.get (returns undefined for missing keys)
4209
4077
  * const map = new Map([
@@ -4213,7 +4081,7 @@ export const flatMapNullishOr: {
4213
4081
  * ])
4214
4082
  * const keys = ["a", "x", "b", "y", "c"]
4215
4083
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4216
- * console.log(Array.from(foundValues)) // [1, 2, 3]
4084
+ * Array.from(foundValues) // => [1, 2, 3]
4217
4085
  * ```
4218
4086
  *
4219
4087
  * @category sequencing
@@ -4234,21 +4102,21 @@ export const flatMapNullishOr: {
4234
4102
  *
4235
4103
  * **Example** (Checking whether some element matches)
4236
4104
  *
4237
- * ```ts
4105
+ * ```ts import.meta.vitest
4238
4106
  * import { Iterable } from "effect"
4239
4107
  *
4240
4108
  * const numbers = [1, 3, 5, 7, 8]
4241
4109
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4242
- * console.log(hasEven) // true (because of 8)
4110
+ * hasEven // => true
4243
4111
  *
4244
4112
  * const allOdd = [1, 3, 5, 7]
4245
4113
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4246
- * console.log(hasEvenInAllOdd) // false
4114
+ * hasEvenInAllOdd // => false
4247
4115
  *
4248
4116
  * // With index
4249
4117
  * const letters = ["a", "b", "c"]
4250
4118
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4251
- * console.log(hasElementAtIndex2) // true
4119
+ * hasElementAtIndex2 // => true
4252
4120
  *
4253
4121
  * // Early termination - stops at first match
4254
4122
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4256,7 +4124,7 @@ export const flatMapNullishOr: {
4256
4124
  * Iterable.take(infiniteOdds, 1000),
4257
4125
  * (x) => x % 2 === 0
4258
4126
  * )
4259
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4127
+ * hasEvenInInfiniteOdds // => false
4260
4128
  *
4261
4129
  * // Type guard usage
4262
4130
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4264,10 +4132,10 @@ export const flatMapNullishOr: {
4264
4132
  * mixed,
4265
4133
  * (x): x is string => typeof x === "string"
4266
4134
  * )
4267
- * console.log(hasString) // true
4135
+ * hasString // => true
4268
4136
  * ```
4269
4137
  *
4270
- * @category elements
4138
+ * @category predicates
4271
4139
  * @since 2.0.0
4272
4140
  */
4273
4141
  export const some: {
@@ -4276,21 +4144,21 @@ export const some: {
4276
4144
  *
4277
4145
  * **Example** (Checking whether some element matches)
4278
4146
  *
4279
- * ```ts
4147
+ * ```ts import.meta.vitest
4280
4148
  * import { Iterable } from "effect"
4281
4149
  *
4282
4150
  * const numbers = [1, 3, 5, 7, 8]
4283
4151
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4284
- * console.log(hasEven) // true (because of 8)
4152
+ * hasEven // => true
4285
4153
  *
4286
4154
  * const allOdd = [1, 3, 5, 7]
4287
4155
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4288
- * console.log(hasEvenInAllOdd) // false
4156
+ * hasEvenInAllOdd // => false
4289
4157
  *
4290
4158
  * // With index
4291
4159
  * const letters = ["a", "b", "c"]
4292
4160
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4293
- * console.log(hasElementAtIndex2) // true
4161
+ * hasElementAtIndex2 // => true
4294
4162
  *
4295
4163
  * // Early termination - stops at first match
4296
4164
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4298,7 +4166,7 @@ export const some: {
4298
4166
  * Iterable.take(infiniteOdds, 1000),
4299
4167
  * (x) => x % 2 === 0
4300
4168
  * )
4301
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4169
+ * hasEvenInInfiniteOdds // => false
4302
4170
  *
4303
4171
  * // Type guard usage
4304
4172
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4306,10 +4174,10 @@ export const some: {
4306
4174
  * mixed,
4307
4175
  * (x): x is string => typeof x === "string"
4308
4176
  * )
4309
- * console.log(hasString) // true
4177
+ * hasString // => true
4310
4178
  * ```
4311
4179
  *
4312
- * @category elements
4180
+ * @category predicates
4313
4181
  * @since 2.0.0
4314
4182
  */
4315
4183
  <A>(predicate: (a: A, i: number) => boolean): (self: Iterable<A>) => boolean
@@ -4318,21 +4186,21 @@ export const some: {
4318
4186
  *
4319
4187
  * **Example** (Checking whether some element matches)
4320
4188
  *
4321
- * ```ts
4189
+ * ```ts import.meta.vitest
4322
4190
  * import { Iterable } from "effect"
4323
4191
  *
4324
4192
  * const numbers = [1, 3, 5, 7, 8]
4325
4193
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4326
- * console.log(hasEven) // true (because of 8)
4194
+ * hasEven // => true
4327
4195
  *
4328
4196
  * const allOdd = [1, 3, 5, 7]
4329
4197
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4330
- * console.log(hasEvenInAllOdd) // false
4198
+ * hasEvenInAllOdd // => false
4331
4199
  *
4332
4200
  * // With index
4333
4201
  * const letters = ["a", "b", "c"]
4334
4202
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4335
- * console.log(hasElementAtIndex2) // true
4203
+ * hasElementAtIndex2 // => true
4336
4204
  *
4337
4205
  * // Early termination - stops at first match
4338
4206
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4340,7 +4208,7 @@ export const some: {
4340
4208
  * Iterable.take(infiniteOdds, 1000),
4341
4209
  * (x) => x % 2 === 0
4342
4210
  * )
4343
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4211
+ * hasEvenInInfiniteOdds // => false
4344
4212
  *
4345
4213
  * // Type guard usage
4346
4214
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4348,10 +4216,10 @@ export const some: {
4348
4216
  * mixed,
4349
4217
  * (x): x is string => typeof x === "string"
4350
4218
  * )
4351
- * console.log(hasString) // true
4219
+ * hasString // => true
4352
4220
  * ```
4353
4221
  *
4354
- * @category elements
4222
+ * @category predicates
4355
4223
  * @since 2.0.0
4356
4224
  */
4357
4225
  <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): boolean
@@ -4380,21 +4248,21 @@ export const some: {
4380
4248
  *
4381
4249
  * **Example** (Unfolding state into values)
4382
4250
  *
4383
- * ```ts
4251
+ * ```ts import.meta.vitest
4384
4252
  * import { Iterable, Option } from "effect"
4385
4253
  *
4386
4254
  * // Generate Fibonacci sequence
4387
4255
  * const fibonacci = Iterable.unfold([0, 1], ([a, b]) => Option.some([a, [b, a + b]]))
4388
4256
  * const first10Fib = Iterable.take(fibonacci, 10)
4389
- * console.log(Array.from(first10Fib)) // [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
4257
+ * Array.from(first10Fib) // => [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
4390
4258
  *
4391
4259
  * // Generate powers of 2 up to a limit
4392
4260
  * const powersOf2 = Iterable.unfold(1, (n) => n <= 1000 ? Option.some([n, n * 2]) : Option.none())
4393
- * console.log(Array.from(powersOf2)) // [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
4261
+ * Array.from(powersOf2) // => [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
4394
4262
  *
4395
4263
  * // Generate countdown
4396
4264
  * const countdown = Iterable.unfold(5, (n) => n > 0 ? Option.some([n, n - 1]) : Option.none())
4397
- * console.log(Array.from(countdown)) // [5, 4, 3, 2, 1]
4265
+ * Array.from(countdown) // => [5, 4, 3, 2, 1]
4398
4266
  *
4399
4267
  * // Generate collatz sequence
4400
4268
  * const collatz = Iterable.unfold(7, (n) => {
@@ -4402,7 +4270,7 @@ export const some: {
4402
4270
  * const next = n % 2 === 0 ? n / 2 : n * 3 + 1
4403
4271
  * return Option.some([n, next])
4404
4272
  * })
4405
- * console.log(Array.from(collatz)) // [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2]
4273
+ * Array.from(collatz) // => [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2]
4406
4274
  * ```
4407
4275
  *
4408
4276
  * @category constructors
@@ -4430,37 +4298,40 @@ export const unfold = <B, A>(b: B, f: (b: B) => Option<readonly [A, B]>): Iterab
4430
4298
  *
4431
4299
  * **Example** (Iterating with side effects)
4432
4300
  *
4433
- * ```ts
4301
+ * ```ts import.meta.vitest
4434
4302
  * import { Iterable } from "effect"
4435
4303
  *
4436
- * // Print each element
4304
+ * // Collect each visited element
4437
4305
  * const numbers = [1, 2, 3, 4, 5]
4438
- * Iterable.forEach(numbers, (n) => console.log(n))
4439
- * // Prints: 1, 2, 3, 4, 5
4306
+ * const visited: Array<number> = []
4307
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4308
+ * visited // => [1, 2, 3, 4, 5]
4440
4309
  *
4441
4310
  * // Use index in the callback
4442
4311
  * const letters = ["a", "b", "c"]
4312
+ * const indexed: Array<string> = []
4443
4313
  * Iterable.forEach(letters, (letter, i) => {
4444
- * console.log(`${i}: ${letter}`)
4314
+ * indexed.push(`${i}: ${letter}`)
4445
4315
  * })
4446
- * // Prints: "0: a", "1: b", "2: c"
4316
+ * indexed // => ["0: a", "1: b", "2: c"]
4447
4317
  *
4448
4318
  * // Side effects with any iterable
4449
4319
  * const results: Array<number> = []
4450
4320
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4451
4321
  * results.push(n * n)
4452
4322
  * })
4453
- * console.log(results) // [1, 4, 9, 16, 25]
4323
+ * results // => [1, 4, 9, 16, 25]
4454
4324
  *
4455
4325
  * // Process in chunks
4456
4326
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4327
+ * const processed: Array<Array<number>> = []
4457
4328
  * Iterable.forEach(data, (chunk) => {
4458
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4329
+ * processed.push(Array.from(chunk))
4459
4330
  * })
4460
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4331
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4461
4332
  * ```
4462
4333
  *
4463
- * @category elements
4334
+ * @category traversing
4464
4335
  * @since 2.0.0
4465
4336
  */
4466
4337
  export const forEach: {
@@ -4469,37 +4340,40 @@ export const forEach: {
4469
4340
  *
4470
4341
  * **Example** (Iterating with side effects)
4471
4342
  *
4472
- * ```ts
4343
+ * ```ts import.meta.vitest
4473
4344
  * import { Iterable } from "effect"
4474
4345
  *
4475
- * // Print each element
4346
+ * // Collect each visited element
4476
4347
  * const numbers = [1, 2, 3, 4, 5]
4477
- * Iterable.forEach(numbers, (n) => console.log(n))
4478
- * // Prints: 1, 2, 3, 4, 5
4348
+ * const visited: Array<number> = []
4349
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4350
+ * visited // => [1, 2, 3, 4, 5]
4479
4351
  *
4480
4352
  * // Use index in the callback
4481
4353
  * const letters = ["a", "b", "c"]
4354
+ * const indexed: Array<string> = []
4482
4355
  * Iterable.forEach(letters, (letter, i) => {
4483
- * console.log(`${i}: ${letter}`)
4356
+ * indexed.push(`${i}: ${letter}`)
4484
4357
  * })
4485
- * // Prints: "0: a", "1: b", "2: c"
4358
+ * indexed // => ["0: a", "1: b", "2: c"]
4486
4359
  *
4487
4360
  * // Side effects with any iterable
4488
4361
  * const results: Array<number> = []
4489
4362
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4490
4363
  * results.push(n * n)
4491
4364
  * })
4492
- * console.log(results) // [1, 4, 9, 16, 25]
4365
+ * results // => [1, 4, 9, 16, 25]
4493
4366
  *
4494
4367
  * // Process in chunks
4495
4368
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4369
+ * const processed: Array<Array<number>> = []
4496
4370
  * Iterable.forEach(data, (chunk) => {
4497
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4371
+ * processed.push(Array.from(chunk))
4498
4372
  * })
4499
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4373
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4500
4374
  * ```
4501
4375
  *
4502
- * @category elements
4376
+ * @category traversing
4503
4377
  * @since 2.0.0
4504
4378
  */
4505
4379
  <A>(f: (a: A, i: number) => void): (self: Iterable<A>) => void
@@ -4508,37 +4382,40 @@ export const forEach: {
4508
4382
  *
4509
4383
  * **Example** (Iterating with side effects)
4510
4384
  *
4511
- * ```ts
4385
+ * ```ts import.meta.vitest
4512
4386
  * import { Iterable } from "effect"
4513
4387
  *
4514
- * // Print each element
4388
+ * // Collect each visited element
4515
4389
  * const numbers = [1, 2, 3, 4, 5]
4516
- * Iterable.forEach(numbers, (n) => console.log(n))
4517
- * // Prints: 1, 2, 3, 4, 5
4390
+ * const visited: Array<number> = []
4391
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4392
+ * visited // => [1, 2, 3, 4, 5]
4518
4393
  *
4519
4394
  * // Use index in the callback
4520
4395
  * const letters = ["a", "b", "c"]
4396
+ * const indexed: Array<string> = []
4521
4397
  * Iterable.forEach(letters, (letter, i) => {
4522
- * console.log(`${i}: ${letter}`)
4398
+ * indexed.push(`${i}: ${letter}`)
4523
4399
  * })
4524
- * // Prints: "0: a", "1: b", "2: c"
4400
+ * indexed // => ["0: a", "1: b", "2: c"]
4525
4401
  *
4526
4402
  * // Side effects with any iterable
4527
4403
  * const results: Array<number> = []
4528
4404
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4529
4405
  * results.push(n * n)
4530
4406
  * })
4531
- * console.log(results) // [1, 4, 9, 16, 25]
4407
+ * results // => [1, 4, 9, 16, 25]
4532
4408
  *
4533
4409
  * // Process in chunks
4534
4410
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4411
+ * const processed: Array<Array<number>> = []
4535
4412
  * Iterable.forEach(data, (chunk) => {
4536
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4413
+ * processed.push(Array.from(chunk))
4537
4414
  * })
4538
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4415
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4539
4416
  * ```
4540
4417
  *
4541
- * @category elements
4418
+ * @category traversing
4542
4419
  * @since 2.0.0
4543
4420
  */
4544
4421
  <A>(self: Iterable<A>, f: (a: A, i: number) => void): void
@@ -4559,18 +4436,17 @@ export const forEach: {
4559
4436
  *
4560
4437
  * **Example** (Reducing an iterable)
4561
4438
  *
4562
- * ```ts
4439
+ * ```ts import.meta.vitest
4563
4440
  * import { Iterable } from "effect"
4564
4441
  *
4565
4442
  * // Sum all numbers
4566
4443
  * const numbers = [1, 2, 3, 4, 5]
4567
4444
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4568
- * console.log(sum) // 15
4445
+ * sum // => 15
4569
4446
  *
4570
4447
  * // Find maximum value
4571
4448
  * const values = [3, 1, 4, 1, 5, 9, 2]
4572
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4573
- * console.log(max) // 9
4449
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4574
4450
  *
4575
4451
  * // Build an object from key-value pairs
4576
4452
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4582,7 +4458,7 @@ export const forEach: {
4582
4458
  * return acc
4583
4459
  * }
4584
4460
  * )
4585
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4461
+ * obj // => { a: 1, b: 2, c: 3 }
4586
4462
  *
4587
4463
  * // Use index in the reducer
4588
4464
  * const letters = ["a", "b", "c"]
@@ -4594,7 +4470,7 @@ export const forEach: {
4594
4470
  * return acc
4595
4471
  * }
4596
4472
  * )
4597
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4473
+ * indexed // => ["0: a", "1: b", "2: c"]
4598
4474
  * ```
4599
4475
  *
4600
4476
  * @category folding
@@ -4611,18 +4487,17 @@ export const reduce: {
4611
4487
  *
4612
4488
  * **Example** (Reducing an iterable)
4613
4489
  *
4614
- * ```ts
4490
+ * ```ts import.meta.vitest
4615
4491
  * import { Iterable } from "effect"
4616
4492
  *
4617
4493
  * // Sum all numbers
4618
4494
  * const numbers = [1, 2, 3, 4, 5]
4619
4495
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4620
- * console.log(sum) // 15
4496
+ * sum // => 15
4621
4497
  *
4622
4498
  * // Find maximum value
4623
4499
  * const values = [3, 1, 4, 1, 5, 9, 2]
4624
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4625
- * console.log(max) // 9
4500
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4626
4501
  *
4627
4502
  * // Build an object from key-value pairs
4628
4503
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4634,7 +4509,7 @@ export const reduce: {
4634
4509
  * return acc
4635
4510
  * }
4636
4511
  * )
4637
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4512
+ * obj // => { a: 1, b: 2, c: 3 }
4638
4513
  *
4639
4514
  * // Use index in the reducer
4640
4515
  * const letters = ["a", "b", "c"]
@@ -4646,7 +4521,7 @@ export const reduce: {
4646
4521
  * return acc
4647
4522
  * }
4648
4523
  * )
4649
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4524
+ * indexed // => ["0: a", "1: b", "2: c"]
4650
4525
  * ```
4651
4526
  *
4652
4527
  * @category folding
@@ -4663,18 +4538,17 @@ export const reduce: {
4663
4538
  *
4664
4539
  * **Example** (Reducing an iterable)
4665
4540
  *
4666
- * ```ts
4541
+ * ```ts import.meta.vitest
4667
4542
  * import { Iterable } from "effect"
4668
4543
  *
4669
4544
  * // Sum all numbers
4670
4545
  * const numbers = [1, 2, 3, 4, 5]
4671
4546
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4672
- * console.log(sum) // 15
4547
+ * sum // => 15
4673
4548
  *
4674
4549
  * // Find maximum value
4675
4550
  * const values = [3, 1, 4, 1, 5, 9, 2]
4676
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4677
- * console.log(max) // 9
4551
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4678
4552
  *
4679
4553
  * // Build an object from key-value pairs
4680
4554
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4686,7 +4560,7 @@ export const reduce: {
4686
4560
  * return acc
4687
4561
  * }
4688
4562
  * )
4689
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4563
+ * obj // => { a: 1, b: 2, c: 3 }
4690
4564
  *
4691
4565
  * // Use index in the reducer
4692
4566
  * const letters = ["a", "b", "c"]
@@ -4698,7 +4572,7 @@ export const reduce: {
4698
4572
  * return acc
4699
4573
  * }
4700
4574
  * )
4701
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4575
+ * indexed // => ["0: a", "1: b", "2: c"]
4702
4576
  * ```
4703
4577
  *
4704
4578
  * @category folding
@@ -4722,20 +4596,20 @@ export const reduce: {
4722
4596
  *
4723
4597
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4724
4598
  *
4725
- * ```ts
4599
+ * ```ts import.meta.vitest
4726
4600
  * import { Iterable } from "effect"
4727
4601
  *
4728
4602
  * // Remove adjacent duplicates with custom equality
4729
4603
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4730
4604
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4731
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4605
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4732
4606
  *
4733
4607
  * // Case-insensitive deduplication
4734
4608
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4735
4609
  * const caseInsensitive = (a: string, b: string) =>
4736
4610
  * a.toLowerCase() === b.toLowerCase()
4737
4611
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4738
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4612
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4739
4613
  *
4740
4614
  * // Deduplication by object property
4741
4615
  * const users = [
@@ -4747,13 +4621,13 @@ export const reduce: {
4747
4621
  * ]
4748
4622
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4749
4623
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4750
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4624
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4751
4625
  *
4752
4626
  * // Approximate numeric equality
4753
4627
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4754
4628
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4755
4629
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4756
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4630
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4757
4631
  * ```
4758
4632
  *
4759
4633
  * @category filtering
@@ -4765,20 +4639,20 @@ export const dedupeAdjacentWith: {
4765
4639
  *
4766
4640
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4767
4641
  *
4768
- * ```ts
4642
+ * ```ts import.meta.vitest
4769
4643
  * import { Iterable } from "effect"
4770
4644
  *
4771
4645
  * // Remove adjacent duplicates with custom equality
4772
4646
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4773
4647
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4774
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4648
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4775
4649
  *
4776
4650
  * // Case-insensitive deduplication
4777
4651
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4778
4652
  * const caseInsensitive = (a: string, b: string) =>
4779
4653
  * a.toLowerCase() === b.toLowerCase()
4780
4654
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4781
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4655
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4782
4656
  *
4783
4657
  * // Deduplication by object property
4784
4658
  * const users = [
@@ -4790,13 +4664,13 @@ export const dedupeAdjacentWith: {
4790
4664
  * ]
4791
4665
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4792
4666
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4793
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4667
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4794
4668
  *
4795
4669
  * // Approximate numeric equality
4796
4670
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4797
4671
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4798
4672
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4799
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4673
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4800
4674
  * ```
4801
4675
  *
4802
4676
  * @category filtering
@@ -4808,20 +4682,20 @@ export const dedupeAdjacentWith: {
4808
4682
  *
4809
4683
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4810
4684
  *
4811
- * ```ts
4685
+ * ```ts import.meta.vitest
4812
4686
  * import { Iterable } from "effect"
4813
4687
  *
4814
4688
  * // Remove adjacent duplicates with custom equality
4815
4689
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4816
4690
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4817
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4691
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4818
4692
  *
4819
4693
  * // Case-insensitive deduplication
4820
4694
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4821
4695
  * const caseInsensitive = (a: string, b: string) =>
4822
4696
  * a.toLowerCase() === b.toLowerCase()
4823
4697
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4824
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4698
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4825
4699
  *
4826
4700
  * // Deduplication by object property
4827
4701
  * const users = [
@@ -4833,13 +4707,13 @@ export const dedupeAdjacentWith: {
4833
4707
  * ]
4834
4708
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4835
4709
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4836
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4710
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4837
4711
  *
4838
4712
  * // Approximate numeric equality
4839
4713
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4840
4714
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4841
4715
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4842
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4716
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4843
4717
  * ```
4844
4718
  *
4845
4719
  * @category filtering
@@ -4877,18 +4751,18 @@ export const dedupeAdjacentWith: {
4877
4751
  *
4878
4752
  * **Example** (Deduplicating adjacent elements)
4879
4753
  *
4880
- * ```ts
4754
+ * ```ts import.meta.vitest
4881
4755
  * import { Iterable } from "effect"
4882
4756
  *
4883
4757
  * // Remove adjacent duplicate numbers
4884
4758
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
4885
4759
  * const deduped = Iterable.dedupeAdjacent(numbers)
4886
- * console.log(Array.from(deduped)) // [1, 2, 3, 1]
4760
+ * Array.from(deduped) // => [1, 2, 3, 1]
4887
4761
  *
4888
4762
  * // Remove adjacent duplicate characters
4889
4763
  * const letters = "aabbccaa"
4890
4764
  * const dedupedLetters = Iterable.dedupeAdjacent(letters)
4891
- * console.log(Array.from(dedupedLetters)) // ["a", "b", "c", "a"]
4765
+ * Array.from(dedupedLetters) // => ["a", "b", "c", "a"]
4892
4766
  *
4893
4767
  * // Works with objects using deep equality
4894
4768
  * const objects = [
@@ -4899,12 +4773,12 @@ export const dedupeAdjacentWith: {
4899
4773
  * { type: "A" }
4900
4774
  * ]
4901
4775
  * const dedupedObjects = Iterable.dedupeAdjacent(objects)
4902
- * console.log(Array.from(dedupedObjects).map((o) => o.type)) // ["A", "B", "A"]
4776
+ * Array.from(dedupedObjects, (object) => object.type) // => ["A", "B", "A"]
4903
4777
  *
4904
4778
  * // Clean up streaming data
4905
4779
  * const sensorData = [100, 100, 100, 101, 101, 102, 102, 102, 100]
4906
4780
  * const cleanedData = Iterable.dedupeAdjacent(sensorData)
4907
- * console.log(Array.from(cleanedData)) // [100, 101, 102, 100]
4781
+ * Array.from(cleanedData) // => [100, 101, 102, 100]
4908
4782
  * ```
4909
4783
  *
4910
4784
  * @category filtering
@@ -4917,14 +4791,14 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4917
4791
  *
4918
4792
  * **Example** (Combining cartesian products)
4919
4793
  *
4920
- * ```ts
4794
+ * ```ts import.meta.vitest
4921
4795
  * import { Iterable } from "effect"
4922
4796
  *
4923
4797
  * // Create coordinate pairs
4924
4798
  * const xs = [1, 2]
4925
4799
  * const ys = ["a", "b", "c"]
4926
4800
  * const coordinates = Iterable.cartesianWith(xs, ys, (x, y) => `(${x},${y})`)
4927
- * console.log(Array.from(coordinates)) // ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4801
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4928
4802
  *
4929
4803
  * // Generate all combinations of options
4930
4804
  * const sizes = ["S", "M", "L"]
@@ -4934,18 +4808,13 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4934
4808
  * colors,
4935
4809
  * (size, color) => ({ size, color })
4936
4810
  * )
4937
- * console.log(Array.from(products))
4938
- * // [
4939
- * // { size: "S", color: "red" }, { size: "S", color: "blue" },
4940
- * // { size: "M", color: "red" }, { size: "M", color: "blue" },
4941
- * // { size: "L", color: "red" }, { size: "L", color: "blue" }
4942
- * // ]
4811
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
4943
4812
  *
4944
4813
  * // Mathematical operations on all pairs
4945
4814
  * const a = [1, 2, 3]
4946
4815
  * const b = [10, 20]
4947
4816
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
4948
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4817
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
4949
4818
  *
4950
4819
  * // Create test data combinations
4951
4820
  * const userTypes = ["admin", "user"]
@@ -4955,11 +4824,10 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4955
4824
  * features,
4956
4825
  * (user, feature) => `${user}_can_${feature}`
4957
4826
  * )
4958
- * console.log(Array.from(testCases))
4959
- * // ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
4827
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
4960
4828
  * ```
4961
4829
  *
4962
- * @category elements
4830
+ * @category combining
4963
4831
  * @since 2.0.0
4964
4832
  */
4965
4833
  export const cartesianWith: {
@@ -4968,14 +4836,14 @@ export const cartesianWith: {
4968
4836
  *
4969
4837
  * **Example** (Combining cartesian products)
4970
4838
  *
4971
- * ```ts
4839
+ * ```ts import.meta.vitest
4972
4840
  * import { Iterable } from "effect"
4973
4841
  *
4974
4842
  * // Create coordinate pairs
4975
4843
  * const xs = [1, 2]
4976
4844
  * const ys = ["a", "b", "c"]
4977
4845
  * const coordinates = Iterable.cartesianWith(xs, ys, (x, y) => `(${x},${y})`)
4978
- * console.log(Array.from(coordinates)) // ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4846
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4979
4847
  *
4980
4848
  * // Generate all combinations of options
4981
4849
  * const sizes = ["S", "M", "L"]
@@ -4985,18 +4853,13 @@ export const cartesianWith: {
4985
4853
  * colors,
4986
4854
  * (size, color) => ({ size, color })
4987
4855
  * )
4988
- * console.log(Array.from(products))
4989
- * // [
4990
- * // { size: "S", color: "red" }, { size: "S", color: "blue" },
4991
- * // { size: "M", color: "red" }, { size: "M", color: "blue" },
4992
- * // { size: "L", color: "red" }, { size: "L", color: "blue" }
4993
- * // ]
4856
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
4994
4857
  *
4995
4858
  * // Mathematical operations on all pairs
4996
4859
  * const a = [1, 2, 3]
4997
4860
  * const b = [10, 20]
4998
4861
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
4999
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4862
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
5000
4863
  *
5001
4864
  * // Create test data combinations
5002
4865
  * const userTypes = ["admin", "user"]
@@ -5006,11 +4869,10 @@ export const cartesianWith: {
5006
4869
  * features,
5007
4870
  * (user, feature) => `${user}_can_${feature}`
5008
4871
  * )
5009
- * console.log(Array.from(testCases))
5010
- * // ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
4872
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
5011
4873
  * ```
5012
4874
  *
5013
- * @category elements
4875
+ * @category combining
5014
4876
  * @since 2.0.0
5015
4877
  */
5016
4878
  <A, B, C>(that: Iterable<B>, f: (a: A, b: B) => C): (self: Iterable<A>) => Iterable<C>
@@ -5019,14 +4881,14 @@ export const cartesianWith: {
5019
4881
  *
5020
4882
  * **Example** (Combining cartesian products)
5021
4883
  *
5022
- * ```ts
4884
+ * ```ts import.meta.vitest
5023
4885
  * import { Iterable } from "effect"
5024
4886
  *
5025
4887
  * // Create coordinate pairs
5026
4888
  * const xs = [1, 2]
5027
4889
  * const ys = ["a", "b", "c"]
5028
4890
  * const coordinates = Iterable.cartesianWith(xs, ys, (x, y) => `(${x},${y})`)
5029
- * console.log(Array.from(coordinates)) // ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4891
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
5030
4892
  *
5031
4893
  * // Generate all combinations of options
5032
4894
  * const sizes = ["S", "M", "L"]
@@ -5036,18 +4898,13 @@ export const cartesianWith: {
5036
4898
  * colors,
5037
4899
  * (size, color) => ({ size, color })
5038
4900
  * )
5039
- * console.log(Array.from(products))
5040
- * // [
5041
- * // { size: "S", color: "red" }, { size: "S", color: "blue" },
5042
- * // { size: "M", color: "red" }, { size: "M", color: "blue" },
5043
- * // { size: "L", color: "red" }, { size: "L", color: "blue" }
5044
- * // ]
4901
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
5045
4902
  *
5046
4903
  * // Mathematical operations on all pairs
5047
4904
  * const a = [1, 2, 3]
5048
4905
  * const b = [10, 20]
5049
4906
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
5050
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4907
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
5051
4908
  *
5052
4909
  * // Create test data combinations
5053
4910
  * const userTypes = ["admin", "user"]
@@ -5057,11 +4914,10 @@ export const cartesianWith: {
5057
4914
  * features,
5058
4915
  * (user, feature) => `${user}_can_${feature}`
5059
4916
  * )
5060
- * console.log(Array.from(testCases))
5061
- * // ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
4917
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
5062
4918
  * ```
5063
4919
  *
5064
- * @category elements
4920
+ * @category combining
5065
4921
  * @since 2.0.0
5066
4922
  */
5067
4923
  <A, B, C>(self: Iterable<A>, that: Iterable<B>, f: (a: A, b: B) => C): Iterable<C>
@@ -5106,40 +4962,34 @@ export const cartesianWith: {
5106
4962
  *
5107
4963
  * **Example** (Generating cartesian pairs)
5108
4964
  *
5109
- * ```ts
4965
+ * ```ts import.meta.vitest
5110
4966
  * import { Iterable } from "effect"
5111
4967
  *
5112
4968
  * // All pairs of numbers and letters
5113
4969
  * const numbers = [1, 2, 3]
5114
4970
  * const letters = ["a", "b"]
5115
4971
  * const pairs = Iterable.cartesian(numbers, letters)
5116
- * console.log(Array.from(pairs))
5117
- * // [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
4972
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5118
4973
  *
5119
4974
  * // Generate coordinate grid
5120
4975
  * const x = [0, 1, 2]
5121
4976
  * const y = [0, 1]
5122
4977
  * const grid = Iterable.cartesian(x, y)
5123
- * console.log(Array.from(grid))
5124
- * // [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
4978
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5125
4979
  *
5126
4980
  * // All combinations for testing
5127
4981
  * const browsers = ["chrome", "firefox"]
5128
4982
  * const devices = ["desktop", "mobile", "tablet"]
5129
4983
  * const testMatrix = Iterable.cartesian(browsers, devices)
5130
- * console.log(Array.from(testMatrix))
5131
- * // [
5132
- * // ["chrome", "desktop"], ["chrome", "mobile"], ["chrome", "tablet"],
5133
- * // ["firefox", "desktop"], ["firefox", "mobile"], ["firefox", "tablet"]
5134
- * // ]
4984
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5135
4985
  *
5136
4986
  * // Empty iterable results in empty cartesian product
5137
4987
  * const empty = Iterable.empty<number>()
5138
4988
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5139
- * console.log(Array.from(withEmpty)) // []
4989
+ * Array.from(withEmpty) // => []
5140
4990
  * ```
5141
4991
  *
5142
- * @category elements
4992
+ * @category combining
5143
4993
  * @since 2.0.0
5144
4994
  */
5145
4995
  export const cartesian: {
@@ -5148,40 +4998,34 @@ export const cartesian: {
5148
4998
  *
5149
4999
  * **Example** (Generating cartesian pairs)
5150
5000
  *
5151
- * ```ts
5001
+ * ```ts import.meta.vitest
5152
5002
  * import { Iterable } from "effect"
5153
5003
  *
5154
5004
  * // All pairs of numbers and letters
5155
5005
  * const numbers = [1, 2, 3]
5156
5006
  * const letters = ["a", "b"]
5157
5007
  * const pairs = Iterable.cartesian(numbers, letters)
5158
- * console.log(Array.from(pairs))
5159
- * // [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5008
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5160
5009
  *
5161
5010
  * // Generate coordinate grid
5162
5011
  * const x = [0, 1, 2]
5163
5012
  * const y = [0, 1]
5164
5013
  * const grid = Iterable.cartesian(x, y)
5165
- * console.log(Array.from(grid))
5166
- * // [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5014
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5167
5015
  *
5168
5016
  * // All combinations for testing
5169
5017
  * const browsers = ["chrome", "firefox"]
5170
5018
  * const devices = ["desktop", "mobile", "tablet"]
5171
5019
  * const testMatrix = Iterable.cartesian(browsers, devices)
5172
- * console.log(Array.from(testMatrix))
5173
- * // [
5174
- * // ["chrome", "desktop"], ["chrome", "mobile"], ["chrome", "tablet"],
5175
- * // ["firefox", "desktop"], ["firefox", "mobile"], ["firefox", "tablet"]
5176
- * // ]
5020
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5177
5021
  *
5178
5022
  * // Empty iterable results in empty cartesian product
5179
5023
  * const empty = Iterable.empty<number>()
5180
5024
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5181
- * console.log(Array.from(withEmpty)) // []
5025
+ * Array.from(withEmpty) // => []
5182
5026
  * ```
5183
5027
  *
5184
- * @category elements
5028
+ * @category combining
5185
5029
  * @since 2.0.0
5186
5030
  */
5187
5031
  <B>(that: Iterable<B>): <A>(self: Iterable<A>) => Iterable<[A, B]>
@@ -5190,40 +5034,34 @@ export const cartesian: {
5190
5034
  *
5191
5035
  * **Example** (Generating cartesian pairs)
5192
5036
  *
5193
- * ```ts
5037
+ * ```ts import.meta.vitest
5194
5038
  * import { Iterable } from "effect"
5195
5039
  *
5196
5040
  * // All pairs of numbers and letters
5197
5041
  * const numbers = [1, 2, 3]
5198
5042
  * const letters = ["a", "b"]
5199
5043
  * const pairs = Iterable.cartesian(numbers, letters)
5200
- * console.log(Array.from(pairs))
5201
- * // [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5044
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5202
5045
  *
5203
5046
  * // Generate coordinate grid
5204
5047
  * const x = [0, 1, 2]
5205
5048
  * const y = [0, 1]
5206
5049
  * const grid = Iterable.cartesian(x, y)
5207
- * console.log(Array.from(grid))
5208
- * // [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5050
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5209
5051
  *
5210
5052
  * // All combinations for testing
5211
5053
  * const browsers = ["chrome", "firefox"]
5212
5054
  * const devices = ["desktop", "mobile", "tablet"]
5213
5055
  * const testMatrix = Iterable.cartesian(browsers, devices)
5214
- * console.log(Array.from(testMatrix))
5215
- * // [
5216
- * // ["chrome", "desktop"], ["chrome", "mobile"], ["chrome", "tablet"],
5217
- * // ["firefox", "desktop"], ["firefox", "mobile"], ["firefox", "tablet"]
5218
- * // ]
5056
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5219
5057
  *
5220
5058
  * // Empty iterable results in empty cartesian product
5221
5059
  * const empty = Iterable.empty<number>()
5222
5060
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5223
- * console.log(Array.from(withEmpty)) // []
5061
+ * Array.from(withEmpty) // => []
5224
5062
  * ```
5225
5063
  *
5226
- * @category elements
5064
+ * @category combining
5227
5065
  * @since 2.0.0
5228
5066
  */
5229
5067
  <A, B>(self: Iterable<A>, that: Iterable<B>): Iterable<[A, B]>
@@ -5237,11 +5075,10 @@ export const cartesian: {
5237
5075
  *
5238
5076
  * **Example** (Counting matching elements)
5239
5077
  *
5240
- * ```ts
5078
+ * ```ts import.meta.vitest
5241
5079
  * import { Iterable } from "effect"
5242
5080
  *
5243
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5244
- * console.log(result) // 2
5081
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5245
5082
  * ```
5246
5083
  *
5247
5084
  * @category folding
@@ -5253,11 +5090,10 @@ export const countBy: {
5253
5090
  *
5254
5091
  * **Example** (Counting matching elements)
5255
5092
  *
5256
- * ```ts
5093
+ * ```ts import.meta.vitest
5257
5094
  * import { Iterable } from "effect"
5258
5095
  *
5259
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5260
- * console.log(result) // 2
5096
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5261
5097
  * ```
5262
5098
  *
5263
5099
  * @category folding
@@ -5269,11 +5105,10 @@ export const countBy: {
5269
5105
  *
5270
5106
  * **Example** (Counting matching elements)
5271
5107
  *
5272
- * ```ts
5108
+ * ```ts import.meta.vitest
5273
5109
  * import { Iterable } from "effect"
5274
5110
  *
5275
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5276
- * console.log(result) // 2
5111
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5277
5112
  * ```
5278
5113
  *
5279
5114
  * @category folding