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/Chunk.ts CHANGED
@@ -37,12 +37,12 @@ const TypeId = "~effect/collections/Chunk"
37
37
  *
38
38
  * **Example** (Inspecting chunk values)
39
39
  *
40
- * ```ts
40
+ * ```ts import.meta.vitest
41
41
  * import { Chunk } from "effect"
42
42
  *
43
43
  * const chunk: Chunk.Chunk<number> = Chunk.make(1, 2, 3)
44
- * console.log(chunk.length) // 3
45
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3]
44
+ * chunk.length // => 3
45
+ * Chunk.toArray(chunk) // => [1, 2, 3]
46
46
  * ```
47
47
  *
48
48
  * @category models
@@ -64,12 +64,12 @@ export interface Chunk<out A> extends Iterable<A>, Equal.Equal, Pipeable, Inspec
64
64
  *
65
65
  * **Example** (Working with non-empty chunks)
66
66
  *
67
- * ```ts
67
+ * ```ts import.meta.vitest
68
68
  * import { Chunk } from "effect"
69
69
  *
70
70
  * const nonEmptyChunk: Chunk.NonEmptyChunk<number> = Chunk.make(1, 2, 3)
71
- * console.log(Chunk.headNonEmpty(nonEmptyChunk)) // 1
72
- * console.log(Chunk.lastNonEmpty(nonEmptyChunk)) // 3
71
+ * Chunk.headNonEmpty(nonEmptyChunk) // => 1
72
+ * Chunk.lastNonEmpty(nonEmptyChunk) // => 3
73
73
  * ```
74
74
  *
75
75
  * @category models
@@ -82,7 +82,7 @@ export interface NonEmptyChunk<out A> extends Chunk<A>, NonEmptyIterable<A> {}
82
82
  *
83
83
  * **Example** (Applying the Chunk type lambda)
84
84
  *
85
- * ```ts
85
+ * ```ts import.meta.vitest
86
86
  * import type { Chunk, HKT } from "effect"
87
87
  *
88
88
  * // Create a Chunk type using the type lambda
@@ -90,7 +90,7 @@ export interface NonEmptyChunk<out A> extends Chunk<A>, NonEmptyIterable<A> {}
90
90
  * // Equivalent to: Chunk<number>
91
91
  * ```
92
92
  *
93
- * @category type lambdas
93
+ * @category utility types
94
94
  * @since 2.0.0
95
95
  */
96
96
  export interface ChunkTypeLambda extends TypeLambda {
@@ -152,7 +152,7 @@ const emptyArray: ReadonlyArray<never> = []
152
152
  *
153
153
  * **Example** (Comparing chunks for equivalence)
154
154
  *
155
- * ```ts
155
+ * ```ts import.meta.vitest
156
156
  * import { Chunk, Equivalence } from "effect"
157
157
  *
158
158
  * const chunk1 = Chunk.make(1, 2, 3)
@@ -160,8 +160,8 @@ const emptyArray: ReadonlyArray<never> = []
160
160
  * const chunk3 = Chunk.make(1, 2, 4)
161
161
  *
162
162
  * const eq = Chunk.makeEquivalence(Equivalence.strictEqual<number>())
163
- * console.log(eq(chunk1, chunk2)) // true
164
- * console.log(eq(chunk1, chunk3)) // false
163
+ * eq(chunk1, chunk2) // => true
164
+ * eq(chunk1, chunk3) // => false
165
165
  * ```
166
166
  *
167
167
  * @category instances
@@ -262,18 +262,18 @@ const makeChunk = <A>(backing: Backing<A>): Chunk<A> => {
262
262
  *
263
263
  * **Example** (Checking for chunks)
264
264
  *
265
- * ```ts
265
+ * ```ts import.meta.vitest
266
266
  * import { Chunk } from "effect"
267
267
  *
268
268
  * const chunk = Chunk.make(1, 2, 3)
269
269
  * const array = [1, 2, 3]
270
270
  *
271
- * console.log(Chunk.isChunk(chunk)) // true
272
- * console.log(Chunk.isChunk(array)) // false
273
- * console.log(Chunk.isChunk("string")) // false
271
+ * Chunk.isChunk(chunk) // => true
272
+ * Chunk.isChunk(array) // => false
273
+ * Chunk.isChunk("string") // => false
274
274
  * ```
275
275
  *
276
- * @category constructors
276
+ * @category guards
277
277
  * @since 2.0.0
278
278
  */
279
279
  export const isChunk: {
@@ -282,18 +282,18 @@ export const isChunk: {
282
282
  *
283
283
  * **Example** (Checking for chunks)
284
284
  *
285
- * ```ts
285
+ * ```ts import.meta.vitest
286
286
  * import { Chunk } from "effect"
287
287
  *
288
288
  * const chunk = Chunk.make(1, 2, 3)
289
289
  * const array = [1, 2, 3]
290
290
  *
291
- * console.log(Chunk.isChunk(chunk)) // true
292
- * console.log(Chunk.isChunk(array)) // false
293
- * console.log(Chunk.isChunk("string")) // false
291
+ * Chunk.isChunk(chunk) // => true
292
+ * Chunk.isChunk(array) // => false
293
+ * Chunk.isChunk("string") // => false
294
294
  * ```
295
295
  *
296
- * @category constructors
296
+ * @category guards
297
297
  * @since 2.0.0
298
298
  */
299
299
  <A>(u: Iterable<A>): u is Chunk<A>
@@ -302,18 +302,18 @@ export const isChunk: {
302
302
  *
303
303
  * **Example** (Checking for chunks)
304
304
  *
305
- * ```ts
305
+ * ```ts import.meta.vitest
306
306
  * import { Chunk } from "effect"
307
307
  *
308
308
  * const chunk = Chunk.make(1, 2, 3)
309
309
  * const array = [1, 2, 3]
310
310
  *
311
- * console.log(Chunk.isChunk(chunk)) // true
312
- * console.log(Chunk.isChunk(array)) // false
313
- * console.log(Chunk.isChunk("string")) // false
311
+ * Chunk.isChunk(chunk) // => true
312
+ * Chunk.isChunk(array) // => false
313
+ * Chunk.isChunk("string") // => false
314
314
  * ```
315
315
  *
316
- * @category constructors
316
+ * @category guards
317
317
  * @since 2.0.0
318
318
  */
319
319
  (u: unknown): u is Chunk<unknown>
@@ -326,11 +326,10 @@ const _empty = makeChunk<never>({ _tag: "IEmpty" })
326
326
  *
327
327
  * **Example** (Creating an empty chunk)
328
328
  *
329
- * ```ts
329
+ * ```ts import.meta.vitest
330
330
  * import { Chunk } from "effect"
331
331
  *
332
- * const emptyChunk = Chunk.empty()
333
- * console.log(Chunk.size(emptyChunk)) // 0
332
+ * Chunk.size(Chunk.empty()) // => 0
334
333
  * ```
335
334
  *
336
335
  * @category constructors
@@ -343,11 +342,10 @@ export const empty: <A = never>() => Chunk<A> = () => _empty
343
342
  *
344
343
  * **Example** (Creating a non-empty chunk)
345
344
  *
346
- * ```ts
345
+ * ```ts import.meta.vitest
347
346
  * import { Chunk } from "effect"
348
347
  *
349
- * const chunk = Chunk.make(1, 2, 3, 4)
350
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4]
348
+ * Chunk.toArray(Chunk.make(1, 2, 3, 4)) // => [1, 2, 3, 4]
351
349
  * ```
352
350
  *
353
351
  * @category constructors
@@ -361,11 +359,10 @@ export const make = <As extends readonly [any, ...Array<any>]>(...as: As): NonEm
361
359
  *
362
360
  * **Example** (Creating a single-element chunk)
363
361
  *
364
- * ```ts
362
+ * ```ts import.meta.vitest
365
363
  * import { Chunk } from "effect"
366
364
  *
367
- * const chunk = Chunk.of("hello")
368
- * console.log(Chunk.toArray(chunk)) // ["hello"]
365
+ * Chunk.toArray(Chunk.of("hello")) // => ["hello"]
369
366
  * ```
370
367
  *
371
368
  * @category constructors
@@ -378,11 +375,10 @@ export const of = <A>(a: A): NonEmptyChunk<A> => makeChunk({ _tag: "ISingleton",
378
375
  *
379
376
  * **Example** (Creating chunks from iterables)
380
377
  *
381
- * ```ts
378
+ * ```ts import.meta.vitest
382
379
  * import { Chunk } from "effect"
383
380
  *
384
- * const chunk = Chunk.fromIterable([1, 2, 3])
385
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3]
381
+ * Chunk.toArray(Chunk.fromIterable([1, 2, 3])) // => [1, 2, 3]
386
382
  * ```
387
383
  *
388
384
  * @category constructors
@@ -428,17 +424,16 @@ const toArray_ = <A>(self: Chunk<A>): Array<A> => toReadonlyArray(self).slice()
428
424
  *
429
425
  * **Example** (Converting chunks to mutable arrays)
430
426
  *
431
- * ```ts
427
+ * ```ts import.meta.vitest
432
428
  * import { Chunk } from "effect"
433
429
  *
434
430
  * const chunk = Chunk.make(1, 2, 3)
435
431
  * const array = Chunk.toArray(chunk)
436
- * console.log(array) // [1, 2, 3]
437
- * console.log(Array.isArray(array)) // true
432
+ * array // => [1, 2, 3]
433
+ * Array.isArray(array) // => true
438
434
  *
439
435
  * // With empty chunk
440
- * const emptyChunk = Chunk.empty<number>()
441
- * console.log(Chunk.toArray(emptyChunk)) // []
436
+ * Chunk.toArray(Chunk.empty<number>()) // => []
442
437
  * ```
443
438
  *
444
439
  * @category converting
@@ -478,19 +473,18 @@ const toReadonlyArray_ = <A>(self: Chunk<A>): ReadonlyArray<A> => {
478
473
  *
479
474
  * **Example** (Converting chunks to readonly arrays)
480
475
  *
481
- * ```ts
476
+ * ```ts import.meta.vitest
482
477
  * import { Chunk } from "effect"
483
478
  *
484
479
  * const chunk = Chunk.make(1, 2, 3)
485
480
  * const readonlyArray = Chunk.toReadonlyArray(chunk)
486
- * console.log(readonlyArray) // [1, 2, 3]
481
+ * readonlyArray // => [1, 2, 3]
487
482
  *
488
483
  * // The result is read-only, modifications would cause TypeScript errors
489
484
  * // readonlyArray[0] = 10 // TypeScript error
490
485
  *
491
486
  * // With empty chunk
492
- * const emptyChunk = Chunk.empty<number>()
493
- * console.log(Chunk.toReadonlyArray(emptyChunk)) // []
487
+ * Chunk.toReadonlyArray(Chunk.empty<number>()) // => []
494
488
  * ```
495
489
  *
496
490
  * @category converting
@@ -531,16 +525,14 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
531
525
  *
532
526
  * **Example** (Reversing chunks)
533
527
  *
534
- * ```ts
528
+ * ```ts import.meta.vitest
535
529
  * import { Chunk } from "effect"
536
530
  *
537
531
  * const chunk = Chunk.make(1, 2, 3)
538
- * const result = Chunk.reverse(chunk)
539
- *
540
- * console.log(Chunk.toArray(result)) // [3, 2, 1]
532
+ * Chunk.toArray(Chunk.reverse(chunk)) // => [3, 2, 1]
541
533
  * ```
542
534
  *
543
- * @category elements
535
+ * @category transforming
544
536
  * @since 2.0.0
545
537
  */
546
538
  export const reverse: <S extends Chunk<any>>(self: S) => Chunk.With<S, Chunk.Infer<S>> = reverseChunk as any
@@ -551,21 +543,20 @@ export const reverse: <S extends Chunk<any>>(self: S) => Chunk.With<S, Chunk.Inf
551
543
  *
552
544
  * **Example** (Accessing elements safely)
553
545
  *
554
- * ```ts
555
- * import { Chunk } from "effect"
546
+ * ```ts import.meta.vitest
547
+ * import { Chunk, Option } from "effect"
556
548
  *
557
549
  * const chunk = Chunk.make("a", "b", "c", "d")
558
550
  *
559
- * console.log(Chunk.get(chunk, 1)) // Option.some("b")
560
- * console.log(Chunk.get(chunk, 10)) // Option.none()
561
- * console.log(Chunk.get(chunk, -1)) // Option.none()
551
+ * Chunk.get(chunk, 1) // => Option.some("b")
552
+ * Chunk.get(chunk, 10) // => Option.none()
553
+ * Chunk.get(chunk, -1) // => Option.none()
562
554
  *
563
555
  * // Using pipe syntax
564
- * const result = chunk.pipe(Chunk.get(2))
565
- * console.log(result) // Option.some("c")
556
+ * chunk.pipe(Chunk.get(2)) // => Option.some("c")
566
557
  * ```
567
558
  *
568
- * @category elements
559
+ * @category getters
569
560
  * @since 2.0.0
570
561
  */
571
562
  export const get: {
@@ -575,21 +566,20 @@ export const get: {
575
566
  *
576
567
  * **Example** (Accessing elements safely)
577
568
  *
578
- * ```ts
579
- * import { Chunk } from "effect"
569
+ * ```ts import.meta.vitest
570
+ * import { Chunk, Option } from "effect"
580
571
  *
581
572
  * const chunk = Chunk.make("a", "b", "c", "d")
582
573
  *
583
- * console.log(Chunk.get(chunk, 1)) // Option.some("b")
584
- * console.log(Chunk.get(chunk, 10)) // Option.none()
585
- * console.log(Chunk.get(chunk, -1)) // Option.none()
574
+ * Chunk.get(chunk, 1) // => Option.some("b")
575
+ * Chunk.get(chunk, 10) // => Option.none()
576
+ * Chunk.get(chunk, -1) // => Option.none()
586
577
  *
587
578
  * // Using pipe syntax
588
- * const result = chunk.pipe(Chunk.get(2))
589
- * console.log(result) // Option.some("c")
579
+ * chunk.pipe(Chunk.get(2)) // => Option.some("c")
590
580
  * ```
591
581
  *
592
- * @category elements
582
+ * @category getters
593
583
  * @since 2.0.0
594
584
  */
595
585
  (index: number): <A>(self: Chunk<A>) => Option<A>
@@ -599,21 +589,20 @@ export const get: {
599
589
  *
600
590
  * **Example** (Accessing elements safely)
601
591
  *
602
- * ```ts
603
- * import { Chunk } from "effect"
592
+ * ```ts import.meta.vitest
593
+ * import { Chunk, Option } from "effect"
604
594
  *
605
595
  * const chunk = Chunk.make("a", "b", "c", "d")
606
596
  *
607
- * console.log(Chunk.get(chunk, 1)) // Option.some("b")
608
- * console.log(Chunk.get(chunk, 10)) // Option.none()
609
- * console.log(Chunk.get(chunk, -1)) // Option.none()
597
+ * Chunk.get(chunk, 1) // => Option.some("b")
598
+ * Chunk.get(chunk, 10) // => Option.none()
599
+ * Chunk.get(chunk, -1) // => Option.none()
610
600
  *
611
601
  * // Using pipe syntax
612
- * const result = chunk.pipe(Chunk.get(2))
613
- * console.log(result) // Option.some("c")
602
+ * chunk.pipe(Chunk.get(2)) // => Option.some("c")
614
603
  * ```
615
604
  *
616
- * @category elements
605
+ * @category getters
617
606
  * @since 2.0.0
618
607
  */
619
608
  <A>(self: Chunk<A>, index: number): Option<A>
@@ -637,16 +626,16 @@ export const get: {
637
626
  *
638
627
  * **Example** (Creating chunks without copying arrays)
639
628
  *
640
- * ```ts
629
+ * ```ts import.meta.vitest
641
630
  * import { Chunk } from "effect"
642
631
  *
643
632
  * const array = [1, 2, 3, 4, 5]
644
633
  * const chunk = Chunk.fromArrayUnsafe(array)
645
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4, 5]
634
+ * Chunk.toArray(chunk) // => [1, 2, 3, 4, 5]
646
635
  *
647
636
  * // Warning: Since this doesn't copy the array, mutations affect the chunk
648
637
  * array[0] = 999
649
- * console.log(Chunk.toArray(chunk)) // [999, 2, 3, 4, 5]
638
+ * Chunk.toArray(chunk) // => [999, 2, 3, 4, 5]
650
639
  * ```
651
640
  *
652
641
  * @category unsafe
@@ -669,15 +658,15 @@ export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
669
658
  *
670
659
  * **Example** (Creating non-empty chunks without copying arrays)
671
660
  *
672
- * ```ts
661
+ * ```ts import.meta.vitest
673
662
  * import { Array, Chunk } from "effect"
674
663
  *
675
664
  * const nonEmptyArray = Array.make(1, 2, 3, 4, 5)
676
665
  * const chunk = Chunk.fromNonEmptyArrayUnsafe(nonEmptyArray)
677
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4, 5]
666
+ * Chunk.toArray(chunk) // => [1, 2, 3, 4, 5]
678
667
  *
679
668
  * // The result is guaranteed to be non-empty
680
- * console.log(Chunk.isNonEmpty(chunk)) // true
669
+ * Chunk.isNonEmpty(chunk) // => true
681
670
  * ```
682
671
  *
683
672
  * @category unsafe
@@ -700,16 +689,16 @@ export const fromNonEmptyArrayUnsafe = <A>(self: NonEmptyReadonlyArray<A>): NonE
700
689
  *
701
690
  * **Example** (Accessing elements unsafely)
702
691
  *
703
- * ```ts
692
+ * ```ts import.meta.vitest
704
693
  * import { Chunk, Option } from "effect"
705
694
  *
706
695
  * const chunk = Chunk.make("a", "b", "c", "d")
707
696
  *
708
- * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
709
- * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
697
+ * Chunk.getUnsafe(chunk, 1) // => "b"
698
+ * Chunk.getUnsafe(chunk, 3) // => "d"
710
699
  *
711
700
  * // Use Chunk.get when the index may be out of bounds
712
- * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
701
+ * Option.isNone(Chunk.get(chunk, 10)) // => true
713
702
  * ```
714
703
  *
715
704
  * @category unsafe
@@ -730,16 +719,16 @@ export const getUnsafe: {
730
719
  *
731
720
  * **Example** (Accessing elements unsafely)
732
721
  *
733
- * ```ts
722
+ * ```ts import.meta.vitest
734
723
  * import { Chunk, Option } from "effect"
735
724
  *
736
725
  * const chunk = Chunk.make("a", "b", "c", "d")
737
726
  *
738
- * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
739
- * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
727
+ * Chunk.getUnsafe(chunk, 1) // => "b"
728
+ * Chunk.getUnsafe(chunk, 3) // => "d"
740
729
  *
741
730
  * // Use Chunk.get when the index may be out of bounds
742
- * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
731
+ * Option.isNone(Chunk.get(chunk, 10)) // => true
743
732
  * ```
744
733
  *
745
734
  * @category unsafe
@@ -760,16 +749,16 @@ export const getUnsafe: {
760
749
  *
761
750
  * **Example** (Accessing elements unsafely)
762
751
  *
763
- * ```ts
752
+ * ```ts import.meta.vitest
764
753
  * import { Chunk, Option } from "effect"
765
754
  *
766
755
  * const chunk = Chunk.make("a", "b", "c", "d")
767
756
  *
768
- * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
769
- * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
757
+ * Chunk.getUnsafe(chunk, 1) // => "b"
758
+ * Chunk.getUnsafe(chunk, 3) // => "d"
770
759
  *
771
760
  * // Use Chunk.get when the index may be out of bounds
772
- * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
761
+ * Option.isNone(Chunk.get(chunk, 10)) // => true
773
762
  * ```
774
763
  *
775
764
  * @category unsafe
@@ -815,17 +804,15 @@ export const getUnsafe: {
815
804
  *
816
805
  * **Example** (Appending an element)
817
806
  *
818
- * ```ts
807
+ * ```ts import.meta.vitest
819
808
  * import { Chunk } from "effect"
820
809
  *
821
810
  * const chunk = Chunk.make(1, 2, 3)
822
- * const newChunk = Chunk.append(chunk, 4)
823
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
811
+ * Chunk.toArray(Chunk.append(chunk, 4)) // => [1, 2, 3, 4]
824
812
  *
825
813
  * // Appending to empty chunk
826
814
  * const emptyChunk = Chunk.empty<number>()
827
- * const singleElement = Chunk.append(emptyChunk, 42)
828
- * console.log(Chunk.toArray(singleElement)) // [42]
815
+ * Chunk.toArray(Chunk.append(emptyChunk, 42)) // => [42]
829
816
  * ```
830
817
  *
831
818
  * @see {@link prepend} for adding one element before the existing elements
@@ -845,17 +832,15 @@ export const append: {
845
832
  *
846
833
  * **Example** (Appending an element)
847
834
  *
848
- * ```ts
835
+ * ```ts import.meta.vitest
849
836
  * import { Chunk } from "effect"
850
837
  *
851
838
  * const chunk = Chunk.make(1, 2, 3)
852
- * const newChunk = Chunk.append(chunk, 4)
853
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
839
+ * Chunk.toArray(Chunk.append(chunk, 4)) // => [1, 2, 3, 4]
854
840
  *
855
841
  * // Appending to empty chunk
856
842
  * const emptyChunk = Chunk.empty<number>()
857
- * const singleElement = Chunk.append(emptyChunk, 42)
858
- * console.log(Chunk.toArray(singleElement)) // [42]
843
+ * Chunk.toArray(Chunk.append(emptyChunk, 42)) // => [42]
859
844
  * ```
860
845
  *
861
846
  * @see {@link prepend} for adding one element before the existing elements
@@ -875,17 +860,15 @@ export const append: {
875
860
  *
876
861
  * **Example** (Appending an element)
877
862
  *
878
- * ```ts
863
+ * ```ts import.meta.vitest
879
864
  * import { Chunk } from "effect"
880
865
  *
881
866
  * const chunk = Chunk.make(1, 2, 3)
882
- * const newChunk = Chunk.append(chunk, 4)
883
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
867
+ * Chunk.toArray(Chunk.append(chunk, 4)) // => [1, 2, 3, 4]
884
868
  *
885
869
  * // Appending to empty chunk
886
870
  * const emptyChunk = Chunk.empty<number>()
887
- * const singleElement = Chunk.append(emptyChunk, 42)
888
- * console.log(Chunk.toArray(singleElement)) // [42]
871
+ * Chunk.toArray(Chunk.append(emptyChunk, 42)) // => [42]
889
872
  * ```
890
873
  *
891
874
  * @see {@link prepend} for adding one element before the existing elements
@@ -902,17 +885,15 @@ export const append: {
902
885
  *
903
886
  * **Example** (Prepending an element)
904
887
  *
905
- * ```ts
888
+ * ```ts import.meta.vitest
906
889
  * import { Chunk } from "effect"
907
890
  *
908
891
  * const chunk = Chunk.make(2, 3, 4)
909
- * const newChunk = Chunk.prepend(chunk, 1)
910
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
892
+ * Chunk.toArray(Chunk.prepend(chunk, 1)) // => [1, 2, 3, 4]
911
893
  *
912
894
  * // Prepending to empty chunk
913
895
  * const emptyChunk = Chunk.empty<string>()
914
- * const singleElement = Chunk.prepend(emptyChunk, "first")
915
- * console.log(Chunk.toArray(singleElement)) // ["first"]
896
+ * Chunk.toArray(Chunk.prepend(emptyChunk, "first")) // => ["first"]
916
897
  * ```
917
898
  *
918
899
  * @category combining
@@ -924,17 +905,15 @@ export const prepend: {
924
905
  *
925
906
  * **Example** (Prepending an element)
926
907
  *
927
- * ```ts
908
+ * ```ts import.meta.vitest
928
909
  * import { Chunk } from "effect"
929
910
  *
930
911
  * const chunk = Chunk.make(2, 3, 4)
931
- * const newChunk = Chunk.prepend(chunk, 1)
932
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
912
+ * Chunk.toArray(Chunk.prepend(chunk, 1)) // => [1, 2, 3, 4]
933
913
  *
934
914
  * // Prepending to empty chunk
935
915
  * const emptyChunk = Chunk.empty<string>()
936
- * const singleElement = Chunk.prepend(emptyChunk, "first")
937
- * console.log(Chunk.toArray(singleElement)) // ["first"]
916
+ * Chunk.toArray(Chunk.prepend(emptyChunk, "first")) // => ["first"]
938
917
  * ```
939
918
  *
940
919
  * @category combining
@@ -946,17 +925,15 @@ export const prepend: {
946
925
  *
947
926
  * **Example** (Prepending an element)
948
927
  *
949
- * ```ts
928
+ * ```ts import.meta.vitest
950
929
  * import { Chunk } from "effect"
951
930
  *
952
931
  * const chunk = Chunk.make(2, 3, 4)
953
- * const newChunk = Chunk.prepend(chunk, 1)
954
- * console.log(Chunk.toArray(newChunk)) // [1, 2, 3, 4]
932
+ * Chunk.toArray(Chunk.prepend(chunk, 1)) // => [1, 2, 3, 4]
955
933
  *
956
934
  * // Prepending to empty chunk
957
935
  * const emptyChunk = Chunk.empty<string>()
958
- * const singleElement = Chunk.prepend(emptyChunk, "first")
959
- * console.log(Chunk.toArray(singleElement)) // ["first"]
936
+ * Chunk.toArray(Chunk.prepend(emptyChunk, "first")) // => ["first"]
960
937
  * ```
961
938
  *
962
939
  * @category combining
@@ -970,15 +947,14 @@ export const prepend: {
970
947
  *
971
948
  * **Example** (Taking elements from the start)
972
949
  *
973
- * ```ts
950
+ * ```ts import.meta.vitest
974
951
  * import { Chunk } from "effect"
975
952
  *
976
953
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
977
- * const result = Chunk.take(chunk, 3)
978
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
954
+ * Chunk.toArray(Chunk.take(chunk, 3)) // => [1, 2, 3]
979
955
  * ```
980
956
  *
981
- * @category elements
957
+ * @category filtering
982
958
  * @since 2.0.0
983
959
  */
984
960
  export const take: {
@@ -987,15 +963,14 @@ export const take: {
987
963
  *
988
964
  * **Example** (Taking elements from the start)
989
965
  *
990
- * ```ts
966
+ * ```ts import.meta.vitest
991
967
  * import { Chunk } from "effect"
992
968
  *
993
969
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
994
- * const result = Chunk.take(chunk, 3)
995
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
970
+ * Chunk.toArray(Chunk.take(chunk, 3)) // => [1, 2, 3]
996
971
  * ```
997
972
  *
998
- * @category elements
973
+ * @category filtering
999
974
  * @since 2.0.0
1000
975
  */
1001
976
  (n: number): <A>(self: Chunk<A>) => Chunk<A>
@@ -1004,19 +979,19 @@ export const take: {
1004
979
  *
1005
980
  * **Example** (Taking elements from the start)
1006
981
  *
1007
- * ```ts
982
+ * ```ts import.meta.vitest
1008
983
  * import { Chunk } from "effect"
1009
984
  *
1010
985
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1011
- * const result = Chunk.take(chunk, 3)
1012
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
986
+ * Chunk.toArray(Chunk.take(chunk, 3)) // => [1, 2, 3]
1013
987
  * ```
1014
988
  *
1015
- * @category elements
989
+ * @category filtering
1016
990
  * @since 2.0.0
1017
991
  */
1018
992
  <A>(self: Chunk<A>, n: number): Chunk<A>
1019
- } = dual(2, <A>(self: Chunk<A>, n: number): Chunk<A> => {
993
+ } = dual(2, <A>(self: Chunk<A>, _n: number): Chunk<A> => {
994
+ const n = Math.floor(_n)
1020
995
  if (n <= 0) {
1021
996
  return _empty
1022
997
  } else if (n >= self.length) {
@@ -1059,15 +1034,14 @@ export const take: {
1059
1034
  *
1060
1035
  * **Example** (Dropping elements from the start)
1061
1036
  *
1062
- * ```ts
1037
+ * ```ts import.meta.vitest
1063
1038
  * import { Chunk } from "effect"
1064
1039
  *
1065
1040
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1066
- * const result = Chunk.drop(chunk, 2)
1067
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1041
+ * Chunk.toArray(Chunk.drop(chunk, 2)) // => [3, 4, 5]
1068
1042
  * ```
1069
1043
  *
1070
- * @category elements
1044
+ * @category filtering
1071
1045
  * @since 2.0.0
1072
1046
  */
1073
1047
  export const drop: {
@@ -1076,15 +1050,14 @@ export const drop: {
1076
1050
  *
1077
1051
  * **Example** (Dropping elements from the start)
1078
1052
  *
1079
- * ```ts
1053
+ * ```ts import.meta.vitest
1080
1054
  * import { Chunk } from "effect"
1081
1055
  *
1082
1056
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1083
- * const result = Chunk.drop(chunk, 2)
1084
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1057
+ * Chunk.toArray(Chunk.drop(chunk, 2)) // => [3, 4, 5]
1085
1058
  * ```
1086
1059
  *
1087
- * @category elements
1060
+ * @category filtering
1088
1061
  * @since 2.0.0
1089
1062
  */
1090
1063
  (n: number): <A>(self: Chunk<A>) => Chunk<A>
@@ -1093,19 +1066,19 @@ export const drop: {
1093
1066
  *
1094
1067
  * **Example** (Dropping elements from the start)
1095
1068
  *
1096
- * ```ts
1069
+ * ```ts import.meta.vitest
1097
1070
  * import { Chunk } from "effect"
1098
1071
  *
1099
1072
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1100
- * const result = Chunk.drop(chunk, 2)
1101
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1073
+ * Chunk.toArray(Chunk.drop(chunk, 2)) // => [3, 4, 5]
1102
1074
  * ```
1103
1075
  *
1104
- * @category elements
1076
+ * @category filtering
1105
1077
  * @since 2.0.0
1106
1078
  */
1107
1079
  <A>(self: Chunk<A>, n: number): Chunk<A>
1108
- } = dual(2, <A>(self: Chunk<A>, n: number): Chunk<A> => {
1080
+ } = dual(2, <A>(self: Chunk<A>, _n: number): Chunk<A> => {
1081
+ const n = Math.floor(_n)
1109
1082
  if (n <= 0) {
1110
1083
  return self
1111
1084
  } else if (n >= self.length) {
@@ -1147,15 +1120,14 @@ export const drop: {
1147
1120
  *
1148
1121
  * **Example** (Dropping elements from the end)
1149
1122
  *
1150
- * ```ts
1123
+ * ```ts import.meta.vitest
1151
1124
  * import { Chunk } from "effect"
1152
1125
  *
1153
1126
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1154
- * const result = Chunk.dropRight(chunk, 2)
1155
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
1127
+ * Chunk.toArray(Chunk.dropRight(chunk, 2)) // => [1, 2, 3]
1156
1128
  * ```
1157
1129
  *
1158
- * @category elements
1130
+ * @category filtering
1159
1131
  * @since 2.0.0
1160
1132
  */
1161
1133
  export const dropRight: {
@@ -1164,15 +1136,14 @@ export const dropRight: {
1164
1136
  *
1165
1137
  * **Example** (Dropping elements from the end)
1166
1138
  *
1167
- * ```ts
1139
+ * ```ts import.meta.vitest
1168
1140
  * import { Chunk } from "effect"
1169
1141
  *
1170
1142
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1171
- * const result = Chunk.dropRight(chunk, 2)
1172
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
1143
+ * Chunk.toArray(Chunk.dropRight(chunk, 2)) // => [1, 2, 3]
1173
1144
  * ```
1174
1145
  *
1175
- * @category elements
1146
+ * @category filtering
1176
1147
  * @since 2.0.0
1177
1148
  */
1178
1149
  (n: number): <A>(self: Chunk<A>) => Chunk<A>
@@ -1181,15 +1152,14 @@ export const dropRight: {
1181
1152
  *
1182
1153
  * **Example** (Dropping elements from the end)
1183
1154
  *
1184
- * ```ts
1155
+ * ```ts import.meta.vitest
1185
1156
  * import { Chunk } from "effect"
1186
1157
  *
1187
1158
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1188
- * const result = Chunk.dropRight(chunk, 2)
1189
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
1159
+ * Chunk.toArray(Chunk.dropRight(chunk, 2)) // => [1, 2, 3]
1190
1160
  * ```
1191
1161
  *
1192
- * @category elements
1162
+ * @category filtering
1193
1163
  * @since 2.0.0
1194
1164
  */
1195
1165
  <A>(self: Chunk<A>, n: number): Chunk<A>
@@ -1200,15 +1170,14 @@ export const dropRight: {
1200
1170
  *
1201
1171
  * **Example** (Dropping elements while a predicate matches)
1202
1172
  *
1203
- * ```ts
1173
+ * ```ts import.meta.vitest
1204
1174
  * import { Chunk } from "effect"
1205
1175
  *
1206
1176
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1207
- * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1208
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1177
+ * Chunk.toArray(Chunk.dropWhile(chunk, (n) => n < 3)) // => [3, 4, 5]
1209
1178
  * ```
1210
1179
  *
1211
- * @category elements
1180
+ * @category filtering
1212
1181
  * @since 2.0.0
1213
1182
  */
1214
1183
  export const dropWhile: {
@@ -1217,15 +1186,14 @@ export const dropWhile: {
1217
1186
  *
1218
1187
  * **Example** (Dropping elements while a predicate matches)
1219
1188
  *
1220
- * ```ts
1189
+ * ```ts import.meta.vitest
1221
1190
  * import { Chunk } from "effect"
1222
1191
  *
1223
1192
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1224
- * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1225
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1193
+ * Chunk.toArray(Chunk.dropWhile(chunk, (n) => n < 3)) // => [3, 4, 5]
1226
1194
  * ```
1227
1195
  *
1228
- * @category elements
1196
+ * @category filtering
1229
1197
  * @since 2.0.0
1230
1198
  */
1231
1199
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
@@ -1234,15 +1202,14 @@ export const dropWhile: {
1234
1202
  *
1235
1203
  * **Example** (Dropping elements while a predicate matches)
1236
1204
  *
1237
- * ```ts
1205
+ * ```ts import.meta.vitest
1238
1206
  * import { Chunk } from "effect"
1239
1207
  *
1240
1208
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1241
- * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1242
- * console.log(Chunk.toArray(result)) // [3, 4, 5]
1209
+ * Chunk.toArray(Chunk.dropWhile(chunk, (n) => n < 3)) // => [3, 4, 5]
1243
1210
  * ```
1244
1211
  *
1245
- * @category elements
1212
+ * @category filtering
1246
1213
  * @since 2.0.0
1247
1214
  */
1248
1215
  <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
@@ -1262,16 +1229,13 @@ export const dropWhile: {
1262
1229
  *
1263
1230
  * **Example** (Prepending all elements)
1264
1231
  *
1265
- * ```ts
1232
+ * ```ts import.meta.vitest
1266
1233
  * import { Chunk } from "effect"
1267
1234
  *
1268
- * const result = Chunk.make(1, 2).pipe(
1235
+ * Chunk.make(1, 2).pipe(
1269
1236
  * Chunk.prependAll(Chunk.make("a", "b")),
1270
1237
  * Chunk.toArray
1271
- * )
1272
- *
1273
- * console.log(result)
1274
- * // [ "a", "b", 1, 2 ]
1238
+ * ) // => ["a", "b", 1, 2]
1275
1239
  * ```
1276
1240
  *
1277
1241
  * @category combining
@@ -1284,16 +1248,13 @@ export const prependAll: {
1284
1248
  *
1285
1249
  * **Example** (Prepending all elements)
1286
1250
  *
1287
- * ```ts
1251
+ * ```ts import.meta.vitest
1288
1252
  * import { Chunk } from "effect"
1289
1253
  *
1290
- * const result = Chunk.make(1, 2).pipe(
1254
+ * Chunk.make(1, 2).pipe(
1291
1255
  * Chunk.prependAll(Chunk.make("a", "b")),
1292
1256
  * Chunk.toArray
1293
- * )
1294
- *
1295
- * console.log(result)
1296
- * // [ "a", "b", 1, 2 ]
1257
+ * ) // => ["a", "b", 1, 2]
1297
1258
  * ```
1298
1259
  *
1299
1260
  * @category combining
@@ -1306,16 +1267,13 @@ export const prependAll: {
1306
1267
  *
1307
1268
  * **Example** (Prepending all elements)
1308
1269
  *
1309
- * ```ts
1270
+ * ```ts import.meta.vitest
1310
1271
  * import { Chunk } from "effect"
1311
1272
  *
1312
- * const result = Chunk.make(1, 2).pipe(
1273
+ * Chunk.make(1, 2).pipe(
1313
1274
  * Chunk.prependAll(Chunk.make("a", "b")),
1314
1275
  * Chunk.toArray
1315
- * )
1316
- *
1317
- * console.log(result)
1318
- * // [ "a", "b", 1, 2 ]
1276
+ * ) // => ["a", "b", 1, 2]
1319
1277
  * ```
1320
1278
  *
1321
1279
  * @category combining
@@ -1328,16 +1286,13 @@ export const prependAll: {
1328
1286
  *
1329
1287
  * **Example** (Prepending all elements)
1330
1288
  *
1331
- * ```ts
1289
+ * ```ts import.meta.vitest
1332
1290
  * import { Chunk } from "effect"
1333
1291
  *
1334
- * const result = Chunk.make(1, 2).pipe(
1292
+ * Chunk.make(1, 2).pipe(
1335
1293
  * Chunk.prependAll(Chunk.make("a", "b")),
1336
1294
  * Chunk.toArray
1337
- * )
1338
- *
1339
- * console.log(result)
1340
- * // [ "a", "b", 1, 2 ]
1295
+ * ) // => ["a", "b", 1, 2]
1341
1296
  * ```
1342
1297
  *
1343
1298
  * @category combining
@@ -1350,16 +1305,13 @@ export const prependAll: {
1350
1305
  *
1351
1306
  * **Example** (Prepending all elements)
1352
1307
  *
1353
- * ```ts
1308
+ * ```ts import.meta.vitest
1354
1309
  * import { Chunk } from "effect"
1355
1310
  *
1356
- * const result = Chunk.make(1, 2).pipe(
1311
+ * Chunk.make(1, 2).pipe(
1357
1312
  * Chunk.prependAll(Chunk.make("a", "b")),
1358
1313
  * Chunk.toArray
1359
- * )
1360
- *
1361
- * console.log(result)
1362
- * // [ "a", "b", 1, 2 ]
1314
+ * ) // => ["a", "b", 1, 2]
1363
1315
  * ```
1364
1316
  *
1365
1317
  * @category combining
@@ -1379,16 +1331,13 @@ export const prependAll: {
1379
1331
  *
1380
1332
  * **Example** (Appending all elements)
1381
1333
  *
1382
- * ```ts
1334
+ * ```ts import.meta.vitest
1383
1335
  * import { Chunk } from "effect"
1384
1336
  *
1385
- * const result = Chunk.make(1, 2).pipe(
1337
+ * Chunk.make(1, 2).pipe(
1386
1338
  * Chunk.appendAll(Chunk.make("a", "b")),
1387
1339
  * Chunk.toArray
1388
- * )
1389
- *
1390
- * console.log(result)
1391
- * // [ 1, 2, "a", "b" ]
1340
+ * ) // => [1, 2, "a", "b"]
1392
1341
  * ```
1393
1342
  *
1394
1343
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1409,16 +1358,13 @@ export const appendAll: {
1409
1358
  *
1410
1359
  * **Example** (Appending all elements)
1411
1360
  *
1412
- * ```ts
1361
+ * ```ts import.meta.vitest
1413
1362
  * import { Chunk } from "effect"
1414
1363
  *
1415
- * const result = Chunk.make(1, 2).pipe(
1364
+ * Chunk.make(1, 2).pipe(
1416
1365
  * Chunk.appendAll(Chunk.make("a", "b")),
1417
1366
  * Chunk.toArray
1418
- * )
1419
- *
1420
- * console.log(result)
1421
- * // [ 1, 2, "a", "b" ]
1367
+ * ) // => [1, 2, "a", "b"]
1422
1368
  * ```
1423
1369
  *
1424
1370
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1439,16 +1385,13 @@ export const appendAll: {
1439
1385
  *
1440
1386
  * **Example** (Appending all elements)
1441
1387
  *
1442
- * ```ts
1388
+ * ```ts import.meta.vitest
1443
1389
  * import { Chunk } from "effect"
1444
1390
  *
1445
- * const result = Chunk.make(1, 2).pipe(
1391
+ * Chunk.make(1, 2).pipe(
1446
1392
  * Chunk.appendAll(Chunk.make("a", "b")),
1447
1393
  * Chunk.toArray
1448
- * )
1449
- *
1450
- * console.log(result)
1451
- * // [ 1, 2, "a", "b" ]
1394
+ * ) // => [1, 2, "a", "b"]
1452
1395
  * ```
1453
1396
  *
1454
1397
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1469,16 +1412,13 @@ export const appendAll: {
1469
1412
  *
1470
1413
  * **Example** (Appending all elements)
1471
1414
  *
1472
- * ```ts
1415
+ * ```ts import.meta.vitest
1473
1416
  * import { Chunk } from "effect"
1474
1417
  *
1475
- * const result = Chunk.make(1, 2).pipe(
1418
+ * Chunk.make(1, 2).pipe(
1476
1419
  * Chunk.appendAll(Chunk.make("a", "b")),
1477
1420
  * Chunk.toArray
1478
- * )
1479
- *
1480
- * console.log(result)
1481
- * // [ 1, 2, "a", "b" ]
1421
+ * ) // => [1, 2, "a", "b"]
1482
1422
  * ```
1483
1423
  *
1484
1424
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1499,16 +1439,13 @@ export const appendAll: {
1499
1439
  *
1500
1440
  * **Example** (Appending all elements)
1501
1441
  *
1502
- * ```ts
1442
+ * ```ts import.meta.vitest
1503
1443
  * import { Chunk } from "effect"
1504
1444
  *
1505
- * const result = Chunk.make(1, 2).pipe(
1445
+ * Chunk.make(1, 2).pipe(
1506
1446
  * Chunk.appendAll(Chunk.make("a", "b")),
1507
1447
  * Chunk.toArray
1508
- * )
1509
- *
1510
- * console.log(result)
1511
- * // [ 1, 2, "a", "b" ]
1448
+ * ) // => [1, 2, "a", "b"]
1512
1449
  * ```
1513
1450
  *
1514
1451
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1538,16 +1475,13 @@ export const appendAll: {
1538
1475
  *
1539
1476
  * **Example** (Appending all elements)
1540
1477
  *
1541
- * ```ts
1478
+ * ```ts import.meta.vitest
1542
1479
  * import { Chunk } from "effect"
1543
1480
  *
1544
- * const result = Chunk.make(1, 2).pipe(
1481
+ * Chunk.make(1, 2).pipe(
1545
1482
  * Chunk.appendAll(Chunk.make("a", "b")),
1546
1483
  * Chunk.toArray
1547
- * )
1548
- *
1549
- * console.log(result)
1550
- * // [ 1, 2, "a", "b" ]
1484
+ * ) // => [1, 2, "a", "b"]
1551
1485
  * ```
1552
1486
  *
1553
1487
  * @see {@link prependAll} for concatenating chunks in the opposite order
@@ -1593,7 +1527,7 @@ export const appendAll: {
1593
1527
  *
1594
1528
  * **Example** (Filtering and mapping values)
1595
1529
  *
1596
- * ```ts
1530
+ * ```ts import.meta.vitest
1597
1531
  * import { Chunk, Result } from "effect"
1598
1532
  *
1599
1533
  * const chunk = Chunk.make("1", "2", "hello", "3", "world")
@@ -1601,14 +1535,14 @@ export const appendAll: {
1601
1535
  * const num = parseInt(str)
1602
1536
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1603
1537
  * })
1604
- * console.log(Chunk.toArray(numbers)) // [1, 2, 3]
1538
+ * Chunk.toArray(numbers) // => [1, 2, 3]
1605
1539
  *
1606
1540
  * // With index parameter
1607
1541
  * const evenIndexNumbers = Chunk.filterMap(chunk, (str, i) => {
1608
1542
  * const num = parseInt(str)
1609
1543
  * return isNaN(num) || i % 2 !== 0 ? Result.failVoid : Result.succeed(num)
1610
1544
  * })
1611
- * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1545
+ * Chunk.toArray(evenIndexNumbers) // => [1]
1612
1546
  * ```
1613
1547
  *
1614
1548
  * @category filtering
@@ -1620,7 +1554,7 @@ export const filterMap: {
1620
1554
  *
1621
1555
  * **Example** (Filtering and mapping values)
1622
1556
  *
1623
- * ```ts
1557
+ * ```ts import.meta.vitest
1624
1558
  * import { Chunk, Result } from "effect"
1625
1559
  *
1626
1560
  * const chunk = Chunk.make("1", "2", "hello", "3", "world")
@@ -1628,14 +1562,14 @@ export const filterMap: {
1628
1562
  * const num = parseInt(str)
1629
1563
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1630
1564
  * })
1631
- * console.log(Chunk.toArray(numbers)) // [1, 2, 3]
1565
+ * Chunk.toArray(numbers) // => [1, 2, 3]
1632
1566
  *
1633
1567
  * // With index parameter
1634
1568
  * const evenIndexNumbers = Chunk.filterMap(chunk, (str, i) => {
1635
1569
  * const num = parseInt(str)
1636
1570
  * return isNaN(num) || i % 2 !== 0 ? Result.failVoid : Result.succeed(num)
1637
1571
  * })
1638
- * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1572
+ * Chunk.toArray(evenIndexNumbers) // => [1]
1639
1573
  * ```
1640
1574
  *
1641
1575
  * @category filtering
@@ -1647,7 +1581,7 @@ export const filterMap: {
1647
1581
  *
1648
1582
  * **Example** (Filtering and mapping values)
1649
1583
  *
1650
- * ```ts
1584
+ * ```ts import.meta.vitest
1651
1585
  * import { Chunk, Result } from "effect"
1652
1586
  *
1653
1587
  * const chunk = Chunk.make("1", "2", "hello", "3", "world")
@@ -1655,14 +1589,14 @@ export const filterMap: {
1655
1589
  * const num = parseInt(str)
1656
1590
  * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1657
1591
  * })
1658
- * console.log(Chunk.toArray(numbers)) // [1, 2, 3]
1592
+ * Chunk.toArray(numbers) // => [1, 2, 3]
1659
1593
  *
1660
1594
  * // With index parameter
1661
1595
  * const evenIndexNumbers = Chunk.filterMap(chunk, (str, i) => {
1662
1596
  * const num = parseInt(str)
1663
1597
  * return isNaN(num) || i % 2 !== 0 ? Result.failVoid : Result.succeed(num)
1664
1598
  * })
1665
- * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1599
+ * Chunk.toArray(evenIndexNumbers) // => [1]
1666
1600
  * ```
1667
1601
  *
1668
1602
  * @category filtering
@@ -1689,17 +1623,17 @@ export const filterMap: {
1689
1623
  *
1690
1624
  * **Example** (Filtering values)
1691
1625
  *
1692
- * ```ts
1626
+ * ```ts import.meta.vitest
1693
1627
  * import { Chunk } from "effect"
1694
1628
  *
1695
1629
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
1696
1630
  * const evenNumbers = Chunk.filter(chunk, (n) => n % 2 === 0)
1697
- * console.log(Chunk.toArray(evenNumbers)) // [2, 4, 6]
1631
+ * Chunk.toArray(evenNumbers) // => [2, 4, 6]
1698
1632
  *
1699
1633
  * // With refinement
1700
1634
  * const mixed = Chunk.make("hello", 42, "world", 100)
1701
1635
  * const numbers = Chunk.filter(mixed, (x): x is number => typeof x === "number")
1702
- * console.log(Chunk.toArray(numbers)) // [42, 100]
1636
+ * Chunk.toArray(numbers) // => [42, 100]
1703
1637
  * ```
1704
1638
  *
1705
1639
  * @category filtering
@@ -1711,17 +1645,17 @@ export const filter: {
1711
1645
  *
1712
1646
  * **Example** (Filtering values)
1713
1647
  *
1714
- * ```ts
1648
+ * ```ts import.meta.vitest
1715
1649
  * import { Chunk } from "effect"
1716
1650
  *
1717
1651
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
1718
1652
  * const evenNumbers = Chunk.filter(chunk, (n) => n % 2 === 0)
1719
- * console.log(Chunk.toArray(evenNumbers)) // [2, 4, 6]
1653
+ * Chunk.toArray(evenNumbers) // => [2, 4, 6]
1720
1654
  *
1721
1655
  * // With refinement
1722
1656
  * const mixed = Chunk.make("hello", 42, "world", 100)
1723
1657
  * const numbers = Chunk.filter(mixed, (x): x is number => typeof x === "number")
1724
- * console.log(Chunk.toArray(numbers)) // [42, 100]
1658
+ * Chunk.toArray(numbers) // => [42, 100]
1725
1659
  * ```
1726
1660
  *
1727
1661
  * @category filtering
@@ -1733,17 +1667,17 @@ export const filter: {
1733
1667
  *
1734
1668
  * **Example** (Filtering values)
1735
1669
  *
1736
- * ```ts
1670
+ * ```ts import.meta.vitest
1737
1671
  * import { Chunk } from "effect"
1738
1672
  *
1739
1673
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
1740
1674
  * const evenNumbers = Chunk.filter(chunk, (n) => n % 2 === 0)
1741
- * console.log(Chunk.toArray(evenNumbers)) // [2, 4, 6]
1675
+ * Chunk.toArray(evenNumbers) // => [2, 4, 6]
1742
1676
  *
1743
1677
  * // With refinement
1744
1678
  * const mixed = Chunk.make("hello", 42, "world", 100)
1745
1679
  * const numbers = Chunk.filter(mixed, (x): x is number => typeof x === "number")
1746
- * console.log(Chunk.toArray(numbers)) // [42, 100]
1680
+ * Chunk.toArray(numbers) // => [42, 100]
1747
1681
  * ```
1748
1682
  *
1749
1683
  * @category filtering
@@ -1755,17 +1689,17 @@ export const filter: {
1755
1689
  *
1756
1690
  * **Example** (Filtering values)
1757
1691
  *
1758
- * ```ts
1692
+ * ```ts import.meta.vitest
1759
1693
  * import { Chunk } from "effect"
1760
1694
  *
1761
1695
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
1762
1696
  * const evenNumbers = Chunk.filter(chunk, (n) => n % 2 === 0)
1763
- * console.log(Chunk.toArray(evenNumbers)) // [2, 4, 6]
1697
+ * Chunk.toArray(evenNumbers) // => [2, 4, 6]
1764
1698
  *
1765
1699
  * // With refinement
1766
1700
  * const mixed = Chunk.make("hello", 42, "world", 100)
1767
1701
  * const numbers = Chunk.filter(mixed, (x): x is number => typeof x === "number")
1768
- * console.log(Chunk.toArray(numbers)) // [42, 100]
1702
+ * Chunk.toArray(numbers) // => [42, 100]
1769
1703
  * ```
1770
1704
  *
1771
1705
  * @category filtering
@@ -1777,17 +1711,17 @@ export const filter: {
1777
1711
  *
1778
1712
  * **Example** (Filtering values)
1779
1713
  *
1780
- * ```ts
1714
+ * ```ts import.meta.vitest
1781
1715
  * import { Chunk } from "effect"
1782
1716
  *
1783
1717
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
1784
1718
  * const evenNumbers = Chunk.filter(chunk, (n) => n % 2 === 0)
1785
- * console.log(Chunk.toArray(evenNumbers)) // [2, 4, 6]
1719
+ * Chunk.toArray(evenNumbers) // => [2, 4, 6]
1786
1720
  *
1787
1721
  * // With refinement
1788
1722
  * const mixed = Chunk.make("hello", 42, "world", 100)
1789
1723
  * const numbers = Chunk.filter(mixed, (x): x is number => typeof x === "number")
1790
- * console.log(Chunk.toArray(numbers)) // [42, 100]
1724
+ * Chunk.toArray(numbers) // => [42, 100]
1791
1725
  * ```
1792
1726
  *
1793
1727
  * @category filtering
@@ -1804,23 +1738,19 @@ export const filter: {
1804
1738
  *
1805
1739
  * **Example** (Filtering and mapping while values match)
1806
1740
  *
1807
- * ```ts
1741
+ * ```ts import.meta.vitest
1808
1742
  * import { Chunk, Result } from "effect"
1809
1743
  *
1810
1744
  * const chunk = Chunk.make("1", "2", "hello", "3", "4")
1811
- * const result = Chunk.filterMapWhile(chunk, (s) => {
1812
- * const num = parseInt(s)
1813
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1814
- * })
1815
- * console.log(Chunk.toArray(result)) // [1, 2]
1816
- * // Stops at "hello" and doesn't process "3", "4"
1817
- *
1818
- * // Compare with regular filterMap
1819
- * const allNumbers = Chunk.filterMap(chunk, (s) => {
1820
- * const num = parseInt(s)
1821
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1822
- * })
1823
- * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1745
+ * Chunk.toArray(Chunk.filterMapWhile(chunk, (s) => {
1746
+ * const n = Number(s)
1747
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1748
+ * })) // => [1, 2]
1749
+ *
1750
+ * Chunk.toArray(Chunk.filterMap(chunk, (s) => {
1751
+ * const n = Number(s)
1752
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1753
+ * })) // => [1, 2, 3, 4]
1824
1754
  * ```
1825
1755
  *
1826
1756
  * @category filtering
@@ -1832,23 +1762,19 @@ export const filterMapWhile: {
1832
1762
  *
1833
1763
  * **Example** (Filtering and mapping while values match)
1834
1764
  *
1835
- * ```ts
1765
+ * ```ts import.meta.vitest
1836
1766
  * import { Chunk, Result } from "effect"
1837
1767
  *
1838
1768
  * const chunk = Chunk.make("1", "2", "hello", "3", "4")
1839
- * const result = Chunk.filterMapWhile(chunk, (s) => {
1840
- * const num = parseInt(s)
1841
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1842
- * })
1843
- * console.log(Chunk.toArray(result)) // [1, 2]
1844
- * // Stops at "hello" and doesn't process "3", "4"
1845
- *
1846
- * // Compare with regular filterMap
1847
- * const allNumbers = Chunk.filterMap(chunk, (s) => {
1848
- * const num = parseInt(s)
1849
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1850
- * })
1851
- * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1769
+ * Chunk.toArray(Chunk.filterMapWhile(chunk, (s) => {
1770
+ * const n = Number(s)
1771
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1772
+ * })) // => [1, 2]
1773
+ *
1774
+ * Chunk.toArray(Chunk.filterMap(chunk, (s) => {
1775
+ * const n = Number(s)
1776
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1777
+ * })) // => [1, 2, 3, 4]
1852
1778
  * ```
1853
1779
  *
1854
1780
  * @category filtering
@@ -1860,23 +1786,19 @@ export const filterMapWhile: {
1860
1786
  *
1861
1787
  * **Example** (Filtering and mapping while values match)
1862
1788
  *
1863
- * ```ts
1789
+ * ```ts import.meta.vitest
1864
1790
  * import { Chunk, Result } from "effect"
1865
1791
  *
1866
1792
  * const chunk = Chunk.make("1", "2", "hello", "3", "4")
1867
- * const result = Chunk.filterMapWhile(chunk, (s) => {
1868
- * const num = parseInt(s)
1869
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1870
- * })
1871
- * console.log(Chunk.toArray(result)) // [1, 2]
1872
- * // Stops at "hello" and doesn't process "3", "4"
1873
- *
1874
- * // Compare with regular filterMap
1875
- * const allNumbers = Chunk.filterMap(chunk, (s) => {
1876
- * const num = parseInt(s)
1877
- * return isNaN(num) ? Result.failVoid : Result.succeed(num)
1878
- * })
1879
- * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1793
+ * Chunk.toArray(Chunk.filterMapWhile(chunk, (s) => {
1794
+ * const n = Number(s)
1795
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1796
+ * })) // => [1, 2]
1797
+ *
1798
+ * Chunk.toArray(Chunk.filterMap(chunk, (s) => {
1799
+ * const n = Number(s)
1800
+ * return Number.isNaN(n) ? Result.failVoid : Result.succeed(n)
1801
+ * })) // => [1, 2, 3, 4]
1880
1802
  * ```
1881
1803
  *
1882
1804
  * @category filtering
@@ -1901,12 +1823,11 @@ export const filterMapWhile: {
1901
1823
  *
1902
1824
  * **Example** (Compacting optional values)
1903
1825
  *
1904
- * ```ts
1826
+ * ```ts import.meta.vitest
1905
1827
  * import { Chunk, Option } from "effect"
1906
1828
  *
1907
1829
  * const chunk = Chunk.make(Option.some(1), Option.none(), Option.some(3))
1908
- * const result = Chunk.compact(chunk)
1909
- * console.log(Chunk.toArray(result)) // [1, 3]
1830
+ * Chunk.toArray(Chunk.compact(chunk)) // => [1, 3]
1910
1831
  * ```
1911
1832
  *
1912
1833
  * @category filtering
@@ -1927,12 +1848,12 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
1927
1848
  *
1928
1849
  * **Example** (Flat mapping chunks)
1929
1850
  *
1930
- * ```ts
1851
+ * ```ts import.meta.vitest
1931
1852
  * import { Chunk } from "effect"
1932
1853
  *
1933
1854
  * const chunk = Chunk.make(1, 2, 3)
1934
1855
  * const duplicated = Chunk.flatMap(chunk, (n) => Chunk.make(n, n))
1935
- * console.log(Chunk.toArray(duplicated)) // [1, 1, 2, 2, 3, 3]
1856
+ * Chunk.toArray(duplicated) // => [1, 1, 2, 2, 3, 3]
1936
1857
  *
1937
1858
  * // Flattening nested arrays
1938
1859
  * const words = Chunk.make("hello", "world")
@@ -1940,11 +1861,11 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
1940
1861
  * words,
1941
1862
  * (word) => Chunk.fromIterable(word.split(""))
1942
1863
  * )
1943
- * console.log(Chunk.toArray(letters)) // ["h", "e", "l", "l", "o", "w", "o", "r", "l", "d"]
1864
+ * Chunk.toArray(letters).join("") // => "helloworld"
1944
1865
  *
1945
1866
  * // With index parameter
1946
1867
  * const indexed = Chunk.flatMap(chunk, (n, i) => Chunk.make(n + i))
1947
- * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1868
+ * Chunk.toArray(indexed) // => [1, 3, 5]
1948
1869
  * ```
1949
1870
  *
1950
1871
  * @category sequencing
@@ -1956,12 +1877,12 @@ export const flatMap: {
1956
1877
  *
1957
1878
  * **Example** (Flat mapping chunks)
1958
1879
  *
1959
- * ```ts
1880
+ * ```ts import.meta.vitest
1960
1881
  * import { Chunk } from "effect"
1961
1882
  *
1962
1883
  * const chunk = Chunk.make(1, 2, 3)
1963
1884
  * const duplicated = Chunk.flatMap(chunk, (n) => Chunk.make(n, n))
1964
- * console.log(Chunk.toArray(duplicated)) // [1, 1, 2, 2, 3, 3]
1885
+ * Chunk.toArray(duplicated) // => [1, 1, 2, 2, 3, 3]
1965
1886
  *
1966
1887
  * // Flattening nested arrays
1967
1888
  * const words = Chunk.make("hello", "world")
@@ -1969,11 +1890,11 @@ export const flatMap: {
1969
1890
  * words,
1970
1891
  * (word) => Chunk.fromIterable(word.split(""))
1971
1892
  * )
1972
- * console.log(Chunk.toArray(letters)) // ["h", "e", "l", "l", "o", "w", "o", "r", "l", "d"]
1893
+ * Chunk.toArray(letters).join("") // => "helloworld"
1973
1894
  *
1974
1895
  * // With index parameter
1975
1896
  * const indexed = Chunk.flatMap(chunk, (n, i) => Chunk.make(n + i))
1976
- * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1897
+ * Chunk.toArray(indexed) // => [1, 3, 5]
1977
1898
  * ```
1978
1899
  *
1979
1900
  * @category sequencing
@@ -1985,12 +1906,12 @@ export const flatMap: {
1985
1906
  *
1986
1907
  * **Example** (Flat mapping chunks)
1987
1908
  *
1988
- * ```ts
1909
+ * ```ts import.meta.vitest
1989
1910
  * import { Chunk } from "effect"
1990
1911
  *
1991
1912
  * const chunk = Chunk.make(1, 2, 3)
1992
1913
  * const duplicated = Chunk.flatMap(chunk, (n) => Chunk.make(n, n))
1993
- * console.log(Chunk.toArray(duplicated)) // [1, 1, 2, 2, 3, 3]
1914
+ * Chunk.toArray(duplicated) // => [1, 1, 2, 2, 3, 3]
1994
1915
  *
1995
1916
  * // Flattening nested arrays
1996
1917
  * const words = Chunk.make("hello", "world")
@@ -1998,11 +1919,11 @@ export const flatMap: {
1998
1919
  * words,
1999
1920
  * (word) => Chunk.fromIterable(word.split(""))
2000
1921
  * )
2001
- * console.log(Chunk.toArray(letters)) // ["h", "e", "l", "l", "o", "w", "o", "r", "l", "d"]
1922
+ * Chunk.toArray(letters).join("") // => "helloworld"
2002
1923
  *
2003
1924
  * // With index parameter
2004
1925
  * const indexed = Chunk.flatMap(chunk, (n, i) => Chunk.make(n + i))
2005
- * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1926
+ * Chunk.toArray(indexed) // => [1, 3, 5]
2006
1927
  * ```
2007
1928
  *
2008
1929
  * @category sequencing
@@ -2014,12 +1935,12 @@ export const flatMap: {
2014
1935
  *
2015
1936
  * **Example** (Flat mapping chunks)
2016
1937
  *
2017
- * ```ts
1938
+ * ```ts import.meta.vitest
2018
1939
  * import { Chunk } from "effect"
2019
1940
  *
2020
1941
  * const chunk = Chunk.make(1, 2, 3)
2021
1942
  * const duplicated = Chunk.flatMap(chunk, (n) => Chunk.make(n, n))
2022
- * console.log(Chunk.toArray(duplicated)) // [1, 1, 2, 2, 3, 3]
1943
+ * Chunk.toArray(duplicated) // => [1, 1, 2, 2, 3, 3]
2023
1944
  *
2024
1945
  * // Flattening nested arrays
2025
1946
  * const words = Chunk.make("hello", "world")
@@ -2027,11 +1948,11 @@ export const flatMap: {
2027
1948
  * words,
2028
1949
  * (word) => Chunk.fromIterable(word.split(""))
2029
1950
  * )
2030
- * console.log(Chunk.toArray(letters)) // ["h", "e", "l", "l", "o", "w", "o", "r", "l", "d"]
1951
+ * Chunk.toArray(letters).join("") // => "helloworld"
2031
1952
  *
2032
1953
  * // With index parameter
2033
1954
  * const indexed = Chunk.flatMap(chunk, (n, i) => Chunk.make(n + i))
2034
- * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1955
+ * Chunk.toArray(indexed) // => [1, 3, 5]
2035
1956
  * ```
2036
1957
  *
2037
1958
  * @category sequencing
@@ -2062,26 +1983,19 @@ export const flatMap: {
2062
1983
  *
2063
1984
  * **Example** (Iterating over chunk values)
2064
1985
  *
2065
- * ```ts
1986
+ * ```ts import.meta.vitest
2066
1987
  * import { Chunk } from "effect"
2067
1988
  *
2068
1989
  * const chunk = Chunk.make(1, 2, 3, 4)
2069
1990
  *
2070
- * // Log each element
2071
- * Chunk.forEach(chunk, (n) => console.log(`Value: ${n}`))
2072
- * // Output:
2073
- * // Value: 1
2074
- * // Value: 2
2075
- * // Value: 3
2076
- * // Value: 4
1991
+ * const values: Array<string> = []
1992
+ * Chunk.forEach(chunk, (n) => values.push(`Value: ${n}`))
1993
+ * values // => ["Value: 1", "Value: 2", "Value: 3", "Value: 4"]
2077
1994
  *
2078
1995
  * // With index parameter
2079
- * Chunk.forEach(chunk, (n, i) => console.log(`Index ${i}: ${n}`))
2080
- * // Output:
2081
- * // Index 0: 1
2082
- * // Index 1: 2
2083
- * // Index 2: 3
2084
- * // Index 3: 4
1996
+ * const indexed: Array<string> = []
1997
+ * Chunk.forEach(chunk, (n, i) => indexed.push(`Index ${i}: ${n}`))
1998
+ * indexed // => ["Index 0: 1", "Index 1: 2", "Index 2: 3", "Index 3: 4"]
2085
1999
  * ```
2086
2000
  *
2087
2001
  * @category combinators
@@ -2100,26 +2014,19 @@ export const forEach: {
2100
2014
  *
2101
2015
  * **Example** (Iterating over chunk values)
2102
2016
  *
2103
- * ```ts
2017
+ * ```ts import.meta.vitest
2104
2018
  * import { Chunk } from "effect"
2105
2019
  *
2106
2020
  * const chunk = Chunk.make(1, 2, 3, 4)
2107
2021
  *
2108
- * // Log each element
2109
- * Chunk.forEach(chunk, (n) => console.log(`Value: ${n}`))
2110
- * // Output:
2111
- * // Value: 1
2112
- * // Value: 2
2113
- * // Value: 3
2114
- * // Value: 4
2022
+ * const values: Array<string> = []
2023
+ * Chunk.forEach(chunk, (n) => values.push(`Value: ${n}`))
2024
+ * values // => ["Value: 1", "Value: 2", "Value: 3", "Value: 4"]
2115
2025
  *
2116
2026
  * // With index parameter
2117
- * Chunk.forEach(chunk, (n, i) => console.log(`Index ${i}: ${n}`))
2118
- * // Output:
2119
- * // Index 0: 1
2120
- * // Index 1: 2
2121
- * // Index 2: 3
2122
- * // Index 3: 4
2027
+ * const indexed: Array<string> = []
2028
+ * Chunk.forEach(chunk, (n, i) => indexed.push(`Index ${i}: ${n}`))
2029
+ * indexed // => ["Index 0: 1", "Index 1: 2", "Index 2: 3", "Index 3: 4"]
2123
2030
  * ```
2124
2031
  *
2125
2032
  * @category combinators
@@ -2138,26 +2045,19 @@ export const forEach: {
2138
2045
  *
2139
2046
  * **Example** (Iterating over chunk values)
2140
2047
  *
2141
- * ```ts
2048
+ * ```ts import.meta.vitest
2142
2049
  * import { Chunk } from "effect"
2143
2050
  *
2144
2051
  * const chunk = Chunk.make(1, 2, 3, 4)
2145
2052
  *
2146
- * // Log each element
2147
- * Chunk.forEach(chunk, (n) => console.log(`Value: ${n}`))
2148
- * // Output:
2149
- * // Value: 1
2150
- * // Value: 2
2151
- * // Value: 3
2152
- * // Value: 4
2053
+ * const values: Array<string> = []
2054
+ * Chunk.forEach(chunk, (n) => values.push(`Value: ${n}`))
2055
+ * values // => ["Value: 1", "Value: 2", "Value: 3", "Value: 4"]
2153
2056
  *
2154
2057
  * // With index parameter
2155
- * Chunk.forEach(chunk, (n, i) => console.log(`Index ${i}: ${n}`))
2156
- * // Output:
2157
- * // Index 0: 1
2158
- * // Index 1: 2
2159
- * // Index 2: 3
2160
- * // Index 3: 4
2058
+ * const indexed: Array<string> = []
2059
+ * Chunk.forEach(chunk, (n, i) => indexed.push(`Index ${i}: ${n}`))
2060
+ * indexed // => ["Index 0: 1", "Index 1: 2", "Index 2: 3", "Index 3: 4"]
2161
2061
  * ```
2162
2062
  *
2163
2063
  * @category combinators
@@ -2171,7 +2071,7 @@ export const forEach: {
2171
2071
  *
2172
2072
  * **Example** (Flattening nested chunks)
2173
2073
  *
2174
- * ```ts
2074
+ * ```ts import.meta.vitest
2175
2075
  * import { Chunk } from "effect"
2176
2076
  *
2177
2077
  * const nested = Chunk.make(
@@ -2179,8 +2079,7 @@ export const forEach: {
2179
2079
  * Chunk.make(3, 4, 5),
2180
2080
  * Chunk.make(6)
2181
2081
  * )
2182
- * const flattened = Chunk.flatten(nested)
2183
- * console.log(Chunk.toArray(flattened)) // [1, 2, 3, 4, 5, 6]
2082
+ * Chunk.toArray(Chunk.flatten(nested)) // => [1, 2, 3, 4, 5, 6]
2184
2083
  *
2185
2084
  * // With empty chunks
2186
2085
  * const withEmpty = Chunk.make(
@@ -2188,7 +2087,7 @@ export const forEach: {
2188
2087
  * Chunk.empty<number>(),
2189
2088
  * Chunk.make(3, 4)
2190
2089
  * )
2191
- * console.log(Chunk.toArray(Chunk.flatten(withEmpty))) // [1, 2, 3, 4]
2090
+ * Chunk.toArray(Chunk.flatten(withEmpty)) // => [1, 2, 3, 4]
2192
2091
  * ```
2193
2092
  *
2194
2093
  * @category sequencing
@@ -2215,25 +2114,23 @@ export const flatten: <S extends Chunk<Chunk<any>>>(self: S) => Chunk.Flatten<S>
2215
2114
  *
2216
2115
  * **Example** (Splitting into fixed-size chunks)
2217
2116
  *
2218
- * ```ts
2117
+ * ```ts import.meta.vitest
2219
2118
  * import { Chunk } from "effect"
2220
2119
  *
2221
2120
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
2222
2121
  * const chunked = Chunk.chunksOf(chunk, 3)
2223
2122
  *
2224
- * console.log(Chunk.toArray(chunked).map(Chunk.toArray))
2225
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2123
+ * Chunk.toArray(chunked).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2226
2124
  *
2227
2125
  * // When length is not evenly divisible
2228
2126
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5)
2229
2127
  * const chunked2 = Chunk.chunksOf(chunk2, 2)
2230
- * console.log(Chunk.toArray(chunked2).map(Chunk.toArray))
2231
- * // [[1, 2], [3, 4], [5]]
2128
+ * Chunk.toArray(chunked2).map(Chunk.toArray) // => [[1, 2], [3, 4], [5]]
2232
2129
  * ```
2233
2130
  *
2234
2131
  * @see {@link split} for splitting into a target number of chunks instead of a fixed chunk size
2235
2132
  *
2236
- * @category elements
2133
+ * @category splitting
2237
2134
  * @since 2.0.0
2238
2135
  */
2239
2136
  export const chunksOf: {
@@ -2256,25 +2153,23 @@ export const chunksOf: {
2256
2153
  *
2257
2154
  * **Example** (Splitting into fixed-size chunks)
2258
2155
  *
2259
- * ```ts
2156
+ * ```ts import.meta.vitest
2260
2157
  * import { Chunk } from "effect"
2261
2158
  *
2262
2159
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
2263
2160
  * const chunked = Chunk.chunksOf(chunk, 3)
2264
2161
  *
2265
- * console.log(Chunk.toArray(chunked).map(Chunk.toArray))
2266
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2162
+ * Chunk.toArray(chunked).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2267
2163
  *
2268
2164
  * // When length is not evenly divisible
2269
2165
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5)
2270
2166
  * const chunked2 = Chunk.chunksOf(chunk2, 2)
2271
- * console.log(Chunk.toArray(chunked2).map(Chunk.toArray))
2272
- * // [[1, 2], [3, 4], [5]]
2167
+ * Chunk.toArray(chunked2).map(Chunk.toArray) // => [[1, 2], [3, 4], [5]]
2273
2168
  * ```
2274
2169
  *
2275
2170
  * @see {@link split} for splitting into a target number of chunks instead of a fixed chunk size
2276
2171
  *
2277
- * @category elements
2172
+ * @category splitting
2278
2173
  * @since 2.0.0
2279
2174
  */
2280
2175
  (n: number): <A>(self: Chunk<A>) => Chunk<Chunk<A>>
@@ -2297,25 +2192,23 @@ export const chunksOf: {
2297
2192
  *
2298
2193
  * **Example** (Splitting into fixed-size chunks)
2299
2194
  *
2300
- * ```ts
2195
+ * ```ts import.meta.vitest
2301
2196
  * import { Chunk } from "effect"
2302
2197
  *
2303
2198
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
2304
2199
  * const chunked = Chunk.chunksOf(chunk, 3)
2305
2200
  *
2306
- * console.log(Chunk.toArray(chunked).map(Chunk.toArray))
2307
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2201
+ * Chunk.toArray(chunked).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
2308
2202
  *
2309
2203
  * // When length is not evenly divisible
2310
2204
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5)
2311
2205
  * const chunked2 = Chunk.chunksOf(chunk2, 2)
2312
- * console.log(Chunk.toArray(chunked2).map(Chunk.toArray))
2313
- * // [[1, 2], [3, 4], [5]]
2206
+ * Chunk.toArray(chunked2).map(Chunk.toArray) // => [[1, 2], [3, 4], [5]]
2314
2207
  * ```
2315
2208
  *
2316
2209
  * @see {@link split} for splitting into a target number of chunks instead of a fixed chunk size
2317
2210
  *
2318
- * @category elements
2211
+ * @category splitting
2319
2212
  * @since 2.0.0
2320
2213
  */
2321
2214
  <A>(self: Chunk<A>, n: number): Chunk<Chunk<A>>
@@ -2344,26 +2237,25 @@ export const chunksOf: {
2344
2237
  *
2345
2238
  * **Example** (Intersecting chunks)
2346
2239
  *
2347
- * ```ts
2240
+ * ```ts import.meta.vitest
2348
2241
  * import { Chunk } from "effect"
2349
2242
  *
2350
2243
  * const chunk1 = Chunk.make(1, 2, 3, 4)
2351
2244
  * const chunk2 = Chunk.make(3, 4, 5, 6)
2352
- * const result = Chunk.intersection(chunk1, chunk2)
2353
- * console.log(Chunk.toArray(result)) // [3, 4]
2245
+ * Chunk.toArray(Chunk.intersection(chunk1, chunk2)) // => [3, 4]
2354
2246
  *
2355
2247
  * // With strings
2356
2248
  * const words1 = Chunk.make("hello", "world", "foo")
2357
2249
  * const words2 = Chunk.make("world", "bar", "foo")
2358
- * console.log(Chunk.toArray(Chunk.intersection(words1, words2))) // ["world", "foo"]
2250
+ * Chunk.toArray(Chunk.intersection(words1, words2)) // => ["world", "foo"]
2359
2251
  *
2360
2252
  * // No intersection
2361
2253
  * const chunk3 = Chunk.make(1, 2)
2362
2254
  * const chunk4 = Chunk.make(3, 4)
2363
- * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2255
+ * Chunk.toArray(Chunk.intersection(chunk3, chunk4)) // => []
2364
2256
  * ```
2365
2257
  *
2366
- * @category elements
2258
+ * @category set operations
2367
2259
  * @since 2.0.0
2368
2260
  */
2369
2261
  export const intersection: {
@@ -2376,26 +2268,25 @@ export const intersection: {
2376
2268
  *
2377
2269
  * **Example** (Intersecting chunks)
2378
2270
  *
2379
- * ```ts
2271
+ * ```ts import.meta.vitest
2380
2272
  * import { Chunk } from "effect"
2381
2273
  *
2382
2274
  * const chunk1 = Chunk.make(1, 2, 3, 4)
2383
2275
  * const chunk2 = Chunk.make(3, 4, 5, 6)
2384
- * const result = Chunk.intersection(chunk1, chunk2)
2385
- * console.log(Chunk.toArray(result)) // [3, 4]
2276
+ * Chunk.toArray(Chunk.intersection(chunk1, chunk2)) // => [3, 4]
2386
2277
  *
2387
2278
  * // With strings
2388
2279
  * const words1 = Chunk.make("hello", "world", "foo")
2389
2280
  * const words2 = Chunk.make("world", "bar", "foo")
2390
- * console.log(Chunk.toArray(Chunk.intersection(words1, words2))) // ["world", "foo"]
2281
+ * Chunk.toArray(Chunk.intersection(words1, words2)) // => ["world", "foo"]
2391
2282
  *
2392
2283
  * // No intersection
2393
2284
  * const chunk3 = Chunk.make(1, 2)
2394
2285
  * const chunk4 = Chunk.make(3, 4)
2395
- * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2286
+ * Chunk.toArray(Chunk.intersection(chunk3, chunk4)) // => []
2396
2287
  * ```
2397
2288
  *
2398
- * @category elements
2289
+ * @category set operations
2399
2290
  * @since 2.0.0
2400
2291
  */
2401
2292
  <A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A & B>
@@ -2408,26 +2299,25 @@ export const intersection: {
2408
2299
  *
2409
2300
  * **Example** (Intersecting chunks)
2410
2301
  *
2411
- * ```ts
2302
+ * ```ts import.meta.vitest
2412
2303
  * import { Chunk } from "effect"
2413
2304
  *
2414
2305
  * const chunk1 = Chunk.make(1, 2, 3, 4)
2415
2306
  * const chunk2 = Chunk.make(3, 4, 5, 6)
2416
- * const result = Chunk.intersection(chunk1, chunk2)
2417
- * console.log(Chunk.toArray(result)) // [3, 4]
2307
+ * Chunk.toArray(Chunk.intersection(chunk1, chunk2)) // => [3, 4]
2418
2308
  *
2419
2309
  * // With strings
2420
2310
  * const words1 = Chunk.make("hello", "world", "foo")
2421
2311
  * const words2 = Chunk.make("world", "bar", "foo")
2422
- * console.log(Chunk.toArray(Chunk.intersection(words1, words2))) // ["world", "foo"]
2312
+ * Chunk.toArray(Chunk.intersection(words1, words2)) // => ["world", "foo"]
2423
2313
  *
2424
2314
  * // No intersection
2425
2315
  * const chunk3 = Chunk.make(1, 2)
2426
2316
  * const chunk4 = Chunk.make(3, 4)
2427
- * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2317
+ * Chunk.toArray(Chunk.intersection(chunk3, chunk4)) // => []
2428
2318
  * ```
2429
2319
  *
2430
- * @category elements
2320
+ * @category set operations
2431
2321
  * @since 2.0.0
2432
2322
  */
2433
2323
  <A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A & B>
@@ -2442,14 +2332,14 @@ export const intersection: {
2442
2332
  *
2443
2333
  * **Example** (Checking for empty chunks)
2444
2334
  *
2445
- * ```ts
2335
+ * ```ts import.meta.vitest
2446
2336
  * import { Chunk } from "effect"
2447
2337
  *
2448
- * console.log(Chunk.isEmpty(Chunk.empty())) // true
2449
- * console.log(Chunk.isEmpty(Chunk.make(1, 2, 3))) // false
2338
+ * Chunk.isEmpty(Chunk.empty()) // => true
2339
+ * Chunk.isEmpty(Chunk.make(1, 2, 3)) // => false
2450
2340
  * ```
2451
2341
  *
2452
- * @category elements
2342
+ * @category predicates
2453
2343
  * @since 2.0.0
2454
2344
  */
2455
2345
  export const isEmpty = <A>(self: Chunk<A>): boolean => self.length === 0
@@ -2459,14 +2349,14 @@ export const isEmpty = <A>(self: Chunk<A>): boolean => self.length === 0
2459
2349
  *
2460
2350
  * **Example** (Checking for non-empty chunks)
2461
2351
  *
2462
- * ```ts
2352
+ * ```ts import.meta.vitest
2463
2353
  * import { Chunk } from "effect"
2464
2354
  *
2465
- * console.log(Chunk.isNonEmpty(Chunk.empty())) // false
2466
- * console.log(Chunk.isNonEmpty(Chunk.make(1, 2, 3))) // true
2355
+ * Chunk.isNonEmpty(Chunk.empty()) // => false
2356
+ * Chunk.isNonEmpty(Chunk.make(1, 2, 3)) // => true
2467
2357
  * ```
2468
2358
  *
2469
- * @category elements
2359
+ * @category guards
2470
2360
  * @since 2.0.0
2471
2361
  */
2472
2362
  export const isNonEmpty = <A>(self: Chunk<A>): self is NonEmptyChunk<A> => self.length > 0
@@ -2476,14 +2366,14 @@ export const isNonEmpty = <A>(self: Chunk<A>): self is NonEmptyChunk<A> => self.
2476
2366
  *
2477
2367
  * **Example** (Getting the first element)
2478
2368
  *
2479
- * ```ts
2480
- * import { Chunk } from "effect"
2369
+ * ```ts import.meta.vitest
2370
+ * import { Chunk, Option } from "effect"
2481
2371
  *
2482
- * console.log(Chunk.head(Chunk.empty())) // { _tag: "None" }
2483
- * console.log(Chunk.head(Chunk.make(1, 2, 3))) // { _tag: "Some", value: 1 }
2372
+ * Chunk.head(Chunk.empty()) // => Option.none()
2373
+ * Chunk.head(Chunk.make(1, 2, 3)) // => Option.some(1)
2484
2374
  * ```
2485
2375
  *
2486
- * @category elements
2376
+ * @category getters
2487
2377
  * @since 2.0.0
2488
2378
  */
2489
2379
  export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
@@ -2502,17 +2392,17 @@ export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
2502
2392
  *
2503
2393
  * **Example** (Getting the first element unsafely)
2504
2394
  *
2505
- * ```ts
2395
+ * ```ts import.meta.vitest
2506
2396
  * import { Chunk, Option } from "effect"
2507
2397
  *
2508
2398
  * const chunk = Chunk.make(1, 2, 3, 4)
2509
- * console.log(Chunk.headUnsafe(chunk)) // 1
2399
+ * Chunk.headUnsafe(chunk) // => 1
2510
2400
  *
2511
2401
  * const singleElement = Chunk.make("hello")
2512
- * console.log(Chunk.headUnsafe(singleElement)) // "hello"
2402
+ * Chunk.headUnsafe(singleElement) // => "hello"
2513
2403
  *
2514
2404
  * // Use Chunk.head when the chunk may be empty
2515
- * console.log(Option.isNone(Chunk.head(Chunk.empty()))) // true
2405
+ * Option.isNone(Chunk.head(Chunk.empty())) // => true
2516
2406
  * ```
2517
2407
  *
2518
2408
  * @category unsafe
@@ -2525,20 +2415,20 @@ export const headUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, 0)
2525
2415
  *
2526
2416
  * **Example** (Getting the first element of a non-empty chunk)
2527
2417
  *
2528
- * ```ts
2418
+ * ```ts import.meta.vitest
2529
2419
  * import { Chunk } from "effect"
2530
2420
  *
2531
2421
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4)
2532
- * console.log(Chunk.headNonEmpty(nonEmptyChunk)) // 1
2422
+ * Chunk.headNonEmpty(nonEmptyChunk) // => 1
2533
2423
  *
2534
2424
  * const singleElement = Chunk.make("hello")
2535
- * console.log(Chunk.headNonEmpty(singleElement)) // "hello"
2425
+ * Chunk.headNonEmpty(singleElement) // => "hello"
2536
2426
  *
2537
2427
  * // Type safety: this function only accepts NonEmptyChunk
2538
2428
  * // Chunk.headNonEmpty(Chunk.empty()) // TypeScript error
2539
2429
  * ```
2540
2430
  *
2541
- * @category elements
2431
+ * @category getters
2542
2432
  * @since 2.0.0
2543
2433
  */
2544
2434
  export const headNonEmpty: <A>(self: NonEmptyChunk<A>) => A = headUnsafe
@@ -2548,14 +2438,14 @@ export const headNonEmpty: <A>(self: NonEmptyChunk<A>) => A = headUnsafe
2548
2438
  *
2549
2439
  * **Example** (Getting the last element)
2550
2440
  *
2551
- * ```ts
2552
- * import { Chunk } from "effect"
2441
+ * ```ts import.meta.vitest
2442
+ * import { Chunk, Option } from "effect"
2553
2443
  *
2554
- * console.log(Chunk.last(Chunk.empty())) // { _tag: "None" }
2555
- * console.log(Chunk.last(Chunk.make(1, 2, 3))) // { _tag: "Some", value: 3 }
2444
+ * Chunk.last(Chunk.empty()) // => Option.none()
2445
+ * Chunk.last(Chunk.make(1, 2, 3)) // => Option.some(3)
2556
2446
  * ```
2557
2447
  *
2558
- * @category elements
2448
+ * @category getters
2559
2449
  * @since 2.0.0
2560
2450
  */
2561
2451
  export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
@@ -2574,17 +2464,17 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
2574
2464
  *
2575
2465
  * **Example** (Getting the last element unsafely)
2576
2466
  *
2577
- * ```ts
2467
+ * ```ts import.meta.vitest
2578
2468
  * import { Chunk, Option } from "effect"
2579
2469
  *
2580
2470
  * const chunk = Chunk.make(1, 2, 3, 4)
2581
- * console.log(Chunk.lastUnsafe(chunk)) // 4
2471
+ * Chunk.lastUnsafe(chunk) // => 4
2582
2472
  *
2583
2473
  * const singleElement = Chunk.make("hello")
2584
- * console.log(Chunk.lastUnsafe(singleElement)) // "hello"
2474
+ * Chunk.lastUnsafe(singleElement) // => "hello"
2585
2475
  *
2586
2476
  * // Use Chunk.last when the chunk may be empty
2587
- * console.log(Option.isNone(Chunk.last(Chunk.empty()))) // true
2477
+ * Option.isNone(Chunk.last(Chunk.empty())) // => true
2588
2478
  * ```
2589
2479
  *
2590
2480
  * @category unsafe
@@ -2597,20 +2487,20 @@ export const lastUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, self.length
2597
2487
  *
2598
2488
  * **Example** (Getting the last element of a non-empty chunk)
2599
2489
  *
2600
- * ```ts
2490
+ * ```ts import.meta.vitest
2601
2491
  * import { Chunk } from "effect"
2602
2492
  *
2603
2493
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4)
2604
- * console.log(Chunk.lastNonEmpty(nonEmptyChunk)) // 4
2494
+ * Chunk.lastNonEmpty(nonEmptyChunk) // => 4
2605
2495
  *
2606
2496
  * const singleElement = Chunk.make("hello")
2607
- * console.log(Chunk.lastNonEmpty(singleElement)) // "hello"
2497
+ * Chunk.lastNonEmpty(singleElement) // => "hello"
2608
2498
  *
2609
2499
  * // Type safety: this function only accepts NonEmptyChunk
2610
2500
  * // Chunk.lastNonEmpty(Chunk.empty()) // TypeScript error
2611
2501
  * ```
2612
2502
  *
2613
- * @category elements
2503
+ * @category getters
2614
2504
  * @since 3.4.0
2615
2505
  */
2616
2506
  export const lastNonEmpty: <A>(self: NonEmptyChunk<A>) => A = lastUnsafe
@@ -2620,7 +2510,7 @@ export const lastNonEmpty: <A>(self: NonEmptyChunk<A>) => A = lastUnsafe
2620
2510
  *
2621
2511
  * **Example** (Working with Chunk utility types)
2622
2512
  *
2623
- * ```ts
2513
+ * ```ts import.meta.vitest
2624
2514
  * import type { Chunk } from "effect"
2625
2515
  *
2626
2516
  * // Extract the element type from a Chunk
@@ -2640,7 +2530,7 @@ export declare namespace Chunk {
2640
2530
  *
2641
2531
  * **Example** (Inferring element types)
2642
2532
  *
2643
- * ```ts
2533
+ * ```ts import.meta.vitest
2644
2534
  * import type { Chunk } from "effect"
2645
2535
  *
2646
2536
  * declare const numberChunk: Chunk.Chunk<number>
@@ -2650,7 +2540,7 @@ export declare namespace Chunk {
2650
2540
  * type StringType = Chunk.Chunk.Infer<typeof stringChunk> // string
2651
2541
  * ```
2652
2542
  *
2653
- * @category types
2543
+ * @category utility types
2654
2544
  * @since 2.0.0
2655
2545
  */
2656
2546
  export type Infer<S extends Chunk<any>> = S extends Chunk<infer A> ? A : never
@@ -2660,7 +2550,7 @@ export declare namespace Chunk {
2660
2550
  *
2661
2551
  * **Example** (Preserving non-emptiness)
2662
2552
  *
2663
- * ```ts
2553
+ * ```ts import.meta.vitest
2664
2554
  * import type { Chunk } from "effect"
2665
2555
  *
2666
2556
  * declare const regularChunk: Chunk.Chunk<number>
@@ -2670,7 +2560,7 @@ export declare namespace Chunk {
2670
2560
  * type WithString2 = Chunk.Chunk.With<typeof nonEmptyChunk, string> // Chunk.NonEmptyChunk<string>
2671
2561
  * ```
2672
2562
  *
2673
- * @category types
2563
+ * @category utility types
2674
2564
  * @since 2.0.0
2675
2565
  */
2676
2566
  export type With<S extends Chunk<any>, A> = S extends NonEmptyChunk<any> ? NonEmptyChunk<A> : Chunk<A>
@@ -2680,7 +2570,7 @@ export declare namespace Chunk {
2680
2570
  *
2681
2571
  * **Example** (Preserving non-emptiness from either input)
2682
2572
  *
2683
- * ```ts
2573
+ * ```ts import.meta.vitest
2684
2574
  * import type { Chunk } from "effect"
2685
2575
  *
2686
2576
  * declare const emptyChunk: Chunk.Chunk<number>
@@ -2703,7 +2593,7 @@ export declare namespace Chunk {
2703
2593
  * > // Chunk.NonEmptyChunk<string>
2704
2594
  * ```
2705
2595
  *
2706
- * @category types
2596
+ * @category utility types
2707
2597
  * @since 2.0.0
2708
2598
  */
2709
2599
  export type OrNonEmpty<S extends Chunk<any>, T extends Chunk<any>, A> = S extends NonEmptyChunk<any> ?
@@ -2716,7 +2606,7 @@ export declare namespace Chunk {
2716
2606
  *
2717
2607
  * **Example** (Requiring non-emptiness from both inputs)
2718
2608
  *
2719
- * ```ts
2609
+ * ```ts import.meta.vitest
2720
2610
  * import type { Chunk } from "effect"
2721
2611
  *
2722
2612
  * declare const emptyChunk: Chunk.Chunk<number>
@@ -2739,7 +2629,7 @@ export declare namespace Chunk {
2739
2629
  * > // Chunk.NonEmptyChunk<string>
2740
2630
  * ```
2741
2631
  *
2742
- * @category types
2632
+ * @category utility types
2743
2633
  * @since 2.0.0
2744
2634
  */
2745
2635
  export type AndNonEmpty<S extends Chunk<any>, T extends Chunk<any>, A> = S extends NonEmptyChunk<any> ?
@@ -2752,7 +2642,7 @@ export declare namespace Chunk {
2752
2642
  *
2753
2643
  * **Example** (Flattening nested chunk types)
2754
2644
  *
2755
- * ```ts
2645
+ * ```ts import.meta.vitest
2756
2646
  * import type { Chunk } from "effect"
2757
2647
  *
2758
2648
  * declare const nestedChunk: Chunk.Chunk<Chunk.Chunk<number>>
@@ -2762,7 +2652,7 @@ export declare namespace Chunk {
2762
2652
  * type Flattened2 = Chunk.Chunk.Flatten<typeof nestedNonEmpty> // Chunk.NonEmptyChunk<string>
2763
2653
  * ```
2764
2654
  *
2765
- * @category types
2655
+ * @category utility types
2766
2656
  * @since 2.0.0
2767
2657
  */
2768
2658
  export type Flatten<T extends Chunk<Chunk<any>>> = T extends NonEmptyChunk<NonEmptyChunk<infer A>> ? NonEmptyChunk<A>
@@ -2776,12 +2666,10 @@ export declare namespace Chunk {
2776
2666
  *
2777
2667
  * **Example** (Mapping values)
2778
2668
  *
2779
- * ```ts
2669
+ * ```ts import.meta.vitest
2780
2670
  * import { Chunk } from "effect"
2781
2671
  *
2782
- * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2783
- *
2784
- * console.log(Chunk.toArray(result)) // [2, 3]
2672
+ * Chunk.toArray(Chunk.map(Chunk.make(1, 2), (n) => n + 1)) // => [2, 3]
2785
2673
  * ```
2786
2674
  *
2787
2675
  * @category mapping
@@ -2794,12 +2682,10 @@ export const map: {
2794
2682
  *
2795
2683
  * **Example** (Mapping values)
2796
2684
  *
2797
- * ```ts
2685
+ * ```ts import.meta.vitest
2798
2686
  * import { Chunk } from "effect"
2799
2687
  *
2800
- * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2801
- *
2802
- * console.log(Chunk.toArray(result)) // [2, 3]
2688
+ * Chunk.toArray(Chunk.map(Chunk.make(1, 2), (n) => n + 1)) // => [2, 3]
2803
2689
  * ```
2804
2690
  *
2805
2691
  * @category mapping
@@ -2812,12 +2698,10 @@ export const map: {
2812
2698
  *
2813
2699
  * **Example** (Mapping values)
2814
2700
  *
2815
- * ```ts
2701
+ * ```ts import.meta.vitest
2816
2702
  * import { Chunk } from "effect"
2817
2703
  *
2818
- * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2819
- *
2820
- * console.log(Chunk.toArray(result)) // [2, 3]
2704
+ * Chunk.toArray(Chunk.map(Chunk.make(1, 2), (n) => n + 1)) // => [2, 3]
2821
2705
  * ```
2822
2706
  *
2823
2707
  * @category mapping
@@ -2830,12 +2714,10 @@ export const map: {
2830
2714
  *
2831
2715
  * **Example** (Mapping values)
2832
2716
  *
2833
- * ```ts
2717
+ * ```ts import.meta.vitest
2834
2718
  * import { Chunk } from "effect"
2835
2719
  *
2836
- * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2837
- *
2838
- * console.log(Chunk.toArray(result)) // [2, 3]
2720
+ * Chunk.toArray(Chunk.map(Chunk.make(1, 2), (n) => n + 1)) // => [2, 3]
2839
2721
  * ```
2840
2722
  *
2841
2723
  * @category mapping
@@ -2852,7 +2734,7 @@ export const map: {
2852
2734
  *
2853
2735
  * **Example** (Mapping with accumulated state)
2854
2736
  *
2855
- * ```ts
2737
+ * ```ts import.meta.vitest
2856
2738
  * import { Chunk } from "effect"
2857
2739
  *
2858
2740
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
@@ -2861,8 +2743,8 @@ export const map: {
2861
2743
  * state + current // output running sum
2862
2744
  * ])
2863
2745
  *
2864
- * console.log(finalState) // 15 (final accumulated sum)
2865
- * console.log(Chunk.toArray(mapped)) // [1, 3, 6, 10, 15] (running sums)
2746
+ * finalState // => 15
2747
+ * Chunk.toArray(mapped) // => [1, 3, 6, 10, 15]
2866
2748
  *
2867
2749
  * // Building a string with indices
2868
2750
  * const words = Chunk.make("hello", "world", "effect")
@@ -2870,8 +2752,8 @@ export const map: {
2870
2752
  * index + 1,
2871
2753
  * `${index}: ${word}`
2872
2754
  * ])
2873
- * console.log(count) // 3
2874
- * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2755
+ * count // => 3
2756
+ * Chunk.toArray(indexed) // => ["0: hello", "1: world", "2: effect"]
2875
2757
  * ```
2876
2758
  *
2877
2759
  * @category folding
@@ -2883,7 +2765,7 @@ export const mapAccum: {
2883
2765
  *
2884
2766
  * **Example** (Mapping with accumulated state)
2885
2767
  *
2886
- * ```ts
2768
+ * ```ts import.meta.vitest
2887
2769
  * import { Chunk } from "effect"
2888
2770
  *
2889
2771
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
@@ -2892,8 +2774,8 @@ export const mapAccum: {
2892
2774
  * state + current // output running sum
2893
2775
  * ])
2894
2776
  *
2895
- * console.log(finalState) // 15 (final accumulated sum)
2896
- * console.log(Chunk.toArray(mapped)) // [1, 3, 6, 10, 15] (running sums)
2777
+ * finalState // => 15
2778
+ * Chunk.toArray(mapped) // => [1, 3, 6, 10, 15]
2897
2779
  *
2898
2780
  * // Building a string with indices
2899
2781
  * const words = Chunk.make("hello", "world", "effect")
@@ -2901,8 +2783,8 @@ export const mapAccum: {
2901
2783
  * index + 1,
2902
2784
  * `${index}: ${word}`
2903
2785
  * ])
2904
- * console.log(count) // 3
2905
- * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2786
+ * count // => 3
2787
+ * Chunk.toArray(indexed) // => ["0: hello", "1: world", "2: effect"]
2906
2788
  * ```
2907
2789
  *
2908
2790
  * @category folding
@@ -2914,7 +2796,7 @@ export const mapAccum: {
2914
2796
  *
2915
2797
  * **Example** (Mapping with accumulated state)
2916
2798
  *
2917
- * ```ts
2799
+ * ```ts import.meta.vitest
2918
2800
  * import { Chunk } from "effect"
2919
2801
  *
2920
2802
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
@@ -2923,8 +2805,8 @@ export const mapAccum: {
2923
2805
  * state + current // output running sum
2924
2806
  * ])
2925
2807
  *
2926
- * console.log(finalState) // 15 (final accumulated sum)
2927
- * console.log(Chunk.toArray(mapped)) // [1, 3, 6, 10, 15] (running sums)
2808
+ * finalState // => 15
2809
+ * Chunk.toArray(mapped) // => [1, 3, 6, 10, 15]
2928
2810
  *
2929
2811
  * // Building a string with indices
2930
2812
  * const words = Chunk.make("hello", "world", "effect")
@@ -2932,8 +2814,8 @@ export const mapAccum: {
2932
2814
  * index + 1,
2933
2815
  * `${index}: ${word}`
2934
2816
  * ])
2935
- * console.log(count) // 3
2936
- * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2817
+ * count // => 3
2818
+ * Chunk.toArray(indexed) // => ["0: hello", "1: world", "2: effect"]
2937
2819
  * ```
2938
2820
  *
2939
2821
  * @category folding
@@ -2954,15 +2836,15 @@ export const mapAccum: {
2954
2836
  *
2955
2837
  * **Example** (Partitioning with a Result)
2956
2838
  *
2957
- * ```ts
2839
+ * ```ts import.meta.vitest
2958
2840
  * import { Chunk, Result } from "effect"
2959
2841
  *
2960
2842
  * const [excluded, satisfying] = Chunk.partition(Chunk.make(1, -2, 3), (n, i) =>
2961
2843
  * n > 0 ? Result.succeed(n + i) : Result.fail(`negative:${n}`)
2962
2844
  * )
2963
2845
  *
2964
- * console.log(Chunk.toArray(excluded)) // ["negative:-2"]
2965
- * console.log(Chunk.toArray(satisfying)) // [1, 5]
2846
+ * Chunk.toArray(excluded) // => ["negative:-2"]
2847
+ * Chunk.toArray(satisfying) // => [1, 5]
2966
2848
  * ```
2967
2849
  *
2968
2850
  * @category filtering
@@ -2978,15 +2860,15 @@ export const partition: {
2978
2860
  *
2979
2861
  * **Example** (Partitioning with a Result)
2980
2862
  *
2981
- * ```ts
2863
+ * ```ts import.meta.vitest
2982
2864
  * import { Chunk, Result } from "effect"
2983
2865
  *
2984
2866
  * const [excluded, satisfying] = Chunk.partition(Chunk.make(1, -2, 3), (n, i) =>
2985
2867
  * n > 0 ? Result.succeed(n + i) : Result.fail(`negative:${n}`)
2986
2868
  * )
2987
2869
  *
2988
- * console.log(Chunk.toArray(excluded)) // ["negative:-2"]
2989
- * console.log(Chunk.toArray(satisfying)) // [1, 5]
2870
+ * Chunk.toArray(excluded) // => ["negative:-2"]
2871
+ * Chunk.toArray(satisfying) // => [1, 5]
2990
2872
  * ```
2991
2873
  *
2992
2874
  * @category filtering
@@ -3002,15 +2884,15 @@ export const partition: {
3002
2884
  *
3003
2885
  * **Example** (Partitioning with a Result)
3004
2886
  *
3005
- * ```ts
2887
+ * ```ts import.meta.vitest
3006
2888
  * import { Chunk, Result } from "effect"
3007
2889
  *
3008
2890
  * const [excluded, satisfying] = Chunk.partition(Chunk.make(1, -2, 3), (n, i) =>
3009
2891
  * n > 0 ? Result.succeed(n + i) : Result.fail(`negative:${n}`)
3010
2892
  * )
3011
2893
  *
3012
- * console.log(Chunk.toArray(excluded)) // ["negative:-2"]
3013
- * console.log(Chunk.toArray(satisfying)) // [1, 5]
2894
+ * Chunk.toArray(excluded) // => ["negative:-2"]
2895
+ * Chunk.toArray(satisfying) // => [1, 5]
3014
2896
  * ```
3015
2897
  *
3016
2898
  * @category filtering
@@ -3039,7 +2921,7 @@ export const partition: {
3039
2921
  *
3040
2922
  * **Example** (Separating failures and successes)
3041
2923
  *
3042
- * ```ts
2924
+ * ```ts import.meta.vitest
3043
2925
  * import { Chunk, Result } from "effect"
3044
2926
  *
3045
2927
  * const chunk = Chunk.make(
@@ -3051,14 +2933,14 @@ export const partition: {
3051
2933
  * )
3052
2934
  *
3053
2935
  * const [errors, values] = Chunk.separate(chunk)
3054
- * console.log(Chunk.toArray(errors)) // ["error1", "error2"]
3055
- * console.log(Chunk.toArray(values)) // [1, 2, 3]
2936
+ * Chunk.toArray(errors) // => ["error1", "error2"]
2937
+ * Chunk.toArray(values) // => [1, 2, 3]
3056
2938
  *
3057
2939
  * // All successes
3058
2940
  * const allSuccesses = Chunk.make(Result.succeed(1), Result.succeed(2))
3059
2941
  * const [noErrors, allValues] = Chunk.separate(allSuccesses)
3060
- * console.log(Chunk.toArray(noErrors)) // []
3061
- * console.log(Chunk.toArray(allValues)) // [1, 2]
2942
+ * Chunk.toArray(noErrors) // => []
2943
+ * Chunk.toArray(allValues) // => [1, 2]
3062
2944
  * ```
3063
2945
  *
3064
2946
  * @category filtering
@@ -3075,14 +2957,13 @@ export const separate = <A, B>(self: Chunk<Result<B, A>>): [Chunk<A>, Chunk<B>]
3075
2957
  *
3076
2958
  * **Example** (Getting chunk size)
3077
2959
  *
3078
- * ```ts
2960
+ * ```ts import.meta.vitest
3079
2961
  * import { Chunk } from "effect"
3080
2962
  *
3081
- * const chunk = Chunk.make(1, 2, 3)
3082
- * console.log(Chunk.size(chunk)) // 3
2963
+ * Chunk.size(Chunk.make(1, 2, 3)) // => 3
3083
2964
  * ```
3084
2965
  *
3085
- * @category elements
2966
+ * @category getters
3086
2967
  * @since 2.0.0
3087
2968
  */
3088
2969
  export const size = <A>(self: Chunk<A>): number => self.length
@@ -3092,21 +2973,18 @@ export const size = <A>(self: Chunk<A>): number => self.length
3092
2973
  *
3093
2974
  * **Example** (Sorting chunks)
3094
2975
  *
3095
- * ```ts
2976
+ * ```ts import.meta.vitest
3096
2977
  * import { Chunk, Order } from "effect"
3097
2978
  *
3098
2979
  * const numbers = Chunk.make(3, 1, 4, 1, 5, 9, 2, 6)
3099
- * const sorted = Chunk.sort(numbers, Order.Number)
3100
- * console.log(Chunk.toArray(sorted)) // [1, 1, 2, 3, 4, 5, 6, 9]
2980
+ * Chunk.toArray(Chunk.sort(numbers, Order.Number)) // => [1, 1, 2, 3, 4, 5, 6, 9]
3101
2981
  *
3102
2982
  * // Reverse order
3103
- * const reverseSorted = Chunk.sort(numbers, Order.flip(Order.Number))
3104
- * console.log(Chunk.toArray(reverseSorted)) // [9, 6, 5, 4, 3, 2, 1, 1]
2983
+ * Chunk.toArray(Chunk.sort(numbers, Order.flip(Order.Number))) // => [9, 6, 5, 4, 3, 2, 1, 1]
3105
2984
  *
3106
2985
  * // String sorting
3107
2986
  * const words = Chunk.make("banana", "apple", "cherry")
3108
- * const sortedWords = Chunk.sort(words, Order.String)
3109
- * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
2987
+ * Chunk.toArray(Chunk.sort(words, Order.String)) // => ["apple", "banana", "cherry"]
3110
2988
  * ```
3111
2989
  *
3112
2990
  * @category sorting
@@ -3118,21 +2996,18 @@ export const sort: {
3118
2996
  *
3119
2997
  * **Example** (Sorting chunks)
3120
2998
  *
3121
- * ```ts
2999
+ * ```ts import.meta.vitest
3122
3000
  * import { Chunk, Order } from "effect"
3123
3001
  *
3124
3002
  * const numbers = Chunk.make(3, 1, 4, 1, 5, 9, 2, 6)
3125
- * const sorted = Chunk.sort(numbers, Order.Number)
3126
- * console.log(Chunk.toArray(sorted)) // [1, 1, 2, 3, 4, 5, 6, 9]
3003
+ * Chunk.toArray(Chunk.sort(numbers, Order.Number)) // => [1, 1, 2, 3, 4, 5, 6, 9]
3127
3004
  *
3128
3005
  * // Reverse order
3129
- * const reverseSorted = Chunk.sort(numbers, Order.flip(Order.Number))
3130
- * console.log(Chunk.toArray(reverseSorted)) // [9, 6, 5, 4, 3, 2, 1, 1]
3006
+ * Chunk.toArray(Chunk.sort(numbers, Order.flip(Order.Number))) // => [9, 6, 5, 4, 3, 2, 1, 1]
3131
3007
  *
3132
3008
  * // String sorting
3133
3009
  * const words = Chunk.make("banana", "apple", "cherry")
3134
- * const sortedWords = Chunk.sort(words, Order.String)
3135
- * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
3010
+ * Chunk.toArray(Chunk.sort(words, Order.String)) // => ["apple", "banana", "cherry"]
3136
3011
  * ```
3137
3012
  *
3138
3013
  * @category sorting
@@ -3144,21 +3019,18 @@ export const sort: {
3144
3019
  *
3145
3020
  * **Example** (Sorting chunks)
3146
3021
  *
3147
- * ```ts
3022
+ * ```ts import.meta.vitest
3148
3023
  * import { Chunk, Order } from "effect"
3149
3024
  *
3150
3025
  * const numbers = Chunk.make(3, 1, 4, 1, 5, 9, 2, 6)
3151
- * const sorted = Chunk.sort(numbers, Order.Number)
3152
- * console.log(Chunk.toArray(sorted)) // [1, 1, 2, 3, 4, 5, 6, 9]
3026
+ * Chunk.toArray(Chunk.sort(numbers, Order.Number)) // => [1, 1, 2, 3, 4, 5, 6, 9]
3153
3027
  *
3154
3028
  * // Reverse order
3155
- * const reverseSorted = Chunk.sort(numbers, Order.flip(Order.Number))
3156
- * console.log(Chunk.toArray(reverseSorted)) // [9, 6, 5, 4, 3, 2, 1, 1]
3029
+ * Chunk.toArray(Chunk.sort(numbers, Order.flip(Order.Number))) // => [9, 6, 5, 4, 3, 2, 1, 1]
3157
3030
  *
3158
3031
  * // String sorting
3159
3032
  * const words = Chunk.make("banana", "apple", "cherry")
3160
- * const sortedWords = Chunk.sort(words, Order.String)
3161
- * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
3033
+ * Chunk.toArray(Chunk.sort(words, Order.String)) // => ["apple", "banana", "cherry"]
3162
3034
  * ```
3163
3035
  *
3164
3036
  * @category sorting
@@ -3175,7 +3047,7 @@ export const sort: {
3175
3047
  *
3176
3048
  * **Example** (Sorting chunks by a derived value)
3177
3049
  *
3178
- * ```ts
3050
+ * ```ts import.meta.vitest
3179
3051
  * import { Chunk, Order } from "effect"
3180
3052
  *
3181
3053
  * const people = Chunk.make(
@@ -3186,18 +3058,15 @@ export const sort: {
3186
3058
  *
3187
3059
  * // Sort by age
3188
3060
  * const byAge = Chunk.sortWith(people, (person) => person.age, Order.Number)
3189
- * console.log(Chunk.toArray(byAge))
3190
- * // [{ name: "Bob", age: 25 }, { name: "Alice", age: 30 }, { name: "Charlie", age: 35 }]
3061
+ * Chunk.toArray(byAge).map((person) => person.name) // => ["Bob", "Alice", "Charlie"]
3191
3062
  *
3192
3063
  * // Sort by name
3193
3064
  * const byName = Chunk.sortWith(people, (person) => person.name, Order.String)
3194
- * console.log(Chunk.toArray(byName))
3195
- * // [{ name: "Alice", age: 30 }, { name: "Bob", age: 25 }, { name: "Charlie", age: 35 }]
3065
+ * Chunk.toArray(byName).map((person) => person.name) // => ["Alice", "Bob", "Charlie"]
3196
3066
  *
3197
3067
  * // Sort by string length
3198
3068
  * const words = Chunk.make("a", "abc", "ab")
3199
- * const byLength = Chunk.sortWith(words, (word) => word.length, Order.Number)
3200
- * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3069
+ * Chunk.toArray(Chunk.sortWith(words, (word) => word.length, Order.Number)) // => ["a", "ab", "abc"]
3201
3070
  * ```
3202
3071
  *
3203
3072
  * @category sorting
@@ -3209,7 +3078,7 @@ export const sortWith: {
3209
3078
  *
3210
3079
  * **Example** (Sorting chunks by a derived value)
3211
3080
  *
3212
- * ```ts
3081
+ * ```ts import.meta.vitest
3213
3082
  * import { Chunk, Order } from "effect"
3214
3083
  *
3215
3084
  * const people = Chunk.make(
@@ -3220,18 +3089,15 @@ export const sortWith: {
3220
3089
  *
3221
3090
  * // Sort by age
3222
3091
  * const byAge = Chunk.sortWith(people, (person) => person.age, Order.Number)
3223
- * console.log(Chunk.toArray(byAge))
3224
- * // [{ name: "Bob", age: 25 }, { name: "Alice", age: 30 }, { name: "Charlie", age: 35 }]
3092
+ * Chunk.toArray(byAge).map((person) => person.name) // => ["Bob", "Alice", "Charlie"]
3225
3093
  *
3226
3094
  * // Sort by name
3227
3095
  * const byName = Chunk.sortWith(people, (person) => person.name, Order.String)
3228
- * console.log(Chunk.toArray(byName))
3229
- * // [{ name: "Alice", age: 30 }, { name: "Bob", age: 25 }, { name: "Charlie", age: 35 }]
3096
+ * Chunk.toArray(byName).map((person) => person.name) // => ["Alice", "Bob", "Charlie"]
3230
3097
  *
3231
3098
  * // Sort by string length
3232
3099
  * const words = Chunk.make("a", "abc", "ab")
3233
- * const byLength = Chunk.sortWith(words, (word) => word.length, Order.Number)
3234
- * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3100
+ * Chunk.toArray(Chunk.sortWith(words, (word) => word.length, Order.Number)) // => ["a", "ab", "abc"]
3235
3101
  * ```
3236
3102
  *
3237
3103
  * @category sorting
@@ -3243,7 +3109,7 @@ export const sortWith: {
3243
3109
  *
3244
3110
  * **Example** (Sorting chunks by a derived value)
3245
3111
  *
3246
- * ```ts
3112
+ * ```ts import.meta.vitest
3247
3113
  * import { Chunk, Order } from "effect"
3248
3114
  *
3249
3115
  * const people = Chunk.make(
@@ -3254,18 +3120,15 @@ export const sortWith: {
3254
3120
  *
3255
3121
  * // Sort by age
3256
3122
  * const byAge = Chunk.sortWith(people, (person) => person.age, Order.Number)
3257
- * console.log(Chunk.toArray(byAge))
3258
- * // [{ name: "Bob", age: 25 }, { name: "Alice", age: 30 }, { name: "Charlie", age: 35 }]
3123
+ * Chunk.toArray(byAge).map((person) => person.name) // => ["Bob", "Alice", "Charlie"]
3259
3124
  *
3260
3125
  * // Sort by name
3261
3126
  * const byName = Chunk.sortWith(people, (person) => person.name, Order.String)
3262
- * console.log(Chunk.toArray(byName))
3263
- * // [{ name: "Alice", age: 30 }, { name: "Bob", age: 25 }, { name: "Charlie", age: 35 }]
3127
+ * Chunk.toArray(byName).map((person) => person.name) // => ["Alice", "Bob", "Charlie"]
3264
3128
  *
3265
3129
  * // Sort by string length
3266
3130
  * const words = Chunk.make("a", "abc", "ab")
3267
- * const byLength = Chunk.sortWith(words, (word) => word.length, Order.Number)
3268
- * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3131
+ * Chunk.toArray(Chunk.sortWith(words, (word) => word.length, Order.Number)) // => ["a", "ab", "abc"]
3269
3132
  * ```
3270
3133
  *
3271
3134
  * @category sorting
@@ -3282,23 +3145,23 @@ export const sortWith: {
3282
3145
  *
3283
3146
  * **Example** (Splitting at an index)
3284
3147
  *
3285
- * ```ts
3148
+ * ```ts import.meta.vitest
3286
3149
  * import { Chunk } from "effect"
3287
3150
  *
3288
3151
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3289
3152
  * const [before, after] = Chunk.splitAt(chunk, 3)
3290
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3291
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3153
+ * Chunk.toArray(before) // => [1, 2, 3]
3154
+ * Chunk.toArray(after) // => [4, 5, 6]
3292
3155
  *
3293
3156
  * // Split at index 0
3294
3157
  * const [empty, all] = Chunk.splitAt(chunk, 0)
3295
- * console.log(Chunk.toArray(empty)) // []
3296
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3158
+ * Chunk.toArray(empty) // => []
3159
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3297
3160
  *
3298
3161
  * // Split beyond length
3299
3162
  * const [allElements, empty2] = Chunk.splitAt(chunk, 10)
3300
- * console.log(Chunk.toArray(allElements)) // [1, 2, 3, 4, 5, 6]
3301
- * console.log(Chunk.toArray(empty2)) // []
3163
+ * Chunk.toArray(allElements) // => [1, 2, 3, 4, 5, 6]
3164
+ * Chunk.toArray(empty2) // => []
3302
3165
  * ```
3303
3166
  *
3304
3167
  * @category splitting
@@ -3310,23 +3173,23 @@ export const splitAt: {
3310
3173
  *
3311
3174
  * **Example** (Splitting at an index)
3312
3175
  *
3313
- * ```ts
3176
+ * ```ts import.meta.vitest
3314
3177
  * import { Chunk } from "effect"
3315
3178
  *
3316
3179
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3317
3180
  * const [before, after] = Chunk.splitAt(chunk, 3)
3318
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3319
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3181
+ * Chunk.toArray(before) // => [1, 2, 3]
3182
+ * Chunk.toArray(after) // => [4, 5, 6]
3320
3183
  *
3321
3184
  * // Split at index 0
3322
3185
  * const [empty, all] = Chunk.splitAt(chunk, 0)
3323
- * console.log(Chunk.toArray(empty)) // []
3324
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3186
+ * Chunk.toArray(empty) // => []
3187
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3325
3188
  *
3326
3189
  * // Split beyond length
3327
3190
  * const [allElements, empty2] = Chunk.splitAt(chunk, 10)
3328
- * console.log(Chunk.toArray(allElements)) // [1, 2, 3, 4, 5, 6]
3329
- * console.log(Chunk.toArray(empty2)) // []
3191
+ * Chunk.toArray(allElements) // => [1, 2, 3, 4, 5, 6]
3192
+ * Chunk.toArray(empty2) // => []
3330
3193
  * ```
3331
3194
  *
3332
3195
  * @category splitting
@@ -3338,23 +3201,23 @@ export const splitAt: {
3338
3201
  *
3339
3202
  * **Example** (Splitting at an index)
3340
3203
  *
3341
- * ```ts
3204
+ * ```ts import.meta.vitest
3342
3205
  * import { Chunk } from "effect"
3343
3206
  *
3344
3207
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3345
3208
  * const [before, after] = Chunk.splitAt(chunk, 3)
3346
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3347
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3209
+ * Chunk.toArray(before) // => [1, 2, 3]
3210
+ * Chunk.toArray(after) // => [4, 5, 6]
3348
3211
  *
3349
3212
  * // Split at index 0
3350
3213
  * const [empty, all] = Chunk.splitAt(chunk, 0)
3351
- * console.log(Chunk.toArray(empty)) // []
3352
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3214
+ * Chunk.toArray(empty) // => []
3215
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3353
3216
  *
3354
3217
  * // Split beyond length
3355
3218
  * const [allElements, empty2] = Chunk.splitAt(chunk, 10)
3356
- * console.log(Chunk.toArray(allElements)) // [1, 2, 3, 4, 5, 6]
3357
- * console.log(Chunk.toArray(empty2)) // []
3219
+ * Chunk.toArray(allElements) // => [1, 2, 3, 4, 5, 6]
3220
+ * Chunk.toArray(empty2) // => []
3358
3221
  * ```
3359
3222
  *
3360
3223
  * @category splitting
@@ -3375,18 +3238,18 @@ export const splitAt: {
3375
3238
  *
3376
3239
  * **Example** (Splitting non-empty chunks at an index)
3377
3240
  *
3378
- * ```ts
3241
+ * ```ts import.meta.vitest
3379
3242
  * import { Chunk } from "effect"
3380
3243
  *
3381
3244
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4, 5, 6)
3382
3245
  * const [before, after] = Chunk.splitNonEmptyAt(nonEmptyChunk, 3)
3383
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3384
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3246
+ * Chunk.toArray(before) // => [1, 2, 3]
3247
+ * Chunk.toArray(after) // => [4, 5, 6]
3385
3248
  *
3386
3249
  * // Split at 1 (minimum)
3387
3250
  * const [first, rest] = Chunk.splitNonEmptyAt(nonEmptyChunk, 1)
3388
- * console.log(Chunk.toArray(first)) // [1]
3389
- * console.log(Chunk.toArray(rest)) // [2, 3, 4, 5, 6]
3251
+ * Chunk.toArray(first) // => [1]
3252
+ * Chunk.toArray(rest) // => [2, 3, 4, 5, 6]
3390
3253
  *
3391
3254
  * // The first part is guaranteed to be NonEmptyChunk
3392
3255
  * // while the second part may be empty
@@ -3408,18 +3271,18 @@ export const splitNonEmptyAt: {
3408
3271
  *
3409
3272
  * **Example** (Splitting non-empty chunks at an index)
3410
3273
  *
3411
- * ```ts
3274
+ * ```ts import.meta.vitest
3412
3275
  * import { Chunk } from "effect"
3413
3276
  *
3414
3277
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4, 5, 6)
3415
3278
  * const [before, after] = Chunk.splitNonEmptyAt(nonEmptyChunk, 3)
3416
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3417
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3279
+ * Chunk.toArray(before) // => [1, 2, 3]
3280
+ * Chunk.toArray(after) // => [4, 5, 6]
3418
3281
  *
3419
3282
  * // Split at 1 (minimum)
3420
3283
  * const [first, rest] = Chunk.splitNonEmptyAt(nonEmptyChunk, 1)
3421
- * console.log(Chunk.toArray(first)) // [1]
3422
- * console.log(Chunk.toArray(rest)) // [2, 3, 4, 5, 6]
3284
+ * Chunk.toArray(first) // => [1]
3285
+ * Chunk.toArray(rest) // => [2, 3, 4, 5, 6]
3423
3286
  *
3424
3287
  * // The first part is guaranteed to be NonEmptyChunk
3425
3288
  * // while the second part may be empty
@@ -3441,18 +3304,18 @@ export const splitNonEmptyAt: {
3441
3304
  *
3442
3305
  * **Example** (Splitting non-empty chunks at an index)
3443
3306
  *
3444
- * ```ts
3307
+ * ```ts import.meta.vitest
3445
3308
  * import { Chunk } from "effect"
3446
3309
  *
3447
3310
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4, 5, 6)
3448
3311
  * const [before, after] = Chunk.splitNonEmptyAt(nonEmptyChunk, 3)
3449
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3450
- * console.log(Chunk.toArray(after)) // [4, 5, 6]
3312
+ * Chunk.toArray(before) // => [1, 2, 3]
3313
+ * Chunk.toArray(after) // => [4, 5, 6]
3451
3314
  *
3452
3315
  * // Split at 1 (minimum)
3453
3316
  * const [first, rest] = Chunk.splitNonEmptyAt(nonEmptyChunk, 1)
3454
- * console.log(Chunk.toArray(first)) // [1]
3455
- * console.log(Chunk.toArray(rest)) // [2, 3, 4, 5, 6]
3317
+ * Chunk.toArray(first) // => [1]
3318
+ * Chunk.toArray(rest) // => [2, 3, 4, 5, 6]
3456
3319
  *
3457
3320
  * // The first part is guaranteed to be NonEmptyChunk
3458
3321
  * // while the second part may be empty
@@ -3479,24 +3342,21 @@ export const splitNonEmptyAt: {
3479
3342
  *
3480
3343
  * **Example** (Splitting chunks into groups)
3481
3344
  *
3482
- * ```ts
3345
+ * ```ts import.meta.vitest
3483
3346
  * import { Chunk } from "effect"
3484
3347
  *
3485
3348
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
3486
3349
  * const chunks = Chunk.split(chunk, 3)
3487
- * console.log(Chunk.toArray(chunks).map(Chunk.toArray))
3488
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3350
+ * Chunk.toArray(chunks).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3489
3351
  *
3490
3352
  * // Uneven split
3491
3353
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8)
3492
3354
  * const chunks2 = Chunk.split(chunk2, 3)
3493
- * console.log(Chunk.toArray(chunks2).map(Chunk.toArray))
3494
- * // [[1, 2, 3], [4, 5, 6], [7, 8]]
3355
+ * Chunk.toArray(chunks2).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8]]
3495
3356
  *
3496
3357
  * // Split into 1 chunk
3497
3358
  * const chunks3 = Chunk.split(chunk, 1)
3498
- * console.log(Chunk.toArray(chunks3).map(Chunk.toArray))
3499
- * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3359
+ * Chunk.toArray(chunks3).map(Chunk.toArray) // => [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3500
3360
  * ```
3501
3361
  *
3502
3362
  * @category splitting
@@ -3513,24 +3373,21 @@ export const split: {
3513
3373
  *
3514
3374
  * **Example** (Splitting chunks into groups)
3515
3375
  *
3516
- * ```ts
3376
+ * ```ts import.meta.vitest
3517
3377
  * import { Chunk } from "effect"
3518
3378
  *
3519
3379
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
3520
3380
  * const chunks = Chunk.split(chunk, 3)
3521
- * console.log(Chunk.toArray(chunks).map(Chunk.toArray))
3522
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3381
+ * Chunk.toArray(chunks).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3523
3382
  *
3524
3383
  * // Uneven split
3525
3384
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8)
3526
3385
  * const chunks2 = Chunk.split(chunk2, 3)
3527
- * console.log(Chunk.toArray(chunks2).map(Chunk.toArray))
3528
- * // [[1, 2, 3], [4, 5, 6], [7, 8]]
3386
+ * Chunk.toArray(chunks2).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8]]
3529
3387
  *
3530
3388
  * // Split into 1 chunk
3531
3389
  * const chunks3 = Chunk.split(chunk, 1)
3532
- * console.log(Chunk.toArray(chunks3).map(Chunk.toArray))
3533
- * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3390
+ * Chunk.toArray(chunks3).map(Chunk.toArray) // => [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3534
3391
  * ```
3535
3392
  *
3536
3393
  * @category splitting
@@ -3547,24 +3404,21 @@ export const split: {
3547
3404
  *
3548
3405
  * **Example** (Splitting chunks into groups)
3549
3406
  *
3550
- * ```ts
3407
+ * ```ts import.meta.vitest
3551
3408
  * import { Chunk } from "effect"
3552
3409
  *
3553
3410
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8, 9)
3554
3411
  * const chunks = Chunk.split(chunk, 3)
3555
- * console.log(Chunk.toArray(chunks).map(Chunk.toArray))
3556
- * // [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3412
+ * Chunk.toArray(chunks).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3557
3413
  *
3558
3414
  * // Uneven split
3559
3415
  * const chunk2 = Chunk.make(1, 2, 3, 4, 5, 6, 7, 8)
3560
3416
  * const chunks2 = Chunk.split(chunk2, 3)
3561
- * console.log(Chunk.toArray(chunks2).map(Chunk.toArray))
3562
- * // [[1, 2, 3], [4, 5, 6], [7, 8]]
3417
+ * Chunk.toArray(chunks2).map(Chunk.toArray) // => [[1, 2, 3], [4, 5, 6], [7, 8]]
3563
3418
  *
3564
3419
  * // Split into 1 chunk
3565
3420
  * const chunks3 = Chunk.split(chunk, 1)
3566
- * console.log(Chunk.toArray(chunks3).map(Chunk.toArray))
3567
- * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3421
+ * Chunk.toArray(chunks3).map(Chunk.toArray) // => [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3568
3422
  * ```
3569
3423
  *
3570
3424
  * @category splitting
@@ -3579,23 +3433,23 @@ export const split: {
3579
3433
  *
3580
3434
  * **Example** (Splitting at a matching element)
3581
3435
  *
3582
- * ```ts
3436
+ * ```ts import.meta.vitest
3583
3437
  * import { Chunk } from "effect"
3584
3438
  *
3585
3439
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3586
3440
  * const [before, fromMatch] = Chunk.splitWhere(chunk, (n) => n > 3)
3587
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3588
- * console.log(Chunk.toArray(fromMatch)) // [4, 5, 6]
3441
+ * Chunk.toArray(before) // => [1, 2, 3]
3442
+ * Chunk.toArray(fromMatch) // => [4, 5, 6]
3589
3443
  *
3590
3444
  * // No match found
3591
3445
  * const [all, empty] = Chunk.splitWhere(chunk, (n) => n > 10)
3592
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3593
- * console.log(Chunk.toArray(empty)) // []
3446
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3447
+ * Chunk.toArray(empty) // => []
3594
3448
  *
3595
3449
  * // Match on first element
3596
3450
  * const [emptyBefore, allFromFirst] = Chunk.splitWhere(chunk, (n) => n === 1)
3597
- * console.log(Chunk.toArray(emptyBefore)) // []
3598
- * console.log(Chunk.toArray(allFromFirst)) // [1, 2, 3, 4, 5, 6]
3451
+ * Chunk.toArray(emptyBefore) // => []
3452
+ * Chunk.toArray(allFromFirst) // => [1, 2, 3, 4, 5, 6]
3599
3453
  * ```
3600
3454
  *
3601
3455
  * @category splitting
@@ -3608,23 +3462,23 @@ export const splitWhere: {
3608
3462
  *
3609
3463
  * **Example** (Splitting at a matching element)
3610
3464
  *
3611
- * ```ts
3465
+ * ```ts import.meta.vitest
3612
3466
  * import { Chunk } from "effect"
3613
3467
  *
3614
3468
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3615
3469
  * const [before, fromMatch] = Chunk.splitWhere(chunk, (n) => n > 3)
3616
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3617
- * console.log(Chunk.toArray(fromMatch)) // [4, 5, 6]
3470
+ * Chunk.toArray(before) // => [1, 2, 3]
3471
+ * Chunk.toArray(fromMatch) // => [4, 5, 6]
3618
3472
  *
3619
3473
  * // No match found
3620
3474
  * const [all, empty] = Chunk.splitWhere(chunk, (n) => n > 10)
3621
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3622
- * console.log(Chunk.toArray(empty)) // []
3475
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3476
+ * Chunk.toArray(empty) // => []
3623
3477
  *
3624
3478
  * // Match on first element
3625
3479
  * const [emptyBefore, allFromFirst] = Chunk.splitWhere(chunk, (n) => n === 1)
3626
- * console.log(Chunk.toArray(emptyBefore)) // []
3627
- * console.log(Chunk.toArray(allFromFirst)) // [1, 2, 3, 4, 5, 6]
3480
+ * Chunk.toArray(emptyBefore) // => []
3481
+ * Chunk.toArray(allFromFirst) // => [1, 2, 3, 4, 5, 6]
3628
3482
  * ```
3629
3483
  *
3630
3484
  * @category splitting
@@ -3637,23 +3491,23 @@ export const splitWhere: {
3637
3491
  *
3638
3492
  * **Example** (Splitting at a matching element)
3639
3493
  *
3640
- * ```ts
3494
+ * ```ts import.meta.vitest
3641
3495
  * import { Chunk } from "effect"
3642
3496
  *
3643
3497
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3644
3498
  * const [before, fromMatch] = Chunk.splitWhere(chunk, (n) => n > 3)
3645
- * console.log(Chunk.toArray(before)) // [1, 2, 3]
3646
- * console.log(Chunk.toArray(fromMatch)) // [4, 5, 6]
3499
+ * Chunk.toArray(before) // => [1, 2, 3]
3500
+ * Chunk.toArray(fromMatch) // => [4, 5, 6]
3647
3501
  *
3648
3502
  * // No match found
3649
3503
  * const [all, empty] = Chunk.splitWhere(chunk, (n) => n > 10)
3650
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3651
- * console.log(Chunk.toArray(empty)) // []
3504
+ * Chunk.toArray(all) // => [1, 2, 3, 4, 5, 6]
3505
+ * Chunk.toArray(empty) // => []
3652
3506
  *
3653
3507
  * // Match on first element
3654
3508
  * const [emptyBefore, allFromFirst] = Chunk.splitWhere(chunk, (n) => n === 1)
3655
- * console.log(Chunk.toArray(emptyBefore)) // []
3656
- * console.log(Chunk.toArray(allFromFirst)) // [1, 2, 3, 4, 5, 6]
3509
+ * Chunk.toArray(emptyBefore) // => []
3510
+ * Chunk.toArray(allFromFirst) // => [1, 2, 3, 4, 5, 6]
3657
3511
  * ```
3658
3512
  *
3659
3513
  * @category splitting
@@ -3677,20 +3531,19 @@ export const splitWhere: {
3677
3531
  *
3678
3532
  * **Example** (Getting the tail safely)
3679
3533
  *
3680
- * ```ts
3681
- * import { Chunk } from "effect"
3534
+ * ```ts import.meta.vitest
3535
+ * import { Chunk, Option } from "effect"
3682
3536
  *
3683
3537
  * const chunk = Chunk.make(1, 2, 3, 4)
3684
- * console.log(Chunk.tail(chunk)) // Option.some(Chunk.make(2, 3, 4))
3538
+ * Chunk.tail(chunk) // => Option.some(Chunk.make(2, 3, 4))
3685
3539
  *
3686
3540
  * const singleElement = Chunk.make(1)
3687
- * console.log(Chunk.tail(singleElement)) // Option.some(Chunk.empty())
3541
+ * Chunk.tail(singleElement) // => Option.some(Chunk.empty())
3688
3542
  *
3689
- * const empty = Chunk.empty<number>()
3690
- * console.log(Chunk.tail(empty)) // Option.none()
3543
+ * Chunk.tail(Chunk.empty<number>()) // => Option.none()
3691
3544
  * ```
3692
3545
  *
3693
- * @category elements
3546
+ * @category getters
3694
3547
  * @since 2.0.0
3695
3548
  */
3696
3549
  export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ? O.some(drop(self, 1)) : O.none()
@@ -3700,22 +3553,20 @@ export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ?
3700
3553
  *
3701
3554
  * **Example** (Getting the tail of a non-empty chunk)
3702
3555
  *
3703
- * ```ts
3556
+ * ```ts import.meta.vitest
3704
3557
  * import { Chunk } from "effect"
3705
3558
  *
3706
3559
  * const nonEmptyChunk = Chunk.make(1, 2, 3, 4)
3707
- * const result = Chunk.tailNonEmpty(nonEmptyChunk)
3708
- * console.log(Chunk.toArray(result)) // [2, 3, 4]
3560
+ * Chunk.toArray(Chunk.tailNonEmpty(nonEmptyChunk)) // => [2, 3, 4]
3709
3561
  *
3710
3562
  * const singleElement = Chunk.make(1)
3711
- * const resultSingle = Chunk.tailNonEmpty(singleElement)
3712
- * console.log(Chunk.toArray(resultSingle)) // []
3563
+ * Chunk.toArray(Chunk.tailNonEmpty(singleElement)) // => []
3713
3564
  *
3714
3565
  * // Type safety: this function only accepts NonEmptyChunk
3715
3566
  * // Chunk.tailNonEmpty(Chunk.empty()) // TypeScript error
3716
3567
  * ```
3717
3568
  *
3718
- * @category elements
3569
+ * @category getters
3719
3570
  * @since 2.0.0
3720
3571
  */
3721
3572
  export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self, 1)
@@ -3725,23 +3576,20 @@ export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self,
3725
3576
  *
3726
3577
  * **Example** (Taking elements from the end)
3727
3578
  *
3728
- * ```ts
3579
+ * ```ts import.meta.vitest
3729
3580
  * import { Chunk } from "effect"
3730
3581
  *
3731
3582
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3732
- * const lastThree = Chunk.takeRight(chunk, 3)
3733
- * console.log(Chunk.toArray(lastThree)) // [4, 5, 6]
3583
+ * Chunk.toArray(Chunk.takeRight(chunk, 3)) // => [4, 5, 6]
3734
3584
  *
3735
3585
  * // Take more than available
3736
- * const all = Chunk.takeRight(chunk, 10)
3737
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3586
+ * Chunk.toArray(Chunk.takeRight(chunk, 10)) // => [1, 2, 3, 4, 5, 6]
3738
3587
  *
3739
3588
  * // Take zero
3740
- * const none = Chunk.takeRight(chunk, 0)
3741
- * console.log(Chunk.toArray(none)) // []
3589
+ * Chunk.toArray(Chunk.takeRight(chunk, 0)) // => []
3742
3590
  * ```
3743
3591
  *
3744
- * @category elements
3592
+ * @category filtering
3745
3593
  * @since 2.0.0
3746
3594
  */
3747
3595
  export const takeRight: {
@@ -3750,23 +3598,20 @@ export const takeRight: {
3750
3598
  *
3751
3599
  * **Example** (Taking elements from the end)
3752
3600
  *
3753
- * ```ts
3601
+ * ```ts import.meta.vitest
3754
3602
  * import { Chunk } from "effect"
3755
3603
  *
3756
3604
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3757
- * const lastThree = Chunk.takeRight(chunk, 3)
3758
- * console.log(Chunk.toArray(lastThree)) // [4, 5, 6]
3605
+ * Chunk.toArray(Chunk.takeRight(chunk, 3)) // => [4, 5, 6]
3759
3606
  *
3760
3607
  * // Take more than available
3761
- * const all = Chunk.takeRight(chunk, 10)
3762
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3608
+ * Chunk.toArray(Chunk.takeRight(chunk, 10)) // => [1, 2, 3, 4, 5, 6]
3763
3609
  *
3764
3610
  * // Take zero
3765
- * const none = Chunk.takeRight(chunk, 0)
3766
- * console.log(Chunk.toArray(none)) // []
3611
+ * Chunk.toArray(Chunk.takeRight(chunk, 0)) // => []
3767
3612
  * ```
3768
3613
  *
3769
- * @category elements
3614
+ * @category filtering
3770
3615
  * @since 2.0.0
3771
3616
  */
3772
3617
  (n: number): <A>(self: Chunk<A>) => Chunk<A>
@@ -3775,23 +3620,20 @@ export const takeRight: {
3775
3620
  *
3776
3621
  * **Example** (Taking elements from the end)
3777
3622
  *
3778
- * ```ts
3623
+ * ```ts import.meta.vitest
3779
3624
  * import { Chunk } from "effect"
3780
3625
  *
3781
3626
  * const chunk = Chunk.make(1, 2, 3, 4, 5, 6)
3782
- * const lastThree = Chunk.takeRight(chunk, 3)
3783
- * console.log(Chunk.toArray(lastThree)) // [4, 5, 6]
3627
+ * Chunk.toArray(Chunk.takeRight(chunk, 3)) // => [4, 5, 6]
3784
3628
  *
3785
3629
  * // Take more than available
3786
- * const all = Chunk.takeRight(chunk, 10)
3787
- * console.log(Chunk.toArray(all)) // [1, 2, 3, 4, 5, 6]
3630
+ * Chunk.toArray(Chunk.takeRight(chunk, 10)) // => [1, 2, 3, 4, 5, 6]
3788
3631
  *
3789
3632
  * // Take zero
3790
- * const none = Chunk.takeRight(chunk, 0)
3791
- * console.log(Chunk.toArray(none)) // []
3633
+ * Chunk.toArray(Chunk.takeRight(chunk, 0)) // => []
3792
3634
  * ```
3793
3635
  *
3794
- * @category elements
3636
+ * @category filtering
3795
3637
  * @since 2.0.0
3796
3638
  */
3797
3639
  <A>(self: Chunk<A>, n: number): Chunk<A>
@@ -3802,24 +3644,21 @@ export const takeRight: {
3802
3644
  *
3803
3645
  * **Example** (Taking elements while a predicate matches)
3804
3646
  *
3805
- * ```ts
3647
+ * ```ts import.meta.vitest
3806
3648
  * import { Chunk } from "effect"
3807
3649
  *
3808
3650
  * const chunk = Chunk.make(1, 2, 3, 4, 3, 2, 1)
3809
- * const result = Chunk.takeWhile(chunk, (n) => n < 4)
3810
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
3651
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n < 4)) // => [1, 2, 3]
3811
3652
  *
3812
3653
  * // Empty if first element doesn't match
3813
- * const none = Chunk.takeWhile(chunk, (n) => n > 5)
3814
- * console.log(Chunk.toArray(none)) // []
3654
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n > 5)) // => []
3815
3655
  *
3816
3656
  * // Takes all if all match
3817
3657
  * const small = Chunk.make(1, 2, 3)
3818
- * const all = Chunk.takeWhile(small, (n) => n < 10)
3819
- * console.log(Chunk.toArray(all)) // [1, 2, 3]
3658
+ * Chunk.toArray(Chunk.takeWhile(small, (n) => n < 10)) // => [1, 2, 3]
3820
3659
  * ```
3821
3660
  *
3822
- * @category elements
3661
+ * @category filtering
3823
3662
  * @since 2.0.0
3824
3663
  */
3825
3664
  export const takeWhile: {
@@ -3828,24 +3667,21 @@ export const takeWhile: {
3828
3667
  *
3829
3668
  * **Example** (Taking elements while a predicate matches)
3830
3669
  *
3831
- * ```ts
3670
+ * ```ts import.meta.vitest
3832
3671
  * import { Chunk } from "effect"
3833
3672
  *
3834
3673
  * const chunk = Chunk.make(1, 2, 3, 4, 3, 2, 1)
3835
- * const result = Chunk.takeWhile(chunk, (n) => n < 4)
3836
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
3674
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n < 4)) // => [1, 2, 3]
3837
3675
  *
3838
3676
  * // Empty if first element doesn't match
3839
- * const none = Chunk.takeWhile(chunk, (n) => n > 5)
3840
- * console.log(Chunk.toArray(none)) // []
3677
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n > 5)) // => []
3841
3678
  *
3842
3679
  * // Takes all if all match
3843
3680
  * const small = Chunk.make(1, 2, 3)
3844
- * const all = Chunk.takeWhile(small, (n) => n < 10)
3845
- * console.log(Chunk.toArray(all)) // [1, 2, 3]
3681
+ * Chunk.toArray(Chunk.takeWhile(small, (n) => n < 10)) // => [1, 2, 3]
3846
3682
  * ```
3847
3683
  *
3848
- * @category elements
3684
+ * @category filtering
3849
3685
  * @since 2.0.0
3850
3686
  */
3851
3687
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Chunk<B>
@@ -3854,24 +3690,21 @@ export const takeWhile: {
3854
3690
  *
3855
3691
  * **Example** (Taking elements while a predicate matches)
3856
3692
  *
3857
- * ```ts
3693
+ * ```ts import.meta.vitest
3858
3694
  * import { Chunk } from "effect"
3859
3695
  *
3860
3696
  * const chunk = Chunk.make(1, 2, 3, 4, 3, 2, 1)
3861
- * const result = Chunk.takeWhile(chunk, (n) => n < 4)
3862
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
3697
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n < 4)) // => [1, 2, 3]
3863
3698
  *
3864
3699
  * // Empty if first element doesn't match
3865
- * const none = Chunk.takeWhile(chunk, (n) => n > 5)
3866
- * console.log(Chunk.toArray(none)) // []
3700
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n > 5)) // => []
3867
3701
  *
3868
3702
  * // Takes all if all match
3869
3703
  * const small = Chunk.make(1, 2, 3)
3870
- * const all = Chunk.takeWhile(small, (n) => n < 10)
3871
- * console.log(Chunk.toArray(all)) // [1, 2, 3]
3704
+ * Chunk.toArray(Chunk.takeWhile(small, (n) => n < 10)) // => [1, 2, 3]
3872
3705
  * ```
3873
3706
  *
3874
- * @category elements
3707
+ * @category filtering
3875
3708
  * @since 2.0.0
3876
3709
  */
3877
3710
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
@@ -3880,24 +3713,21 @@ export const takeWhile: {
3880
3713
  *
3881
3714
  * **Example** (Taking elements while a predicate matches)
3882
3715
  *
3883
- * ```ts
3716
+ * ```ts import.meta.vitest
3884
3717
  * import { Chunk } from "effect"
3885
3718
  *
3886
3719
  * const chunk = Chunk.make(1, 2, 3, 4, 3, 2, 1)
3887
- * const result = Chunk.takeWhile(chunk, (n) => n < 4)
3888
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
3720
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n < 4)) // => [1, 2, 3]
3889
3721
  *
3890
3722
  * // Empty if first element doesn't match
3891
- * const none = Chunk.takeWhile(chunk, (n) => n > 5)
3892
- * console.log(Chunk.toArray(none)) // []
3723
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n > 5)) // => []
3893
3724
  *
3894
3725
  * // Takes all if all match
3895
3726
  * const small = Chunk.make(1, 2, 3)
3896
- * const all = Chunk.takeWhile(small, (n) => n < 10)
3897
- * console.log(Chunk.toArray(all)) // [1, 2, 3]
3727
+ * Chunk.toArray(Chunk.takeWhile(small, (n) => n < 10)) // => [1, 2, 3]
3898
3728
  * ```
3899
3729
  *
3900
- * @category elements
3730
+ * @category filtering
3901
3731
  * @since 2.0.0
3902
3732
  */
3903
3733
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Chunk<B>
@@ -3906,24 +3736,21 @@ export const takeWhile: {
3906
3736
  *
3907
3737
  * **Example** (Taking elements while a predicate matches)
3908
3738
  *
3909
- * ```ts
3739
+ * ```ts import.meta.vitest
3910
3740
  * import { Chunk } from "effect"
3911
3741
  *
3912
3742
  * const chunk = Chunk.make(1, 2, 3, 4, 3, 2, 1)
3913
- * const result = Chunk.takeWhile(chunk, (n) => n < 4)
3914
- * console.log(Chunk.toArray(result)) // [1, 2, 3]
3743
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n < 4)) // => [1, 2, 3]
3915
3744
  *
3916
3745
  * // Empty if first element doesn't match
3917
- * const none = Chunk.takeWhile(chunk, (n) => n > 5)
3918
- * console.log(Chunk.toArray(none)) // []
3746
+ * Chunk.toArray(Chunk.takeWhile(chunk, (n) => n > 5)) // => []
3919
3747
  *
3920
3748
  * // Takes all if all match
3921
3749
  * const small = Chunk.make(1, 2, 3)
3922
- * const all = Chunk.takeWhile(small, (n) => n < 10)
3923
- * console.log(Chunk.toArray(all)) // [1, 2, 3]
3750
+ * Chunk.toArray(Chunk.takeWhile(small, (n) => n < 10)) // => [1, 2, 3]
3924
3751
  * ```
3925
3752
  *
3926
- * @category elements
3753
+ * @category filtering
3927
3754
  * @since 2.0.0
3928
3755
  */
3929
3756
  <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
@@ -3944,22 +3771,20 @@ export const takeWhile: {
3944
3771
  *
3945
3772
  * **Example** (Unioning chunks)
3946
3773
  *
3947
- * ```ts
3774
+ * ```ts import.meta.vitest
3948
3775
  * import { Chunk } from "effect"
3949
3776
  *
3950
3777
  * const chunk1 = Chunk.make(1, 2, 3)
3951
3778
  * const chunk2 = Chunk.make(3, 4, 5)
3952
- * const result = Chunk.union(chunk1, chunk2)
3953
- * console.log(Chunk.toArray(result)) // [1, 2, 3, 4, 5]
3779
+ * Chunk.toArray(Chunk.union(chunk1, chunk2)) // => [1, 2, 3, 4, 5]
3954
3780
  *
3955
3781
  * // Handles duplicates within the same chunk
3956
3782
  * const withDupes1 = Chunk.make(1, 1, 2)
3957
3783
  * const withDupes2 = Chunk.make(2, 3, 3)
3958
- * const unified = Chunk.union(withDupes1, withDupes2)
3959
- * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3784
+ * Chunk.toArray(Chunk.union(withDupes1, withDupes2)) // => [1, 2, 3]
3960
3785
  * ```
3961
3786
  *
3962
- * @category elements
3787
+ * @category set operations
3963
3788
  * @since 2.0.0
3964
3789
  */
3965
3790
  export const union: {
@@ -3968,22 +3793,20 @@ export const union: {
3968
3793
  *
3969
3794
  * **Example** (Unioning chunks)
3970
3795
  *
3971
- * ```ts
3796
+ * ```ts import.meta.vitest
3972
3797
  * import { Chunk } from "effect"
3973
3798
  *
3974
3799
  * const chunk1 = Chunk.make(1, 2, 3)
3975
3800
  * const chunk2 = Chunk.make(3, 4, 5)
3976
- * const result = Chunk.union(chunk1, chunk2)
3977
- * console.log(Chunk.toArray(result)) // [1, 2, 3, 4, 5]
3801
+ * Chunk.toArray(Chunk.union(chunk1, chunk2)) // => [1, 2, 3, 4, 5]
3978
3802
  *
3979
3803
  * // Handles duplicates within the same chunk
3980
3804
  * const withDupes1 = Chunk.make(1, 1, 2)
3981
3805
  * const withDupes2 = Chunk.make(2, 3, 3)
3982
- * const unified = Chunk.union(withDupes1, withDupes2)
3983
- * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3806
+ * Chunk.toArray(Chunk.union(withDupes1, withDupes2)) // => [1, 2, 3]
3984
3807
  * ```
3985
3808
  *
3986
- * @category elements
3809
+ * @category set operations
3987
3810
  * @since 2.0.0
3988
3811
  */
3989
3812
  <A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A | B>
@@ -3992,22 +3815,20 @@ export const union: {
3992
3815
  *
3993
3816
  * **Example** (Unioning chunks)
3994
3817
  *
3995
- * ```ts
3818
+ * ```ts import.meta.vitest
3996
3819
  * import { Chunk } from "effect"
3997
3820
  *
3998
3821
  * const chunk1 = Chunk.make(1, 2, 3)
3999
3822
  * const chunk2 = Chunk.make(3, 4, 5)
4000
- * const result = Chunk.union(chunk1, chunk2)
4001
- * console.log(Chunk.toArray(result)) // [1, 2, 3, 4, 5]
3823
+ * Chunk.toArray(Chunk.union(chunk1, chunk2)) // => [1, 2, 3, 4, 5]
4002
3824
  *
4003
3825
  * // Handles duplicates within the same chunk
4004
3826
  * const withDupes1 = Chunk.make(1, 1, 2)
4005
3827
  * const withDupes2 = Chunk.make(2, 3, 3)
4006
- * const unified = Chunk.union(withDupes1, withDupes2)
4007
- * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3828
+ * Chunk.toArray(Chunk.union(withDupes1, withDupes2)) // => [1, 2, 3]
4008
3829
  * ```
4009
3830
  *
4010
- * @category elements
3831
+ * @category set operations
4011
3832
  * @since 2.0.0
4012
3833
  */
4013
3834
  <A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A | B>
@@ -4022,25 +3843,22 @@ export const union: {
4022
3843
  *
4023
3844
  * **Example** (Removing duplicate values)
4024
3845
  *
4025
- * ```ts
3846
+ * ```ts import.meta.vitest
4026
3847
  * import { Chunk } from "effect"
4027
3848
  *
4028
3849
  * const chunk = Chunk.make(1, 2, 2, 3, 1, 4, 3)
4029
- * const result = Chunk.dedupe(chunk)
4030
- * console.log(Chunk.toArray(result)) // [1, 2, 3, 4]
3850
+ * Chunk.toArray(Chunk.dedupe(chunk)) // => [1, 2, 3, 4]
4031
3851
  *
4032
3852
  * // Empty chunk
4033
3853
  * const empty = Chunk.empty<number>()
4034
- * const emptyDeduped = Chunk.dedupe(empty)
4035
- * console.log(Chunk.toArray(emptyDeduped)) // []
3854
+ * Chunk.toArray(Chunk.dedupe(empty)) // => []
4036
3855
  *
4037
3856
  * // No duplicates
4038
3857
  * const unique = Chunk.make(1, 2, 3)
4039
- * const uniqueDeduped = Chunk.dedupe(unique)
4040
- * console.log(Chunk.toArray(uniqueDeduped)) // [1, 2, 3]
3858
+ * Chunk.toArray(Chunk.dedupe(unique)) // => [1, 2, 3]
4041
3859
  * ```
4042
3860
  *
4043
- * @category elements
3861
+ * @category deduplication
4044
3862
  * @since 2.0.0
4045
3863
  */
4046
3864
  export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe(toReadonlyArray(self)))
@@ -4050,17 +3868,15 @@ export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe
4050
3868
  *
4051
3869
  * **Example** (Removing adjacent duplicates)
4052
3870
  *
4053
- * ```ts
3871
+ * ```ts import.meta.vitest
4054
3872
  * import { Chunk } from "effect"
4055
3873
  *
4056
3874
  * const chunk = Chunk.make(1, 1, 2, 2, 2, 3, 1, 1)
4057
- * const result = Chunk.dedupeAdjacent(chunk)
4058
- * console.log(Chunk.toArray(result)) // [1, 2, 3, 1]
3875
+ * Chunk.toArray(Chunk.dedupeAdjacent(chunk)) // => [1, 2, 3, 1]
4059
3876
  *
4060
3877
  * // Only removes adjacent duplicates, not all duplicates
4061
3878
  * const mixed = Chunk.make("a", "a", "b", "a", "a")
4062
- * const mixedResult = Chunk.dedupeAdjacent(mixed)
4063
- * console.log(Chunk.toArray(mixedResult)) // ["a", "b", "a"]
3879
+ * Chunk.toArray(Chunk.dedupeAdjacent(mixed)) // => ["a", "b", "a"]
4064
3880
  * ```
4065
3881
  *
4066
3882
  * @category filtering
@@ -4077,7 +3893,7 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
4077
3893
  *
4078
3894
  * **Example** (Unzipping pairs)
4079
3895
  *
4080
- * ```ts
3896
+ * ```ts import.meta.vitest
4081
3897
  * import { Chunk } from "effect"
4082
3898
  *
4083
3899
  * const pairs = Chunk.make(
@@ -4086,17 +3902,17 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
4086
3902
  * [3, "c"] as const
4087
3903
  * )
4088
3904
  * const [numbers, letters] = Chunk.unzip(pairs)
4089
- * console.log(Chunk.toArray(numbers)) // [1, 2, 3]
4090
- * console.log(Chunk.toArray(letters)) // ["a", "b", "c"]
3905
+ * Chunk.toArray(numbers) // => [1, 2, 3]
3906
+ * Chunk.toArray(letters) // => ["a", "b", "c"]
4091
3907
  *
4092
3908
  * // Empty chunk
4093
3909
  * const empty = Chunk.empty<[number, string]>()
4094
3910
  * const [emptyNums, emptyStrs] = Chunk.unzip(empty)
4095
- * console.log(Chunk.toArray(emptyNums)) // []
4096
- * console.log(Chunk.toArray(emptyStrs)) // []
3911
+ * Chunk.toArray(emptyNums) // => []
3912
+ * Chunk.toArray(emptyStrs) // => []
4097
3913
  * ```
4098
3914
  *
4099
- * @category elements
3915
+ * @category splitting
4100
3916
  * @since 2.0.0
4101
3917
  */
4102
3918
  export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>] => {
@@ -4109,19 +3925,17 @@ export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>]
4109
3925
  *
4110
3926
  * **Example** (Zipping chunks with a function)
4111
3927
  *
4112
- * ```ts
3928
+ * ```ts import.meta.vitest
4113
3929
  * import { Chunk } from "effect"
4114
3930
  *
4115
3931
  * const numbers = Chunk.make(1, 2, 3)
4116
3932
  * const letters = Chunk.make("a", "b", "c")
4117
- * const result = Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)
4118
- * console.log(Chunk.toArray(result)) // ["1-a", "2-b", "3-c"]
3933
+ * Chunk.toArray(Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)) // => ["1-a", "2-b", "3-c"]
4119
3934
  *
4120
3935
  * // Different lengths - takes minimum
4121
3936
  * const short = Chunk.make(1, 2)
4122
3937
  * const long = Chunk.make("a", "b", "c", "d")
4123
- * const mixed = Chunk.zipWith(short, long, (n, l) => [n, l])
4124
- * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3938
+ * Chunk.toArray(Chunk.zipWith(short, long, (n, l) => [n, l])) // => [[1, "a"], [2, "b"]]
4125
3939
  * ```
4126
3940
  *
4127
3941
  * @category zipping
@@ -4133,19 +3947,17 @@ export const zipWith: {
4133
3947
  *
4134
3948
  * **Example** (Zipping chunks with a function)
4135
3949
  *
4136
- * ```ts
3950
+ * ```ts import.meta.vitest
4137
3951
  * import { Chunk } from "effect"
4138
3952
  *
4139
3953
  * const numbers = Chunk.make(1, 2, 3)
4140
3954
  * const letters = Chunk.make("a", "b", "c")
4141
- * const result = Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)
4142
- * console.log(Chunk.toArray(result)) // ["1-a", "2-b", "3-c"]
3955
+ * Chunk.toArray(Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)) // => ["1-a", "2-b", "3-c"]
4143
3956
  *
4144
3957
  * // Different lengths - takes minimum
4145
3958
  * const short = Chunk.make(1, 2)
4146
3959
  * const long = Chunk.make("a", "b", "c", "d")
4147
- * const mixed = Chunk.zipWith(short, long, (n, l) => [n, l])
4148
- * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3960
+ * Chunk.toArray(Chunk.zipWith(short, long, (n, l) => [n, l])) // => [[1, "a"], [2, "b"]]
4149
3961
  * ```
4150
3962
  *
4151
3963
  * @category zipping
@@ -4157,19 +3969,17 @@ export const zipWith: {
4157
3969
  *
4158
3970
  * **Example** (Zipping chunks with a function)
4159
3971
  *
4160
- * ```ts
3972
+ * ```ts import.meta.vitest
4161
3973
  * import { Chunk } from "effect"
4162
3974
  *
4163
3975
  * const numbers = Chunk.make(1, 2, 3)
4164
3976
  * const letters = Chunk.make("a", "b", "c")
4165
- * const result = Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)
4166
- * console.log(Chunk.toArray(result)) // ["1-a", "2-b", "3-c"]
3977
+ * Chunk.toArray(Chunk.zipWith(numbers, letters, (n, l) => `${n}-${l}`)) // => ["1-a", "2-b", "3-c"]
4167
3978
  *
4168
3979
  * // Different lengths - takes minimum
4169
3980
  * const short = Chunk.make(1, 2)
4170
3981
  * const long = Chunk.make("a", "b", "c", "d")
4171
- * const mixed = Chunk.zipWith(short, long, (n, l) => [n, l])
4172
- * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3982
+ * Chunk.toArray(Chunk.zipWith(short, long, (n, l) => [n, l])) // => [[1, "a"], [2, "b"]]
4173
3983
  * ```
4174
3984
  *
4175
3985
  * @category zipping
@@ -4187,19 +3997,17 @@ export const zipWith: {
4187
3997
  *
4188
3998
  * **Example** (Zipping chunks)
4189
3999
  *
4190
- * ```ts
4000
+ * ```ts import.meta.vitest
4191
4001
  * import { Chunk } from "effect"
4192
4002
  *
4193
4003
  * const numbers = Chunk.make(1, 2, 3)
4194
4004
  * const letters = Chunk.make("a", "b", "c")
4195
- * const result = Chunk.zip(numbers, letters)
4196
- * console.log(Chunk.toArray(result)) // [[1, "a"], [2, "b"], [3, "c"]]
4005
+ * Chunk.toArray(Chunk.zip(numbers, letters)) // => [[1, "a"], [2, "b"], [3, "c"]]
4197
4006
  *
4198
4007
  * // Different lengths - takes minimum length
4199
4008
  * const short = Chunk.make(1, 2)
4200
4009
  * const long = Chunk.make("a", "b", "c", "d")
4201
- * const zipped = Chunk.zip(short, long)
4202
- * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
4010
+ * Chunk.toArray(Chunk.zip(short, long)) // => [[1, "a"], [2, "b"]]
4203
4011
  * ```
4204
4012
  *
4205
4013
  * @category zipping
@@ -4211,19 +4019,17 @@ export const zip: {
4211
4019
  *
4212
4020
  * **Example** (Zipping chunks)
4213
4021
  *
4214
- * ```ts
4022
+ * ```ts import.meta.vitest
4215
4023
  * import { Chunk } from "effect"
4216
4024
  *
4217
4025
  * const numbers = Chunk.make(1, 2, 3)
4218
4026
  * const letters = Chunk.make("a", "b", "c")
4219
- * const result = Chunk.zip(numbers, letters)
4220
- * console.log(Chunk.toArray(result)) // [[1, "a"], [2, "b"], [3, "c"]]
4027
+ * Chunk.toArray(Chunk.zip(numbers, letters)) // => [[1, "a"], [2, "b"], [3, "c"]]
4221
4028
  *
4222
4029
  * // Different lengths - takes minimum length
4223
4030
  * const short = Chunk.make(1, 2)
4224
4031
  * const long = Chunk.make("a", "b", "c", "d")
4225
- * const zipped = Chunk.zip(short, long)
4226
- * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
4032
+ * Chunk.toArray(Chunk.zip(short, long)) // => [[1, "a"], [2, "b"]]
4227
4033
  * ```
4228
4034
  *
4229
4035
  * @category zipping
@@ -4235,19 +4041,17 @@ export const zip: {
4235
4041
  *
4236
4042
  * **Example** (Zipping chunks)
4237
4043
  *
4238
- * ```ts
4044
+ * ```ts import.meta.vitest
4239
4045
  * import { Chunk } from "effect"
4240
4046
  *
4241
4047
  * const numbers = Chunk.make(1, 2, 3)
4242
4048
  * const letters = Chunk.make("a", "b", "c")
4243
- * const result = Chunk.zip(numbers, letters)
4244
- * console.log(Chunk.toArray(result)) // [[1, "a"], [2, "b"], [3, "c"]]
4049
+ * Chunk.toArray(Chunk.zip(numbers, letters)) // => [[1, "a"], [2, "b"], [3, "c"]]
4245
4050
  *
4246
4051
  * // Different lengths - takes minimum length
4247
4052
  * const short = Chunk.make(1, 2)
4248
4053
  * const long = Chunk.make("a", "b", "c", "d")
4249
- * const zipped = Chunk.zip(short, long)
4250
- * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
4054
+ * Chunk.toArray(Chunk.zip(short, long)) // => [[1, "a"], [2, "b"]]
4251
4055
  * ```
4252
4056
  *
4253
4057
  * @category zipping
@@ -4264,23 +4068,20 @@ export const zip: {
4264
4068
  *
4265
4069
  * **Example** (Removing an element)
4266
4070
  *
4267
- * ```ts
4071
+ * ```ts import.meta.vitest
4268
4072
  * import { Chunk } from "effect"
4269
4073
  *
4270
4074
  * const chunk = Chunk.make("a", "b", "c", "d")
4271
- * const result = Chunk.remove(chunk, 1)
4272
- * console.log(Chunk.toArray(result)) // ["a", "c", "d"]
4075
+ * Chunk.toArray(Chunk.remove(chunk, 1)) // => ["a", "c", "d"]
4273
4076
  *
4274
4077
  * // Remove first element
4275
- * const removeFirst = Chunk.remove(chunk, 0)
4276
- * console.log(Chunk.toArray(removeFirst)) // ["b", "c", "d"]
4078
+ * Chunk.toArray(Chunk.remove(chunk, 0)) // => ["b", "c", "d"]
4277
4079
  *
4278
4080
  * // Index out of bounds returns same chunk
4279
- * const outOfBounds = Chunk.remove(chunk, 10)
4280
- * console.log(Chunk.toArray(outOfBounds)) // ["a", "b", "c", "d"]
4081
+ * Chunk.toArray(Chunk.remove(chunk, 10)) // => ["a", "b", "c", "d"]
4281
4082
  * ```
4282
4083
  *
4283
- * @category elements
4084
+ * @category transforming
4284
4085
  * @since 2.0.0
4285
4086
  */
4286
4087
  export const remove: {
@@ -4289,23 +4090,20 @@ export const remove: {
4289
4090
  *
4290
4091
  * **Example** (Removing an element)
4291
4092
  *
4292
- * ```ts
4093
+ * ```ts import.meta.vitest
4293
4094
  * import { Chunk } from "effect"
4294
4095
  *
4295
4096
  * const chunk = Chunk.make("a", "b", "c", "d")
4296
- * const result = Chunk.remove(chunk, 1)
4297
- * console.log(Chunk.toArray(result)) // ["a", "c", "d"]
4097
+ * Chunk.toArray(Chunk.remove(chunk, 1)) // => ["a", "c", "d"]
4298
4098
  *
4299
4099
  * // Remove first element
4300
- * const removeFirst = Chunk.remove(chunk, 0)
4301
- * console.log(Chunk.toArray(removeFirst)) // ["b", "c", "d"]
4100
+ * Chunk.toArray(Chunk.remove(chunk, 0)) // => ["b", "c", "d"]
4302
4101
  *
4303
4102
  * // Index out of bounds returns same chunk
4304
- * const outOfBounds = Chunk.remove(chunk, 10)
4305
- * console.log(Chunk.toArray(outOfBounds)) // ["a", "b", "c", "d"]
4103
+ * Chunk.toArray(Chunk.remove(chunk, 10)) // => ["a", "b", "c", "d"]
4306
4104
  * ```
4307
4105
  *
4308
- * @category elements
4106
+ * @category transforming
4309
4107
  * @since 2.0.0
4310
4108
  */
4311
4109
  (i: number): <A>(self: Chunk<A>) => Chunk<A>
@@ -4314,23 +4112,20 @@ export const remove: {
4314
4112
  *
4315
4113
  * **Example** (Removing an element)
4316
4114
  *
4317
- * ```ts
4115
+ * ```ts import.meta.vitest
4318
4116
  * import { Chunk } from "effect"
4319
4117
  *
4320
4118
  * const chunk = Chunk.make("a", "b", "c", "d")
4321
- * const result = Chunk.remove(chunk, 1)
4322
- * console.log(Chunk.toArray(result)) // ["a", "c", "d"]
4119
+ * Chunk.toArray(Chunk.remove(chunk, 1)) // => ["a", "c", "d"]
4323
4120
  *
4324
4121
  * // Remove first element
4325
- * const removeFirst = Chunk.remove(chunk, 0)
4326
- * console.log(Chunk.toArray(removeFirst)) // ["b", "c", "d"]
4122
+ * Chunk.toArray(Chunk.remove(chunk, 0)) // => ["b", "c", "d"]
4327
4123
  *
4328
4124
  * // Index out of bounds returns same chunk
4329
- * const outOfBounds = Chunk.remove(chunk, 10)
4330
- * console.log(Chunk.toArray(outOfBounds)) // ["a", "b", "c", "d"]
4125
+ * Chunk.toArray(Chunk.remove(chunk, 10)) // => ["a", "b", "c", "d"]
4331
4126
  * ```
4332
4127
  *
4333
- * @category elements
4128
+ * @category transforming
4334
4129
  * @since 2.0.0
4335
4130
  */
4336
4131
  <A>(self: Chunk<A>, i: number): Chunk<A>
@@ -4345,23 +4140,20 @@ export const remove: {
4345
4140
  *
4346
4141
  * **Example** (Modifying an element)
4347
4142
  *
4348
- * ```ts
4349
- * import { Chunk } from "effect"
4143
+ * ```ts import.meta.vitest
4144
+ * import { Chunk, Option } from "effect"
4350
4145
  *
4351
4146
  * const chunk = Chunk.make(1, 2, 3, 4)
4352
- * const result = Chunk.modify(chunk, 1, (n) => n * 10)
4353
- * console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
4147
+ * Chunk.modify(chunk, 1, (n) => n * 10) // => Option.some(Chunk.make(1, 20, 3, 4))
4354
4148
  *
4355
4149
  * // Index out of bounds returns None
4356
- * const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
4357
- * console.log(outOfBounds) // Option.none()
4150
+ * chunk.pipe(Chunk.modify(10, (n) => n * 10)) // => Option.none()
4358
4151
  *
4359
4152
  * // Negative index returns None
4360
- * const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
4361
- * console.log(negative) // Option.none()
4153
+ * chunk.pipe(Chunk.modify(-1, (n) => n * 10)) // => Option.none()
4362
4154
  * ```
4363
4155
  *
4364
- * @category elements
4156
+ * @category transforming
4365
4157
  * @since 2.0.0
4366
4158
  */
4367
4159
  export const modify: {
@@ -4371,23 +4163,20 @@ export const modify: {
4371
4163
  *
4372
4164
  * **Example** (Modifying an element)
4373
4165
  *
4374
- * ```ts
4375
- * import { Chunk } from "effect"
4166
+ * ```ts import.meta.vitest
4167
+ * import { Chunk, Option } from "effect"
4376
4168
  *
4377
4169
  * const chunk = Chunk.make(1, 2, 3, 4)
4378
- * const result = Chunk.modify(chunk, 1, (n) => n * 10)
4379
- * console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
4170
+ * Chunk.modify(chunk, 1, (n) => n * 10) // => Option.some(Chunk.make(1, 20, 3, 4))
4380
4171
  *
4381
4172
  * // Index out of bounds returns None
4382
- * const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
4383
- * console.log(outOfBounds) // Option.none()
4173
+ * chunk.pipe(Chunk.modify(10, (n) => n * 10)) // => Option.none()
4384
4174
  *
4385
4175
  * // Negative index returns None
4386
- * const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
4387
- * console.log(negative) // Option.none()
4176
+ * chunk.pipe(Chunk.modify(-1, (n) => n * 10)) // => Option.none()
4388
4177
  * ```
4389
4178
  *
4390
- * @category elements
4179
+ * @category transforming
4391
4180
  * @since 2.0.0
4392
4181
  */
4393
4182
  <A, B>(i: number, f: (a: A) => B): (self: Chunk<A>) => O.Option<Chunk<A | B>>
@@ -4397,23 +4186,20 @@ export const modify: {
4397
4186
  *
4398
4187
  * **Example** (Modifying an element)
4399
4188
  *
4400
- * ```ts
4401
- * import { Chunk } from "effect"
4189
+ * ```ts import.meta.vitest
4190
+ * import { Chunk, Option } from "effect"
4402
4191
  *
4403
4192
  * const chunk = Chunk.make(1, 2, 3, 4)
4404
- * const result = Chunk.modify(chunk, 1, (n) => n * 10)
4405
- * console.log(result) // Option.some(Chunk.make(1, 20, 3, 4))
4193
+ * Chunk.modify(chunk, 1, (n) => n * 10) // => Option.some(Chunk.make(1, 20, 3, 4))
4406
4194
  *
4407
4195
  * // Index out of bounds returns None
4408
- * const outOfBounds = chunk.pipe(Chunk.modify(10, (n) => n * 10))
4409
- * console.log(outOfBounds) // Option.none()
4196
+ * chunk.pipe(Chunk.modify(10, (n) => n * 10)) // => Option.none()
4410
4197
  *
4411
4198
  * // Negative index returns None
4412
- * const negative = chunk.pipe(Chunk.modify(-1, (n) => n * 10))
4413
- * console.log(negative) // Option.none()
4199
+ * chunk.pipe(Chunk.modify(-1, (n) => n * 10)) // => Option.none()
4414
4200
  * ```
4415
4201
  *
4416
- * @category elements
4202
+ * @category transforming
4417
4203
  * @since 2.0.0
4418
4204
  */
4419
4205
  <A, B>(self: Chunk<A>, i: number, f: (a: A) => B): O.Option<Chunk<A | B>>
@@ -4429,23 +4215,20 @@ export const modify: {
4429
4215
  *
4430
4216
  * **Example** (Replacing an element)
4431
4217
  *
4432
- * ```ts
4433
- * import { Chunk } from "effect"
4218
+ * ```ts import.meta.vitest
4219
+ * import { Chunk, Option } from "effect"
4434
4220
  *
4435
4221
  * const chunk = Chunk.make("a", "b", "c", "d")
4436
- * const result = Chunk.replace(chunk, 1, "X")
4437
- * console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
4222
+ * Chunk.replace(chunk, 1, "X") // => Option.some(Chunk.make("a", "X", "c", "d"))
4438
4223
  *
4439
4224
  * // Index out of bounds returns None
4440
- * const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
4441
- * console.log(outOfBounds) // Option.none()
4225
+ * chunk.pipe(Chunk.replace(10, "Y")) // => Option.none()
4442
4226
  *
4443
4227
  * // Negative index returns None
4444
- * const negative = chunk.pipe(Chunk.replace(-1, "Z"))
4445
- * console.log(negative) // Option.none()
4228
+ * chunk.pipe(Chunk.replace(-1, "Z")) // => Option.none()
4446
4229
  * ```
4447
4230
  *
4448
- * @category elements
4231
+ * @category transforming
4449
4232
  * @since 2.0.0
4450
4233
  */
4451
4234
  export const replace: {
@@ -4455,23 +4238,20 @@ export const replace: {
4455
4238
  *
4456
4239
  * **Example** (Replacing an element)
4457
4240
  *
4458
- * ```ts
4459
- * import { Chunk } from "effect"
4241
+ * ```ts import.meta.vitest
4242
+ * import { Chunk, Option } from "effect"
4460
4243
  *
4461
4244
  * const chunk = Chunk.make("a", "b", "c", "d")
4462
- * const result = Chunk.replace(chunk, 1, "X")
4463
- * console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
4245
+ * Chunk.replace(chunk, 1, "X") // => Option.some(Chunk.make("a", "X", "c", "d"))
4464
4246
  *
4465
4247
  * // Index out of bounds returns None
4466
- * const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
4467
- * console.log(outOfBounds) // Option.none()
4248
+ * chunk.pipe(Chunk.replace(10, "Y")) // => Option.none()
4468
4249
  *
4469
4250
  * // Negative index returns None
4470
- * const negative = chunk.pipe(Chunk.replace(-1, "Z"))
4471
- * console.log(negative) // Option.none()
4251
+ * chunk.pipe(Chunk.replace(-1, "Z")) // => Option.none()
4472
4252
  * ```
4473
4253
  *
4474
- * @category elements
4254
+ * @category transforming
4475
4255
  * @since 2.0.0
4476
4256
  */
4477
4257
  <B>(i: number, b: B): <A>(self: Chunk<A>) => O.Option<Chunk<B | A>>
@@ -4481,23 +4261,20 @@ export const replace: {
4481
4261
  *
4482
4262
  * **Example** (Replacing an element)
4483
4263
  *
4484
- * ```ts
4485
- * import { Chunk } from "effect"
4264
+ * ```ts import.meta.vitest
4265
+ * import { Chunk, Option } from "effect"
4486
4266
  *
4487
4267
  * const chunk = Chunk.make("a", "b", "c", "d")
4488
- * const result = Chunk.replace(chunk, 1, "X")
4489
- * console.log(result) // Option.some(Chunk.make("a", "X", "c", "d"))
4268
+ * Chunk.replace(chunk, 1, "X") // => Option.some(Chunk.make("a", "X", "c", "d"))
4490
4269
  *
4491
4270
  * // Index out of bounds returns None
4492
- * const outOfBounds = chunk.pipe(Chunk.replace(10, "Y"))
4493
- * console.log(outOfBounds) // Option.none()
4271
+ * chunk.pipe(Chunk.replace(10, "Y")) // => Option.none()
4494
4272
  *
4495
4273
  * // Negative index returns None
4496
- * const negative = chunk.pipe(Chunk.replace(-1, "Z"))
4497
- * console.log(negative) // Option.none()
4274
+ * chunk.pipe(Chunk.replace(-1, "Z")) // => Option.none()
4498
4275
  * ```
4499
4276
  *
4500
- * @category elements
4277
+ * @category transforming
4501
4278
  * @since 2.0.0
4502
4279
  */
4503
4280
  <A, B>(self: Chunk<A>, i: number, b: B): O.Option<Chunk<B | A>>
@@ -4512,11 +4289,10 @@ export const replace: {
4512
4289
  *
4513
4290
  * **Example** (Generating chunks from indices)
4514
4291
  *
4515
- * ```ts
4292
+ * ```ts import.meta.vitest
4516
4293
  * import { Chunk } from "effect"
4517
4294
  *
4518
- * const chunk = Chunk.makeBy(5, (i) => i * 2)
4519
- * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4295
+ * Chunk.toArray(Chunk.makeBy(5, (i) => i * 2)) // => [0, 2, 4, 6, 8]
4520
4296
  * ```
4521
4297
  *
4522
4298
  * @category constructors
@@ -4532,11 +4308,10 @@ export const makeBy: {
4532
4308
  *
4533
4309
  * **Example** (Generating chunks from indices)
4534
4310
  *
4535
- * ```ts
4311
+ * ```ts import.meta.vitest
4536
4312
  * import { Chunk } from "effect"
4537
4313
  *
4538
- * const chunk = Chunk.makeBy(5, (i) => i * 2)
4539
- * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4314
+ * Chunk.toArray(Chunk.makeBy(5, (i) => i * 2)) // => [0, 2, 4, 6, 8]
4540
4315
  * ```
4541
4316
  *
4542
4317
  * @category constructors
@@ -4552,11 +4327,10 @@ export const makeBy: {
4552
4327
  *
4553
4328
  * **Example** (Generating chunks from indices)
4554
4329
  *
4555
- * ```ts
4330
+ * ```ts import.meta.vitest
4556
4331
  * import { Chunk } from "effect"
4557
4332
  *
4558
- * const chunk = Chunk.makeBy(5, (i) => i * 2)
4559
- * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4333
+ * Chunk.toArray(Chunk.makeBy(5, (i) => i * 2)) // => [0, 2, 4, 6, 8]
4560
4334
  * ```
4561
4335
  *
4562
4336
  * @category constructors
@@ -4576,11 +4350,10 @@ export const makeBy: {
4576
4350
  *
4577
4351
  * **Example** (Creating a range)
4578
4352
  *
4579
- * ```ts
4353
+ * ```ts import.meta.vitest
4580
4354
  * import { Chunk } from "effect"
4581
4355
  *
4582
- * const chunk = Chunk.range(1, 5)
4583
- * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4, 5]
4356
+ * Chunk.toArray(Chunk.range(1, 5)) // => [1, 2, 3, 4, 5]
4584
4357
  * ```
4585
4358
  *
4586
4359
  * @category constructors
@@ -4598,24 +4371,23 @@ export const range = (start: number, end: number): NonEmptyChunk<number> =>
4598
4371
  *
4599
4372
  * **Example** (Checking membership)
4600
4373
  *
4601
- * ```ts
4374
+ * ```ts import.meta.vitest
4602
4375
  * import { Chunk } from "effect"
4603
4376
  *
4604
4377
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4605
- * console.log(Chunk.contains(chunk, 3)) // true
4606
- * console.log(Chunk.contains(chunk, 6)) // false
4378
+ * Chunk.contains(chunk, 3) // => true
4379
+ * Chunk.contains(chunk, 6) // => false
4607
4380
  *
4608
4381
  * // Works with strings
4609
4382
  * const words = Chunk.make("apple", "banana", "cherry")
4610
- * console.log(Chunk.contains(words, "banana")) // true
4611
- * console.log(Chunk.contains(words, "grape")) // false
4383
+ * Chunk.contains(words, "banana") // => true
4384
+ * Chunk.contains(words, "grape") // => false
4612
4385
  *
4613
4386
  * // Empty chunk
4614
- * const empty = Chunk.empty<number>()
4615
- * console.log(Chunk.contains(empty, 1)) // false
4387
+ * Chunk.contains(Chunk.empty<number>(), 1) // => false
4616
4388
  * ```
4617
4389
  *
4618
- * @category elements
4390
+ * @category predicates
4619
4391
  * @since 2.0.0
4620
4392
  */
4621
4393
  export const contains: {
@@ -4628,24 +4400,23 @@ export const contains: {
4628
4400
  *
4629
4401
  * **Example** (Checking membership)
4630
4402
  *
4631
- * ```ts
4403
+ * ```ts import.meta.vitest
4632
4404
  * import { Chunk } from "effect"
4633
4405
  *
4634
4406
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4635
- * console.log(Chunk.contains(chunk, 3)) // true
4636
- * console.log(Chunk.contains(chunk, 6)) // false
4407
+ * Chunk.contains(chunk, 3) // => true
4408
+ * Chunk.contains(chunk, 6) // => false
4637
4409
  *
4638
4410
  * // Works with strings
4639
4411
  * const words = Chunk.make("apple", "banana", "cherry")
4640
- * console.log(Chunk.contains(words, "banana")) // true
4641
- * console.log(Chunk.contains(words, "grape")) // false
4412
+ * Chunk.contains(words, "banana") // => true
4413
+ * Chunk.contains(words, "grape") // => false
4642
4414
  *
4643
4415
  * // Empty chunk
4644
- * const empty = Chunk.empty<number>()
4645
- * console.log(Chunk.contains(empty, 1)) // false
4416
+ * Chunk.contains(Chunk.empty<number>(), 1) // => false
4646
4417
  * ```
4647
4418
  *
4648
- * @category elements
4419
+ * @category predicates
4649
4420
  * @since 2.0.0
4650
4421
  */
4651
4422
  <A>(a: A): (self: Chunk<A>) => boolean
@@ -4658,24 +4429,23 @@ export const contains: {
4658
4429
  *
4659
4430
  * **Example** (Checking membership)
4660
4431
  *
4661
- * ```ts
4432
+ * ```ts import.meta.vitest
4662
4433
  * import { Chunk } from "effect"
4663
4434
  *
4664
4435
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4665
- * console.log(Chunk.contains(chunk, 3)) // true
4666
- * console.log(Chunk.contains(chunk, 6)) // false
4436
+ * Chunk.contains(chunk, 3) // => true
4437
+ * Chunk.contains(chunk, 6) // => false
4667
4438
  *
4668
4439
  * // Works with strings
4669
4440
  * const words = Chunk.make("apple", "banana", "cherry")
4670
- * console.log(Chunk.contains(words, "banana")) // true
4671
- * console.log(Chunk.contains(words, "grape")) // false
4441
+ * Chunk.contains(words, "banana") // => true
4442
+ * Chunk.contains(words, "grape") // => false
4672
4443
  *
4673
4444
  * // Empty chunk
4674
- * const empty = Chunk.empty<number>()
4675
- * console.log(Chunk.contains(empty, 1)) // false
4445
+ * Chunk.contains(Chunk.empty<number>(), 1) // => false
4676
4446
  * ```
4677
4447
  *
4678
- * @category elements
4448
+ * @category predicates
4679
4449
  * @since 2.0.0
4680
4450
  */
4681
4451
  <A>(self: Chunk<A>, a: A): boolean
@@ -4686,7 +4456,7 @@ export const contains: {
4686
4456
  *
4687
4457
  * **Example** (Checking membership with custom equivalence)
4688
4458
  *
4689
- * ```ts
4459
+ * ```ts import.meta.vitest
4690
4460
  * import { Chunk } from "effect"
4691
4461
  *
4692
4462
  * const chunk = Chunk.make({ id: 1, name: "Alice" }, { id: 2, name: "Bob" })
@@ -4695,19 +4465,19 @@ export const contains: {
4695
4465
  * const containsById = Chunk.containsWith<{ id: number; name: string }>((a, b) =>
4696
4466
  * a.id === b.id
4697
4467
  * )
4698
- * console.log(containsById(chunk, { id: 1, name: "Different" })) // true
4699
- * console.log(containsById(chunk, { id: 3, name: "Charlie" })) // false
4468
+ * containsById(chunk, { id: 1, name: "Different" }) // => true
4469
+ * containsById(chunk, { id: 3, name: "Charlie" }) // => false
4700
4470
  *
4701
4471
  * // Case-insensitive string comparison
4702
4472
  * const words = Chunk.make("Apple", "Banana", "Cherry")
4703
4473
  * const containsCaseInsensitive = Chunk.containsWith<string>((a, b) =>
4704
4474
  * a.toLowerCase() === b.toLowerCase()
4705
4475
  * )
4706
- * console.log(containsCaseInsensitive(words, "apple")) // true
4707
- * console.log(containsCaseInsensitive(words, "grape")) // false
4476
+ * containsCaseInsensitive(words, "apple") // => true
4477
+ * containsCaseInsensitive(words, "grape") // => false
4708
4478
  * ```
4709
4479
  *
4710
- * @category elements
4480
+ * @category predicates
4711
4481
  * @since 2.0.0
4712
4482
  */
4713
4483
  export const containsWith: <A>(
@@ -4723,17 +4493,14 @@ export const containsWith: <A>(
4723
4493
  *
4724
4494
  * **Example** (Finding the first matching element)
4725
4495
  *
4726
- * ```ts
4496
+ * ```ts import.meta.vitest
4727
4497
  * import { Chunk, Option } from "effect"
4728
4498
  *
4729
4499
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4730
- * const result = Chunk.findFirst(chunk, (n) => n > 3)
4731
- * console.log(Option.isSome(result)) // true
4732
- * console.log(Option.getOrElse(result, () => 0)) // 4
4500
+ * Chunk.findFirst(chunk, (n) => n > 3) // => Option.some(4)
4733
4501
  *
4734
4502
  * // No match found
4735
- * const notFound = Chunk.findFirst(chunk, (n) => n > 10)
4736
- * console.log(Option.isNone(notFound)) // true
4503
+ * Chunk.findFirst(chunk, (n) => n > 10) // => Option.none()
4737
4504
  *
4738
4505
  * // With type refinement
4739
4506
  * const mixed = Chunk.make(1, "hello", 2, "world", 3)
@@ -4741,10 +4508,10 @@ export const containsWith: <A>(
4741
4508
  * mixed,
4742
4509
  * (x): x is string => typeof x === "string"
4743
4510
  * )
4744
- * console.log(Option.getOrElse(firstString, () => "")) // "hello"
4511
+ * firstString // => Option.some("hello")
4745
4512
  * ```
4746
4513
  *
4747
- * @category elements
4514
+ * @category searching
4748
4515
  * @since 2.0.0
4749
4516
  */
4750
4517
  export const findFirst: {
@@ -4754,17 +4521,14 @@ export const findFirst: {
4754
4521
  *
4755
4522
  * **Example** (Finding the first matching element)
4756
4523
  *
4757
- * ```ts
4524
+ * ```ts import.meta.vitest
4758
4525
  * import { Chunk, Option } from "effect"
4759
4526
  *
4760
4527
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4761
- * const result = Chunk.findFirst(chunk, (n) => n > 3)
4762
- * console.log(Option.isSome(result)) // true
4763
- * console.log(Option.getOrElse(result, () => 0)) // 4
4528
+ * Chunk.findFirst(chunk, (n) => n > 3) // => Option.some(4)
4764
4529
  *
4765
4530
  * // No match found
4766
- * const notFound = Chunk.findFirst(chunk, (n) => n > 10)
4767
- * console.log(Option.isNone(notFound)) // true
4531
+ * Chunk.findFirst(chunk, (n) => n > 10) // => Option.none()
4768
4532
  *
4769
4533
  * // With type refinement
4770
4534
  * const mixed = Chunk.make(1, "hello", 2, "world", 3)
@@ -4772,10 +4536,10 @@ export const findFirst: {
4772
4536
  * mixed,
4773
4537
  * (x): x is string => typeof x === "string"
4774
4538
  * )
4775
- * console.log(Option.getOrElse(firstString, () => "")) // "hello"
4539
+ * firstString // => Option.some("hello")
4776
4540
  * ```
4777
4541
  *
4778
- * @category elements
4542
+ * @category searching
4779
4543
  * @since 2.0.0
4780
4544
  */
4781
4545
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Option<B>
@@ -4785,17 +4549,14 @@ export const findFirst: {
4785
4549
  *
4786
4550
  * **Example** (Finding the first matching element)
4787
4551
  *
4788
- * ```ts
4552
+ * ```ts import.meta.vitest
4789
4553
  * import { Chunk, Option } from "effect"
4790
4554
  *
4791
4555
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4792
- * const result = Chunk.findFirst(chunk, (n) => n > 3)
4793
- * console.log(Option.isSome(result)) // true
4794
- * console.log(Option.getOrElse(result, () => 0)) // 4
4556
+ * Chunk.findFirst(chunk, (n) => n > 3) // => Option.some(4)
4795
4557
  *
4796
4558
  * // No match found
4797
- * const notFound = Chunk.findFirst(chunk, (n) => n > 10)
4798
- * console.log(Option.isNone(notFound)) // true
4559
+ * Chunk.findFirst(chunk, (n) => n > 10) // => Option.none()
4799
4560
  *
4800
4561
  * // With type refinement
4801
4562
  * const mixed = Chunk.make(1, "hello", 2, "world", 3)
@@ -4803,10 +4564,10 @@ export const findFirst: {
4803
4564
  * mixed,
4804
4565
  * (x): x is string => typeof x === "string"
4805
4566
  * )
4806
- * console.log(Option.getOrElse(firstString, () => "")) // "hello"
4567
+ * firstString // => Option.some("hello")
4807
4568
  * ```
4808
4569
  *
4809
- * @category elements
4570
+ * @category searching
4810
4571
  * @since 2.0.0
4811
4572
  */
4812
4573
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Option<A>
@@ -4816,17 +4577,14 @@ export const findFirst: {
4816
4577
  *
4817
4578
  * **Example** (Finding the first matching element)
4818
4579
  *
4819
- * ```ts
4580
+ * ```ts import.meta.vitest
4820
4581
  * import { Chunk, Option } from "effect"
4821
4582
  *
4822
4583
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4823
- * const result = Chunk.findFirst(chunk, (n) => n > 3)
4824
- * console.log(Option.isSome(result)) // true
4825
- * console.log(Option.getOrElse(result, () => 0)) // 4
4584
+ * Chunk.findFirst(chunk, (n) => n > 3) // => Option.some(4)
4826
4585
  *
4827
4586
  * // No match found
4828
- * const notFound = Chunk.findFirst(chunk, (n) => n > 10)
4829
- * console.log(Option.isNone(notFound)) // true
4587
+ * Chunk.findFirst(chunk, (n) => n > 10) // => Option.none()
4830
4588
  *
4831
4589
  * // With type refinement
4832
4590
  * const mixed = Chunk.make(1, "hello", 2, "world", 3)
@@ -4834,10 +4592,10 @@ export const findFirst: {
4834
4592
  * mixed,
4835
4593
  * (x): x is string => typeof x === "string"
4836
4594
  * )
4837
- * console.log(Option.getOrElse(firstString, () => "")) // "hello"
4595
+ * firstString // => Option.some("hello")
4838
4596
  * ```
4839
4597
  *
4840
- * @category elements
4598
+ * @category searching
4841
4599
  * @since 2.0.0
4842
4600
  */
4843
4601
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Option<B>
@@ -4847,17 +4605,14 @@ export const findFirst: {
4847
4605
  *
4848
4606
  * **Example** (Finding the first matching element)
4849
4607
  *
4850
- * ```ts
4608
+ * ```ts import.meta.vitest
4851
4609
  * import { Chunk, Option } from "effect"
4852
4610
  *
4853
4611
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4854
- * const result = Chunk.findFirst(chunk, (n) => n > 3)
4855
- * console.log(Option.isSome(result)) // true
4856
- * console.log(Option.getOrElse(result, () => 0)) // 4
4612
+ * Chunk.findFirst(chunk, (n) => n > 3) // => Option.some(4)
4857
4613
  *
4858
4614
  * // No match found
4859
- * const notFound = Chunk.findFirst(chunk, (n) => n > 10)
4860
- * console.log(Option.isNone(notFound)) // true
4615
+ * Chunk.findFirst(chunk, (n) => n > 10) // => Option.none()
4861
4616
  *
4862
4617
  * // With type refinement
4863
4618
  * const mixed = Chunk.make(1, "hello", 2, "world", 3)
@@ -4865,10 +4620,10 @@ export const findFirst: {
4865
4620
  * mixed,
4866
4621
  * (x): x is string => typeof x === "string"
4867
4622
  * )
4868
- * console.log(Option.getOrElse(firstString, () => "")) // "hello"
4623
+ * firstString // => Option.some("hello")
4869
4624
  * ```
4870
4625
  *
4871
- * @category elements
4626
+ * @category searching
4872
4627
  * @since 2.0.0
4873
4628
  */
4874
4629
  <A>(self: Chunk<A>, predicate: Predicate<A>): Option<A>
@@ -4879,23 +4634,20 @@ export const findFirst: {
4879
4634
  *
4880
4635
  * **Example** (Finding the first matching index)
4881
4636
  *
4882
- * ```ts
4883
- * import { Chunk } from "effect"
4637
+ * ```ts import.meta.vitest
4638
+ * import { Chunk, Option } from "effect"
4884
4639
  *
4885
4640
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4886
- * const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
4887
- * console.log(result) // Option.some(3)
4641
+ * Chunk.findFirstIndex(chunk, (n) => n > 3) // => Option.some(3)
4888
4642
  *
4889
4643
  * // No match found
4890
- * const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
4891
- * console.log(notFound) // Option.none()
4644
+ * Chunk.findFirstIndex(chunk, (n) => n > 10) // => Option.none()
4892
4645
  *
4893
4646
  * // Find first even number
4894
- * const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
4895
- * console.log(firstEven) // Option.some(1)
4647
+ * Chunk.findFirstIndex(chunk, (n) => n % 2 === 0) // => Option.some(1)
4896
4648
  * ```
4897
4649
  *
4898
- * @category elements
4650
+ * @category searching
4899
4651
  * @since 2.0.0
4900
4652
  */
4901
4653
  export const findFirstIndex: {
@@ -4904,23 +4656,20 @@ export const findFirstIndex: {
4904
4656
  *
4905
4657
  * **Example** (Finding the first matching index)
4906
4658
  *
4907
- * ```ts
4908
- * import { Chunk } from "effect"
4659
+ * ```ts import.meta.vitest
4660
+ * import { Chunk, Option } from "effect"
4909
4661
  *
4910
4662
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4911
- * const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
4912
- * console.log(result) // Option.some(3)
4663
+ * Chunk.findFirstIndex(chunk, (n) => n > 3) // => Option.some(3)
4913
4664
  *
4914
4665
  * // No match found
4915
- * const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
4916
- * console.log(notFound) // Option.none()
4666
+ * Chunk.findFirstIndex(chunk, (n) => n > 10) // => Option.none()
4917
4667
  *
4918
4668
  * // Find first even number
4919
- * const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
4920
- * console.log(firstEven) // Option.some(1)
4669
+ * Chunk.findFirstIndex(chunk, (n) => n % 2 === 0) // => Option.some(1)
4921
4670
  * ```
4922
4671
  *
4923
- * @category elements
4672
+ * @category searching
4924
4673
  * @since 2.0.0
4925
4674
  */
4926
4675
  <A>(predicate: Predicate<A>): (self: Chunk<A>) => O.Option<number>
@@ -4929,23 +4678,20 @@ export const findFirstIndex: {
4929
4678
  *
4930
4679
  * **Example** (Finding the first matching index)
4931
4680
  *
4932
- * ```ts
4933
- * import { Chunk } from "effect"
4681
+ * ```ts import.meta.vitest
4682
+ * import { Chunk, Option } from "effect"
4934
4683
  *
4935
4684
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4936
- * const result = Chunk.findFirstIndex(chunk, (n) => n > 3)
4937
- * console.log(result) // Option.some(3)
4685
+ * Chunk.findFirstIndex(chunk, (n) => n > 3) // => Option.some(3)
4938
4686
  *
4939
4687
  * // No match found
4940
- * const notFound = Chunk.findFirstIndex(chunk, (n) => n > 10)
4941
- * console.log(notFound) // Option.none()
4688
+ * Chunk.findFirstIndex(chunk, (n) => n > 10) // => Option.none()
4942
4689
  *
4943
4690
  * // Find first even number
4944
- * const firstEven = Chunk.findFirstIndex(chunk, (n) => n % 2 === 0)
4945
- * console.log(firstEven) // Option.some(1)
4691
+ * Chunk.findFirstIndex(chunk, (n) => n % 2 === 0) // => Option.some(1)
4946
4692
  * ```
4947
4693
  *
4948
- * @category elements
4694
+ * @category searching
4949
4695
  * @since 2.0.0
4950
4696
  */
4951
4697
  <A>(self: Chunk<A>, predicate: Predicate<A>): O.Option<number>
@@ -4959,24 +4705,20 @@ export const findFirstIndex: {
4959
4705
  *
4960
4706
  * **Example** (Finding the last matching element)
4961
4707
  *
4962
- * ```ts
4708
+ * ```ts import.meta.vitest
4963
4709
  * import { Chunk, Option } from "effect"
4964
4710
  *
4965
4711
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4966
- * const result = Chunk.findLast(chunk, (n) => n < 4)
4967
- * console.log(Option.isSome(result)) // true
4968
- * console.log(Option.getOrElse(result, () => 0)) // 3
4712
+ * Chunk.findLast(chunk, (n) => n < 4) // => Option.some(3)
4969
4713
  *
4970
4714
  * // No match found
4971
- * const notFound = Chunk.findLast(chunk, (n) => n > 10)
4972
- * console.log(Option.isNone(notFound)) // true
4715
+ * Chunk.findLast(chunk, (n) => n > 10) // => Option.none()
4973
4716
  *
4974
4717
  * // Find last even number
4975
- * const lastEven = Chunk.findLast(chunk, (n) => n % 2 === 0)
4976
- * console.log(Option.getOrElse(lastEven, () => 0)) // 4
4718
+ * Chunk.findLast(chunk, (n) => n % 2 === 0) // => Option.some(4)
4977
4719
  * ```
4978
4720
  *
4979
- * @category elements
4721
+ * @category searching
4980
4722
  * @since 2.0.0
4981
4723
  */
4982
4724
  export const findLast: {
@@ -4985,24 +4727,20 @@ export const findLast: {
4985
4727
  *
4986
4728
  * **Example** (Finding the last matching element)
4987
4729
  *
4988
- * ```ts
4730
+ * ```ts import.meta.vitest
4989
4731
  * import { Chunk, Option } from "effect"
4990
4732
  *
4991
4733
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
4992
- * const result = Chunk.findLast(chunk, (n) => n < 4)
4993
- * console.log(Option.isSome(result)) // true
4994
- * console.log(Option.getOrElse(result, () => 0)) // 3
4734
+ * Chunk.findLast(chunk, (n) => n < 4) // => Option.some(3)
4995
4735
  *
4996
4736
  * // No match found
4997
- * const notFound = Chunk.findLast(chunk, (n) => n > 10)
4998
- * console.log(Option.isNone(notFound)) // true
4737
+ * Chunk.findLast(chunk, (n) => n > 10) // => Option.none()
4999
4738
  *
5000
4739
  * // Find last even number
5001
- * const lastEven = Chunk.findLast(chunk, (n) => n % 2 === 0)
5002
- * console.log(Option.getOrElse(lastEven, () => 0)) // 4
4740
+ * Chunk.findLast(chunk, (n) => n % 2 === 0) // => Option.some(4)
5003
4741
  * ```
5004
4742
  *
5005
- * @category elements
4743
+ * @category searching
5006
4744
  * @since 2.0.0
5007
4745
  */
5008
4746
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Option<B>
@@ -5011,24 +4749,20 @@ export const findLast: {
5011
4749
  *
5012
4750
  * **Example** (Finding the last matching element)
5013
4751
  *
5014
- * ```ts
4752
+ * ```ts import.meta.vitest
5015
4753
  * import { Chunk, Option } from "effect"
5016
4754
  *
5017
4755
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5018
- * const result = Chunk.findLast(chunk, (n) => n < 4)
5019
- * console.log(Option.isSome(result)) // true
5020
- * console.log(Option.getOrElse(result, () => 0)) // 3
4756
+ * Chunk.findLast(chunk, (n) => n < 4) // => Option.some(3)
5021
4757
  *
5022
4758
  * // No match found
5023
- * const notFound = Chunk.findLast(chunk, (n) => n > 10)
5024
- * console.log(Option.isNone(notFound)) // true
4759
+ * Chunk.findLast(chunk, (n) => n > 10) // => Option.none()
5025
4760
  *
5026
4761
  * // Find last even number
5027
- * const lastEven = Chunk.findLast(chunk, (n) => n % 2 === 0)
5028
- * console.log(Option.getOrElse(lastEven, () => 0)) // 4
4762
+ * Chunk.findLast(chunk, (n) => n % 2 === 0) // => Option.some(4)
5029
4763
  * ```
5030
4764
  *
5031
- * @category elements
4765
+ * @category searching
5032
4766
  * @since 2.0.0
5033
4767
  */
5034
4768
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Option<A>
@@ -5037,24 +4771,20 @@ export const findLast: {
5037
4771
  *
5038
4772
  * **Example** (Finding the last matching element)
5039
4773
  *
5040
- * ```ts
4774
+ * ```ts import.meta.vitest
5041
4775
  * import { Chunk, Option } from "effect"
5042
4776
  *
5043
4777
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5044
- * const result = Chunk.findLast(chunk, (n) => n < 4)
5045
- * console.log(Option.isSome(result)) // true
5046
- * console.log(Option.getOrElse(result, () => 0)) // 3
4778
+ * Chunk.findLast(chunk, (n) => n < 4) // => Option.some(3)
5047
4779
  *
5048
4780
  * // No match found
5049
- * const notFound = Chunk.findLast(chunk, (n) => n > 10)
5050
- * console.log(Option.isNone(notFound)) // true
4781
+ * Chunk.findLast(chunk, (n) => n > 10) // => Option.none()
5051
4782
  *
5052
4783
  * // Find last even number
5053
- * const lastEven = Chunk.findLast(chunk, (n) => n % 2 === 0)
5054
- * console.log(Option.getOrElse(lastEven, () => 0)) // 4
4784
+ * Chunk.findLast(chunk, (n) => n % 2 === 0) // => Option.some(4)
5055
4785
  * ```
5056
4786
  *
5057
- * @category elements
4787
+ * @category searching
5058
4788
  * @since 2.0.0
5059
4789
  */
5060
4790
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Option<B>
@@ -5063,24 +4793,20 @@ export const findLast: {
5063
4793
  *
5064
4794
  * **Example** (Finding the last matching element)
5065
4795
  *
5066
- * ```ts
4796
+ * ```ts import.meta.vitest
5067
4797
  * import { Chunk, Option } from "effect"
5068
4798
  *
5069
4799
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5070
- * const result = Chunk.findLast(chunk, (n) => n < 4)
5071
- * console.log(Option.isSome(result)) // true
5072
- * console.log(Option.getOrElse(result, () => 0)) // 3
4800
+ * Chunk.findLast(chunk, (n) => n < 4) // => Option.some(3)
5073
4801
  *
5074
4802
  * // No match found
5075
- * const notFound = Chunk.findLast(chunk, (n) => n > 10)
5076
- * console.log(Option.isNone(notFound)) // true
4803
+ * Chunk.findLast(chunk, (n) => n > 10) // => Option.none()
5077
4804
  *
5078
4805
  * // Find last even number
5079
- * const lastEven = Chunk.findLast(chunk, (n) => n % 2 === 0)
5080
- * console.log(Option.getOrElse(lastEven, () => 0)) // 4
4806
+ * Chunk.findLast(chunk, (n) => n % 2 === 0) // => Option.some(4)
5081
4807
  * ```
5082
4808
  *
5083
- * @category elements
4809
+ * @category searching
5084
4810
  * @since 2.0.0
5085
4811
  */
5086
4812
  <A>(self: Chunk<A>, predicate: Predicate<A>): Option<A>
@@ -5091,23 +4817,20 @@ export const findLast: {
5091
4817
  *
5092
4818
  * **Example** (Finding the last matching index)
5093
4819
  *
5094
- * ```ts
5095
- * import { Chunk } from "effect"
4820
+ * ```ts import.meta.vitest
4821
+ * import { Chunk, Option } from "effect"
5096
4822
  *
5097
4823
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5098
- * const result = Chunk.findLastIndex(chunk, (n) => n < 4)
5099
- * console.log(result) // Option.some(2)
4824
+ * Chunk.findLastIndex(chunk, (n) => n < 4) // => Option.some(2)
5100
4825
  *
5101
4826
  * // No match found
5102
- * const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
5103
- * console.log(notFound) // Option.none()
4827
+ * Chunk.findLastIndex(chunk, (n) => n > 10) // => Option.none()
5104
4828
  *
5105
4829
  * // Find last even number index
5106
- * const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
5107
- * console.log(lastEven) // Option.some(3)
4830
+ * Chunk.findLastIndex(chunk, (n) => n % 2 === 0) // => Option.some(3)
5108
4831
  * ```
5109
4832
  *
5110
- * @category elements
4833
+ * @category searching
5111
4834
  * @since 2.0.0
5112
4835
  */
5113
4836
  export const findLastIndex: {
@@ -5116,23 +4839,20 @@ export const findLastIndex: {
5116
4839
  *
5117
4840
  * **Example** (Finding the last matching index)
5118
4841
  *
5119
- * ```ts
5120
- * import { Chunk } from "effect"
4842
+ * ```ts import.meta.vitest
4843
+ * import { Chunk, Option } from "effect"
5121
4844
  *
5122
4845
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5123
- * const result = Chunk.findLastIndex(chunk, (n) => n < 4)
5124
- * console.log(result) // Option.some(2)
4846
+ * Chunk.findLastIndex(chunk, (n) => n < 4) // => Option.some(2)
5125
4847
  *
5126
4848
  * // No match found
5127
- * const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
5128
- * console.log(notFound) // Option.none()
4849
+ * Chunk.findLastIndex(chunk, (n) => n > 10) // => Option.none()
5129
4850
  *
5130
4851
  * // Find last even number index
5131
- * const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
5132
- * console.log(lastEven) // Option.some(3)
4852
+ * Chunk.findLastIndex(chunk, (n) => n % 2 === 0) // => Option.some(3)
5133
4853
  * ```
5134
4854
  *
5135
- * @category elements
4855
+ * @category searching
5136
4856
  * @since 2.0.0
5137
4857
  */
5138
4858
  <A>(predicate: Predicate<A>): (self: Chunk<A>) => O.Option<number>
@@ -5141,23 +4861,20 @@ export const findLastIndex: {
5141
4861
  *
5142
4862
  * **Example** (Finding the last matching index)
5143
4863
  *
5144
- * ```ts
5145
- * import { Chunk } from "effect"
4864
+ * ```ts import.meta.vitest
4865
+ * import { Chunk, Option } from "effect"
5146
4866
  *
5147
4867
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5148
- * const result = Chunk.findLastIndex(chunk, (n) => n < 4)
5149
- * console.log(result) // Option.some(2)
4868
+ * Chunk.findLastIndex(chunk, (n) => n < 4) // => Option.some(2)
5150
4869
  *
5151
4870
  * // No match found
5152
- * const notFound = Chunk.findLastIndex(chunk, (n) => n > 10)
5153
- * console.log(notFound) // Option.none()
4871
+ * Chunk.findLastIndex(chunk, (n) => n > 10) // => Option.none()
5154
4872
  *
5155
4873
  * // Find last even number index
5156
- * const lastEven = Chunk.findLastIndex(chunk, (n) => n % 2 === 0)
5157
- * console.log(lastEven) // Option.some(3)
4874
+ * Chunk.findLastIndex(chunk, (n) => n % 2 === 0) // => Option.some(3)
5158
4875
  * ```
5159
4876
  *
5160
- * @category elements
4877
+ * @category searching
5161
4878
  * @since 2.0.0
5162
4879
  */
5163
4880
  <A>(self: Chunk<A>, predicate: Predicate<A>): O.Option<number>
@@ -5171,26 +4888,24 @@ export const findLastIndex: {
5171
4888
  *
5172
4889
  * **Example** (Checking every element)
5173
4890
  *
5174
- * ```ts
4891
+ * ```ts import.meta.vitest
5175
4892
  * import { Chunk } from "effect"
5176
4893
  *
5177
4894
  * const allPositive = Chunk.make(1, 2, 3, 4, 5)
5178
- * console.log(Chunk.every(allPositive, (n) => n > 0)) // true
5179
- * console.log(Chunk.every(allPositive, (n) => n > 3)) // false
4895
+ * Chunk.every(allPositive, (n) => n > 0) // => true
4896
+ * Chunk.every(allPositive, (n) => n > 3) // => false
5180
4897
  *
5181
4898
  * // Empty chunk returns true
5182
- * const empty = Chunk.empty<number>()
5183
- * console.log(Chunk.every(empty, (n) => n > 0)) // true
4899
+ * Chunk.every(Chunk.empty<number>(), (n) => n > 0) // => true
5184
4900
  *
5185
4901
  * // Type refinement
5186
4902
  * const mixed = Chunk.make(1, 2, 3)
5187
4903
  * if (Chunk.every(mixed, (x): x is number => typeof x === "number")) {
5188
4904
  * // mixed is now typed as Chunk<number>
5189
- * console.log("All elements are numbers")
5190
4905
  * }
5191
4906
  * ```
5192
4907
  *
5193
- * @category elements
4908
+ * @category guards
5194
4909
  * @since 2.0.0
5195
4910
  */
5196
4911
  export const every: {
@@ -5199,26 +4914,24 @@ export const every: {
5199
4914
  *
5200
4915
  * **Example** (Checking every element)
5201
4916
  *
5202
- * ```ts
4917
+ * ```ts import.meta.vitest
5203
4918
  * import { Chunk } from "effect"
5204
4919
  *
5205
4920
  * const allPositive = Chunk.make(1, 2, 3, 4, 5)
5206
- * console.log(Chunk.every(allPositive, (n) => n > 0)) // true
5207
- * console.log(Chunk.every(allPositive, (n) => n > 3)) // false
4921
+ * Chunk.every(allPositive, (n) => n > 0) // => true
4922
+ * Chunk.every(allPositive, (n) => n > 3) // => false
5208
4923
  *
5209
4924
  * // Empty chunk returns true
5210
- * const empty = Chunk.empty<number>()
5211
- * console.log(Chunk.every(empty, (n) => n > 0)) // true
4925
+ * Chunk.every(Chunk.empty<number>(), (n) => n > 0) // => true
5212
4926
  *
5213
4927
  * // Type refinement
5214
4928
  * const mixed = Chunk.make(1, 2, 3)
5215
4929
  * if (Chunk.every(mixed, (x): x is number => typeof x === "number")) {
5216
4930
  * // mixed is now typed as Chunk<number>
5217
- * console.log("All elements are numbers")
5218
4931
  * }
5219
4932
  * ```
5220
4933
  *
5221
- * @category elements
4934
+ * @category guards
5222
4935
  * @since 2.0.0
5223
4936
  */
5224
4937
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => self is Chunk<B>
@@ -5227,26 +4940,24 @@ export const every: {
5227
4940
  *
5228
4941
  * **Example** (Checking every element)
5229
4942
  *
5230
- * ```ts
4943
+ * ```ts import.meta.vitest
5231
4944
  * import { Chunk } from "effect"
5232
4945
  *
5233
4946
  * const allPositive = Chunk.make(1, 2, 3, 4, 5)
5234
- * console.log(Chunk.every(allPositive, (n) => n > 0)) // true
5235
- * console.log(Chunk.every(allPositive, (n) => n > 3)) // false
4947
+ * Chunk.every(allPositive, (n) => n > 0) // => true
4948
+ * Chunk.every(allPositive, (n) => n > 3) // => false
5236
4949
  *
5237
4950
  * // Empty chunk returns true
5238
- * const empty = Chunk.empty<number>()
5239
- * console.log(Chunk.every(empty, (n) => n > 0)) // true
4951
+ * Chunk.every(Chunk.empty<number>(), (n) => n > 0) // => true
5240
4952
  *
5241
4953
  * // Type refinement
5242
4954
  * const mixed = Chunk.make(1, 2, 3)
5243
4955
  * if (Chunk.every(mixed, (x): x is number => typeof x === "number")) {
5244
4956
  * // mixed is now typed as Chunk<number>
5245
- * console.log("All elements are numbers")
5246
4957
  * }
5247
4958
  * ```
5248
4959
  *
5249
- * @category elements
4960
+ * @category guards
5250
4961
  * @since 2.0.0
5251
4962
  */
5252
4963
  <A>(predicate: Predicate<A>): (self: Chunk<A>) => boolean
@@ -5255,26 +4966,24 @@ export const every: {
5255
4966
  *
5256
4967
  * **Example** (Checking every element)
5257
4968
  *
5258
- * ```ts
4969
+ * ```ts import.meta.vitest
5259
4970
  * import { Chunk } from "effect"
5260
4971
  *
5261
4972
  * const allPositive = Chunk.make(1, 2, 3, 4, 5)
5262
- * console.log(Chunk.every(allPositive, (n) => n > 0)) // true
5263
- * console.log(Chunk.every(allPositive, (n) => n > 3)) // false
4973
+ * Chunk.every(allPositive, (n) => n > 0) // => true
4974
+ * Chunk.every(allPositive, (n) => n > 3) // => false
5264
4975
  *
5265
4976
  * // Empty chunk returns true
5266
- * const empty = Chunk.empty<number>()
5267
- * console.log(Chunk.every(empty, (n) => n > 0)) // true
4977
+ * Chunk.every(Chunk.empty<number>(), (n) => n > 0) // => true
5268
4978
  *
5269
4979
  * // Type refinement
5270
4980
  * const mixed = Chunk.make(1, 2, 3)
5271
4981
  * if (Chunk.every(mixed, (x): x is number => typeof x === "number")) {
5272
4982
  * // mixed is now typed as Chunk<number>
5273
- * console.log("All elements are numbers")
5274
4983
  * }
5275
4984
  * ```
5276
4985
  *
5277
- * @category elements
4986
+ * @category guards
5278
4987
  * @since 2.0.0
5279
4988
  */
5280
4989
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): self is Chunk<B>
@@ -5283,26 +4992,24 @@ export const every: {
5283
4992
  *
5284
4993
  * **Example** (Checking every element)
5285
4994
  *
5286
- * ```ts
4995
+ * ```ts import.meta.vitest
5287
4996
  * import { Chunk } from "effect"
5288
4997
  *
5289
4998
  * const allPositive = Chunk.make(1, 2, 3, 4, 5)
5290
- * console.log(Chunk.every(allPositive, (n) => n > 0)) // true
5291
- * console.log(Chunk.every(allPositive, (n) => n > 3)) // false
4999
+ * Chunk.every(allPositive, (n) => n > 0) // => true
5000
+ * Chunk.every(allPositive, (n) => n > 3) // => false
5292
5001
  *
5293
5002
  * // Empty chunk returns true
5294
- * const empty = Chunk.empty<number>()
5295
- * console.log(Chunk.every(empty, (n) => n > 0)) // true
5003
+ * Chunk.every(Chunk.empty<number>(), (n) => n > 0) // => true
5296
5004
  *
5297
5005
  * // Type refinement
5298
5006
  * const mixed = Chunk.make(1, 2, 3)
5299
5007
  * if (Chunk.every(mixed, (x): x is number => typeof x === "number")) {
5300
5008
  * // mixed is now typed as Chunk<number>
5301
- * console.log("All elements are numbers")
5302
5009
  * }
5303
5010
  * ```
5304
5011
  *
5305
- * @category elements
5012
+ * @category guards
5306
5013
  * @since 2.0.0
5307
5014
  */
5308
5015
  <A>(self: Chunk<A>, predicate: Predicate<A>): boolean
@@ -5317,23 +5024,22 @@ export const every: {
5317
5024
  *
5318
5025
  * **Example** (Checking for some matching element)
5319
5026
  *
5320
- * ```ts
5027
+ * ```ts import.meta.vitest
5321
5028
  * import { Chunk } from "effect"
5322
5029
  *
5323
5030
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5324
- * console.log(Chunk.some(chunk, (n) => n > 4)) // true
5325
- * console.log(Chunk.some(chunk, (n) => n > 10)) // false
5031
+ * Chunk.some(chunk, (n) => n > 4) // => true
5032
+ * Chunk.some(chunk, (n) => n > 10) // => false
5326
5033
  *
5327
5034
  * // Empty chunk returns false
5328
- * const empty = Chunk.empty<number>()
5329
- * console.log(Chunk.some(empty, (n) => n > 0)) // false
5035
+ * Chunk.some(Chunk.empty<number>(), (n) => n > 0) // => false
5330
5036
  *
5331
5037
  * // Check for specific value
5332
5038
  * const words = Chunk.make("apple", "banana", "cherry")
5333
- * console.log(Chunk.some(words, (word) => word.includes("ban"))) // true
5039
+ * Chunk.some(words, (word) => word.includes("ban")) // => true
5334
5040
  * ```
5335
5041
  *
5336
- * @category elements
5042
+ * @category guards
5337
5043
  * @since 2.0.0
5338
5044
  */
5339
5045
  export const some: {
@@ -5342,23 +5048,22 @@ export const some: {
5342
5048
  *
5343
5049
  * **Example** (Checking for some matching element)
5344
5050
  *
5345
- * ```ts
5051
+ * ```ts import.meta.vitest
5346
5052
  * import { Chunk } from "effect"
5347
5053
  *
5348
5054
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5349
- * console.log(Chunk.some(chunk, (n) => n > 4)) // true
5350
- * console.log(Chunk.some(chunk, (n) => n > 10)) // false
5055
+ * Chunk.some(chunk, (n) => n > 4) // => true
5056
+ * Chunk.some(chunk, (n) => n > 10) // => false
5351
5057
  *
5352
5058
  * // Empty chunk returns false
5353
- * const empty = Chunk.empty<number>()
5354
- * console.log(Chunk.some(empty, (n) => n > 0)) // false
5059
+ * Chunk.some(Chunk.empty<number>(), (n) => n > 0) // => false
5355
5060
  *
5356
5061
  * // Check for specific value
5357
5062
  * const words = Chunk.make("apple", "banana", "cherry")
5358
- * console.log(Chunk.some(words, (word) => word.includes("ban"))) // true
5063
+ * Chunk.some(words, (word) => word.includes("ban")) // => true
5359
5064
  * ```
5360
5065
  *
5361
- * @category elements
5066
+ * @category guards
5362
5067
  * @since 2.0.0
5363
5068
  */
5364
5069
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => self is NonEmptyChunk<A>
@@ -5367,23 +5072,22 @@ export const some: {
5367
5072
  *
5368
5073
  * **Example** (Checking for some matching element)
5369
5074
  *
5370
- * ```ts
5075
+ * ```ts import.meta.vitest
5371
5076
  * import { Chunk } from "effect"
5372
5077
  *
5373
5078
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5374
- * console.log(Chunk.some(chunk, (n) => n > 4)) // true
5375
- * console.log(Chunk.some(chunk, (n) => n > 10)) // false
5079
+ * Chunk.some(chunk, (n) => n > 4) // => true
5080
+ * Chunk.some(chunk, (n) => n > 10) // => false
5376
5081
  *
5377
5082
  * // Empty chunk returns false
5378
- * const empty = Chunk.empty<number>()
5379
- * console.log(Chunk.some(empty, (n) => n > 0)) // false
5083
+ * Chunk.some(Chunk.empty<number>(), (n) => n > 0) // => false
5380
5084
  *
5381
5085
  * // Check for specific value
5382
5086
  * const words = Chunk.make("apple", "banana", "cherry")
5383
- * console.log(Chunk.some(words, (word) => word.includes("ban"))) // true
5087
+ * Chunk.some(words, (word) => word.includes("ban")) // => true
5384
5088
  * ```
5385
5089
  *
5386
- * @category elements
5090
+ * @category guards
5387
5091
  * @since 2.0.0
5388
5092
  */
5389
5093
  <A>(self: Chunk<A>, predicate: Predicate<A>): self is NonEmptyChunk<A>
@@ -5397,24 +5101,20 @@ export const some: {
5397
5101
  *
5398
5102
  * **Example** (Joining chunks into a string)
5399
5103
  *
5400
- * ```ts
5104
+ * ```ts import.meta.vitest
5401
5105
  * import { Chunk } from "effect"
5402
5106
  *
5403
5107
  * const chunk = Chunk.make("apple", "banana", "cherry")
5404
- * const result = Chunk.join(chunk, ", ")
5405
- * console.log(result) // "apple, banana, cherry"
5108
+ * Chunk.join(chunk, ", ") // => "apple, banana, cherry"
5406
5109
  *
5407
5110
  * // With different separator
5408
- * const withPipe = Chunk.join(chunk, " | ")
5409
- * console.log(withPipe) // "apple | banana | cherry"
5111
+ * Chunk.join(chunk, " | ") // => "apple | banana | cherry"
5410
5112
  *
5411
5113
  * // Empty chunk
5412
- * const empty = Chunk.empty<string>()
5413
- * console.log(Chunk.join(empty, ", ")) // ""
5114
+ * Chunk.join(Chunk.empty<string>(), ", ") // => ""
5414
5115
  *
5415
5116
  * // Single element
5416
- * const single = Chunk.make("hello")
5417
- * console.log(Chunk.join(single, ", ")) // "hello"
5117
+ * Chunk.join(Chunk.make("hello"), ", ") // => "hello"
5418
5118
  * ```
5419
5119
  *
5420
5120
  * @category folding
@@ -5426,24 +5126,20 @@ export const join: {
5426
5126
  *
5427
5127
  * **Example** (Joining chunks into a string)
5428
5128
  *
5429
- * ```ts
5129
+ * ```ts import.meta.vitest
5430
5130
  * import { Chunk } from "effect"
5431
5131
  *
5432
5132
  * const chunk = Chunk.make("apple", "banana", "cherry")
5433
- * const result = Chunk.join(chunk, ", ")
5434
- * console.log(result) // "apple, banana, cherry"
5133
+ * Chunk.join(chunk, ", ") // => "apple, banana, cherry"
5435
5134
  *
5436
5135
  * // With different separator
5437
- * const withPipe = Chunk.join(chunk, " | ")
5438
- * console.log(withPipe) // "apple | banana | cherry"
5136
+ * Chunk.join(chunk, " | ") // => "apple | banana | cherry"
5439
5137
  *
5440
5138
  * // Empty chunk
5441
- * const empty = Chunk.empty<string>()
5442
- * console.log(Chunk.join(empty, ", ")) // ""
5139
+ * Chunk.join(Chunk.empty<string>(), ", ") // => ""
5443
5140
  *
5444
5141
  * // Single element
5445
- * const single = Chunk.make("hello")
5446
- * console.log(Chunk.join(single, ", ")) // "hello"
5142
+ * Chunk.join(Chunk.make("hello"), ", ") // => "hello"
5447
5143
  * ```
5448
5144
  *
5449
5145
  * @category folding
@@ -5455,24 +5151,20 @@ export const join: {
5455
5151
  *
5456
5152
  * **Example** (Joining chunks into a string)
5457
5153
  *
5458
- * ```ts
5154
+ * ```ts import.meta.vitest
5459
5155
  * import { Chunk } from "effect"
5460
5156
  *
5461
5157
  * const chunk = Chunk.make("apple", "banana", "cherry")
5462
- * const result = Chunk.join(chunk, ", ")
5463
- * console.log(result) // "apple, banana, cherry"
5158
+ * Chunk.join(chunk, ", ") // => "apple, banana, cherry"
5464
5159
  *
5465
5160
  * // With different separator
5466
- * const withPipe = Chunk.join(chunk, " | ")
5467
- * console.log(withPipe) // "apple | banana | cherry"
5161
+ * Chunk.join(chunk, " | ") // => "apple | banana | cherry"
5468
5162
  *
5469
5163
  * // Empty chunk
5470
- * const empty = Chunk.empty<string>()
5471
- * console.log(Chunk.join(empty, ", ")) // ""
5164
+ * Chunk.join(Chunk.empty<string>(), ", ") // => ""
5472
5165
  *
5473
5166
  * // Single element
5474
- * const single = Chunk.make("hello")
5475
- * console.log(Chunk.join(single, ", ")) // "hello"
5167
+ * Chunk.join(Chunk.make("hello"), ", ") // => "hello"
5476
5168
  * ```
5477
5169
  *
5478
5170
  * @category folding
@@ -5486,21 +5178,18 @@ export const join: {
5486
5178
  *
5487
5179
  * **Example** (Reducing from the left)
5488
5180
  *
5489
- * ```ts
5181
+ * ```ts import.meta.vitest
5490
5182
  * import { Chunk } from "effect"
5491
5183
  *
5492
5184
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5493
- * const sum = Chunk.reduce(chunk, 0, (acc, n) => acc + n)
5494
- * console.log(sum) // 15
5185
+ * Chunk.reduce(chunk, 0, (acc, n) => acc + n) // => 15
5495
5186
  *
5496
5187
  * // String concatenation with index
5497
5188
  * const words = Chunk.make("a", "b", "c")
5498
- * const result = Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `)
5499
- * console.log(result) // "0:a 1:b 2:c "
5189
+ * Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `).trimEnd() // => "0:a 1:b 2:c"
5500
5190
  *
5501
5191
  * // Find maximum
5502
- * const max = Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n))
5503
- * console.log(max) // 5
5192
+ * Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n)) // => 5
5504
5193
  * ```
5505
5194
  *
5506
5195
  * @category folding
@@ -5512,21 +5201,18 @@ export const reduce: {
5512
5201
  *
5513
5202
  * **Example** (Reducing from the left)
5514
5203
  *
5515
- * ```ts
5204
+ * ```ts import.meta.vitest
5516
5205
  * import { Chunk } from "effect"
5517
5206
  *
5518
5207
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5519
- * const sum = Chunk.reduce(chunk, 0, (acc, n) => acc + n)
5520
- * console.log(sum) // 15
5208
+ * Chunk.reduce(chunk, 0, (acc, n) => acc + n) // => 15
5521
5209
  *
5522
5210
  * // String concatenation with index
5523
5211
  * const words = Chunk.make("a", "b", "c")
5524
- * const result = Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `)
5525
- * console.log(result) // "0:a 1:b 2:c "
5212
+ * Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `).trimEnd() // => "0:a 1:b 2:c"
5526
5213
  *
5527
5214
  * // Find maximum
5528
- * const max = Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n))
5529
- * console.log(max) // 5
5215
+ * Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n)) // => 5
5530
5216
  * ```
5531
5217
  *
5532
5218
  * @category folding
@@ -5538,21 +5224,18 @@ export const reduce: {
5538
5224
  *
5539
5225
  * **Example** (Reducing from the left)
5540
5226
  *
5541
- * ```ts
5227
+ * ```ts import.meta.vitest
5542
5228
  * import { Chunk } from "effect"
5543
5229
  *
5544
5230
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
5545
- * const sum = Chunk.reduce(chunk, 0, (acc, n) => acc + n)
5546
- * console.log(sum) // 15
5231
+ * Chunk.reduce(chunk, 0, (acc, n) => acc + n) // => 15
5547
5232
  *
5548
5233
  * // String concatenation with index
5549
5234
  * const words = Chunk.make("a", "b", "c")
5550
- * const result = Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `)
5551
- * console.log(result) // "0:a 1:b 2:c "
5235
+ * Chunk.reduce(words, "", (acc, word, i) => acc + `${i}:${word} `).trimEnd() // => "0:a 1:b 2:c"
5552
5236
  *
5553
5237
  * // Find maximum
5554
- * const max = Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n))
5555
- * console.log(max) // 5
5238
+ * Chunk.reduce(chunk, -Infinity, (acc, n) => Math.max(acc, n)) // => 5
5556
5239
  * ```
5557
5240
  *
5558
5241
  * @category folding
@@ -5566,25 +5249,22 @@ export const reduce: {
5566
5249
  *
5567
5250
  * **Example** (Reducing from the right)
5568
5251
  *
5569
- * ```ts
5252
+ * ```ts import.meta.vitest
5570
5253
  * import { Chunk } from "effect"
5571
5254
  *
5572
5255
  * const chunk = Chunk.make(1, 2, 3, 4)
5573
- * const result = Chunk.reduceRight(chunk, 0, (acc, n) => acc + n)
5574
- * console.log(result) // 10
5256
+ * Chunk.reduceRight(chunk, 0, (acc, n) => acc + n) // => 10
5575
5257
  *
5576
5258
  * // String building (right to left)
5577
5259
  * const words = Chunk.make("a", "b", "c")
5578
- * const reversed = Chunk.reduceRight(
5260
+ * Chunk.reduceRight(
5579
5261
  * words,
5580
5262
  * "",
5581
5263
  * (acc, word, i) => acc + `${i}:${word} `
5582
- * )
5583
- * console.log(reversed) // "2:c 1:b 0:a "
5264
+ * ).trim() // => "2:c 1:b 0:a"
5584
5265
  *
5585
5266
  * // Subtract from right to left
5586
- * const subtraction = Chunk.reduceRight(chunk, 0, (acc, n) => n - acc)
5587
- * console.log(subtraction) // -2 (4 - (3 - (2 - (1 - 0))))
5267
+ * Chunk.reduceRight(chunk, 0, (acc, n) => n - acc) // => -2
5588
5268
  * ```
5589
5269
  *
5590
5270
  * @category folding
@@ -5596,25 +5276,22 @@ export const reduceRight: {
5596
5276
  *
5597
5277
  * **Example** (Reducing from the right)
5598
5278
  *
5599
- * ```ts
5279
+ * ```ts import.meta.vitest
5600
5280
  * import { Chunk } from "effect"
5601
5281
  *
5602
5282
  * const chunk = Chunk.make(1, 2, 3, 4)
5603
- * const result = Chunk.reduceRight(chunk, 0, (acc, n) => acc + n)
5604
- * console.log(result) // 10
5283
+ * Chunk.reduceRight(chunk, 0, (acc, n) => acc + n) // => 10
5605
5284
  *
5606
5285
  * // String building (right to left)
5607
5286
  * const words = Chunk.make("a", "b", "c")
5608
- * const reversed = Chunk.reduceRight(
5287
+ * Chunk.reduceRight(
5609
5288
  * words,
5610
5289
  * "",
5611
5290
  * (acc, word, i) => acc + `${i}:${word} `
5612
- * )
5613
- * console.log(reversed) // "2:c 1:b 0:a "
5291
+ * ).trim() // => "2:c 1:b 0:a"
5614
5292
  *
5615
5293
  * // Subtract from right to left
5616
- * const subtraction = Chunk.reduceRight(chunk, 0, (acc, n) => n - acc)
5617
- * console.log(subtraction) // -2 (4 - (3 - (2 - (1 - 0))))
5294
+ * Chunk.reduceRight(chunk, 0, (acc, n) => n - acc) // => -2
5618
5295
  * ```
5619
5296
  *
5620
5297
  * @category folding
@@ -5626,25 +5303,22 @@ export const reduceRight: {
5626
5303
  *
5627
5304
  * **Example** (Reducing from the right)
5628
5305
  *
5629
- * ```ts
5306
+ * ```ts import.meta.vitest
5630
5307
  * import { Chunk } from "effect"
5631
5308
  *
5632
5309
  * const chunk = Chunk.make(1, 2, 3, 4)
5633
- * const result = Chunk.reduceRight(chunk, 0, (acc, n) => acc + n)
5634
- * console.log(result) // 10
5310
+ * Chunk.reduceRight(chunk, 0, (acc, n) => acc + n) // => 10
5635
5311
  *
5636
5312
  * // String building (right to left)
5637
5313
  * const words = Chunk.make("a", "b", "c")
5638
- * const reversed = Chunk.reduceRight(
5314
+ * Chunk.reduceRight(
5639
5315
  * words,
5640
5316
  * "",
5641
5317
  * (acc, word, i) => acc + `${i}:${word} `
5642
- * )
5643
- * console.log(reversed) // "2:c 1:b 0:a "
5318
+ * ).trim() // => "2:c 1:b 0:a"
5644
5319
  *
5645
5320
  * // Subtract from right to left
5646
- * const subtraction = Chunk.reduceRight(chunk, 0, (acc, n) => n - acc)
5647
- * console.log(subtraction) // -2 (4 - (3 - (2 - (1 - 0))))
5321
+ * Chunk.reduceRight(chunk, 0, (acc, n) => n - acc) // => -2
5648
5322
  * ```
5649
5323
  *
5650
5324
  * @category folding
@@ -5659,7 +5333,7 @@ export const reduceRight: {
5659
5333
  *
5660
5334
  * **Example** (Computing difference with custom equivalence)
5661
5335
  *
5662
- * ```ts
5336
+ * ```ts import.meta.vitest
5663
5337
  * import { Chunk } from "effect"
5664
5338
  *
5665
5339
  * const chunk1 = Chunk.make({ id: 1, name: "Alice" }, { id: 2, name: "Bob" })
@@ -5669,8 +5343,7 @@ export const reduceRight: {
5669
5343
  * const byId = Chunk.differenceWith<{ id: number; name: string }>((a, b) =>
5670
5344
  * a.id === b.id
5671
5345
  * )
5672
- * const result = byId(chunk1, chunk2)
5673
- * console.log(Chunk.toArray(result)) // [{ id: 2, name: "Bob" }]
5346
+ * Chunk.toArray(byId(chunk1, chunk2)) // => [{ id: 2, name: "Bob" }]
5674
5347
  *
5675
5348
  * // String comparison case-insensitive
5676
5349
  * const words1 = Chunk.make("Apple", "Banana", "Cherry")
@@ -5678,8 +5351,7 @@ export const reduceRight: {
5678
5351
  * const caseInsensitive = Chunk.differenceWith<string>((a, b) =>
5679
5352
  * a.toLowerCase() === b.toLowerCase()
5680
5353
  * )
5681
- * const wordDiff = caseInsensitive(words1, words2)
5682
- * console.log(Chunk.toArray(wordDiff)) // ["Banana", "Cherry"]
5354
+ * Chunk.toArray(caseInsensitive(words1, words2)) // => ["Banana", "Cherry"]
5683
5355
  * ```
5684
5356
  *
5685
5357
  * @category filtering
@@ -5701,24 +5373,20 @@ export const differenceWith = <A>(isEquivalent: (self: A, that: A) => boolean):
5701
5373
  *
5702
5374
  * **Example** (Computing chunk difference)
5703
5375
  *
5704
- * ```ts
5376
+ * ```ts import.meta.vitest
5705
5377
  * import { Chunk } from "effect"
5706
5378
  *
5707
5379
  * const chunk1 = Chunk.make(1, 2, 3, 4, 5)
5708
5380
  * const chunk2 = Chunk.make(3, 4, 6, 7)
5709
- * const result = Chunk.difference(chunk1, chunk2)
5710
- * console.log(Chunk.toArray(result)) // [1, 2, 5]
5381
+ * Chunk.toArray(Chunk.difference(chunk1, chunk2)) // => [1, 2, 5]
5711
5382
  *
5712
5383
  * // String difference
5713
5384
  * const words1 = Chunk.make("apple", "banana", "cherry")
5714
5385
  * const words2 = Chunk.make("banana", "grape")
5715
- * const wordDiff = Chunk.difference(words1, words2)
5716
- * console.log(Chunk.toArray(wordDiff)) // ["apple", "cherry"]
5386
+ * Chunk.toArray(Chunk.difference(words1, words2)) // => ["apple", "cherry"]
5717
5387
  *
5718
5388
  * // Empty second chunk returns original
5719
- * const empty = Chunk.empty<number>()
5720
- * const unchanged = Chunk.difference(chunk1, empty)
5721
- * console.log(Chunk.toArray(unchanged)) // [1, 2, 3, 4, 5]
5389
+ * Chunk.toArray(Chunk.difference(chunk1, Chunk.empty<number>())) // => [1, 2, 3, 4, 5]
5722
5390
  * ```
5723
5391
  *
5724
5392
  * @category filtering
@@ -5731,24 +5399,20 @@ export const difference: {
5731
5399
  *
5732
5400
  * **Example** (Computing chunk difference)
5733
5401
  *
5734
- * ```ts
5402
+ * ```ts import.meta.vitest
5735
5403
  * import { Chunk } from "effect"
5736
5404
  *
5737
5405
  * const chunk1 = Chunk.make(1, 2, 3, 4, 5)
5738
5406
  * const chunk2 = Chunk.make(3, 4, 6, 7)
5739
- * const result = Chunk.difference(chunk1, chunk2)
5740
- * console.log(Chunk.toArray(result)) // [1, 2, 5]
5407
+ * Chunk.toArray(Chunk.difference(chunk1, chunk2)) // => [1, 2, 5]
5741
5408
  *
5742
5409
  * // String difference
5743
5410
  * const words1 = Chunk.make("apple", "banana", "cherry")
5744
5411
  * const words2 = Chunk.make("banana", "grape")
5745
- * const wordDiff = Chunk.difference(words1, words2)
5746
- * console.log(Chunk.toArray(wordDiff)) // ["apple", "cherry"]
5412
+ * Chunk.toArray(Chunk.difference(words1, words2)) // => ["apple", "cherry"]
5747
5413
  *
5748
5414
  * // Empty second chunk returns original
5749
- * const empty = Chunk.empty<number>()
5750
- * const unchanged = Chunk.difference(chunk1, empty)
5751
- * console.log(Chunk.toArray(unchanged)) // [1, 2, 3, 4, 5]
5415
+ * Chunk.toArray(Chunk.difference(chunk1, Chunk.empty<number>())) // => [1, 2, 3, 4, 5]
5752
5416
  * ```
5753
5417
  *
5754
5418
  * @category filtering
@@ -5761,24 +5425,20 @@ export const difference: {
5761
5425
  *
5762
5426
  * **Example** (Computing chunk difference)
5763
5427
  *
5764
- * ```ts
5428
+ * ```ts import.meta.vitest
5765
5429
  * import { Chunk } from "effect"
5766
5430
  *
5767
5431
  * const chunk1 = Chunk.make(1, 2, 3, 4, 5)
5768
5432
  * const chunk2 = Chunk.make(3, 4, 6, 7)
5769
- * const result = Chunk.difference(chunk1, chunk2)
5770
- * console.log(Chunk.toArray(result)) // [1, 2, 5]
5433
+ * Chunk.toArray(Chunk.difference(chunk1, chunk2)) // => [1, 2, 5]
5771
5434
  *
5772
5435
  * // String difference
5773
5436
  * const words1 = Chunk.make("apple", "banana", "cherry")
5774
5437
  * const words2 = Chunk.make("banana", "grape")
5775
- * const wordDiff = Chunk.difference(words1, words2)
5776
- * console.log(Chunk.toArray(wordDiff)) // ["apple", "cherry"]
5438
+ * Chunk.toArray(Chunk.difference(words1, words2)) // => ["apple", "cherry"]
5777
5439
  *
5778
5440
  * // Empty second chunk returns original
5779
- * const empty = Chunk.empty<number>()
5780
- * const unchanged = Chunk.difference(chunk1, empty)
5781
- * console.log(Chunk.toArray(unchanged)) // [1, 2, 3, 4, 5]
5441
+ * Chunk.toArray(Chunk.difference(chunk1, Chunk.empty<number>())) // => [1, 2, 3, 4, 5]
5782
5442
  * ```
5783
5443
  *
5784
5444
  * @category filtering