effect 4.0.0-beta.102 → 4.0.0-beta.103

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 (1451) 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 +166 -101
  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 +729 -768
  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 +336 -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 +115 -80
  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 +151 -274
  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 +9 -10
  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 +132 -186
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2841 -3247
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +1322 -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 +29 -21
  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 +13 -55
  107. package/dist/ExecutionPlan.d.ts.map +1 -1
  108. package/dist/ExecutionPlan.js +7 -28
  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 +85 -59
  129. package/dist/FiberSet.js.map +1 -1
  130. package/dist/FileSystem.d.ts +153 -264
  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 +76 -145
  143. package/dist/Function.d.ts.map +1 -1
  144. package/dist/Function.js +40 -57
  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 +228 -306
  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 +195 -175
  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 +290 -1636
  357. package/dist/Schedule.d.ts.map +1 -1
  358. package/dist/Schedule.js +162 -803
  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 +644 -642
  365. package/dist/Schema.d.ts.map +1 -1
  366. package/dist/Schema.js +491 -527
  367. package/dist/Schema.js.map +1 -1
  368. package/dist/SchemaAST.d.ts +27 -50
  369. package/dist/SchemaAST.d.ts.map +1 -1
  370. package/dist/SchemaAST.js +366 -279
  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 +123 -75
  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.map +1 -1
  401. package/dist/ScopedRef.d.ts +3 -3
  402. package/dist/ScopedRef.js +2 -2
  403. package/dist/ScopedRef.js.map +1 -1
  404. package/dist/Semaphore.d.ts +96 -10
  405. package/dist/Semaphore.d.ts.map +1 -1
  406. package/dist/Semaphore.js +78 -39
  407. package/dist/Semaphore.js.map +1 -1
  408. package/dist/Sink.d.ts +117 -107
  409. package/dist/Sink.d.ts.map +1 -1
  410. package/dist/Sink.js +107 -100
  411. package/dist/Sink.js.map +1 -1
  412. package/dist/Stdio.d.ts +1 -1
  413. package/dist/Stdio.js.map +1 -1
  414. package/dist/Stream.d.ts +2415 -2949
  415. package/dist/Stream.d.ts.map +1 -1
  416. package/dist/Stream.js +1078 -1381
  417. package/dist/Stream.js.map +1 -1
  418. package/dist/String.d.ts +262 -308
  419. package/dist/String.d.ts.map +1 -1
  420. package/dist/String.js +184 -215
  421. package/dist/String.js.map +1 -1
  422. package/dist/Struct.d.ts +109 -114
  423. package/dist/Struct.d.ts.map +1 -1
  424. package/dist/Struct.js +41 -50
  425. package/dist/Struct.js.map +1 -1
  426. package/dist/SubscriptionRef.d.ts +282 -250
  427. package/dist/SubscriptionRef.d.ts.map +1 -1
  428. package/dist/SubscriptionRef.js +104 -92
  429. package/dist/SubscriptionRef.js.map +1 -1
  430. package/dist/Symbol.d.ts +3 -3
  431. package/dist/Symbol.js +3 -3
  432. package/dist/Symbol.js.map +1 -1
  433. package/dist/SynchronizedRef.js.map +1 -1
  434. package/dist/Take.js.map +1 -1
  435. package/dist/Terminal.d.ts +2 -2
  436. package/dist/Terminal.js +1 -1
  437. package/dist/Terminal.js.map +1 -1
  438. package/dist/Tracer.d.ts +100 -54
  439. package/dist/Tracer.d.ts.map +1 -1
  440. package/dist/Tracer.js +41 -24
  441. package/dist/Tracer.js.map +1 -1
  442. package/dist/Trie.d.ts +287 -679
  443. package/dist/Trie.d.ts.map +1 -1
  444. package/dist/Trie.js +109 -251
  445. package/dist/Trie.js.map +1 -1
  446. package/dist/Tuple.d.ts +92 -127
  447. package/dist/Tuple.d.ts.map +1 -1
  448. package/dist/Tuple.js +42 -57
  449. package/dist/Tuple.js.map +1 -1
  450. package/dist/TxChunk.d.ts +201 -121
  451. package/dist/TxChunk.d.ts.map +1 -1
  452. package/dist/TxChunk.js +85 -56
  453. package/dist/TxChunk.js.map +1 -1
  454. package/dist/TxDeferred.d.ts +62 -46
  455. package/dist/TxDeferred.d.ts.map +1 -1
  456. package/dist/TxDeferred.js +30 -22
  457. package/dist/TxDeferred.js.map +1 -1
  458. package/dist/TxHashMap.d.ts +631 -779
  459. package/dist/TxHashMap.d.ts.map +1 -1
  460. package/dist/TxHashMap.js +268 -330
  461. package/dist/TxHashMap.js.map +1 -1
  462. package/dist/TxHashSet.d.ts +297 -236
  463. package/dist/TxHashSet.d.ts.map +1 -1
  464. package/dist/TxHashSet.js +130 -100
  465. package/dist/TxHashSet.js.map +1 -1
  466. package/dist/TxPriorityQueue.d.ts +126 -95
  467. package/dist/TxPriorityQueue.d.ts.map +1 -1
  468. package/dist/TxPriorityQueue.js +74 -56
  469. package/dist/TxPriorityQueue.js.map +1 -1
  470. package/dist/TxPubSub.d.ts +101 -88
  471. package/dist/TxPubSub.d.ts.map +1 -1
  472. package/dist/TxPubSub.js +87 -66
  473. package/dist/TxPubSub.js.map +1 -1
  474. package/dist/TxQueue.d.ts +200 -180
  475. package/dist/TxQueue.d.ts.map +1 -1
  476. package/dist/TxQueue.js +160 -136
  477. package/dist/TxQueue.js.map +1 -1
  478. package/dist/TxReentrantLock.d.ts +97 -66
  479. package/dist/TxReentrantLock.d.ts.map +1 -1
  480. package/dist/TxReentrantLock.js +67 -45
  481. package/dist/TxReentrantLock.js.map +1 -1
  482. package/dist/TxRef.d.ts +51 -32
  483. package/dist/TxRef.d.ts.map +1 -1
  484. package/dist/TxRef.js +23 -15
  485. package/dist/TxRef.js.map +1 -1
  486. package/dist/TxSemaphore.d.ts +129 -95
  487. package/dist/TxSemaphore.d.ts.map +1 -1
  488. package/dist/TxSemaphore.js +85 -70
  489. package/dist/TxSemaphore.js.map +1 -1
  490. package/dist/TxSubscriptionRef.d.ts +97 -70
  491. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  492. package/dist/TxSubscriptionRef.js +44 -34
  493. package/dist/TxSubscriptionRef.js.map +1 -1
  494. package/dist/Types.d.ts +126 -67
  495. package/dist/Types.d.ts.map +1 -1
  496. package/dist/UndefinedOr.js.map +1 -1
  497. package/dist/Unify.d.ts +45 -65
  498. package/dist/Unify.d.ts.map +1 -1
  499. package/dist/Unify.js +6 -9
  500. package/dist/Unify.js.map +1 -1
  501. package/dist/Utils.d.ts +23 -16
  502. package/dist/Utils.d.ts.map +1 -1
  503. package/dist/Utils.js +3 -7
  504. package/dist/Utils.js.map +1 -1
  505. package/dist/index.js.map +1 -1
  506. package/dist/internal/array.js.map +1 -1
  507. package/dist/internal/core.js +1 -1
  508. package/dist/internal/core.js.map +1 -1
  509. package/dist/internal/dateTime.js +4 -0
  510. package/dist/internal/dateTime.js.map +1 -1
  511. package/dist/internal/doNotation.js.map +1 -1
  512. package/dist/internal/effect.js +77 -40
  513. package/dist/internal/effect.js.map +1 -1
  514. package/dist/internal/equal.js.map +1 -1
  515. package/dist/internal/errors.js.map +1 -1
  516. package/dist/internal/executionPlan.js.map +1 -1
  517. package/dist/internal/hashMap.js.map +1 -1
  518. package/dist/internal/hashSet.js.map +1 -1
  519. package/dist/internal/layer.js.map +1 -1
  520. package/dist/internal/matcher.js.map +1 -1
  521. package/dist/internal/metric.js.map +1 -1
  522. package/dist/internal/option.js.map +1 -1
  523. package/dist/internal/persistence.d.ts +2 -0
  524. package/dist/internal/persistence.d.ts.map +1 -0
  525. package/dist/internal/persistence.js +3 -0
  526. package/dist/internal/persistence.js.map +1 -0
  527. package/dist/internal/random.js.map +1 -1
  528. package/dist/internal/rcRef.js.map +1 -1
  529. package/dist/internal/record.js.map +1 -1
  530. package/dist/internal/redacted.js.map +1 -1
  531. package/dist/internal/references.js +3 -0
  532. package/dist/internal/references.js.map +1 -1
  533. package/dist/internal/request.js.map +1 -1
  534. package/dist/internal/result.js.map +1 -1
  535. package/dist/internal/schedule.js.map +1 -1
  536. package/dist/internal/schema/annotations.js.map +1 -1
  537. package/dist/internal/schema/cause.js.map +1 -1
  538. package/dist/internal/schema/fromJsonSchemaDocument.js +13 -11
  539. package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
  540. package/dist/internal/schema/fromRepresentation.js +8 -15
  541. package/dist/internal/schema/fromRepresentation.js.map +1 -1
  542. package/dist/internal/schema/parser.d.ts +14 -0
  543. package/dist/internal/schema/parser.d.ts.map +1 -0
  544. package/dist/internal/schema/parser.js +13 -0
  545. package/dist/internal/schema/parser.js.map +1 -0
  546. package/dist/internal/schema/schema.js.map +1 -1
  547. package/dist/internal/schema/toArbitrary.js.map +1 -1
  548. package/dist/internal/schema/toCodeDocument.js.map +1 -1
  549. package/dist/internal/schema/toEquivalence.js.map +1 -1
  550. package/dist/internal/schema/toJsonSchemaDocument.js +48 -6
  551. package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
  552. package/dist/internal/schema/toRepresentation.js +87 -107
  553. package/dist/internal/schema/toRepresentation.js.map +1 -1
  554. package/dist/internal/stackTraceLimit.js.map +1 -1
  555. package/dist/internal/stream.js.map +1 -1
  556. package/dist/internal/tracer.js.map +1 -1
  557. package/dist/internal/trie.js +13 -9
  558. package/dist/internal/trie.js.map +1 -1
  559. package/dist/testing/FastCheck.d.ts +8 -7
  560. package/dist/testing/FastCheck.d.ts.map +1 -1
  561. package/dist/testing/FastCheck.js +8 -7
  562. package/dist/testing/FastCheck.js.map +1 -1
  563. package/dist/testing/TestClock.d.ts +57 -28
  564. package/dist/testing/TestClock.d.ts.map +1 -1
  565. package/dist/testing/TestClock.js +50 -18
  566. package/dist/testing/TestClock.js.map +1 -1
  567. package/dist/testing/TestConsole.d.ts +32 -31
  568. package/dist/testing/TestConsole.d.ts.map +1 -1
  569. package/dist/testing/TestConsole.js +24 -22
  570. package/dist/testing/TestConsole.js.map +1 -1
  571. package/dist/testing/TestSchema.d.ts +29 -29
  572. package/dist/testing/TestSchema.js +25 -25
  573. package/dist/testing/TestSchema.js.map +1 -1
  574. package/dist/testing/index.js.map +1 -1
  575. package/dist/unstable/ai/AiError.d.ts +95 -118
  576. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  577. package/dist/unstable/ai/AiError.js +94 -117
  578. package/dist/unstable/ai/AiError.js.map +1 -1
  579. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  580. package/dist/unstable/ai/AnthropicStructuredOutput.js +1 -1
  581. package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
  582. package/dist/unstable/ai/Chat.d.ts +132 -97
  583. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  584. package/dist/unstable/ai/Chat.js +55 -51
  585. package/dist/unstable/ai/Chat.js.map +1 -1
  586. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  587. package/dist/unstable/ai/IdGenerator.d.ts +32 -28
  588. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  589. package/dist/unstable/ai/IdGenerator.js +26 -21
  590. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  591. package/dist/unstable/ai/LanguageModel.d.ts +107 -67
  592. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  593. package/dist/unstable/ai/LanguageModel.js +104 -64
  594. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  595. package/dist/unstable/ai/McpProtocol.d.ts +30 -0
  596. package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
  597. package/dist/unstable/ai/McpProtocol.js +20 -0
  598. package/dist/unstable/ai/McpProtocol.js.map +1 -0
  599. package/dist/unstable/ai/McpSchema.d.ts +141 -75
  600. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  601. package/dist/unstable/ai/McpSchema.js +58 -50
  602. package/dist/unstable/ai/McpSchema.js.map +1 -1
  603. package/dist/unstable/ai/McpServer.d.ts +68 -59
  604. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  605. package/dist/unstable/ai/McpServer.js +694 -241
  606. package/dist/unstable/ai/McpServer.js.map +1 -1
  607. package/dist/unstable/ai/Model.d.ts +8 -19
  608. package/dist/unstable/ai/Model.d.ts.map +1 -1
  609. package/dist/unstable/ai/Model.js +9 -20
  610. package/dist/unstable/ai/Model.js.map +1 -1
  611. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  612. package/dist/unstable/ai/OpenAiStructuredOutput.js +1 -1
  613. package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
  614. package/dist/unstable/ai/Prompt.d.ts +112 -38
  615. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  616. package/dist/unstable/ai/Prompt.js +53 -17
  617. package/dist/unstable/ai/Prompt.js.map +1 -1
  618. package/dist/unstable/ai/Response.d.ts +28 -14
  619. package/dist/unstable/ai/Response.d.ts.map +1 -1
  620. package/dist/unstable/ai/Response.js +9 -4
  621. package/dist/unstable/ai/Response.js.map +1 -1
  622. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  623. package/dist/unstable/ai/Telemetry.d.ts +46 -13
  624. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  625. package/dist/unstable/ai/Telemetry.js +18 -7
  626. package/dist/unstable/ai/Telemetry.js.map +1 -1
  627. package/dist/unstable/ai/Tokenizer.d.ts +14 -3
  628. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  629. package/dist/unstable/ai/Tokenizer.js +10 -2
  630. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  631. package/dist/unstable/ai/Tool.d.ts +59 -44
  632. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  633. package/dist/unstable/ai/Tool.js +48 -39
  634. package/dist/unstable/ai/Tool.js.map +1 -1
  635. package/dist/unstable/ai/Toolkit.d.ts +26 -8
  636. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  637. package/dist/unstable/ai/Toolkit.js +18 -4
  638. package/dist/unstable/ai/Toolkit.js.map +1 -1
  639. package/dist/unstable/ai/index.d.ts +4 -0
  640. package/dist/unstable/ai/index.d.ts.map +1 -1
  641. package/dist/unstable/ai/index.js +4 -0
  642. package/dist/unstable/ai/index.js.map +1 -1
  643. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  644. package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
  645. package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
  646. package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
  647. package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
  648. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
  649. package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
  650. package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
  651. package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
  652. package/dist/unstable/ai/internal/structured-output.js +14 -15
  653. package/dist/unstable/ai/internal/structured-output.js.map +1 -1
  654. package/dist/unstable/cli/Argument.d.ts +273 -69
  655. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  656. package/dist/unstable/cli/Argument.js +111 -33
  657. package/dist/unstable/cli/Argument.js.map +1 -1
  658. package/dist/unstable/cli/CliConfig.js.map +1 -1
  659. package/dist/unstable/cli/CliError.d.ts +69 -76
  660. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  661. package/dist/unstable/cli/CliError.js +57 -61
  662. package/dist/unstable/cli/CliError.js.map +1 -1
  663. package/dist/unstable/cli/CliOutput.d.ts +35 -54
  664. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  665. package/dist/unstable/cli/CliOutput.js +26 -42
  666. package/dist/unstable/cli/CliOutput.js.map +1 -1
  667. package/dist/unstable/cli/Command.d.ts +705 -107
  668. package/dist/unstable/cli/Command.d.ts.map +1 -1
  669. package/dist/unstable/cli/Command.js +238 -42
  670. package/dist/unstable/cli/Command.js.map +1 -1
  671. package/dist/unstable/cli/Completions.js.map +1 -1
  672. package/dist/unstable/cli/Flag.d.ts +418 -138
  673. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  674. package/dist/unstable/cli/Flag.js +197 -71
  675. package/dist/unstable/cli/Flag.js.map +1 -1
  676. package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
  677. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  678. package/dist/unstable/cli/HelpDoc.d.ts +12 -4
  679. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  680. package/dist/unstable/cli/Param.d.ts +292 -78
  681. package/dist/unstable/cli/Param.d.ts.map +1 -1
  682. package/dist/unstable/cli/Param.js +128 -46
  683. package/dist/unstable/cli/Param.js.map +1 -1
  684. package/dist/unstable/cli/Primitive.d.ts +370 -149
  685. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  686. package/dist/unstable/cli/Primitive.js +344 -136
  687. package/dist/unstable/cli/Primitive.js.map +1 -1
  688. package/dist/unstable/cli/Prompt.d.ts +23 -14
  689. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  690. package/dist/unstable/cli/Prompt.js +23 -14
  691. package/dist/unstable/cli/Prompt.js.map +1 -1
  692. package/dist/unstable/cli/index.js.map +1 -1
  693. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  694. package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
  695. package/dist/unstable/cli/internal/command.js.map +1 -1
  696. package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
  697. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  698. package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
  699. package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
  700. package/dist/unstable/cli/internal/config.js.map +1 -1
  701. package/dist/unstable/cli/internal/help.js.map +1 -1
  702. package/dist/unstable/cli/internal/lexer.js +17 -7
  703. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  704. package/dist/unstable/cli/internal/parser.js +2 -2
  705. package/dist/unstable/cli/internal/parser.js.map +1 -1
  706. package/dist/unstable/cli/internal/wizard.js.map +1 -1
  707. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  708. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  709. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  710. package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
  711. package/dist/unstable/cluster/ClusterSchema.js +8 -8
  712. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  713. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  714. package/dist/unstable/cluster/ClusterWorkflowEngine.js +5 -1
  715. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  716. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  717. package/dist/unstable/cluster/Entity.d.ts +10 -10
  718. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  719. package/dist/unstable/cluster/Entity.js +8 -8
  720. package/dist/unstable/cluster/Entity.js.map +1 -1
  721. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  722. package/dist/unstable/cluster/EntityId.js.map +1 -1
  723. package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
  724. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  725. package/dist/unstable/cluster/EntityProxy.js +4 -2
  726. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  727. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  728. package/dist/unstable/cluster/EntityResource.d.ts +2 -2
  729. package/dist/unstable/cluster/EntityResource.js +2 -2
  730. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  731. package/dist/unstable/cluster/EntityType.js.map +1 -1
  732. package/dist/unstable/cluster/Envelope.d.ts +3 -3
  733. package/dist/unstable/cluster/Envelope.js +3 -3
  734. package/dist/unstable/cluster/Envelope.js.map +1 -1
  735. package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
  736. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  737. package/dist/unstable/cluster/HttpRunner.js +6 -4
  738. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  739. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  740. package/dist/unstable/cluster/MachineId.js.map +1 -1
  741. package/dist/unstable/cluster/Message.d.ts +9 -9
  742. package/dist/unstable/cluster/Message.js +6 -6
  743. package/dist/unstable/cluster/Message.js.map +1 -1
  744. package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
  745. package/dist/unstable/cluster/MessageStorage.js +5 -5
  746. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  747. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  748. package/dist/unstable/cluster/Reply.js +4 -4
  749. package/dist/unstable/cluster/Reply.js.map +1 -1
  750. package/dist/unstable/cluster/Runner.js.map +1 -1
  751. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  752. package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
  753. package/dist/unstable/cluster/RunnerHealth.js +1 -1
  754. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  755. package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
  756. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  757. package/dist/unstable/cluster/RunnerServer.js +16 -16
  758. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  759. package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
  760. package/dist/unstable/cluster/RunnerStorage.js +1 -1
  761. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  762. package/dist/unstable/cluster/Runners.d.ts +6 -6
  763. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  764. package/dist/unstable/cluster/Runners.js +19 -10
  765. package/dist/unstable/cluster/Runners.js.map +1 -1
  766. package/dist/unstable/cluster/ShardId.js.map +1 -1
  767. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  768. package/dist/unstable/cluster/Sharding.js +3 -2
  769. package/dist/unstable/cluster/Sharding.js.map +1 -1
  770. package/dist/unstable/cluster/ShardingConfig.d.ts +3 -3
  771. package/dist/unstable/cluster/ShardingConfig.js +3 -3
  772. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  773. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  774. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  775. package/dist/unstable/cluster/Singleton.js.map +1 -1
  776. package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
  777. package/dist/unstable/cluster/SingletonAddress.js +1 -1
  778. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  779. package/dist/unstable/cluster/Snowflake.d.ts +8 -8
  780. package/dist/unstable/cluster/Snowflake.js +8 -8
  781. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  782. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  783. package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
  784. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  785. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  786. package/dist/unstable/cluster/SqlRunnerStorage.js +20 -5
  787. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  788. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  789. package/dist/unstable/cluster/index.js.map +1 -1
  790. package/dist/unstable/cluster/internal/entityManager.js +5 -5
  791. package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
  792. package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
  793. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  794. package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
  795. package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
  796. package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
  797. package/dist/unstable/cluster/internal/shardLock.js.map +1 -1
  798. package/dist/unstable/devtools/DevTools.js.map +1 -1
  799. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  800. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  801. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  802. package/dist/unstable/devtools/index.js.map +1 -1
  803. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  804. package/dist/unstable/encoding/Msgpack.js +6 -8
  805. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  806. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  807. package/dist/unstable/encoding/Sse.d.ts +72 -8
  808. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  809. package/dist/unstable/encoding/Sse.js +58 -8
  810. package/dist/unstable/encoding/Sse.js.map +1 -1
  811. package/dist/unstable/encoding/index.js.map +1 -1
  812. package/dist/unstable/eventlog/Event.d.ts +20 -20
  813. package/dist/unstable/eventlog/Event.js.map +1 -1
  814. package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
  815. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  816. package/dist/unstable/eventlog/EventJournal.d.ts +15 -15
  817. package/dist/unstable/eventlog/EventJournal.js +13 -13
  818. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  819. package/dist/unstable/eventlog/EventLog.d.ts +3 -3
  820. package/dist/unstable/eventlog/EventLog.js +3 -3
  821. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  822. package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
  823. package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
  824. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  825. package/dist/unstable/eventlog/EventLogMessage.d.ts +2 -2
  826. package/dist/unstable/eventlog/EventLogMessage.js +1 -1
  827. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  828. package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
  829. package/dist/unstable/eventlog/EventLogRemote.js +1 -1
  830. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  831. package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
  832. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  833. package/dist/unstable/eventlog/EventLogServer.js +45 -21
  834. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  835. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
  836. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  837. package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
  838. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  839. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
  840. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  841. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +14 -6
  842. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  843. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
  844. package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
  845. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  846. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  847. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  848. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  849. package/dist/unstable/eventlog/index.js.map +1 -1
  850. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
  851. package/dist/unstable/http/Cookies.d.ts +2 -2
  852. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  853. package/dist/unstable/http/Cookies.js +30 -18
  854. package/dist/unstable/http/Cookies.js.map +1 -1
  855. package/dist/unstable/http/Etag.d.ts +1 -1
  856. package/dist/unstable/http/Etag.js +1 -1
  857. package/dist/unstable/http/Etag.js.map +1 -1
  858. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  859. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  860. package/dist/unstable/http/Headers.d.ts +2 -2
  861. package/dist/unstable/http/Headers.js +2 -2
  862. package/dist/unstable/http/Headers.js.map +1 -1
  863. package/dist/unstable/http/HttpBody.d.ts +5 -3
  864. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  865. package/dist/unstable/http/HttpBody.js +11 -5
  866. package/dist/unstable/http/HttpBody.js.map +1 -1
  867. package/dist/unstable/http/HttpClient.d.ts +51 -44
  868. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  869. package/dist/unstable/http/HttpClient.js +46 -17
  870. package/dist/unstable/http/HttpClient.js.map +1 -1
  871. package/dist/unstable/http/HttpClientError.js.map +1 -1
  872. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  873. package/dist/unstable/http/HttpClientRequest.js +2 -0
  874. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  875. package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
  876. package/dist/unstable/http/HttpClientResponse.js +2 -2
  877. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  878. package/dist/unstable/http/HttpEffect.d.ts +6 -6
  879. package/dist/unstable/http/HttpEffect.js +3 -3
  880. package/dist/unstable/http/HttpEffect.js.map +1 -1
  881. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  882. package/dist/unstable/http/HttpMethod.d.ts +6 -9
  883. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  884. package/dist/unstable/http/HttpMethod.js +6 -9
  885. package/dist/unstable/http/HttpMethod.js.map +1 -1
  886. package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
  887. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  888. package/dist/unstable/http/HttpMiddleware.js +164 -39
  889. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  890. package/dist/unstable/http/HttpPlatform.d.ts +76 -0
  891. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  892. package/dist/unstable/http/HttpPlatform.js +32 -0
  893. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  894. package/dist/unstable/http/HttpRouter.d.ts +88 -89
  895. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  896. package/dist/unstable/http/HttpRouter.js +78 -79
  897. package/dist/unstable/http/HttpRouter.js.map +1 -1
  898. package/dist/unstable/http/HttpServer.d.ts +13 -13
  899. package/dist/unstable/http/HttpServer.js +6 -6
  900. package/dist/unstable/http/HttpServer.js.map +1 -1
  901. package/dist/unstable/http/HttpServerError.d.ts +2 -2
  902. package/dist/unstable/http/HttpServerError.js +2 -2
  903. package/dist/unstable/http/HttpServerError.js.map +1 -1
  904. package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
  905. package/dist/unstable/http/HttpServerRequest.js +4 -4
  906. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  907. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  908. package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
  909. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  910. package/dist/unstable/http/HttpServerResponse.js +10 -0
  911. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  912. package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
  913. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  914. package/dist/unstable/http/HttpStaticServer.js +35 -7
  915. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  916. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  917. package/dist/unstable/http/Multipart.d.ts +6 -6
  918. package/dist/unstable/http/Multipart.js +5 -5
  919. package/dist/unstable/http/Multipart.js.map +1 -1
  920. package/dist/unstable/http/Template.js.map +1 -1
  921. package/dist/unstable/http/Url.d.ts +33 -63
  922. package/dist/unstable/http/Url.d.ts.map +1 -1
  923. package/dist/unstable/http/Url.js +14 -28
  924. package/dist/unstable/http/Url.js.map +1 -1
  925. package/dist/unstable/http/UrlParams.d.ts +10 -18
  926. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  927. package/dist/unstable/http/UrlParams.js +9 -17
  928. package/dist/unstable/http/UrlParams.js.map +1 -1
  929. package/dist/unstable/http/index.js.map +1 -1
  930. package/dist/unstable/http/internal/compression.d.ts +2 -0
  931. package/dist/unstable/http/internal/compression.d.ts.map +1 -0
  932. package/dist/unstable/http/internal/compression.js +155 -0
  933. package/dist/unstable/http/internal/compression.js.map +1 -0
  934. package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
  935. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  936. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
  937. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  938. package/dist/unstable/httpapi/HttpApiBuilder.js +10 -11
  939. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  940. package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
  941. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  942. package/dist/unstable/httpapi/HttpApiClient.js +11 -13
  943. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  944. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
  945. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  946. package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
  947. package/dist/unstable/httpapi/HttpApiError.js +13 -13
  948. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  949. package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
  950. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  951. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
  952. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  953. package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
  954. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  955. package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
  956. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  957. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  958. package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -6
  959. package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
  960. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  961. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  962. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  963. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  964. package/dist/unstable/httpapi/OpenApi.d.ts +13 -13
  965. package/dist/unstable/httpapi/OpenApi.js +13 -13
  966. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  967. package/dist/unstable/httpapi/index.js.map +1 -1
  968. package/dist/unstable/httpapi/internal/html.js.map +1 -1
  969. package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
  970. package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
  971. package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
  972. package/dist/unstable/observability/Otlp.js.map +1 -1
  973. package/dist/unstable/observability/OtlpExporter.d.ts +12 -14
  974. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  975. package/dist/unstable/observability/OtlpExporter.js +17 -4
  976. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  977. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  978. package/dist/unstable/observability/OtlpMetrics.d.ts +4 -1
  979. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  980. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  981. package/dist/unstable/observability/OtlpResource.d.ts +16 -7
  982. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  983. package/dist/unstable/observability/OtlpResource.js +21 -12
  984. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  985. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  986. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  987. package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
  988. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  989. package/dist/unstable/observability/PrometheusMetrics.js +10 -3
  990. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  991. package/dist/unstable/observability/index.js.map +1 -1
  992. package/dist/unstable/observability/internal/otlpEnv.js +1 -1
  993. package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
  994. package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
  995. package/dist/unstable/observability/internal/protobuf.js +3 -0
  996. package/dist/unstable/observability/internal/protobuf.js.map +1 -1
  997. package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
  998. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  999. package/dist/unstable/persistence/KeyValueStore.js +22 -13
  1000. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1001. package/dist/unstable/persistence/Persistable.d.ts +8 -8
  1002. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1003. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1004. package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
  1005. package/dist/unstable/persistence/PersistedQueue.js +6 -6
  1006. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1007. package/dist/unstable/persistence/Persistence.d.ts +3 -3
  1008. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1009. package/dist/unstable/persistence/Persistence.js +91 -15
  1010. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1011. package/dist/unstable/persistence/RateLimiter.d.ts +26 -15
  1012. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1013. package/dist/unstable/persistence/RateLimiter.js +24 -13
  1014. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1015. package/dist/unstable/persistence/Redis.d.ts +2 -2
  1016. package/dist/unstable/persistence/Redis.js +1 -1
  1017. package/dist/unstable/persistence/Redis.js.map +1 -1
  1018. package/dist/unstable/persistence/index.js.map +1 -1
  1019. package/dist/unstable/process/ChildProcess.d.ts +64 -21
  1020. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1021. package/dist/unstable/process/ChildProcess.js +14 -5
  1022. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1023. package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
  1024. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1025. package/dist/unstable/process/ChildProcessSpawner.js +1 -1
  1026. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1027. package/dist/unstable/process/index.js.map +1 -1
  1028. package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
  1029. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1030. package/dist/unstable/reactivity/AsyncResult.js +10 -10
  1031. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1032. package/dist/unstable/reactivity/Atom.d.ts +25 -22
  1033. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1034. package/dist/unstable/reactivity/Atom.js +14 -13
  1035. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1036. package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
  1037. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1038. package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
  1039. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1040. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1041. package/dist/unstable/reactivity/AtomRegistry.js +24 -3
  1042. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1043. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
  1044. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1045. package/dist/unstable/reactivity/AtomRpc.js +4 -1
  1046. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1047. package/dist/unstable/reactivity/Hydration.d.ts +1 -1
  1048. package/dist/unstable/reactivity/Hydration.js +1 -1
  1049. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1050. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1051. package/dist/unstable/reactivity/index.js.map +1 -1
  1052. package/dist/unstable/rpc/Rpc.d.ts +35 -33
  1053. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1054. package/dist/unstable/rpc/Rpc.js +4 -2
  1055. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1056. package/dist/unstable/rpc/RpcClient.d.ts +12 -12
  1057. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1058. package/dist/unstable/rpc/RpcClient.js +12 -11
  1059. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1060. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1061. package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
  1062. package/dist/unstable/rpc/RpcGroup.js +1 -1
  1063. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1064. package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
  1065. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1066. package/dist/unstable/rpc/RpcMessage.js +6 -6
  1067. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1068. package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
  1069. package/dist/unstable/rpc/RpcMiddleware.js +1 -1
  1070. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1071. package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
  1072. package/dist/unstable/rpc/RpcSchema.js +3 -3
  1073. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1074. package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
  1075. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1076. package/dist/unstable/rpc/RpcSerialization.js +175 -96
  1077. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1078. package/dist/unstable/rpc/RpcServer.d.ts +13 -13
  1079. package/dist/unstable/rpc/RpcServer.js +17 -13
  1080. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1081. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1082. package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
  1083. package/dist/unstable/rpc/RpcWorker.js +4 -4
  1084. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1085. package/dist/unstable/rpc/Utils.js.map +1 -1
  1086. package/dist/unstable/rpc/index.js.map +1 -1
  1087. package/dist/unstable/schema/Model.d.ts +52 -50
  1088. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1089. package/dist/unstable/schema/Model.js +35 -33
  1090. package/dist/unstable/schema/Model.js.map +1 -1
  1091. package/dist/unstable/schema/VariantSchema.d.ts +5 -5
  1092. package/dist/unstable/schema/VariantSchema.js +2 -2
  1093. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1094. package/dist/unstable/schema/index.js.map +1 -1
  1095. package/dist/unstable/socket/Socket.d.ts +11 -3
  1096. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1097. package/dist/unstable/socket/Socket.js +9 -4
  1098. package/dist/unstable/socket/Socket.js.map +1 -1
  1099. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1100. package/dist/unstable/socket/index.js.map +1 -1
  1101. package/dist/unstable/sql/Migrator.js.map +1 -1
  1102. package/dist/unstable/sql/SqlClient.d.ts +1 -1
  1103. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1104. package/dist/unstable/sql/SqlClient.js +2 -2
  1105. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1106. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1107. package/dist/unstable/sql/SqlError.js.map +1 -1
  1108. package/dist/unstable/sql/SqlModel.d.ts +2 -2
  1109. package/dist/unstable/sql/SqlModel.js +2 -2
  1110. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1111. package/dist/unstable/sql/SqlResolver.d.ts +5 -5
  1112. package/dist/unstable/sql/SqlResolver.js +2 -2
  1113. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1114. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1115. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1116. package/dist/unstable/sql/Statement.d.ts +6 -6
  1117. package/dist/unstable/sql/Statement.js +15 -15
  1118. package/dist/unstable/sql/Statement.js.map +1 -1
  1119. package/dist/unstable/sql/index.js.map +1 -1
  1120. package/dist/unstable/workers/Transferable.d.ts +1 -1
  1121. package/dist/unstable/workers/Transferable.js +1 -1
  1122. package/dist/unstable/workers/Transferable.js.map +1 -1
  1123. package/dist/unstable/workers/Worker.d.ts +2 -2
  1124. package/dist/unstable/workers/Worker.js +2 -2
  1125. package/dist/unstable/workers/Worker.js.map +1 -1
  1126. package/dist/unstable/workers/WorkerError.d.ts +7 -7
  1127. package/dist/unstable/workers/WorkerError.js +6 -6
  1128. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1129. package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
  1130. package/dist/unstable/workers/WorkerRunner.js +1 -1
  1131. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1132. package/dist/unstable/workers/index.js.map +1 -1
  1133. package/dist/unstable/workflow/Activity.d.ts +2 -2
  1134. package/dist/unstable/workflow/Activity.js +2 -2
  1135. package/dist/unstable/workflow/Activity.js.map +1 -1
  1136. package/dist/unstable/workflow/DurableClock.d.ts +1 -1
  1137. package/dist/unstable/workflow/DurableClock.js +1 -1
  1138. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1139. package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
  1140. package/dist/unstable/workflow/DurableDeferred.js +5 -5
  1141. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1142. package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
  1143. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1144. package/dist/unstable/workflow/DurableQueue.js +22 -20
  1145. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1146. package/dist/unstable/workflow/Workflow.d.ts +21 -21
  1147. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1148. package/dist/unstable/workflow/Workflow.js +13 -14
  1149. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1150. package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
  1151. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1152. package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
  1153. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1154. package/dist/unstable/workflow/WorkflowProxy.js +4 -2
  1155. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1156. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1157. package/dist/unstable/workflow/index.js.map +1 -1
  1158. package/dist/unstable/workflow/internal/crypto.js.map +1 -1
  1159. package/package.json +5 -6
  1160. package/src/Array.ts +982 -1045
  1161. package/src/BigDecimal.ts +433 -756
  1162. package/src/BigInt.ts +213 -269
  1163. package/src/Boolean.ts +146 -188
  1164. package/src/Cache.ts +409 -255
  1165. package/src/Cause.ts +167 -277
  1166. package/src/Channel.ts +891 -816
  1167. package/src/ChannelSchema.ts +1 -1
  1168. package/src/Chunk.ts +841 -1181
  1169. package/src/Clock.ts +181 -49
  1170. package/src/Combiner.ts +20 -33
  1171. package/src/Config.ts +615 -332
  1172. package/src/ConfigProvider.ts +214 -120
  1173. package/src/Console.ts +289 -39
  1174. package/src/Context.ts +319 -378
  1175. package/src/Cron.ts +68 -77
  1176. package/src/Crypto.ts +13 -15
  1177. package/src/Data.ts +60 -80
  1178. package/src/DateTime.ts +564 -660
  1179. package/src/Deferred.ts +253 -256
  1180. package/src/Duration.ts +216 -308
  1181. package/src/Effect.ts +2893 -3279
  1182. package/src/Encoding.ts +22 -40
  1183. package/src/Equal.ts +49 -39
  1184. package/src/Equivalence.ts +103 -105
  1185. package/src/ErrorReporter.ts +51 -27
  1186. package/src/ExecutionPlan.ts +13 -55
  1187. package/src/Exit.ts +116 -192
  1188. package/src/Fiber.ts +81 -148
  1189. package/src/FiberHandle.ts +152 -105
  1190. package/src/FiberMap.ts +225 -174
  1191. package/src/FiberSet.ts +124 -82
  1192. package/src/FileSystem.ts +155 -263
  1193. package/src/Filter.ts +61 -33
  1194. package/src/Formatter.ts +54 -56
  1195. package/src/Function.ts +76 -145
  1196. package/src/Graph.ts +416 -770
  1197. package/src/HKT.ts +12 -6
  1198. package/src/Hash.ts +52 -83
  1199. package/src/HashMap.ts +319 -411
  1200. package/src/HashRing.ts +1 -0
  1201. package/src/HashSet.ts +177 -284
  1202. package/src/Inspectable.ts +12 -12
  1203. package/src/Iterable.ts +620 -786
  1204. package/src/JsonPatch.ts +58 -112
  1205. package/src/JsonPointer.ts +8 -8
  1206. package/src/JsonSchema.ts +402 -244
  1207. package/src/Latch.ts +23 -35
  1208. package/src/Layer.ts +359 -260
  1209. package/src/LayerMap.ts +49 -29
  1210. package/src/LayerRef.ts +6 -2
  1211. package/src/LogLevel.ts +114 -214
  1212. package/src/Logger.ts +344 -697
  1213. package/src/ManagedRuntime.ts +7 -5
  1214. package/src/Match.ts +217 -252
  1215. package/src/Metric.ts +516 -1089
  1216. package/src/MutableHashMap.ts +218 -255
  1217. package/src/MutableHashSet.ts +84 -89
  1218. package/src/MutableList.ts +73 -370
  1219. package/src/MutableRef.ts +420 -243
  1220. package/src/Newtype.ts +21 -14
  1221. package/src/NonEmptyIterable.ts +7 -137
  1222. package/src/Number.ts +196 -233
  1223. package/src/Optic.ts +243 -383
  1224. package/src/Option.ts +447 -812
  1225. package/src/Order.ts +109 -109
  1226. package/src/Ordering.ts +20 -23
  1227. package/src/Path.ts +38 -41
  1228. package/src/Pipeable.ts +6 -5
  1229. package/src/PlatformError.ts +4 -4
  1230. package/src/Pool.ts +4 -2
  1231. package/src/Predicate.ts +200 -181
  1232. package/src/PrimaryKey.ts +7 -7
  1233. package/src/PubSub.ts +526 -552
  1234. package/src/Pull.ts +24 -18
  1235. package/src/Queue.ts +200 -159
  1236. package/src/Random.ts +49 -74
  1237. package/src/RcMap.ts +121 -63
  1238. package/src/RcRef.ts +24 -13
  1239. package/src/Record.ts +291 -488
  1240. package/src/Redactable.ts +10 -3
  1241. package/src/Redacted.ts +25 -25
  1242. package/src/Reducer.ts +8 -15
  1243. package/src/Ref.ts +221 -361
  1244. package/src/References.ts +102 -168
  1245. package/src/RegExp.ts +10 -14
  1246. package/src/Request.ts +31 -21
  1247. package/src/RequestResolver.ts +202 -91
  1248. package/src/Result.ts +312 -484
  1249. package/src/Runtime.ts +50 -75
  1250. package/src/Schedule.ts +308 -1734
  1251. package/src/Scheduler.ts +20 -7
  1252. package/src/Schema.ts +716 -745
  1253. package/src/SchemaAST.ts +466 -358
  1254. package/src/SchemaError.ts +7 -6
  1255. package/src/SchemaGetter.ts +242 -190
  1256. package/src/SchemaIssue.ts +89 -275
  1257. package/src/SchemaParser.ts +180 -93
  1258. package/src/SchemaRepresentation.ts +22 -40
  1259. package/src/SchemaTransformation.ts +129 -88
  1260. package/src/Scope.ts +123 -151
  1261. package/src/ScopedRef.ts +4 -4
  1262. package/src/Semaphore.ts +152 -51
  1263. package/src/Sink.ts +128 -113
  1264. package/src/Stdio.ts +1 -1
  1265. package/src/Stream.ts +2602 -3123
  1266. package/src/String.ts +275 -312
  1267. package/src/Struct.ts +109 -114
  1268. package/src/SubscriptionRef.ts +284 -252
  1269. package/src/Symbol.ts +3 -3
  1270. package/src/Terminal.ts +2 -2
  1271. package/src/Tracer.ts +102 -55
  1272. package/src/Trie.ts +287 -679
  1273. package/src/Tuple.ts +92 -127
  1274. package/src/TxChunk.ts +201 -121
  1275. package/src/TxDeferred.ts +62 -46
  1276. package/src/TxHashMap.ts +645 -799
  1277. package/src/TxHashSet.ts +443 -356
  1278. package/src/TxPriorityQueue.ts +130 -98
  1279. package/src/TxPubSub.ts +107 -80
  1280. package/src/TxQueue.ts +214 -183
  1281. package/src/TxReentrantLock.ts +97 -66
  1282. package/src/TxRef.ts +51 -32
  1283. package/src/TxSemaphore.ts +129 -95
  1284. package/src/TxSubscriptionRef.ts +97 -70
  1285. package/src/Types.ts +126 -67
  1286. package/src/Unify.ts +45 -65
  1287. package/src/Utils.ts +23 -16
  1288. package/src/internal/core.ts +2 -2
  1289. package/src/internal/dateTime.ts +6 -0
  1290. package/src/internal/effect.ts +93 -48
  1291. package/src/internal/persistence.ts +2 -0
  1292. package/src/internal/references.ts +3 -2
  1293. package/src/internal/schema/fromJsonSchemaDocument.ts +15 -13
  1294. package/src/internal/schema/fromRepresentation.ts +10 -16
  1295. package/src/internal/schema/parser.ts +22 -0
  1296. package/src/internal/schema/toJsonSchemaDocument.ts +60 -6
  1297. package/src/internal/schema/toRepresentation.ts +104 -119
  1298. package/src/internal/trie.ts +10 -11
  1299. package/src/testing/FastCheck.ts +8 -7
  1300. package/src/testing/TestClock.ts +72 -30
  1301. package/src/testing/TestConsole.ts +32 -31
  1302. package/src/testing/TestSchema.ts +29 -29
  1303. package/src/unstable/ai/AiError.ts +95 -118
  1304. package/src/unstable/ai/AnthropicStructuredOutput.ts +1 -1
  1305. package/src/unstable/ai/Chat.ts +132 -97
  1306. package/src/unstable/ai/IdGenerator.ts +32 -28
  1307. package/src/unstable/ai/LanguageModel.ts +107 -67
  1308. package/src/unstable/ai/McpProtocol.ts +48 -0
  1309. package/src/unstable/ai/McpSchema.ts +60 -50
  1310. package/src/unstable/ai/McpServer.ts +930 -304
  1311. package/src/unstable/ai/Model.ts +9 -20
  1312. package/src/unstable/ai/OpenAiStructuredOutput.ts +1 -1
  1313. package/src/unstable/ai/Prompt.ts +145 -43
  1314. package/src/unstable/ai/Response.ts +28 -14
  1315. package/src/unstable/ai/Telemetry.ts +46 -13
  1316. package/src/unstable/ai/Tokenizer.ts +14 -3
  1317. package/src/unstable/ai/Tool.ts +59 -44
  1318. package/src/unstable/ai/Toolkit.ts +26 -8
  1319. package/src/unstable/ai/index.ts +5 -0
  1320. package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
  1321. package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
  1322. package/src/unstable/ai/internal/structured-output.ts +13 -18
  1323. package/src/unstable/cli/Argument.ts +273 -69
  1324. package/src/unstable/cli/CliError.ts +69 -76
  1325. package/src/unstable/cli/CliOutput.ts +44 -58
  1326. package/src/unstable/cli/Command.ts +705 -107
  1327. package/src/unstable/cli/Flag.ts +418 -138
  1328. package/src/unstable/cli/GlobalFlag.ts +1 -1
  1329. package/src/unstable/cli/HelpDoc.ts +12 -4
  1330. package/src/unstable/cli/Param.ts +292 -78
  1331. package/src/unstable/cli/Primitive.ts +370 -149
  1332. package/src/unstable/cli/Prompt.ts +28 -14
  1333. package/src/unstable/cli/internal/lexer.ts +8 -2
  1334. package/src/unstable/cli/internal/parser.ts +2 -2
  1335. package/src/unstable/cluster/ClusterSchema.ts +8 -8
  1336. package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -1
  1337. package/src/unstable/cluster/Entity.ts +15 -16
  1338. package/src/unstable/cluster/EntityProxy.ts +4 -2
  1339. package/src/unstable/cluster/EntityResource.ts +2 -2
  1340. package/src/unstable/cluster/Envelope.ts +3 -3
  1341. package/src/unstable/cluster/HttpRunner.ts +6 -4
  1342. package/src/unstable/cluster/Message.ts +9 -9
  1343. package/src/unstable/cluster/MessageStorage.ts +15 -15
  1344. package/src/unstable/cluster/Reply.ts +4 -6
  1345. package/src/unstable/cluster/RunnerHealth.ts +1 -1
  1346. package/src/unstable/cluster/RunnerServer.ts +41 -8
  1347. package/src/unstable/cluster/RunnerStorage.ts +2 -2
  1348. package/src/unstable/cluster/Runners.ts +23 -12
  1349. package/src/unstable/cluster/Sharding.ts +7 -8
  1350. package/src/unstable/cluster/ShardingConfig.ts +3 -3
  1351. package/src/unstable/cluster/SingletonAddress.ts +1 -1
  1352. package/src/unstable/cluster/Snowflake.ts +8 -8
  1353. package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
  1354. package/src/unstable/cluster/SqlRunnerStorage.ts +21 -5
  1355. package/src/unstable/cluster/internal/entityManager.ts +11 -15
  1356. package/src/unstable/encoding/Msgpack.ts +6 -8
  1357. package/src/unstable/encoding/Sse.ts +98 -16
  1358. package/src/unstable/eventlog/Event.ts +20 -20
  1359. package/src/unstable/eventlog/EventGroup.ts +4 -4
  1360. package/src/unstable/eventlog/EventJournal.ts +15 -15
  1361. package/src/unstable/eventlog/EventLog.ts +3 -3
  1362. package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
  1363. package/src/unstable/eventlog/EventLogMessage.ts +2 -2
  1364. package/src/unstable/eventlog/EventLogRemote.ts +1 -1
  1365. package/src/unstable/eventlog/EventLogServer.ts +41 -7
  1366. package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
  1367. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
  1368. package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
  1369. package/src/unstable/http/Cookies.ts +35 -21
  1370. package/src/unstable/http/Etag.ts +1 -1
  1371. package/src/unstable/http/FetchHttpClient.ts +3 -1
  1372. package/src/unstable/http/Headers.ts +2 -2
  1373. package/src/unstable/http/HttpBody.ts +20 -5
  1374. package/src/unstable/http/HttpClient.ts +83 -55
  1375. package/src/unstable/http/HttpClientRequest.ts +2 -0
  1376. package/src/unstable/http/HttpClientResponse.ts +4 -4
  1377. package/src/unstable/http/HttpEffect.ts +8 -8
  1378. package/src/unstable/http/HttpMethod.ts +6 -9
  1379. package/src/unstable/http/HttpMiddleware.ts +202 -39
  1380. package/src/unstable/http/HttpPlatform.ts +95 -0
  1381. package/src/unstable/http/HttpRouter.ts +102 -98
  1382. package/src/unstable/http/HttpServer.ts +13 -13
  1383. package/src/unstable/http/HttpServerError.ts +2 -2
  1384. package/src/unstable/http/HttpServerRequest.ts +4 -4
  1385. package/src/unstable/http/HttpServerResponse.ts +30 -0
  1386. package/src/unstable/http/HttpStaticServer.ts +35 -7
  1387. package/src/unstable/http/Multipart.ts +6 -6
  1388. package/src/unstable/http/Url.ts +33 -63
  1389. package/src/unstable/http/UrlParams.ts +10 -18
  1390. package/src/unstable/http/internal/compression.ts +196 -0
  1391. package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
  1392. package/src/unstable/httpapi/HttpApiClient.ts +14 -14
  1393. package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
  1394. package/src/unstable/httpapi/HttpApiError.ts +13 -13
  1395. package/src/unstable/httpapi/HttpApiGroup.ts +15 -15
  1396. package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
  1397. package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
  1398. package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
  1399. package/src/unstable/httpapi/OpenApi.ts +13 -13
  1400. package/src/unstable/observability/OtlpExporter.ts +31 -19
  1401. package/src/unstable/observability/OtlpMetrics.ts +4 -1
  1402. package/src/unstable/observability/OtlpResource.ts +26 -17
  1403. package/src/unstable/observability/PrometheusMetrics.ts +13 -4
  1404. package/src/unstable/observability/internal/otlpEnv.ts +1 -1
  1405. package/src/unstable/observability/internal/protobuf.ts +3 -0
  1406. package/src/unstable/persistence/KeyValueStore.ts +72 -49
  1407. package/src/unstable/persistence/Persistable.ts +8 -8
  1408. package/src/unstable/persistence/PersistedQueue.ts +6 -6
  1409. package/src/unstable/persistence/Persistence.ts +126 -19
  1410. package/src/unstable/persistence/RateLimiter.ts +26 -15
  1411. package/src/unstable/persistence/Redis.ts +2 -2
  1412. package/src/unstable/process/ChildProcess.ts +64 -21
  1413. package/src/unstable/process/ChildProcessSpawner.ts +21 -10
  1414. package/src/unstable/reactivity/AsyncResult.ts +12 -13
  1415. package/src/unstable/reactivity/Atom.ts +28 -25
  1416. package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
  1417. package/src/unstable/reactivity/AtomRegistry.ts +24 -3
  1418. package/src/unstable/reactivity/AtomRpc.ts +5 -4
  1419. package/src/unstable/reactivity/Hydration.ts +1 -1
  1420. package/src/unstable/rpc/Rpc.ts +35 -33
  1421. package/src/unstable/rpc/RpcClient.ts +16 -15
  1422. package/src/unstable/rpc/RpcGroup.ts +8 -8
  1423. package/src/unstable/rpc/RpcMessage.ts +31 -30
  1424. package/src/unstable/rpc/RpcMiddleware.ts +10 -10
  1425. package/src/unstable/rpc/RpcSchema.ts +4 -4
  1426. package/src/unstable/rpc/RpcSerialization.ts +167 -68
  1427. package/src/unstable/rpc/RpcServer.ts +18 -15
  1428. package/src/unstable/rpc/RpcWorker.ts +5 -5
  1429. package/src/unstable/schema/Model.ts +52 -50
  1430. package/src/unstable/schema/VariantSchema.ts +5 -5
  1431. package/src/unstable/socket/Socket.ts +17 -4
  1432. package/src/unstable/sql/SqlClient.ts +5 -6
  1433. package/src/unstable/sql/SqlModel.ts +2 -2
  1434. package/src/unstable/sql/SqlResolver.ts +5 -5
  1435. package/src/unstable/sql/Statement.ts +24 -23
  1436. package/src/unstable/workers/Transferable.ts +1 -1
  1437. package/src/unstable/workers/Worker.ts +2 -2
  1438. package/src/unstable/workers/WorkerError.ts +7 -7
  1439. package/src/unstable/workers/WorkerRunner.ts +1 -1
  1440. package/src/unstable/workflow/Activity.ts +2 -2
  1441. package/src/unstable/workflow/DurableClock.ts +1 -1
  1442. package/src/unstable/workflow/DurableDeferred.ts +10 -10
  1443. package/src/unstable/workflow/DurableQueue.ts +22 -20
  1444. package/src/unstable/workflow/Workflow.ts +23 -23
  1445. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
  1446. package/src/unstable/workflow/WorkflowProxy.ts +4 -2
  1447. package/dist/internal/version.d.ts +0 -3
  1448. package/dist/internal/version.d.ts.map +0 -1
  1449. package/dist/internal/version.js +0 -2
  1450. package/dist/internal/version.js.map +0 -1
  1451. package/src/internal/version.ts +0 -2
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
@@ -3420,7 +3305,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3420
3305
  *
3421
3306
  * **Example** (Filtering and transforming Result values)
3422
3307
  *
3423
- * ```ts
3308
+ * ```ts import.meta.vitest
3424
3309
  * import { Iterable, Result } from "effect"
3425
3310
  *
3426
3311
  * // Parse strings to numbers, keeping only valid ones
@@ -3429,7 +3314,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3429
3314
  * const num = parseInt(s)
3430
3315
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3431
3316
  * })
3432
- * console.log(Array.from(numbers)) // [1, 2, 4]
3317
+ * Array.from(numbers) // => [1, 2, 4]
3433
3318
  *
3434
3319
  * // Extract specific properties from objects
3435
3320
  * const users = [
@@ -3443,7 +3328,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3443
3328
  * (user) =>
3444
3329
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3445
3330
  * )
3446
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3331
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3447
3332
  *
3448
3333
  * // Use index in transformation
3449
3334
  * const items = ["a", "b", "c", "d", "e"]
@@ -3451,7 +3336,7 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
3451
3336
  * items,
3452
3337
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3453
3338
  * )
3454
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3339
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3455
3340
  * ```
3456
3341
  *
3457
3342
  * @category filtering
@@ -3469,7 +3354,7 @@ export const filterMap: {
3469
3354
  *
3470
3355
  * **Example** (Filtering and transforming Result values)
3471
3356
  *
3472
- * ```ts
3357
+ * ```ts import.meta.vitest
3473
3358
  * import { Iterable, Result } from "effect"
3474
3359
  *
3475
3360
  * // Parse strings to numbers, keeping only valid ones
@@ -3478,7 +3363,7 @@ export const filterMap: {
3478
3363
  * const num = parseInt(s)
3479
3364
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3480
3365
  * })
3481
- * console.log(Array.from(numbers)) // [1, 2, 4]
3366
+ * Array.from(numbers) // => [1, 2, 4]
3482
3367
  *
3483
3368
  * // Extract specific properties from objects
3484
3369
  * const users = [
@@ -3492,7 +3377,7 @@ export const filterMap: {
3492
3377
  * (user) =>
3493
3378
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3494
3379
  * )
3495
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3380
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3496
3381
  *
3497
3382
  * // Use index in transformation
3498
3383
  * const items = ["a", "b", "c", "d", "e"]
@@ -3500,7 +3385,7 @@ export const filterMap: {
3500
3385
  * items,
3501
3386
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3502
3387
  * )
3503
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3388
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3504
3389
  * ```
3505
3390
  *
3506
3391
  * @category filtering
@@ -3518,7 +3403,7 @@ export const filterMap: {
3518
3403
  *
3519
3404
  * **Example** (Filtering and transforming Result values)
3520
3405
  *
3521
- * ```ts
3406
+ * ```ts import.meta.vitest
3522
3407
  * import { Iterable, Result } from "effect"
3523
3408
  *
3524
3409
  * // Parse strings to numbers, keeping only valid ones
@@ -3527,7 +3412,7 @@ export const filterMap: {
3527
3412
  * const num = parseInt(s)
3528
3413
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3529
3414
  * })
3530
- * console.log(Array.from(numbers)) // [1, 2, 4]
3415
+ * Array.from(numbers) // => [1, 2, 4]
3531
3416
  *
3532
3417
  * // Extract specific properties from objects
3533
3418
  * const users = [
@@ -3541,7 +3426,7 @@ export const filterMap: {
3541
3426
  * (user) =>
3542
3427
  * user.age >= 18 && user.email ? Result.succeed(user.email) : Result.failVoid
3543
3428
  * )
3544
- * console.log(Array.from(adultEmails)) // ["alice@example.com", "charlie@example.com"]
3429
+ * Array.from(adultEmails) // => ["alice@example.com", "charlie@example.com"]
3545
3430
  *
3546
3431
  * // Use index in transformation
3547
3432
  * const items = ["a", "b", "c", "d", "e"]
@@ -3549,7 +3434,7 @@ export const filterMap: {
3549
3434
  * items,
3550
3435
  * (item, i) => i % 2 === 0 ? Result.succeed(`${i}: ${item}`) : Result.failVoid
3551
3436
  * )
3552
- * console.log(Array.from(evenIndexItems)) // ["0: a", "2: c", "4: e"]
3437
+ * Array.from(evenIndexItems) // => ["0: a", "2: c", "4: e"]
3553
3438
  * ```
3554
3439
  *
3555
3440
  * @category filtering
@@ -3584,7 +3469,7 @@ export const filterMap: {
3584
3469
  *
3585
3470
  * **Example** (Filtering and transforming until failure)
3586
3471
  *
3587
- * ```ts
3472
+ * ```ts import.meta.vitest
3588
3473
  * import { Iterable, Result } from "effect"
3589
3474
  *
3590
3475
  * // Parse numbers until we hit an invalid one
@@ -3593,7 +3478,7 @@ export const filterMap: {
3593
3478
  * const num = parseInt(s)
3594
3479
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3595
3480
  * })
3596
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3481
+ * Array.from(numbers) // => [1, 2, 3]
3597
3482
  *
3598
3483
  * // Take elements while they meet a condition and transform them
3599
3484
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3601,7 +3486,7 @@ export const filterMap: {
3601
3486
  * values,
3602
3487
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3603
3488
  * )
3604
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3489
+ * Array.from(doubledEvens) // => [4, 8, 12]
3605
3490
  *
3606
3491
  * // Process with index until condition fails
3607
3492
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3609,7 +3494,7 @@ export const filterMap: {
3609
3494
  * letters,
3610
3495
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3611
3496
  * )
3612
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3497
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3613
3498
  * ```
3614
3499
  *
3615
3500
  * @category filtering
@@ -3621,7 +3506,7 @@ export const filterMapWhile: {
3621
3506
  *
3622
3507
  * **Example** (Filtering and transforming until failure)
3623
3508
  *
3624
- * ```ts
3509
+ * ```ts import.meta.vitest
3625
3510
  * import { Iterable, Result } from "effect"
3626
3511
  *
3627
3512
  * // Parse numbers until we hit an invalid one
@@ -3630,7 +3515,7 @@ export const filterMapWhile: {
3630
3515
  * const num = parseInt(s)
3631
3516
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3632
3517
  * })
3633
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3518
+ * Array.from(numbers) // => [1, 2, 3]
3634
3519
  *
3635
3520
  * // Take elements while they meet a condition and transform them
3636
3521
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3638,7 +3523,7 @@ export const filterMapWhile: {
3638
3523
  * values,
3639
3524
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3640
3525
  * )
3641
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3526
+ * Array.from(doubledEvens) // => [4, 8, 12]
3642
3527
  *
3643
3528
  * // Process with index until condition fails
3644
3529
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3646,7 +3531,7 @@ export const filterMapWhile: {
3646
3531
  * letters,
3647
3532
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3648
3533
  * )
3649
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3534
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3650
3535
  * ```
3651
3536
  *
3652
3537
  * @category filtering
@@ -3658,7 +3543,7 @@ export const filterMapWhile: {
3658
3543
  *
3659
3544
  * **Example** (Filtering and transforming until failure)
3660
3545
  *
3661
- * ```ts
3546
+ * ```ts import.meta.vitest
3662
3547
  * import { Iterable, Result } from "effect"
3663
3548
  *
3664
3549
  * // Parse numbers until we hit an invalid one
@@ -3667,7 +3552,7 @@ export const filterMapWhile: {
3667
3552
  * const num = parseInt(s)
3668
3553
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
3669
3554
  * })
3670
- * console.log(Array.from(numbers)) // [1, 2, 3] (stops at "invalid")
3555
+ * Array.from(numbers) // => [1, 2, 3]
3671
3556
  *
3672
3557
  * // Take elements while they meet a condition and transform them
3673
3558
  * const values = [2, 4, 6, 7, 8, 10]
@@ -3675,7 +3560,7 @@ export const filterMapWhile: {
3675
3560
  * values,
3676
3561
  * (n) => n % 2 === 0 ? Result.succeed(n * 2) : Result.failVoid
3677
3562
  * )
3678
- * console.log(Array.from(doubledEvens)) // [4, 8, 12] (stops at 7)
3563
+ * Array.from(doubledEvens) // => [4, 8, 12]
3679
3564
  *
3680
3565
  * // Process with index until condition fails
3681
3566
  * const letters = ["a", "b", "c", "d", "e"]
@@ -3683,7 +3568,7 @@ export const filterMapWhile: {
3683
3568
  * letters,
3684
3569
  * (letter, i) => letter !== "c" ? Result.succeed(`${i}: ${letter}`) : Result.failVoid
3685
3570
  * )
3686
- * console.log(Array.from(indexedUntilC)) // ["0: a", "1: b"] (stops at "c")
3571
+ * Array.from(indexedUntilC) // => ["0: a", "1: b"]
3687
3572
  * ```
3688
3573
  *
3689
3574
  * @category filtering
@@ -3715,16 +3600,10 @@ export const filterMapWhile: {
3715
3600
  *
3716
3601
  * **Example** (Extracting Some values)
3717
3602
  *
3718
- * ```ts
3603
+ * ```ts import.meta.vitest
3719
3604
  * import { Iterable, Option } from "effect"
3720
- * import * as assert from "node:assert"
3721
3605
  *
3722
- * assert.deepStrictEqual(
3723
- * Array.from(
3724
- * Iterable.getSomes([Option.some(1), Option.none(), Option.some(2)])
3725
- * ),
3726
- * [1, 2]
3727
- * )
3606
+ * Array.from(Iterable.getSomes([Option.some(1), Option.none(), Option.some(2)])) // => [1, 2]
3728
3607
  * ```
3729
3608
  *
3730
3609
  * @category filtering
@@ -3756,20 +3635,14 @@ export const getSomes = <A>(self: Iterable<Option<A>>): Iterable<A> => {
3756
3635
  *
3757
3636
  * **Example** (Extracting failures)
3758
3637
  *
3759
- * ```ts
3638
+ * ```ts import.meta.vitest
3760
3639
  * 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
- * )
3640
+ *
3641
+ * Array.from(Iterable.getFailures([
3642
+ * Result.succeed(1),
3643
+ * Result.fail("err"),
3644
+ * Result.succeed(2)
3645
+ * ])) // => ["err"]
3773
3646
  * ```
3774
3647
  *
3775
3648
  * @category filtering
@@ -3801,20 +3674,14 @@ export const getFailures = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<L> =
3801
3674
  *
3802
3675
  * **Example** (Extracting successes)
3803
3676
  *
3804
- * ```ts
3677
+ * ```ts import.meta.vitest
3805
3678
  * 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
- * )
3679
+ *
3680
+ * Array.from(Iterable.getSuccesses([
3681
+ * Result.succeed(1),
3682
+ * Result.fail("err"),
3683
+ * Result.succeed(2)
3684
+ * ])) // => [1, 2]
3818
3685
  * ```
3819
3686
  *
3820
3687
  * @category filtering
@@ -3851,18 +3718,18 @@ export const getSuccesses = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<R0>
3851
3718
  *
3852
3719
  * **Example** (Filtering elements)
3853
3720
  *
3854
- * ```ts
3721
+ * ```ts import.meta.vitest
3855
3722
  * import { Iterable } from "effect"
3856
3723
  *
3857
3724
  * // Filter even numbers
3858
3725
  * const numbers = [1, 2, 3, 4, 5, 6]
3859
3726
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3860
- * console.log(Array.from(evens)) // [2, 4, 6]
3727
+ * Array.from(evens) // => [2, 4, 6]
3861
3728
  *
3862
3729
  * // Filter with index
3863
3730
  * const items = ["a", "b", "c", "d"]
3864
3731
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3865
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3732
+ * Array.from(oddPositions) // => ["b", "d"]
3866
3733
  *
3867
3734
  * // Type refinement
3868
3735
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3870,14 +3737,14 @@ export const getSuccesses = <R0, L>(self: Iterable<Result<R0, L>>): Iterable<R0>
3870
3737
  * mixed,
3871
3738
  * (x): x is string => typeof x === "string"
3872
3739
  * )
3873
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3740
+ * Array.from(onlyStrings) // => ["hello", "world"]
3874
3741
  *
3875
3742
  * // Combine with map
3876
3743
  * const processed = Iterable.map(
3877
3744
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3878
3745
  * (x) => x * 10
3879
3746
  * )
3880
- * console.log(Array.from(processed)) // [30, 40, 50]
3747
+ * Array.from(processed) // => [30, 40, 50]
3881
3748
  * ```
3882
3749
  *
3883
3750
  * @category filtering
@@ -3895,18 +3762,18 @@ export const filter: {
3895
3762
  *
3896
3763
  * **Example** (Filtering elements)
3897
3764
  *
3898
- * ```ts
3765
+ * ```ts import.meta.vitest
3899
3766
  * import { Iterable } from "effect"
3900
3767
  *
3901
3768
  * // Filter even numbers
3902
3769
  * const numbers = [1, 2, 3, 4, 5, 6]
3903
3770
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3904
- * console.log(Array.from(evens)) // [2, 4, 6]
3771
+ * Array.from(evens) // => [2, 4, 6]
3905
3772
  *
3906
3773
  * // Filter with index
3907
3774
  * const items = ["a", "b", "c", "d"]
3908
3775
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3909
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3776
+ * Array.from(oddPositions) // => ["b", "d"]
3910
3777
  *
3911
3778
  * // Type refinement
3912
3779
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3914,14 +3781,14 @@ export const filter: {
3914
3781
  * mixed,
3915
3782
  * (x): x is string => typeof x === "string"
3916
3783
  * )
3917
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3784
+ * Array.from(onlyStrings) // => ["hello", "world"]
3918
3785
  *
3919
3786
  * // Combine with map
3920
3787
  * const processed = Iterable.map(
3921
3788
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3922
3789
  * (x) => x * 10
3923
3790
  * )
3924
- * console.log(Array.from(processed)) // [30, 40, 50]
3791
+ * Array.from(processed) // => [30, 40, 50]
3925
3792
  * ```
3926
3793
  *
3927
3794
  * @category filtering
@@ -3939,18 +3806,18 @@ export const filter: {
3939
3806
  *
3940
3807
  * **Example** (Filtering elements)
3941
3808
  *
3942
- * ```ts
3809
+ * ```ts import.meta.vitest
3943
3810
  * import { Iterable } from "effect"
3944
3811
  *
3945
3812
  * // Filter even numbers
3946
3813
  * const numbers = [1, 2, 3, 4, 5, 6]
3947
3814
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3948
- * console.log(Array.from(evens)) // [2, 4, 6]
3815
+ * Array.from(evens) // => [2, 4, 6]
3949
3816
  *
3950
3817
  * // Filter with index
3951
3818
  * const items = ["a", "b", "c", "d"]
3952
3819
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3953
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3820
+ * Array.from(oddPositions) // => ["b", "d"]
3954
3821
  *
3955
3822
  * // Type refinement
3956
3823
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -3958,14 +3825,14 @@ export const filter: {
3958
3825
  * mixed,
3959
3826
  * (x): x is string => typeof x === "string"
3960
3827
  * )
3961
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3828
+ * Array.from(onlyStrings) // => ["hello", "world"]
3962
3829
  *
3963
3830
  * // Combine with map
3964
3831
  * const processed = Iterable.map(
3965
3832
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
3966
3833
  * (x) => x * 10
3967
3834
  * )
3968
- * console.log(Array.from(processed)) // [30, 40, 50]
3835
+ * Array.from(processed) // => [30, 40, 50]
3969
3836
  * ```
3970
3837
  *
3971
3838
  * @category filtering
@@ -3983,18 +3850,18 @@ export const filter: {
3983
3850
  *
3984
3851
  * **Example** (Filtering elements)
3985
3852
  *
3986
- * ```ts
3853
+ * ```ts import.meta.vitest
3987
3854
  * import { Iterable } from "effect"
3988
3855
  *
3989
3856
  * // Filter even numbers
3990
3857
  * const numbers = [1, 2, 3, 4, 5, 6]
3991
3858
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
3992
- * console.log(Array.from(evens)) // [2, 4, 6]
3859
+ * Array.from(evens) // => [2, 4, 6]
3993
3860
  *
3994
3861
  * // Filter with index
3995
3862
  * const items = ["a", "b", "c", "d"]
3996
3863
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
3997
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3864
+ * Array.from(oddPositions) // => ["b", "d"]
3998
3865
  *
3999
3866
  * // Type refinement
4000
3867
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -4002,14 +3869,14 @@ export const filter: {
4002
3869
  * mixed,
4003
3870
  * (x): x is string => typeof x === "string"
4004
3871
  * )
4005
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3872
+ * Array.from(onlyStrings) // => ["hello", "world"]
4006
3873
  *
4007
3874
  * // Combine with map
4008
3875
  * const processed = Iterable.map(
4009
3876
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
4010
3877
  * (x) => x * 10
4011
3878
  * )
4012
- * console.log(Array.from(processed)) // [30, 40, 50]
3879
+ * Array.from(processed) // => [30, 40, 50]
4013
3880
  * ```
4014
3881
  *
4015
3882
  * @category filtering
@@ -4027,18 +3894,18 @@ export const filter: {
4027
3894
  *
4028
3895
  * **Example** (Filtering elements)
4029
3896
  *
4030
- * ```ts
3897
+ * ```ts import.meta.vitest
4031
3898
  * import { Iterable } from "effect"
4032
3899
  *
4033
3900
  * // Filter even numbers
4034
3901
  * const numbers = [1, 2, 3, 4, 5, 6]
4035
3902
  * const evens = Iterable.filter(numbers, (x) => x % 2 === 0)
4036
- * console.log(Array.from(evens)) // [2, 4, 6]
3903
+ * Array.from(evens) // => [2, 4, 6]
4037
3904
  *
4038
3905
  * // Filter with index
4039
3906
  * const items = ["a", "b", "c", "d"]
4040
3907
  * const oddPositions = Iterable.filter(items, (_, i) => i % 2 === 1)
4041
- * console.log(Array.from(oddPositions)) // ["b", "d"]
3908
+ * Array.from(oddPositions) // => ["b", "d"]
4042
3909
  *
4043
3910
  * // Type refinement
4044
3911
  * const mixed: Array<string | number> = ["hello", 42, "world", 100]
@@ -4046,14 +3913,14 @@ export const filter: {
4046
3913
  * mixed,
4047
3914
  * (x): x is string => typeof x === "string"
4048
3915
  * )
4049
- * console.log(Array.from(onlyStrings)) // ["hello", "world"] (typed as string[])
3916
+ * Array.from(onlyStrings) // => ["hello", "world"]
4050
3917
  *
4051
3918
  * // Combine with map
4052
3919
  * const processed = Iterable.map(
4053
3920
  * Iterable.filter([1, 2, 3, 4, 5], (x) => x > 2),
4054
3921
  * (x) => x * 10
4055
3922
  * )
4056
- * console.log(Array.from(processed)) // [30, 40, 50]
3923
+ * Array.from(processed) // => [30, 40, 50]
4057
3924
  * ```
4058
3925
  *
4059
3926
  * @category filtering
@@ -4092,7 +3959,7 @@ export const filter: {
4092
3959
  *
4093
3960
  * **Example** (Flat mapping nullable results)
4094
3961
  *
4095
- * ```ts
3962
+ * ```ts import.meta.vitest
4096
3963
  * import { Iterable } from "effect"
4097
3964
  *
4098
3965
  * // Extract valid elements from nullable function results
@@ -4101,7 +3968,7 @@ export const filter: {
4101
3968
  * const num = parseInt(s)
4102
3969
  * return isNaN(num) ? null : num * 2
4103
3970
  * })
4104
- * console.log(Array.from(parsed)) // [2, 4, 8]
3971
+ * Array.from(parsed) // => [2, 4, 8]
4105
3972
  *
4106
3973
  * // Safe property access
4107
3974
  * const objects = [
@@ -4111,7 +3978,7 @@ export const filter: {
4111
3978
  * {}
4112
3979
  * ]
4113
3980
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4114
- * console.log(Array.from(values)) // [10, 20]
3981
+ * Array.from(values) // => [10, 20]
4115
3982
  *
4116
3983
  * // Working with Map.get (returns undefined for missing keys)
4117
3984
  * const map = new Map([
@@ -4121,7 +3988,7 @@ export const filter: {
4121
3988
  * ])
4122
3989
  * const keys = ["a", "x", "b", "y", "c"]
4123
3990
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4124
- * console.log(Array.from(foundValues)) // [1, 2, 3]
3991
+ * Array.from(foundValues) // => [1, 2, 3]
4125
3992
  * ```
4126
3993
  *
4127
3994
  * @category sequencing
@@ -4138,7 +4005,7 @@ export const flatMapNullishOr: {
4138
4005
  *
4139
4006
  * **Example** (Flat mapping nullable results)
4140
4007
  *
4141
- * ```ts
4008
+ * ```ts import.meta.vitest
4142
4009
  * import { Iterable } from "effect"
4143
4010
  *
4144
4011
  * // Extract valid elements from nullable function results
@@ -4147,7 +4014,7 @@ export const flatMapNullishOr: {
4147
4014
  * const num = parseInt(s)
4148
4015
  * return isNaN(num) ? null : num * 2
4149
4016
  * })
4150
- * console.log(Array.from(parsed)) // [2, 4, 8]
4017
+ * Array.from(parsed) // => [2, 4, 8]
4151
4018
  *
4152
4019
  * // Safe property access
4153
4020
  * const objects = [
@@ -4157,7 +4024,7 @@ export const flatMapNullishOr: {
4157
4024
  * {}
4158
4025
  * ]
4159
4026
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4160
- * console.log(Array.from(values)) // [10, 20]
4027
+ * Array.from(values) // => [10, 20]
4161
4028
  *
4162
4029
  * // Working with Map.get (returns undefined for missing keys)
4163
4030
  * const map = new Map([
@@ -4167,7 +4034,7 @@ export const flatMapNullishOr: {
4167
4034
  * ])
4168
4035
  * const keys = ["a", "x", "b", "y", "c"]
4169
4036
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4170
- * console.log(Array.from(foundValues)) // [1, 2, 3]
4037
+ * Array.from(foundValues) // => [1, 2, 3]
4171
4038
  * ```
4172
4039
  *
4173
4040
  * @category sequencing
@@ -4184,7 +4051,7 @@ export const flatMapNullishOr: {
4184
4051
  *
4185
4052
  * **Example** (Flat mapping nullable results)
4186
4053
  *
4187
- * ```ts
4054
+ * ```ts import.meta.vitest
4188
4055
  * import { Iterable } from "effect"
4189
4056
  *
4190
4057
  * // Extract valid elements from nullable function results
@@ -4193,7 +4060,7 @@ export const flatMapNullishOr: {
4193
4060
  * const num = parseInt(s)
4194
4061
  * return isNaN(num) ? null : num * 2
4195
4062
  * })
4196
- * console.log(Array.from(parsed)) // [2, 4, 8]
4063
+ * Array.from(parsed) // => [2, 4, 8]
4197
4064
  *
4198
4065
  * // Safe property access
4199
4066
  * const objects = [
@@ -4203,7 +4070,7 @@ export const flatMapNullishOr: {
4203
4070
  * {}
4204
4071
  * ]
4205
4072
  * const values = Iterable.flatMapNullishOr(objects, (obj) => obj.nested?.value)
4206
- * console.log(Array.from(values)) // [10, 20]
4073
+ * Array.from(values) // => [10, 20]
4207
4074
  *
4208
4075
  * // Working with Map.get (returns undefined for missing keys)
4209
4076
  * const map = new Map([
@@ -4213,7 +4080,7 @@ export const flatMapNullishOr: {
4213
4080
  * ])
4214
4081
  * const keys = ["a", "x", "b", "y", "c"]
4215
4082
  * const foundValues = Iterable.flatMapNullishOr(keys, (key) => map.get(key))
4216
- * console.log(Array.from(foundValues)) // [1, 2, 3]
4083
+ * Array.from(foundValues) // => [1, 2, 3]
4217
4084
  * ```
4218
4085
  *
4219
4086
  * @category sequencing
@@ -4234,21 +4101,21 @@ export const flatMapNullishOr: {
4234
4101
  *
4235
4102
  * **Example** (Checking whether some element matches)
4236
4103
  *
4237
- * ```ts
4104
+ * ```ts import.meta.vitest
4238
4105
  * import { Iterable } from "effect"
4239
4106
  *
4240
4107
  * const numbers = [1, 3, 5, 7, 8]
4241
4108
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4242
- * console.log(hasEven) // true (because of 8)
4109
+ * hasEven // => true
4243
4110
  *
4244
4111
  * const allOdd = [1, 3, 5, 7]
4245
4112
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4246
- * console.log(hasEvenInAllOdd) // false
4113
+ * hasEvenInAllOdd // => false
4247
4114
  *
4248
4115
  * // With index
4249
4116
  * const letters = ["a", "b", "c"]
4250
4117
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4251
- * console.log(hasElementAtIndex2) // true
4118
+ * hasElementAtIndex2 // => true
4252
4119
  *
4253
4120
  * // Early termination - stops at first match
4254
4121
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4256,7 +4123,7 @@ export const flatMapNullishOr: {
4256
4123
  * Iterable.take(infiniteOdds, 1000),
4257
4124
  * (x) => x % 2 === 0
4258
4125
  * )
4259
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4126
+ * hasEvenInInfiniteOdds // => false
4260
4127
  *
4261
4128
  * // Type guard usage
4262
4129
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4264,10 +4131,10 @@ export const flatMapNullishOr: {
4264
4131
  * mixed,
4265
4132
  * (x): x is string => typeof x === "string"
4266
4133
  * )
4267
- * console.log(hasString) // true
4134
+ * hasString // => true
4268
4135
  * ```
4269
4136
  *
4270
- * @category elements
4137
+ * @category predicates
4271
4138
  * @since 2.0.0
4272
4139
  */
4273
4140
  export const some: {
@@ -4276,21 +4143,21 @@ export const some: {
4276
4143
  *
4277
4144
  * **Example** (Checking whether some element matches)
4278
4145
  *
4279
- * ```ts
4146
+ * ```ts import.meta.vitest
4280
4147
  * import { Iterable } from "effect"
4281
4148
  *
4282
4149
  * const numbers = [1, 3, 5, 7, 8]
4283
4150
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4284
- * console.log(hasEven) // true (because of 8)
4151
+ * hasEven // => true
4285
4152
  *
4286
4153
  * const allOdd = [1, 3, 5, 7]
4287
4154
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4288
- * console.log(hasEvenInAllOdd) // false
4155
+ * hasEvenInAllOdd // => false
4289
4156
  *
4290
4157
  * // With index
4291
4158
  * const letters = ["a", "b", "c"]
4292
4159
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4293
- * console.log(hasElementAtIndex2) // true
4160
+ * hasElementAtIndex2 // => true
4294
4161
  *
4295
4162
  * // Early termination - stops at first match
4296
4163
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4298,7 +4165,7 @@ export const some: {
4298
4165
  * Iterable.take(infiniteOdds, 1000),
4299
4166
  * (x) => x % 2 === 0
4300
4167
  * )
4301
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4168
+ * hasEvenInInfiniteOdds // => false
4302
4169
  *
4303
4170
  * // Type guard usage
4304
4171
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4306,10 +4173,10 @@ export const some: {
4306
4173
  * mixed,
4307
4174
  * (x): x is string => typeof x === "string"
4308
4175
  * )
4309
- * console.log(hasString) // true
4176
+ * hasString // => true
4310
4177
  * ```
4311
4178
  *
4312
- * @category elements
4179
+ * @category predicates
4313
4180
  * @since 2.0.0
4314
4181
  */
4315
4182
  <A>(predicate: (a: A, i: number) => boolean): (self: Iterable<A>) => boolean
@@ -4318,21 +4185,21 @@ export const some: {
4318
4185
  *
4319
4186
  * **Example** (Checking whether some element matches)
4320
4187
  *
4321
- * ```ts
4188
+ * ```ts import.meta.vitest
4322
4189
  * import { Iterable } from "effect"
4323
4190
  *
4324
4191
  * const numbers = [1, 3, 5, 7, 8]
4325
4192
  * const hasEven = Iterable.some(numbers, (x) => x % 2 === 0)
4326
- * console.log(hasEven) // true (because of 8)
4193
+ * hasEven // => true
4327
4194
  *
4328
4195
  * const allOdd = [1, 3, 5, 7]
4329
4196
  * const hasEvenInAllOdd = Iterable.some(allOdd, (x) => x % 2 === 0)
4330
- * console.log(hasEvenInAllOdd) // false
4197
+ * hasEvenInAllOdd // => false
4331
4198
  *
4332
4199
  * // With index
4333
4200
  * const letters = ["a", "b", "c"]
4334
4201
  * const hasElementAtIndex2 = Iterable.some(letters, (_, i) => i === 2)
4335
- * console.log(hasElementAtIndex2) // true
4202
+ * hasElementAtIndex2 // => true
4336
4203
  *
4337
4204
  * // Early termination - stops at first match
4338
4205
  * const infiniteOdds = Iterable.filter(Iterable.range(1), (x) => x % 2 === 1)
@@ -4340,7 +4207,7 @@ export const some: {
4340
4207
  * Iterable.take(infiniteOdds, 1000),
4341
4208
  * (x) => x % 2 === 0
4342
4209
  * )
4343
- * console.log(hasEvenInInfiniteOdds) // false (quickly, doesn't check all 1000)
4210
+ * hasEvenInInfiniteOdds // => false
4344
4211
  *
4345
4212
  * // Type guard usage
4346
4213
  * const mixed: Array<string | number> = [1, 2, "hello"]
@@ -4348,10 +4215,10 @@ export const some: {
4348
4215
  * mixed,
4349
4216
  * (x): x is string => typeof x === "string"
4350
4217
  * )
4351
- * console.log(hasString) // true
4218
+ * hasString // => true
4352
4219
  * ```
4353
4220
  *
4354
- * @category elements
4221
+ * @category predicates
4355
4222
  * @since 2.0.0
4356
4223
  */
4357
4224
  <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): boolean
@@ -4380,21 +4247,21 @@ export const some: {
4380
4247
  *
4381
4248
  * **Example** (Unfolding state into values)
4382
4249
  *
4383
- * ```ts
4250
+ * ```ts import.meta.vitest
4384
4251
  * import { Iterable, Option } from "effect"
4385
4252
  *
4386
4253
  * // Generate Fibonacci sequence
4387
4254
  * const fibonacci = Iterable.unfold([0, 1], ([a, b]) => Option.some([a, [b, a + b]]))
4388
4255
  * const first10Fib = Iterable.take(fibonacci, 10)
4389
- * console.log(Array.from(first10Fib)) // [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
4256
+ * Array.from(first10Fib) // => [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
4390
4257
  *
4391
4258
  * // Generate powers of 2 up to a limit
4392
4259
  * 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]
4260
+ * Array.from(powersOf2) // => [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
4394
4261
  *
4395
4262
  * // Generate countdown
4396
4263
  * 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]
4264
+ * Array.from(countdown) // => [5, 4, 3, 2, 1]
4398
4265
  *
4399
4266
  * // Generate collatz sequence
4400
4267
  * const collatz = Iterable.unfold(7, (n) => {
@@ -4402,7 +4269,7 @@ export const some: {
4402
4269
  * const next = n % 2 === 0 ? n / 2 : n * 3 + 1
4403
4270
  * return Option.some([n, next])
4404
4271
  * })
4405
- * console.log(Array.from(collatz)) // [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2]
4272
+ * Array.from(collatz) // => [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2]
4406
4273
  * ```
4407
4274
  *
4408
4275
  * @category constructors
@@ -4430,37 +4297,40 @@ export const unfold = <B, A>(b: B, f: (b: B) => Option<readonly [A, B]>): Iterab
4430
4297
  *
4431
4298
  * **Example** (Iterating with side effects)
4432
4299
  *
4433
- * ```ts
4300
+ * ```ts import.meta.vitest
4434
4301
  * import { Iterable } from "effect"
4435
4302
  *
4436
- * // Print each element
4303
+ * // Collect each visited element
4437
4304
  * const numbers = [1, 2, 3, 4, 5]
4438
- * Iterable.forEach(numbers, (n) => console.log(n))
4439
- * // Prints: 1, 2, 3, 4, 5
4305
+ * const visited: Array<number> = []
4306
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4307
+ * visited // => [1, 2, 3, 4, 5]
4440
4308
  *
4441
4309
  * // Use index in the callback
4442
4310
  * const letters = ["a", "b", "c"]
4311
+ * const indexed: Array<string> = []
4443
4312
  * Iterable.forEach(letters, (letter, i) => {
4444
- * console.log(`${i}: ${letter}`)
4313
+ * indexed.push(`${i}: ${letter}`)
4445
4314
  * })
4446
- * // Prints: "0: a", "1: b", "2: c"
4315
+ * indexed // => ["0: a", "1: b", "2: c"]
4447
4316
  *
4448
4317
  * // Side effects with any iterable
4449
4318
  * const results: Array<number> = []
4450
4319
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4451
4320
  * results.push(n * n)
4452
4321
  * })
4453
- * console.log(results) // [1, 4, 9, 16, 25]
4322
+ * results // => [1, 4, 9, 16, 25]
4454
4323
  *
4455
4324
  * // Process in chunks
4456
4325
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4326
+ * const processed: Array<Array<number>> = []
4457
4327
  * Iterable.forEach(data, (chunk) => {
4458
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4328
+ * processed.push(Array.from(chunk))
4459
4329
  * })
4460
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4330
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4461
4331
  * ```
4462
4332
  *
4463
- * @category elements
4333
+ * @category traversing
4464
4334
  * @since 2.0.0
4465
4335
  */
4466
4336
  export const forEach: {
@@ -4469,37 +4339,40 @@ export const forEach: {
4469
4339
  *
4470
4340
  * **Example** (Iterating with side effects)
4471
4341
  *
4472
- * ```ts
4342
+ * ```ts import.meta.vitest
4473
4343
  * import { Iterable } from "effect"
4474
4344
  *
4475
- * // Print each element
4345
+ * // Collect each visited element
4476
4346
  * const numbers = [1, 2, 3, 4, 5]
4477
- * Iterable.forEach(numbers, (n) => console.log(n))
4478
- * // Prints: 1, 2, 3, 4, 5
4347
+ * const visited: Array<number> = []
4348
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4349
+ * visited // => [1, 2, 3, 4, 5]
4479
4350
  *
4480
4351
  * // Use index in the callback
4481
4352
  * const letters = ["a", "b", "c"]
4353
+ * const indexed: Array<string> = []
4482
4354
  * Iterable.forEach(letters, (letter, i) => {
4483
- * console.log(`${i}: ${letter}`)
4355
+ * indexed.push(`${i}: ${letter}`)
4484
4356
  * })
4485
- * // Prints: "0: a", "1: b", "2: c"
4357
+ * indexed // => ["0: a", "1: b", "2: c"]
4486
4358
  *
4487
4359
  * // Side effects with any iterable
4488
4360
  * const results: Array<number> = []
4489
4361
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4490
4362
  * results.push(n * n)
4491
4363
  * })
4492
- * console.log(results) // [1, 4, 9, 16, 25]
4364
+ * results // => [1, 4, 9, 16, 25]
4493
4365
  *
4494
4366
  * // Process in chunks
4495
4367
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4368
+ * const processed: Array<Array<number>> = []
4496
4369
  * Iterable.forEach(data, (chunk) => {
4497
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4370
+ * processed.push(Array.from(chunk))
4498
4371
  * })
4499
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4372
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4500
4373
  * ```
4501
4374
  *
4502
- * @category elements
4375
+ * @category traversing
4503
4376
  * @since 2.0.0
4504
4377
  */
4505
4378
  <A>(f: (a: A, i: number) => void): (self: Iterable<A>) => void
@@ -4508,37 +4381,40 @@ export const forEach: {
4508
4381
  *
4509
4382
  * **Example** (Iterating with side effects)
4510
4383
  *
4511
- * ```ts
4384
+ * ```ts import.meta.vitest
4512
4385
  * import { Iterable } from "effect"
4513
4386
  *
4514
- * // Print each element
4387
+ * // Collect each visited element
4515
4388
  * const numbers = [1, 2, 3, 4, 5]
4516
- * Iterable.forEach(numbers, (n) => console.log(n))
4517
- * // Prints: 1, 2, 3, 4, 5
4389
+ * const visited: Array<number> = []
4390
+ * Iterable.forEach(numbers, (n) => visited.push(n))
4391
+ * visited // => [1, 2, 3, 4, 5]
4518
4392
  *
4519
4393
  * // Use index in the callback
4520
4394
  * const letters = ["a", "b", "c"]
4395
+ * const indexed: Array<string> = []
4521
4396
  * Iterable.forEach(letters, (letter, i) => {
4522
- * console.log(`${i}: ${letter}`)
4397
+ * indexed.push(`${i}: ${letter}`)
4523
4398
  * })
4524
- * // Prints: "0: a", "1: b", "2: c"
4399
+ * indexed // => ["0: a", "1: b", "2: c"]
4525
4400
  *
4526
4401
  * // Side effects with any iterable
4527
4402
  * const results: Array<number> = []
4528
4403
  * Iterable.forEach(Iterable.range(1, 5), (n) => {
4529
4404
  * results.push(n * n)
4530
4405
  * })
4531
- * console.log(results) // [1, 4, 9, 16, 25]
4406
+ * results // => [1, 4, 9, 16, 25]
4532
4407
  *
4533
4408
  * // Process in chunks
4534
4409
  * const data = Iterable.chunksOf([1, 2, 3, 4, 5, 6], 2)
4410
+ * const processed: Array<Array<number>> = []
4535
4411
  * Iterable.forEach(data, (chunk) => {
4536
- * console.log(`Processing chunk: ${Array.from(chunk)}`)
4412
+ * processed.push(Array.from(chunk))
4537
4413
  * })
4538
- * // Prints: "Processing chunk: 1,2", "Processing chunk: 3,4", "Processing chunk: 5,6"
4414
+ * processed // => [[1, 2], [3, 4], [5, 6]]
4539
4415
  * ```
4540
4416
  *
4541
- * @category elements
4417
+ * @category traversing
4542
4418
  * @since 2.0.0
4543
4419
  */
4544
4420
  <A>(self: Iterable<A>, f: (a: A, i: number) => void): void
@@ -4559,18 +4435,17 @@ export const forEach: {
4559
4435
  *
4560
4436
  * **Example** (Reducing an iterable)
4561
4437
  *
4562
- * ```ts
4438
+ * ```ts import.meta.vitest
4563
4439
  * import { Iterable } from "effect"
4564
4440
  *
4565
4441
  * // Sum all numbers
4566
4442
  * const numbers = [1, 2, 3, 4, 5]
4567
4443
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4568
- * console.log(sum) // 15
4444
+ * sum // => 15
4569
4445
  *
4570
4446
  * // Find maximum value
4571
4447
  * const values = [3, 1, 4, 1, 5, 9, 2]
4572
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4573
- * console.log(max) // 9
4448
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4574
4449
  *
4575
4450
  * // Build an object from key-value pairs
4576
4451
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4582,7 +4457,7 @@ export const forEach: {
4582
4457
  * return acc
4583
4458
  * }
4584
4459
  * )
4585
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4460
+ * obj // => { a: 1, b: 2, c: 3 }
4586
4461
  *
4587
4462
  * // Use index in the reducer
4588
4463
  * const letters = ["a", "b", "c"]
@@ -4594,7 +4469,7 @@ export const forEach: {
4594
4469
  * return acc
4595
4470
  * }
4596
4471
  * )
4597
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4472
+ * indexed // => ["0: a", "1: b", "2: c"]
4598
4473
  * ```
4599
4474
  *
4600
4475
  * @category folding
@@ -4611,18 +4486,17 @@ export const reduce: {
4611
4486
  *
4612
4487
  * **Example** (Reducing an iterable)
4613
4488
  *
4614
- * ```ts
4489
+ * ```ts import.meta.vitest
4615
4490
  * import { Iterable } from "effect"
4616
4491
  *
4617
4492
  * // Sum all numbers
4618
4493
  * const numbers = [1, 2, 3, 4, 5]
4619
4494
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4620
- * console.log(sum) // 15
4495
+ * sum // => 15
4621
4496
  *
4622
4497
  * // Find maximum value
4623
4498
  * const values = [3, 1, 4, 1, 5, 9, 2]
4624
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4625
- * console.log(max) // 9
4499
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4626
4500
  *
4627
4501
  * // Build an object from key-value pairs
4628
4502
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4634,7 +4508,7 @@ export const reduce: {
4634
4508
  * return acc
4635
4509
  * }
4636
4510
  * )
4637
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4511
+ * obj // => { a: 1, b: 2, c: 3 }
4638
4512
  *
4639
4513
  * // Use index in the reducer
4640
4514
  * const letters = ["a", "b", "c"]
@@ -4646,7 +4520,7 @@ export const reduce: {
4646
4520
  * return acc
4647
4521
  * }
4648
4522
  * )
4649
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4523
+ * indexed // => ["0: a", "1: b", "2: c"]
4650
4524
  * ```
4651
4525
  *
4652
4526
  * @category folding
@@ -4663,18 +4537,17 @@ export const reduce: {
4663
4537
  *
4664
4538
  * **Example** (Reducing an iterable)
4665
4539
  *
4666
- * ```ts
4540
+ * ```ts import.meta.vitest
4667
4541
  * import { Iterable } from "effect"
4668
4542
  *
4669
4543
  * // Sum all numbers
4670
4544
  * const numbers = [1, 2, 3, 4, 5]
4671
4545
  * const sum = Iterable.reduce(numbers, 0, (acc, n) => acc + n)
4672
- * console.log(sum) // 15
4546
+ * sum // => 15
4673
4547
  *
4674
4548
  * // Find maximum value
4675
4549
  * const values = [3, 1, 4, 1, 5, 9, 2]
4676
- * const max = Iterable.reduce(values, -Infinity, Math.max)
4677
- * console.log(max) // 9
4550
+ * Iterable.reduce(values, -Infinity, (max, value) => Math.max(max, value)) // => 9
4678
4551
  *
4679
4552
  * // Build an object from key-value pairs
4680
4553
  * const pairs = [["a", 1], ["b", 2], ["c", 3]] as const
@@ -4686,7 +4559,7 @@ export const reduce: {
4686
4559
  * return acc
4687
4560
  * }
4688
4561
  * )
4689
- * console.log(obj) // { a: 1, b: 2, c: 3 }
4562
+ * obj // => { a: 1, b: 2, c: 3 }
4690
4563
  *
4691
4564
  * // Use index in the reducer
4692
4565
  * const letters = ["a", "b", "c"]
@@ -4698,7 +4571,7 @@ export const reduce: {
4698
4571
  * return acc
4699
4572
  * }
4700
4573
  * )
4701
- * console.log(indexed) // ["0: a", "1: b", "2: c"]
4574
+ * indexed // => ["0: a", "1: b", "2: c"]
4702
4575
  * ```
4703
4576
  *
4704
4577
  * @category folding
@@ -4722,20 +4595,20 @@ export const reduce: {
4722
4595
  *
4723
4596
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4724
4597
  *
4725
- * ```ts
4598
+ * ```ts import.meta.vitest
4726
4599
  * import { Iterable } from "effect"
4727
4600
  *
4728
4601
  * // Remove adjacent duplicates with custom equality
4729
4602
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4730
4603
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4731
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4604
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4732
4605
  *
4733
4606
  * // Case-insensitive deduplication
4734
4607
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4735
4608
  * const caseInsensitive = (a: string, b: string) =>
4736
4609
  * a.toLowerCase() === b.toLowerCase()
4737
4610
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4738
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4611
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4739
4612
  *
4740
4613
  * // Deduplication by object property
4741
4614
  * const users = [
@@ -4747,13 +4620,13 @@ export const reduce: {
4747
4620
  * ]
4748
4621
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4749
4622
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4750
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4623
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4751
4624
  *
4752
4625
  * // Approximate numeric equality
4753
4626
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4754
4627
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4755
4628
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4756
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4629
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4757
4630
  * ```
4758
4631
  *
4759
4632
  * @category filtering
@@ -4765,20 +4638,20 @@ export const dedupeAdjacentWith: {
4765
4638
  *
4766
4639
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4767
4640
  *
4768
- * ```ts
4641
+ * ```ts import.meta.vitest
4769
4642
  * import { Iterable } from "effect"
4770
4643
  *
4771
4644
  * // Remove adjacent duplicates with custom equality
4772
4645
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4773
4646
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4774
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4647
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4775
4648
  *
4776
4649
  * // Case-insensitive deduplication
4777
4650
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4778
4651
  * const caseInsensitive = (a: string, b: string) =>
4779
4652
  * a.toLowerCase() === b.toLowerCase()
4780
4653
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4781
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4654
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4782
4655
  *
4783
4656
  * // Deduplication by object property
4784
4657
  * const users = [
@@ -4790,13 +4663,13 @@ export const dedupeAdjacentWith: {
4790
4663
  * ]
4791
4664
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4792
4665
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4793
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4666
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4794
4667
  *
4795
4668
  * // Approximate numeric equality
4796
4669
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4797
4670
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4798
4671
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4799
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4672
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4800
4673
  * ```
4801
4674
  *
4802
4675
  * @category filtering
@@ -4808,20 +4681,20 @@ export const dedupeAdjacentWith: {
4808
4681
  *
4809
4682
  * **Example** (Deduplicating adjacent elements with custom equivalence)
4810
4683
  *
4811
- * ```ts
4684
+ * ```ts import.meta.vitest
4812
4685
  * import { Iterable } from "effect"
4813
4686
  *
4814
4687
  * // Remove adjacent duplicates with custom equality
4815
4688
  * const numbers = [1, 1, 2, 2, 3, 1, 1]
4816
4689
  * const dedupedNumbers = Iterable.dedupeAdjacentWith(numbers, (a, b) => a === b)
4817
- * console.log(Array.from(dedupedNumbers)) // [1, 2, 3, 1]
4690
+ * Array.from(dedupedNumbers) // => [1, 2, 3, 1]
4818
4691
  *
4819
4692
  * // Case-insensitive deduplication
4820
4693
  * const words = ["Hello", "HELLO", "world", "World", "test"]
4821
4694
  * const caseInsensitive = (a: string, b: string) =>
4822
4695
  * a.toLowerCase() === b.toLowerCase()
4823
4696
  * const dedupedWords = Iterable.dedupeAdjacentWith(words, caseInsensitive)
4824
- * console.log(Array.from(dedupedWords)) // ["Hello", "world", "test"]
4697
+ * Array.from(dedupedWords) // => ["Hello", "world", "test"]
4825
4698
  *
4826
4699
  * // Deduplication by object property
4827
4700
  * const users = [
@@ -4833,13 +4706,13 @@ export const dedupeAdjacentWith: {
4833
4706
  * ]
4834
4707
  * const byId = (a: typeof users[0], b: typeof users[0]) => a.id === b.id
4835
4708
  * const dedupedUsers = Iterable.dedupeAdjacentWith(users, byId)
4836
- * console.log(Array.from(dedupedUsers).map((u) => u.id)) // [1, 2, 3]
4709
+ * Array.from(dedupedUsers, (user) => user.id) // => [1, 2, 3]
4837
4710
  *
4838
4711
  * // Approximate numeric equality
4839
4712
  * const floats = [1.0, 1.01, 1.02, 2.0, 2.01, 3.0]
4840
4713
  * const approxEqual = (a: number, b: number) => Math.abs(a - b) < 0.1
4841
4714
  * const dedupedFloats = Iterable.dedupeAdjacentWith(floats, approxEqual)
4842
- * console.log(Array.from(dedupedFloats)) // [1.0, 2.0, 3.0]
4715
+ * Array.from(dedupedFloats) // => [1, 2, 3]
4843
4716
  * ```
4844
4717
  *
4845
4718
  * @category filtering
@@ -4877,18 +4750,18 @@ export const dedupeAdjacentWith: {
4877
4750
  *
4878
4751
  * **Example** (Deduplicating adjacent elements)
4879
4752
  *
4880
- * ```ts
4753
+ * ```ts import.meta.vitest
4881
4754
  * import { Iterable } from "effect"
4882
4755
  *
4883
4756
  * // Remove adjacent duplicate numbers
4884
4757
  * const numbers = [1, 1, 2, 2, 2, 3, 1, 1]
4885
4758
  * const deduped = Iterable.dedupeAdjacent(numbers)
4886
- * console.log(Array.from(deduped)) // [1, 2, 3, 1]
4759
+ * Array.from(deduped) // => [1, 2, 3, 1]
4887
4760
  *
4888
4761
  * // Remove adjacent duplicate characters
4889
4762
  * const letters = "aabbccaa"
4890
4763
  * const dedupedLetters = Iterable.dedupeAdjacent(letters)
4891
- * console.log(Array.from(dedupedLetters)) // ["a", "b", "c", "a"]
4764
+ * Array.from(dedupedLetters) // => ["a", "b", "c", "a"]
4892
4765
  *
4893
4766
  * // Works with objects using deep equality
4894
4767
  * const objects = [
@@ -4899,12 +4772,12 @@ export const dedupeAdjacentWith: {
4899
4772
  * { type: "A" }
4900
4773
  * ]
4901
4774
  * const dedupedObjects = Iterable.dedupeAdjacent(objects)
4902
- * console.log(Array.from(dedupedObjects).map((o) => o.type)) // ["A", "B", "A"]
4775
+ * Array.from(dedupedObjects, (object) => object.type) // => ["A", "B", "A"]
4903
4776
  *
4904
4777
  * // Clean up streaming data
4905
4778
  * const sensorData = [100, 100, 100, 101, 101, 102, 102, 102, 100]
4906
4779
  * const cleanedData = Iterable.dedupeAdjacent(sensorData)
4907
- * console.log(Array.from(cleanedData)) // [100, 101, 102, 100]
4780
+ * Array.from(cleanedData) // => [100, 101, 102, 100]
4908
4781
  * ```
4909
4782
  *
4910
4783
  * @category filtering
@@ -4917,14 +4790,14 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4917
4790
  *
4918
4791
  * **Example** (Combining cartesian products)
4919
4792
  *
4920
- * ```ts
4793
+ * ```ts import.meta.vitest
4921
4794
  * import { Iterable } from "effect"
4922
4795
  *
4923
4796
  * // Create coordinate pairs
4924
4797
  * const xs = [1, 2]
4925
4798
  * const ys = ["a", "b", "c"]
4926
4799
  * 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)"]
4800
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4928
4801
  *
4929
4802
  * // Generate all combinations of options
4930
4803
  * const sizes = ["S", "M", "L"]
@@ -4934,18 +4807,13 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4934
4807
  * colors,
4935
4808
  * (size, color) => ({ size, color })
4936
4809
  * )
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
- * // ]
4810
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
4943
4811
  *
4944
4812
  * // Mathematical operations on all pairs
4945
4813
  * const a = [1, 2, 3]
4946
4814
  * const b = [10, 20]
4947
4815
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
4948
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4816
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
4949
4817
  *
4950
4818
  * // Create test data combinations
4951
4819
  * const userTypes = ["admin", "user"]
@@ -4955,11 +4823,10 @@ export const dedupeAdjacent: <A>(self: Iterable<A>) => Iterable<A> = dedupeAdjac
4955
4823
  * features,
4956
4824
  * (user, feature) => `${user}_can_${feature}`
4957
4825
  * )
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"]
4826
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
4960
4827
  * ```
4961
4828
  *
4962
- * @category elements
4829
+ * @category combining
4963
4830
  * @since 2.0.0
4964
4831
  */
4965
4832
  export const cartesianWith: {
@@ -4968,14 +4835,14 @@ export const cartesianWith: {
4968
4835
  *
4969
4836
  * **Example** (Combining cartesian products)
4970
4837
  *
4971
- * ```ts
4838
+ * ```ts import.meta.vitest
4972
4839
  * import { Iterable } from "effect"
4973
4840
  *
4974
4841
  * // Create coordinate pairs
4975
4842
  * const xs = [1, 2]
4976
4843
  * const ys = ["a", "b", "c"]
4977
4844
  * 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)"]
4845
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
4979
4846
  *
4980
4847
  * // Generate all combinations of options
4981
4848
  * const sizes = ["S", "M", "L"]
@@ -4985,18 +4852,13 @@ export const cartesianWith: {
4985
4852
  * colors,
4986
4853
  * (size, color) => ({ size, color })
4987
4854
  * )
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
- * // ]
4855
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
4994
4856
  *
4995
4857
  * // Mathematical operations on all pairs
4996
4858
  * const a = [1, 2, 3]
4997
4859
  * const b = [10, 20]
4998
4860
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
4999
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4861
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
5000
4862
  *
5001
4863
  * // Create test data combinations
5002
4864
  * const userTypes = ["admin", "user"]
@@ -5006,11 +4868,10 @@ export const cartesianWith: {
5006
4868
  * features,
5007
4869
  * (user, feature) => `${user}_can_${feature}`
5008
4870
  * )
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"]
4871
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
5011
4872
  * ```
5012
4873
  *
5013
- * @category elements
4874
+ * @category combining
5014
4875
  * @since 2.0.0
5015
4876
  */
5016
4877
  <A, B, C>(that: Iterable<B>, f: (a: A, b: B) => C): (self: Iterable<A>) => Iterable<C>
@@ -5019,14 +4880,14 @@ export const cartesianWith: {
5019
4880
  *
5020
4881
  * **Example** (Combining cartesian products)
5021
4882
  *
5022
- * ```ts
4883
+ * ```ts import.meta.vitest
5023
4884
  * import { Iterable } from "effect"
5024
4885
  *
5025
4886
  * // Create coordinate pairs
5026
4887
  * const xs = [1, 2]
5027
4888
  * const ys = ["a", "b", "c"]
5028
4889
  * 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)"]
4890
+ * Array.from(coordinates) // => ["(1,a)", "(1,b)", "(1,c)", "(2,a)", "(2,b)", "(2,c)"]
5030
4891
  *
5031
4892
  * // Generate all combinations of options
5032
4893
  * const sizes = ["S", "M", "L"]
@@ -5036,18 +4897,13 @@ export const cartesianWith: {
5036
4897
  * colors,
5037
4898
  * (size, color) => ({ size, color })
5038
4899
  * )
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
- * // ]
4900
+ * Array.from(products, ({ color, size }) => `${size}:${color}`) // => ["S:red", "S:blue", "M:red", "M:blue", "L:red", "L:blue"]
5045
4901
  *
5046
4902
  * // Mathematical operations on all pairs
5047
4903
  * const a = [1, 2, 3]
5048
4904
  * const b = [10, 20]
5049
4905
  * const mathProducts = Iterable.cartesianWith(a, b, (x, y) => x * y)
5050
- * console.log(Array.from(mathProducts)) // [10, 20, 20, 40, 30, 60]
4906
+ * Array.from(mathProducts) // => [10, 20, 20, 40, 30, 60]
5051
4907
  *
5052
4908
  * // Create test data combinations
5053
4909
  * const userTypes = ["admin", "user"]
@@ -5057,11 +4913,10 @@ export const cartesianWith: {
5057
4913
  * features,
5058
4914
  * (user, feature) => `${user}_can_${feature}`
5059
4915
  * )
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"]
4916
+ * Array.from(testCases) // => ["admin_can_read", "admin_can_write", "admin_can_delete", "user_can_read", "user_can_write", "user_can_delete"]
5062
4917
  * ```
5063
4918
  *
5064
- * @category elements
4919
+ * @category combining
5065
4920
  * @since 2.0.0
5066
4921
  */
5067
4922
  <A, B, C>(self: Iterable<A>, that: Iterable<B>, f: (a: A, b: B) => C): Iterable<C>
@@ -5106,40 +4961,34 @@ export const cartesianWith: {
5106
4961
  *
5107
4962
  * **Example** (Generating cartesian pairs)
5108
4963
  *
5109
- * ```ts
4964
+ * ```ts import.meta.vitest
5110
4965
  * import { Iterable } from "effect"
5111
4966
  *
5112
4967
  * // All pairs of numbers and letters
5113
4968
  * const numbers = [1, 2, 3]
5114
4969
  * const letters = ["a", "b"]
5115
4970
  * 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"]]
4971
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5118
4972
  *
5119
4973
  * // Generate coordinate grid
5120
4974
  * const x = [0, 1, 2]
5121
4975
  * const y = [0, 1]
5122
4976
  * 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]]
4977
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5125
4978
  *
5126
4979
  * // All combinations for testing
5127
4980
  * const browsers = ["chrome", "firefox"]
5128
4981
  * const devices = ["desktop", "mobile", "tablet"]
5129
4982
  * 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
- * // ]
4983
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5135
4984
  *
5136
4985
  * // Empty iterable results in empty cartesian product
5137
4986
  * const empty = Iterable.empty<number>()
5138
4987
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5139
- * console.log(Array.from(withEmpty)) // []
4988
+ * Array.from(withEmpty) // => []
5140
4989
  * ```
5141
4990
  *
5142
- * @category elements
4991
+ * @category combining
5143
4992
  * @since 2.0.0
5144
4993
  */
5145
4994
  export const cartesian: {
@@ -5148,40 +4997,34 @@ export const cartesian: {
5148
4997
  *
5149
4998
  * **Example** (Generating cartesian pairs)
5150
4999
  *
5151
- * ```ts
5000
+ * ```ts import.meta.vitest
5152
5001
  * import { Iterable } from "effect"
5153
5002
  *
5154
5003
  * // All pairs of numbers and letters
5155
5004
  * const numbers = [1, 2, 3]
5156
5005
  * const letters = ["a", "b"]
5157
5006
  * 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"]]
5007
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5160
5008
  *
5161
5009
  * // Generate coordinate grid
5162
5010
  * const x = [0, 1, 2]
5163
5011
  * const y = [0, 1]
5164
5012
  * 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]]
5013
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5167
5014
  *
5168
5015
  * // All combinations for testing
5169
5016
  * const browsers = ["chrome", "firefox"]
5170
5017
  * const devices = ["desktop", "mobile", "tablet"]
5171
5018
  * 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
- * // ]
5019
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5177
5020
  *
5178
5021
  * // Empty iterable results in empty cartesian product
5179
5022
  * const empty = Iterable.empty<number>()
5180
5023
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5181
- * console.log(Array.from(withEmpty)) // []
5024
+ * Array.from(withEmpty) // => []
5182
5025
  * ```
5183
5026
  *
5184
- * @category elements
5027
+ * @category combining
5185
5028
  * @since 2.0.0
5186
5029
  */
5187
5030
  <B>(that: Iterable<B>): <A>(self: Iterable<A>) => Iterable<[A, B]>
@@ -5190,40 +5033,34 @@ export const cartesian: {
5190
5033
  *
5191
5034
  * **Example** (Generating cartesian pairs)
5192
5035
  *
5193
- * ```ts
5036
+ * ```ts import.meta.vitest
5194
5037
  * import { Iterable } from "effect"
5195
5038
  *
5196
5039
  * // All pairs of numbers and letters
5197
5040
  * const numbers = [1, 2, 3]
5198
5041
  * const letters = ["a", "b"]
5199
5042
  * 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"]]
5043
+ * Array.from(pairs) // => [[1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]]
5202
5044
  *
5203
5045
  * // Generate coordinate grid
5204
5046
  * const x = [0, 1, 2]
5205
5047
  * const y = [0, 1]
5206
5048
  * 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]]
5049
+ * Array.from(grid) // => [[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]]
5209
5050
  *
5210
5051
  * // All combinations for testing
5211
5052
  * const browsers = ["chrome", "firefox"]
5212
5053
  * const devices = ["desktop", "mobile", "tablet"]
5213
5054
  * 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
- * // ]
5055
+ * Array.from(testMatrix, ([browser, device]) => `${browser}:${device}`) // => ["chrome:desktop", "chrome:mobile", "chrome:tablet", "firefox:desktop", "firefox:mobile", "firefox:tablet"]
5219
5056
  *
5220
5057
  * // Empty iterable results in empty cartesian product
5221
5058
  * const empty = Iterable.empty<number>()
5222
5059
  * const withEmpty = Iterable.cartesian([1, 2], empty)
5223
- * console.log(Array.from(withEmpty)) // []
5060
+ * Array.from(withEmpty) // => []
5224
5061
  * ```
5225
5062
  *
5226
- * @category elements
5063
+ * @category combining
5227
5064
  * @since 2.0.0
5228
5065
  */
5229
5066
  <A, B>(self: Iterable<A>, that: Iterable<B>): Iterable<[A, B]>
@@ -5237,11 +5074,10 @@ export const cartesian: {
5237
5074
  *
5238
5075
  * **Example** (Counting matching elements)
5239
5076
  *
5240
- * ```ts
5077
+ * ```ts import.meta.vitest
5241
5078
  * import { Iterable } from "effect"
5242
5079
  *
5243
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5244
- * console.log(result) // 2
5080
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5245
5081
  * ```
5246
5082
  *
5247
5083
  * @category folding
@@ -5253,11 +5089,10 @@ export const countBy: {
5253
5089
  *
5254
5090
  * **Example** (Counting matching elements)
5255
5091
  *
5256
- * ```ts
5092
+ * ```ts import.meta.vitest
5257
5093
  * import { Iterable } from "effect"
5258
5094
  *
5259
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5260
- * console.log(result) // 2
5095
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5261
5096
  * ```
5262
5097
  *
5263
5098
  * @category folding
@@ -5269,11 +5104,10 @@ export const countBy: {
5269
5104
  *
5270
5105
  * **Example** (Counting matching elements)
5271
5106
  *
5272
- * ```ts
5107
+ * ```ts import.meta.vitest
5273
5108
  * import { Iterable } from "effect"
5274
5109
  *
5275
- * const result = Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0)
5276
- * console.log(result) // 2
5110
+ * Iterable.countBy([1, 2, 3, 4, 5], (n) => n % 2 === 0) // => 2
5277
5111
  * ```
5278
5112
  *
5279
5113
  * @category folding