effect 4.0.0-beta.66 → 4.0.0-beta.67

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 (1633) hide show
  1. package/dist/Array.d.ts +113 -67
  2. package/dist/Array.d.ts.map +1 -1
  3. package/dist/Array.js +28 -18
  4. package/dist/Array.js.map +1 -1
  5. package/dist/BigDecimal.d.ts +404 -337
  6. package/dist/BigDecimal.d.ts.map +1 -1
  7. package/dist/BigDecimal.js +190 -146
  8. package/dist/BigDecimal.js.map +1 -1
  9. package/dist/BigInt.d.ts +167 -97
  10. package/dist/BigInt.d.ts.map +1 -1
  11. package/dist/BigInt.js +87 -47
  12. package/dist/BigInt.js.map +1 -1
  13. package/dist/Boolean.d.ts +62 -31
  14. package/dist/Boolean.d.ts.map +1 -1
  15. package/dist/Boolean.js +30 -15
  16. package/dist/Boolean.js.map +1 -1
  17. package/dist/Brand.d.ts +20 -1
  18. package/dist/Brand.d.ts.map +1 -1
  19. package/dist/Brand.js +16 -0
  20. package/dist/Brand.js.map +1 -1
  21. package/dist/Cache.d.ts +236 -132
  22. package/dist/Cache.d.ts.map +1 -1
  23. package/dist/Cache.js +133 -57
  24. package/dist/Cache.js.map +1 -1
  25. package/dist/Cause.d.ts +74 -62
  26. package/dist/Cause.d.ts.map +1 -1
  27. package/dist/Cause.js +43 -36
  28. package/dist/Cause.js.map +1 -1
  29. package/dist/Channel.d.ts +1518 -575
  30. package/dist/Channel.d.ts.map +1 -1
  31. package/dist/Channel.js +661 -287
  32. package/dist/Channel.js.map +1 -1
  33. package/dist/ChannelSchema.d.ts +119 -10
  34. package/dist/ChannelSchema.d.ts.map +1 -1
  35. package/dist/ChannelSchema.js +45 -6
  36. package/dist/ChannelSchema.js.map +1 -1
  37. package/dist/Chunk.d.ts +548 -379
  38. package/dist/Chunk.d.ts.map +1 -1
  39. package/dist/Chunk.js +238 -170
  40. package/dist/Chunk.js.map +1 -1
  41. package/dist/Clock.d.ts +15 -8
  42. package/dist/Clock.d.ts.map +1 -1
  43. package/dist/Clock.js +8 -4
  44. package/dist/Clock.js.map +1 -1
  45. package/dist/Combiner.d.ts +2 -4
  46. package/dist/Combiner.d.ts.map +1 -1
  47. package/dist/Combiner.js +2 -4
  48. package/dist/Combiner.js.map +1 -1
  49. package/dist/Config.d.ts +4 -2
  50. package/dist/Config.d.ts.map +1 -1
  51. package/dist/Config.js +2 -2
  52. package/dist/Config.js.map +1 -1
  53. package/dist/ConfigProvider.d.ts +1 -1
  54. package/dist/ConfigProvider.js +1 -1
  55. package/dist/Console.d.ts +76 -50
  56. package/dist/Console.d.ts.map +1 -1
  57. package/dist/Console.js +69 -46
  58. package/dist/Console.js.map +1 -1
  59. package/dist/Context.d.ts +383 -134
  60. package/dist/Context.d.ts.map +1 -1
  61. package/dist/Context.js +134 -54
  62. package/dist/Context.js.map +1 -1
  63. package/dist/Cron.d.ts +69 -48
  64. package/dist/Cron.d.ts.map +1 -1
  65. package/dist/Cron.js +96 -36
  66. package/dist/Cron.js.map +1 -1
  67. package/dist/Data.d.ts +3 -2
  68. package/dist/Data.d.ts.map +1 -1
  69. package/dist/Data.js.map +1 -1
  70. package/dist/DateTime.d.ts +874 -443
  71. package/dist/DateTime.d.ts.map +1 -1
  72. package/dist/DateTime.js +374 -215
  73. package/dist/DateTime.js.map +1 -1
  74. package/dist/Deferred.d.ts +367 -174
  75. package/dist/Deferred.d.ts.map +1 -1
  76. package/dist/Deferred.js +145 -71
  77. package/dist/Deferred.js.map +1 -1
  78. package/dist/Differ.d.ts +42 -0
  79. package/dist/Differ.d.ts.map +1 -1
  80. package/dist/Differ.js +36 -0
  81. package/dist/Duration.d.ts +329 -185
  82. package/dist/Duration.d.ts.map +1 -1
  83. package/dist/Duration.js +174 -106
  84. package/dist/Duration.js.map +1 -1
  85. package/dist/Effect.d.ts +2109 -1945
  86. package/dist/Effect.d.ts.map +1 -1
  87. package/dist/Effect.js +901 -726
  88. package/dist/Effect.js.map +1 -1
  89. package/dist/Effectable.d.ts +37 -2
  90. package/dist/Effectable.d.ts.map +1 -1
  91. package/dist/Effectable.js +2 -2
  92. package/dist/Effectable.js.map +1 -1
  93. package/dist/Encoding.d.ts +78 -28
  94. package/dist/Encoding.d.ts.map +1 -1
  95. package/dist/Encoding.js +75 -27
  96. package/dist/Encoding.js.map +1 -1
  97. package/dist/Equivalence.d.ts +14 -19
  98. package/dist/Equivalence.d.ts.map +1 -1
  99. package/dist/Equivalence.js +14 -19
  100. package/dist/Equivalence.js.map +1 -1
  101. package/dist/ErrorReporter.d.ts +66 -82
  102. package/dist/ErrorReporter.d.ts.map +1 -1
  103. package/dist/ErrorReporter.js +38 -29
  104. package/dist/ErrorReporter.js.map +1 -1
  105. package/dist/ExecutionPlan.d.ts +94 -9
  106. package/dist/ExecutionPlan.d.ts.map +1 -1
  107. package/dist/ExecutionPlan.js +20 -5
  108. package/dist/ExecutionPlan.js.map +1 -1
  109. package/dist/Exit.d.ts +7 -5
  110. package/dist/Exit.d.ts.map +1 -1
  111. package/dist/Exit.js.map +1 -1
  112. package/dist/Fiber.d.ts +72 -40
  113. package/dist/Fiber.d.ts.map +1 -1
  114. package/dist/Fiber.js +39 -21
  115. package/dist/Fiber.js.map +1 -1
  116. package/dist/FiberHandle.d.ts +117 -56
  117. package/dist/FiberHandle.d.ts.map +1 -1
  118. package/dist/FiberHandle.js +120 -38
  119. package/dist/FiberHandle.js.map +1 -1
  120. package/dist/FiberMap.d.ts +286 -158
  121. package/dist/FiberMap.d.ts.map +1 -1
  122. package/dist/FiberMap.js +174 -72
  123. package/dist/FiberMap.js.map +1 -1
  124. package/dist/FiberSet.d.ts +92 -51
  125. package/dist/FiberSet.d.ts.map +1 -1
  126. package/dist/FiberSet.js +96 -33
  127. package/dist/FiberSet.js.map +1 -1
  128. package/dist/FileSystem.d.ts +104 -73
  129. package/dist/FileSystem.d.ts.map +1 -1
  130. package/dist/FileSystem.js +53 -39
  131. package/dist/FileSystem.js.map +1 -1
  132. package/dist/Filter.d.ts +166 -88
  133. package/dist/Filter.d.ts.map +1 -1
  134. package/dist/Filter.js +68 -42
  135. package/dist/Filter.js.map +1 -1
  136. package/dist/Function.d.ts +154 -86
  137. package/dist/Function.d.ts.map +1 -1
  138. package/dist/Function.js +53 -37
  139. package/dist/Function.js.map +1 -1
  140. package/dist/Graph.d.ts +682 -365
  141. package/dist/Graph.d.ts.map +1 -1
  142. package/dist/Graph.js +308 -157
  143. package/dist/Graph.js.map +1 -1
  144. package/dist/HKT.d.ts +29 -13
  145. package/dist/HKT.d.ts.map +1 -1
  146. package/dist/Hash.d.ts +31 -18
  147. package/dist/Hash.d.ts.map +1 -1
  148. package/dist/Hash.js +25 -15
  149. package/dist/Hash.js.map +1 -1
  150. package/dist/HashMap.d.ts +444 -256
  151. package/dist/HashMap.d.ts.map +1 -1
  152. package/dist/HashMap.js +223 -105
  153. package/dist/HashMap.js.map +1 -1
  154. package/dist/HashRing.d.ts +36 -17
  155. package/dist/HashRing.d.ts.map +1 -1
  156. package/dist/HashRing.js +75 -8
  157. package/dist/HashRing.js.map +1 -1
  158. package/dist/HashSet.d.ts +194 -104
  159. package/dist/HashSet.d.ts.map +1 -1
  160. package/dist/HashSet.js +93 -38
  161. package/dist/HashSet.js.map +1 -1
  162. package/dist/Inspectable.d.ts +20 -9
  163. package/dist/Inspectable.d.ts.map +1 -1
  164. package/dist/Inspectable.js +16 -6
  165. package/dist/Inspectable.js.map +1 -1
  166. package/dist/Iterable.d.ts +309 -149
  167. package/dist/Iterable.d.ts.map +1 -1
  168. package/dist/Iterable.js +129 -65
  169. package/dist/Iterable.js.map +1 -1
  170. package/dist/JsonPatch.d.ts +4 -3
  171. package/dist/JsonPatch.d.ts.map +1 -1
  172. package/dist/JsonPatch.js +4 -3
  173. package/dist/JsonPatch.js.map +1 -1
  174. package/dist/Latch.d.ts +98 -15
  175. package/dist/Latch.d.ts.map +1 -1
  176. package/dist/Latch.js +41 -10
  177. package/dist/Latch.js.map +1 -1
  178. package/dist/Layer.d.ts +412 -309
  179. package/dist/Layer.d.ts.map +1 -1
  180. package/dist/Layer.js +261 -180
  181. package/dist/Layer.js.map +1 -1
  182. package/dist/LayerMap.d.ts +95 -21
  183. package/dist/LayerMap.d.ts.map +1 -1
  184. package/dist/LayerMap.js +55 -11
  185. package/dist/LayerMap.js.map +1 -1
  186. package/dist/LogLevel.d.ts +92 -131
  187. package/dist/LogLevel.d.ts.map +1 -1
  188. package/dist/LogLevel.js +25 -15
  189. package/dist/LogLevel.js.map +1 -1
  190. package/dist/Logger.d.ts +155 -99
  191. package/dist/Logger.d.ts.map +1 -1
  192. package/dist/Logger.js +211 -184
  193. package/dist/Logger.js.map +1 -1
  194. package/dist/ManagedRuntime.d.ts +75 -17
  195. package/dist/ManagedRuntime.d.ts.map +1 -1
  196. package/dist/ManagedRuntime.js +22 -16
  197. package/dist/ManagedRuntime.js.map +1 -1
  198. package/dist/Match.d.ts +133 -157
  199. package/dist/Match.d.ts.map +1 -1
  200. package/dist/Match.js +85 -76
  201. package/dist/Match.js.map +1 -1
  202. package/dist/Metric.d.ts +325 -284
  203. package/dist/Metric.d.ts.map +1 -1
  204. package/dist/Metric.js +217 -212
  205. package/dist/Metric.js.map +1 -1
  206. package/dist/MutableHashMap.d.ts +117 -58
  207. package/dist/MutableHashMap.d.ts.map +1 -1
  208. package/dist/MutableHashMap.js +52 -29
  209. package/dist/MutableHashMap.js.map +1 -1
  210. package/dist/MutableHashSet.d.ts +52 -30
  211. package/dist/MutableHashSet.d.ts.map +1 -1
  212. package/dist/MutableHashSet.js +94 -38
  213. package/dist/MutableHashSet.js.map +1 -1
  214. package/dist/MutableList.d.ts +92 -49
  215. package/dist/MutableList.d.ts.map +1 -1
  216. package/dist/MutableList.js +123 -71
  217. package/dist/MutableList.js.map +1 -1
  218. package/dist/MutableRef.d.ts +99 -62
  219. package/dist/MutableRef.d.ts.map +1 -1
  220. package/dist/MutableRef.js +79 -60
  221. package/dist/MutableRef.js.map +1 -1
  222. package/dist/Newtype.d.ts +3 -0
  223. package/dist/Newtype.d.ts.map +1 -1
  224. package/dist/Newtype.js.map +1 -1
  225. package/dist/NonEmptyIterable.d.ts +36 -39
  226. package/dist/NonEmptyIterable.d.ts.map +1 -1
  227. package/dist/NonEmptyIterable.js +34 -20
  228. package/dist/NonEmptyIterable.js.map +1 -1
  229. package/dist/Number.d.ts +116 -64
  230. package/dist/Number.d.ts.map +1 -1
  231. package/dist/Number.js +54 -30
  232. package/dist/Number.js.map +1 -1
  233. package/dist/Optic.d.ts +1 -2
  234. package/dist/Optic.d.ts.map +1 -1
  235. package/dist/Optic.js +0 -1
  236. package/dist/Optic.js.map +1 -1
  237. package/dist/Option.d.ts +28 -47
  238. package/dist/Option.d.ts.map +1 -1
  239. package/dist/Option.js +14 -12
  240. package/dist/Option.js.map +1 -1
  241. package/dist/Ordering.d.ts +43 -28
  242. package/dist/Ordering.d.ts.map +1 -1
  243. package/dist/Ordering.js +4 -2
  244. package/dist/Ordering.js.map +1 -1
  245. package/dist/PartitionedSemaphore.d.ts +225 -40
  246. package/dist/PartitionedSemaphore.d.ts.map +1 -1
  247. package/dist/PartitionedSemaphore.js +113 -17
  248. package/dist/PartitionedSemaphore.js.map +1 -1
  249. package/dist/Path.d.ts +77 -13
  250. package/dist/Path.d.ts.map +1 -1
  251. package/dist/Path.js +48 -4
  252. package/dist/Path.js.map +1 -1
  253. package/dist/Pipeable.d.ts +71 -15
  254. package/dist/Pipeable.d.ts.map +1 -1
  255. package/dist/Pipeable.js +59 -12
  256. package/dist/Pipeable.js.map +1 -1
  257. package/dist/PlatformError.d.ts +74 -6
  258. package/dist/PlatformError.d.ts.map +1 -1
  259. package/dist/PlatformError.js +68 -5
  260. package/dist/PlatformError.js.map +1 -1
  261. package/dist/Pool.d.ts +66 -31
  262. package/dist/Pool.d.ts.map +1 -1
  263. package/dist/Pool.js +26 -24
  264. package/dist/Pool.js.map +1 -1
  265. package/dist/Predicate.d.ts +16 -21
  266. package/dist/Predicate.d.ts.map +1 -1
  267. package/dist/Predicate.js +9 -14
  268. package/dist/Predicate.js.map +1 -1
  269. package/dist/PrimaryKey.d.ts +9 -2
  270. package/dist/PrimaryKey.d.ts.map +1 -1
  271. package/dist/PrimaryKey.js +7 -1
  272. package/dist/PrimaryKey.js.map +1 -1
  273. package/dist/PubSub.d.ts +364 -262
  274. package/dist/PubSub.d.ts.map +1 -1
  275. package/dist/PubSub.js +245 -174
  276. package/dist/PubSub.js.map +1 -1
  277. package/dist/Pull.d.ts +94 -25
  278. package/dist/Pull.d.ts.map +1 -1
  279. package/dist/Pull.js +61 -13
  280. package/dist/Pull.js.map +1 -1
  281. package/dist/Queue.d.ts +284 -150
  282. package/dist/Queue.d.ts.map +1 -1
  283. package/dist/Queue.js +216 -113
  284. package/dist/Queue.js.map +1 -1
  285. package/dist/Random.d.ts +54 -35
  286. package/dist/Random.d.ts.map +1 -1
  287. package/dist/Random.js +36 -24
  288. package/dist/Random.js.map +1 -1
  289. package/dist/RcMap.d.ts +151 -141
  290. package/dist/RcMap.d.ts.map +1 -1
  291. package/dist/RcMap.js +66 -20
  292. package/dist/RcMap.js.map +1 -1
  293. package/dist/RcRef.d.ts +69 -32
  294. package/dist/RcRef.d.ts.map +1 -1
  295. package/dist/RcRef.js +33 -16
  296. package/dist/RcRef.js.map +1 -1
  297. package/dist/Record.d.ts +273 -129
  298. package/dist/Record.d.ts.map +1 -1
  299. package/dist/Record.js +117 -57
  300. package/dist/Record.js.map +1 -1
  301. package/dist/Redactable.d.ts +3 -3
  302. package/dist/Redactable.js +2 -2
  303. package/dist/Redacted.d.ts +63 -33
  304. package/dist/Redacted.d.ts.map +1 -1
  305. package/dist/Redacted.js +30 -14
  306. package/dist/Redacted.js.map +1 -1
  307. package/dist/Ref.d.ts +81 -52
  308. package/dist/Ref.d.ts.map +1 -1
  309. package/dist/Ref.js +54 -35
  310. package/dist/Ref.js.map +1 -1
  311. package/dist/References.d.ts +73 -31
  312. package/dist/References.d.ts.map +1 -1
  313. package/dist/References.js +66 -30
  314. package/dist/References.js.map +1 -1
  315. package/dist/RegExp.d.ts +11 -5
  316. package/dist/RegExp.d.ts.map +1 -1
  317. package/dist/RegExp.js +11 -5
  318. package/dist/RegExp.js.map +1 -1
  319. package/dist/Request.d.ts +158 -34
  320. package/dist/Request.d.ts.map +1 -1
  321. package/dist/Request.js +67 -12
  322. package/dist/Request.js.map +1 -1
  323. package/dist/RequestResolver.d.ts +261 -116
  324. package/dist/RequestResolver.d.ts.map +1 -1
  325. package/dist/RequestResolver.js +77 -41
  326. package/dist/RequestResolver.js.map +1 -1
  327. package/dist/Resource.d.ts +13 -7
  328. package/dist/Resource.d.ts.map +1 -1
  329. package/dist/Resource.js +44 -6
  330. package/dist/Resource.js.map +1 -1
  331. package/dist/Result.d.ts +16 -14
  332. package/dist/Result.d.ts.map +1 -1
  333. package/dist/Result.js +6 -6
  334. package/dist/Result.js.map +1 -1
  335. package/dist/Runtime.d.ts +43 -18
  336. package/dist/Runtime.d.ts.map +1 -1
  337. package/dist/Runtime.js +35 -16
  338. package/dist/Runtime.js.map +1 -1
  339. package/dist/Schedule.d.ts +545 -576
  340. package/dist/Schedule.d.ts.map +1 -1
  341. package/dist/Schedule.js +260 -246
  342. package/dist/Schedule.js.map +1 -1
  343. package/dist/Scheduler.d.ts +43 -6
  344. package/dist/Scheduler.d.ts.map +1 -1
  345. package/dist/Scheduler.js +33 -4
  346. package/dist/Scheduler.js.map +1 -1
  347. package/dist/Schema.d.ts +803 -282
  348. package/dist/Schema.d.ts.map +1 -1
  349. package/dist/Schema.js +281 -189
  350. package/dist/Schema.js.map +1 -1
  351. package/dist/SchemaAST.d.ts +24 -15
  352. package/dist/SchemaAST.d.ts.map +1 -1
  353. package/dist/SchemaAST.js +13 -9
  354. package/dist/SchemaAST.js.map +1 -1
  355. package/dist/SchemaGetter.d.ts +26 -13
  356. package/dist/SchemaGetter.d.ts.map +1 -1
  357. package/dist/SchemaGetter.js +22 -9
  358. package/dist/SchemaGetter.js.map +1 -1
  359. package/dist/SchemaIssue.d.ts +1 -8
  360. package/dist/SchemaIssue.d.ts.map +1 -1
  361. package/dist/SchemaIssue.js.map +1 -1
  362. package/dist/SchemaParser.d.ts +194 -25
  363. package/dist/SchemaParser.d.ts.map +1 -1
  364. package/dist/SchemaParser.js +220 -26
  365. package/dist/SchemaParser.js.map +1 -1
  366. package/dist/SchemaTransformation.d.ts +61 -41
  367. package/dist/SchemaTransformation.d.ts.map +1 -1
  368. package/dist/SchemaTransformation.js +56 -33
  369. package/dist/SchemaTransformation.js.map +1 -1
  370. package/dist/SchemaUtils.d.ts +7 -0
  371. package/dist/SchemaUtils.d.ts.map +1 -1
  372. package/dist/SchemaUtils.js +23 -0
  373. package/dist/SchemaUtils.js.map +1 -1
  374. package/dist/Scope.d.ts +102 -43
  375. package/dist/Scope.d.ts.map +1 -1
  376. package/dist/Scope.js +57 -23
  377. package/dist/Scope.js.map +1 -1
  378. package/dist/ScopedCache.d.ts +138 -46
  379. package/dist/ScopedCache.d.ts.map +1 -1
  380. package/dist/ScopedCache.js +80 -19
  381. package/dist/ScopedCache.js.map +1 -1
  382. package/dist/ScopedRef.d.ts +28 -8
  383. package/dist/ScopedRef.d.ts.map +1 -1
  384. package/dist/ScopedRef.js +25 -5
  385. package/dist/ScopedRef.js.map +1 -1
  386. package/dist/Semaphore.d.ts +64 -28
  387. package/dist/Semaphore.d.ts.map +1 -1
  388. package/dist/Semaphore.js +22 -13
  389. package/dist/Semaphore.js.map +1 -1
  390. package/dist/Sink.d.ts +458 -200
  391. package/dist/Sink.d.ts.map +1 -1
  392. package/dist/Sink.js +240 -89
  393. package/dist/Sink.js.map +1 -1
  394. package/dist/Stdio.d.ts +43 -6
  395. package/dist/Stdio.d.ts.map +1 -1
  396. package/dist/Stdio.js +33 -4
  397. package/dist/Stdio.js.map +1 -1
  398. package/dist/Stream.d.ts +1896 -1183
  399. package/dist/Stream.d.ts.map +1 -1
  400. package/dist/Stream.js +867 -524
  401. package/dist/Stream.js.map +1 -1
  402. package/dist/String.d.ts +171 -95
  403. package/dist/String.d.ts.map +1 -1
  404. package/dist/String.js +125 -67
  405. package/dist/String.js.map +1 -1
  406. package/dist/SubscriptionRef.d.ts +308 -203
  407. package/dist/SubscriptionRef.d.ts.map +1 -1
  408. package/dist/SubscriptionRef.js +125 -76
  409. package/dist/SubscriptionRef.js.map +1 -1
  410. package/dist/Symbol.d.ts +13 -5
  411. package/dist/Symbol.d.ts.map +1 -1
  412. package/dist/Symbol.js +13 -5
  413. package/dist/Symbol.js.map +1 -1
  414. package/dist/SynchronizedRef.d.ts +278 -62
  415. package/dist/SynchronizedRef.d.ts.map +1 -1
  416. package/dist/SynchronizedRef.js +116 -23
  417. package/dist/SynchronizedRef.js.map +1 -1
  418. package/dist/Take.d.ts +26 -2
  419. package/dist/Take.d.ts.map +1 -1
  420. package/dist/Take.js +4 -1
  421. package/dist/Take.js.map +1 -1
  422. package/dist/Terminal.d.ts +39 -7
  423. package/dist/Terminal.d.ts.map +1 -1
  424. package/dist/Terminal.js +10 -4
  425. package/dist/Terminal.js.map +1 -1
  426. package/dist/Tracer.d.ts +229 -55
  427. package/dist/Tracer.d.ts.map +1 -1
  428. package/dist/Tracer.js +94 -18
  429. package/dist/Tracer.js.map +1 -1
  430. package/dist/Trie.d.ts +213 -142
  431. package/dist/Trie.d.ts.map +1 -1
  432. package/dist/Trie.js +88 -60
  433. package/dist/Trie.js.map +1 -1
  434. package/dist/TxChunk.d.ts +182 -146
  435. package/dist/TxChunk.d.ts.map +1 -1
  436. package/dist/TxChunk.js +73 -56
  437. package/dist/TxChunk.js.map +1 -1
  438. package/dist/TxDeferred.d.ts +43 -29
  439. package/dist/TxDeferred.d.ts.map +1 -1
  440. package/dist/TxDeferred.js +22 -15
  441. package/dist/TxDeferred.js.map +1 -1
  442. package/dist/TxHashMap.d.ts +362 -222
  443. package/dist/TxHashMap.d.ts.map +1 -1
  444. package/dist/TxHashMap.js +171 -98
  445. package/dist/TxHashMap.js.map +1 -1
  446. package/dist/TxHashSet.d.ts +178 -104
  447. package/dist/TxHashSet.d.ts.map +1 -1
  448. package/dist/TxHashSet.js +84 -43
  449. package/dist/TxHashSet.js.map +1 -1
  450. package/dist/TxPriorityQueue.d.ts +93 -62
  451. package/dist/TxPriorityQueue.d.ts.map +1 -1
  452. package/dist/TxPriorityQueue.js +54 -36
  453. package/dist/TxPriorityQueue.js.map +1 -1
  454. package/dist/TxPubSub.d.ts +77 -49
  455. package/dist/TxPubSub.d.ts.map +1 -1
  456. package/dist/TxPubSub.js +60 -37
  457. package/dist/TxPubSub.js.map +1 -1
  458. package/dist/TxQueue.d.ts +279 -241
  459. package/dist/TxQueue.d.ts.map +1 -1
  460. package/dist/TxQueue.js +147 -101
  461. package/dist/TxQueue.js.map +1 -1
  462. package/dist/TxReentrantLock.d.ts +69 -46
  463. package/dist/TxReentrantLock.d.ts.map +1 -1
  464. package/dist/TxReentrantLock.js +48 -32
  465. package/dist/TxReentrantLock.js.map +1 -1
  466. package/dist/TxRef.d.ts +69 -40
  467. package/dist/TxRef.d.ts.map +1 -1
  468. package/dist/TxRef.js +34 -19
  469. package/dist/TxRef.js.map +1 -1
  470. package/dist/TxSemaphore.d.ts +101 -54
  471. package/dist/TxSemaphore.d.ts.map +1 -1
  472. package/dist/TxSemaphore.js +76 -34
  473. package/dist/TxSemaphore.js.map +1 -1
  474. package/dist/TxSubscriptionRef.d.ts +72 -48
  475. package/dist/TxSubscriptionRef.d.ts.map +1 -1
  476. package/dist/TxSubscriptionRef.js +33 -22
  477. package/dist/TxSubscriptionRef.js.map +1 -1
  478. package/dist/Types.d.ts +34 -34
  479. package/dist/UndefinedOr.d.ts +48 -25
  480. package/dist/UndefinedOr.d.ts.map +1 -1
  481. package/dist/UndefinedOr.js +28 -25
  482. package/dist/UndefinedOr.js.map +1 -1
  483. package/dist/Unify.d.ts +71 -116
  484. package/dist/Unify.d.ts.map +1 -1
  485. package/dist/Unify.js +20 -6
  486. package/dist/Unify.js.map +1 -1
  487. package/dist/Utils.d.ts +4 -0
  488. package/dist/Utils.d.ts.map +1 -1
  489. package/dist/Utils.js +4 -0
  490. package/dist/Utils.js.map +1 -1
  491. package/dist/index.d.ts +81 -32
  492. package/dist/index.d.ts.map +1 -1
  493. package/dist/index.js +81 -32
  494. package/dist/index.js.map +1 -1
  495. package/dist/internal/schema/schema.js +1 -1
  496. package/dist/internal/schema/schema.js.map +1 -1
  497. package/dist/testing/FastCheck.d.ts +6 -3
  498. package/dist/testing/FastCheck.d.ts.map +1 -1
  499. package/dist/testing/FastCheck.js +6 -3
  500. package/dist/testing/FastCheck.js.map +1 -1
  501. package/dist/testing/TestClock.d.ts +39 -34
  502. package/dist/testing/TestClock.d.ts.map +1 -1
  503. package/dist/testing/TestClock.js +42 -12
  504. package/dist/testing/TestClock.js.map +1 -1
  505. package/dist/testing/TestConsole.d.ts +39 -30
  506. package/dist/testing/TestConsole.d.ts.map +1 -1
  507. package/dist/testing/TestConsole.js +25 -10
  508. package/dist/testing/TestConsole.js.map +1 -1
  509. package/dist/testing/TestSchema.js +7 -7
  510. package/dist/testing/TestSchema.js.map +1 -1
  511. package/dist/unstable/ai/AiError.d.ts +197 -130
  512. package/dist/unstable/ai/AiError.d.ts.map +1 -1
  513. package/dist/unstable/ai/AiError.js +166 -102
  514. package/dist/unstable/ai/AiError.js.map +1 -1
  515. package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
  516. package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
  517. package/dist/unstable/ai/Chat.d.ts +65 -41
  518. package/dist/unstable/ai/Chat.d.ts.map +1 -1
  519. package/dist/unstable/ai/Chat.js +51 -33
  520. package/dist/unstable/ai/Chat.js.map +1 -1
  521. package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
  522. package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
  523. package/dist/unstable/ai/EmbeddingModel.js +9 -8
  524. package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
  525. package/dist/unstable/ai/IdGenerator.d.ts +28 -18
  526. package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
  527. package/dist/unstable/ai/IdGenerator.js +18 -11
  528. package/dist/unstable/ai/IdGenerator.js.map +1 -1
  529. package/dist/unstable/ai/LanguageModel.d.ts +31 -25
  530. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  531. package/dist/unstable/ai/LanguageModel.js +20 -14
  532. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  533. package/dist/unstable/ai/McpSchema.d.ts +339 -119
  534. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  535. package/dist/unstable/ai/McpSchema.js +264 -98
  536. package/dist/unstable/ai/McpSchema.js.map +1 -1
  537. package/dist/unstable/ai/McpServer.d.ts +53 -19
  538. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  539. package/dist/unstable/ai/McpServer.js +63 -15
  540. package/dist/unstable/ai/McpServer.js.map +1 -1
  541. package/dist/unstable/ai/Model.d.ts +8 -6
  542. package/dist/unstable/ai/Model.d.ts.map +1 -1
  543. package/dist/unstable/ai/Model.js +7 -5
  544. package/dist/unstable/ai/Model.js.map +1 -1
  545. package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
  546. package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
  547. package/dist/unstable/ai/Prompt.d.ts +194 -168
  548. package/dist/unstable/ai/Prompt.d.ts.map +1 -1
  549. package/dist/unstable/ai/Prompt.js +75 -66
  550. package/dist/unstable/ai/Prompt.js.map +1 -1
  551. package/dist/unstable/ai/Response.d.ts +153 -140
  552. package/dist/unstable/ai/Response.d.ts.map +1 -1
  553. package/dist/unstable/ai/Response.js +43 -48
  554. package/dist/unstable/ai/Response.js.map +1 -1
  555. package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
  556. package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
  557. package/dist/unstable/ai/ResponseIdTracker.js +27 -2
  558. package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
  559. package/dist/unstable/ai/Telemetry.d.ts +42 -32
  560. package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
  561. package/dist/unstable/ai/Telemetry.js +14 -10
  562. package/dist/unstable/ai/Telemetry.js.map +1 -1
  563. package/dist/unstable/ai/Tokenizer.d.ts +13 -8
  564. package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
  565. package/dist/unstable/ai/Tokenizer.js +10 -6
  566. package/dist/unstable/ai/Tokenizer.js.map +1 -1
  567. package/dist/unstable/ai/Tool.d.ts +153 -84
  568. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  569. package/dist/unstable/ai/Tool.js +97 -44
  570. package/dist/unstable/ai/Tool.js.map +1 -1
  571. package/dist/unstable/ai/Toolkit.d.ts +32 -39
  572. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  573. package/dist/unstable/ai/Toolkit.js +7 -5
  574. package/dist/unstable/ai/Toolkit.js.map +1 -1
  575. package/dist/unstable/ai/index.d.ts +42 -24
  576. package/dist/unstable/ai/index.d.ts.map +1 -1
  577. package/dist/unstable/ai/index.js +42 -24
  578. package/dist/unstable/ai/index.js.map +1 -1
  579. package/dist/unstable/cli/Argument.d.ts +226 -134
  580. package/dist/unstable/cli/Argument.d.ts.map +1 -1
  581. package/dist/unstable/cli/Argument.js +101 -65
  582. package/dist/unstable/cli/Argument.js.map +1 -1
  583. package/dist/unstable/cli/CliError.d.ts +72 -26
  584. package/dist/unstable/cli/CliError.d.ts.map +1 -1
  585. package/dist/unstable/cli/CliError.js +86 -23
  586. package/dist/unstable/cli/CliError.js.map +1 -1
  587. package/dist/unstable/cli/CliOutput.d.ts +43 -13
  588. package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
  589. package/dist/unstable/cli/CliOutput.js +30 -6
  590. package/dist/unstable/cli/CliOutput.js.map +1 -1
  591. package/dist/unstable/cli/Command.d.ts +194 -113
  592. package/dist/unstable/cli/Command.d.ts.map +1 -1
  593. package/dist/unstable/cli/Command.js +45 -31
  594. package/dist/unstable/cli/Command.js.map +1 -1
  595. package/dist/unstable/cli/Completions.d.ts +7 -7
  596. package/dist/unstable/cli/Completions.js +1 -1
  597. package/dist/unstable/cli/Flag.d.ts +235 -142
  598. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  599. package/dist/unstable/cli/Flag.js +111 -71
  600. package/dist/unstable/cli/Flag.js.map +1 -1
  601. package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
  602. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  603. package/dist/unstable/cli/GlobalFlag.js +30 -7
  604. package/dist/unstable/cli/GlobalFlag.js.map +1 -1
  605. package/dist/unstable/cli/HelpDoc.d.ts +35 -10
  606. package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
  607. package/dist/unstable/cli/HelpDoc.js +21 -0
  608. package/dist/unstable/cli/Param.d.ts +79 -31
  609. package/dist/unstable/cli/Param.d.ts.map +1 -1
  610. package/dist/unstable/cli/Param.js +160 -98
  611. package/dist/unstable/cli/Param.js.map +1 -1
  612. package/dist/unstable/cli/Primitive.d.ts +79 -42
  613. package/dist/unstable/cli/Primitive.d.ts.map +1 -1
  614. package/dist/unstable/cli/Primitive.js +66 -35
  615. package/dist/unstable/cli/Primitive.js.map +1 -1
  616. package/dist/unstable/cli/Prompt.d.ts +177 -45
  617. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  618. package/dist/unstable/cli/Prompt.js +103 -21
  619. package/dist/unstable/cli/Prompt.js.map +1 -1
  620. package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
  621. package/dist/unstable/cli/internal/ansi.js +13 -0
  622. package/dist/unstable/cli/internal/ansi.js.map +1 -1
  623. package/dist/unstable/cli/internal/command.d.ts +5 -1
  624. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  625. package/dist/unstable/cli/internal/command.js +5 -1
  626. package/dist/unstable/cli/internal/command.js.map +1 -1
  627. package/dist/unstable/cli/internal/config.d.ts +3 -0
  628. package/dist/unstable/cli/internal/config.d.ts.map +1 -1
  629. package/dist/unstable/cli/internal/config.js.map +1 -1
  630. package/dist/unstable/cli/internal/lexer.js.map +1 -1
  631. package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
  632. package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
  633. package/dist/unstable/cluster/ClusterCron.js +35 -1
  634. package/dist/unstable/cluster/ClusterCron.js.map +1 -1
  635. package/dist/unstable/cluster/ClusterError.d.ts +56 -7
  636. package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
  637. package/dist/unstable/cluster/ClusterError.js +56 -7
  638. package/dist/unstable/cluster/ClusterError.js.map +1 -1
  639. package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
  640. package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
  641. package/dist/unstable/cluster/ClusterMetrics.js +39 -5
  642. package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
  643. package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
  644. package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
  645. package/dist/unstable/cluster/ClusterSchema.js +61 -8
  646. package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
  647. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
  648. package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
  649. package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
  650. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  651. package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
  652. package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
  653. package/dist/unstable/cluster/DeliverAt.js +11 -3
  654. package/dist/unstable/cluster/DeliverAt.js.map +1 -1
  655. package/dist/unstable/cluster/Entity.d.ts +75 -16
  656. package/dist/unstable/cluster/Entity.d.ts.map +1 -1
  657. package/dist/unstable/cluster/Entity.js +75 -10
  658. package/dist/unstable/cluster/Entity.js.map +1 -1
  659. package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
  660. package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
  661. package/dist/unstable/cluster/EntityAddress.js +30 -2
  662. package/dist/unstable/cluster/EntityAddress.js.map +1 -1
  663. package/dist/unstable/cluster/EntityId.d.ts +18 -3
  664. package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
  665. package/dist/unstable/cluster/EntityId.js +15 -2
  666. package/dist/unstable/cluster/EntityId.js.map +1 -1
  667. package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
  668. package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
  669. package/dist/unstable/cluster/EntityProxy.js +24 -2
  670. package/dist/unstable/cluster/EntityProxy.js.map +1 -1
  671. package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
  672. package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
  673. package/dist/unstable/cluster/EntityProxyServer.js +40 -8
  674. package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
  675. package/dist/unstable/cluster/EntityResource.d.ts +43 -6
  676. package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
  677. package/dist/unstable/cluster/EntityResource.js +11 -4
  678. package/dist/unstable/cluster/EntityResource.js.map +1 -1
  679. package/dist/unstable/cluster/EntityType.d.ts +27 -3
  680. package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
  681. package/dist/unstable/cluster/EntityType.js +24 -2
  682. package/dist/unstable/cluster/EntityType.js.map +1 -1
  683. package/dist/unstable/cluster/Envelope.d.ts +105 -23
  684. package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
  685. package/dist/unstable/cluster/Envelope.js +88 -14
  686. package/dist/unstable/cluster/Envelope.js.map +1 -1
  687. package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
  688. package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
  689. package/dist/unstable/cluster/HttpRunner.js +88 -13
  690. package/dist/unstable/cluster/HttpRunner.js.map +1 -1
  691. package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
  692. package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
  693. package/dist/unstable/cluster/K8sHttpClient.js +31 -6
  694. package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
  695. package/dist/unstable/cluster/MachineId.d.ts +24 -3
  696. package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
  697. package/dist/unstable/cluster/MachineId.js +21 -2
  698. package/dist/unstable/cluster/MachineId.js.map +1 -1
  699. package/dist/unstable/cluster/Message.d.ts +102 -13
  700. package/dist/unstable/cluster/Message.d.ts.map +1 -1
  701. package/dist/unstable/cluster/Message.js +86 -10
  702. package/dist/unstable/cluster/Message.js.map +1 -1
  703. package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
  704. package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
  705. package/dist/unstable/cluster/MessageStorage.js +70 -10
  706. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  707. package/dist/unstable/cluster/Reply.d.ts +101 -12
  708. package/dist/unstable/cluster/Reply.d.ts.map +1 -1
  709. package/dist/unstable/cluster/Reply.js +64 -8
  710. package/dist/unstable/cluster/Reply.js.map +1 -1
  711. package/dist/unstable/cluster/Runner.d.ts +47 -17
  712. package/dist/unstable/cluster/Runner.d.ts.map +1 -1
  713. package/dist/unstable/cluster/Runner.js +47 -17
  714. package/dist/unstable/cluster/Runner.js.map +1 -1
  715. package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
  716. package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
  717. package/dist/unstable/cluster/RunnerAddress.js +34 -2
  718. package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
  719. package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
  720. package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
  721. package/dist/unstable/cluster/RunnerHealth.js +40 -12
  722. package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
  723. package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
  724. package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
  725. package/dist/unstable/cluster/RunnerServer.js +31 -4
  726. package/dist/unstable/cluster/RunnerServer.js.map +1 -1
  727. package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
  728. package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
  729. package/dist/unstable/cluster/RunnerStorage.js +38 -4
  730. package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
  731. package/dist/unstable/cluster/Runners.d.ts +73 -10
  732. package/dist/unstable/cluster/Runners.d.ts.map +1 -1
  733. package/dist/unstable/cluster/Runners.js +70 -9
  734. package/dist/unstable/cluster/Runners.js.map +1 -1
  735. package/dist/unstable/cluster/ShardId.d.ts +51 -5
  736. package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
  737. package/dist/unstable/cluster/ShardId.js +47 -4
  738. package/dist/unstable/cluster/ShardId.js.map +1 -1
  739. package/dist/unstable/cluster/Sharding.d.ts +10 -2
  740. package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
  741. package/dist/unstable/cluster/Sharding.js +35 -4
  742. package/dist/unstable/cluster/Sharding.js.map +1 -1
  743. package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
  744. package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
  745. package/dist/unstable/cluster/ShardingConfig.js +66 -9
  746. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  747. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
  748. package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
  749. package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
  750. package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
  751. package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
  752. package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
  753. package/dist/unstable/cluster/SingleRunner.js +23 -1
  754. package/dist/unstable/cluster/SingleRunner.js.map +1 -1
  755. package/dist/unstable/cluster/Singleton.d.ts +15 -1
  756. package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
  757. package/dist/unstable/cluster/Singleton.js +15 -1
  758. package/dist/unstable/cluster/Singleton.js.map +1 -1
  759. package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
  760. package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
  761. package/dist/unstable/cluster/SingletonAddress.js +21 -1
  762. package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
  763. package/dist/unstable/cluster/Snowflake.d.ts +89 -19
  764. package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
  765. package/dist/unstable/cluster/Snowflake.js +48 -13
  766. package/dist/unstable/cluster/Snowflake.js.map +1 -1
  767. package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
  768. package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
  769. package/dist/unstable/cluster/SocketRunner.js +29 -2
  770. package/dist/unstable/cluster/SocketRunner.js.map +1 -1
  771. package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
  772. package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
  773. package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
  774. package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
  775. package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
  776. package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
  777. package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
  778. package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
  779. package/dist/unstable/cluster/TestRunner.d.ts +18 -1
  780. package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
  781. package/dist/unstable/cluster/TestRunner.js +18 -1
  782. package/dist/unstable/cluster/TestRunner.js.map +1 -1
  783. package/dist/unstable/cluster/internal/hash.js +12 -0
  784. package/dist/unstable/cluster/internal/hash.js.map +1 -1
  785. package/dist/unstable/devtools/DevTools.d.ts +26 -3
  786. package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
  787. package/dist/unstable/devtools/DevTools.js +26 -3
  788. package/dist/unstable/devtools/DevTools.js.map +1 -1
  789. package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
  790. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  791. package/dist/unstable/devtools/DevToolsClient.js +32 -5
  792. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  793. package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
  794. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  795. package/dist/unstable/devtools/DevToolsSchema.js +102 -20
  796. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  797. package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
  798. package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
  799. package/dist/unstable/devtools/DevToolsServer.js +21 -1
  800. package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
  801. package/dist/unstable/encoding/Msgpack.d.ts +81 -12
  802. package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
  803. package/dist/unstable/encoding/Msgpack.js +75 -9
  804. package/dist/unstable/encoding/Msgpack.js.map +1 -1
  805. package/dist/unstable/encoding/Ndjson.d.ts +149 -21
  806. package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
  807. package/dist/unstable/encoding/Ndjson.js +97 -13
  808. package/dist/unstable/encoding/Ndjson.js.map +1 -1
  809. package/dist/unstable/encoding/Sse.d.ts +109 -18
  810. package/dist/unstable/encoding/Sse.d.ts.map +1 -1
  811. package/dist/unstable/encoding/Sse.js +69 -13
  812. package/dist/unstable/encoding/Sse.js.map +1 -1
  813. package/dist/unstable/eventlog/Event.d.ts +115 -30
  814. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  815. package/dist/unstable/eventlog/Event.js +22 -2
  816. package/dist/unstable/eventlog/Event.js.map +1 -1
  817. package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
  818. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  819. package/dist/unstable/eventlog/EventGroup.js +24 -6
  820. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  821. package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
  822. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  823. package/dist/unstable/eventlog/EventJournal.js +108 -16
  824. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  825. package/dist/unstable/eventlog/EventLog.d.ts +151 -31
  826. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  827. package/dist/unstable/eventlog/EventLog.js +111 -20
  828. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  829. package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
  830. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  831. package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
  832. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  833. package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
  834. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
  835. package/dist/unstable/eventlog/EventLogMessage.js +72 -16
  836. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
  837. package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
  838. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  839. package/dist/unstable/eventlog/EventLogRemote.js +54 -8
  840. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  841. package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
  842. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  843. package/dist/unstable/eventlog/EventLogServer.js +17 -3
  844. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  845. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
  846. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
  847. package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
  848. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
  849. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
  850. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
  851. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
  852. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
  853. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
  854. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
  855. package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
  856. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
  857. package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
  858. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
  859. package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
  860. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
  861. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
  862. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
  863. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
  864. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
  865. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
  866. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
  867. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
  868. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
  869. package/dist/unstable/http/Cookies.d.ts +156 -77
  870. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  871. package/dist/unstable/http/Cookies.js +93 -39
  872. package/dist/unstable/http/Cookies.js.map +1 -1
  873. package/dist/unstable/http/Etag.d.ts +40 -7
  874. package/dist/unstable/http/Etag.d.ts.map +1 -1
  875. package/dist/unstable/http/Etag.js +27 -4
  876. package/dist/unstable/http/Etag.js.map +1 -1
  877. package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
  878. package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
  879. package/dist/unstable/http/FetchHttpClient.js +33 -4
  880. package/dist/unstable/http/FetchHttpClient.js.map +1 -1
  881. package/dist/unstable/http/FindMyWay.d.ts +1 -1
  882. package/dist/unstable/http/FindMyWay.js +1 -1
  883. package/dist/unstable/http/Headers.d.ts +182 -36
  884. package/dist/unstable/http/Headers.d.ts.map +1 -1
  885. package/dist/unstable/http/Headers.js +86 -16
  886. package/dist/unstable/http/Headers.js.map +1 -1
  887. package/dist/unstable/http/HttpBody.d.ts +114 -26
  888. package/dist/unstable/http/HttpBody.d.ts.map +1 -1
  889. package/dist/unstable/http/HttpBody.js +98 -20
  890. package/dist/unstable/http/HttpBody.js.map +1 -1
  891. package/dist/unstable/http/HttpClient.d.ts +205 -96
  892. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  893. package/dist/unstable/http/HttpClient.js +84 -38
  894. package/dist/unstable/http/HttpClient.js.map +1 -1
  895. package/dist/unstable/http/HttpClientError.d.ts +68 -12
  896. package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
  897. package/dist/unstable/http/HttpClientError.js +71 -9
  898. package/dist/unstable/http/HttpClientError.js.map +1 -1
  899. package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
  900. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  901. package/dist/unstable/http/HttpClientRequest.js +151 -45
  902. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  903. package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
  904. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  905. package/dist/unstable/http/HttpClientResponse.js +44 -11
  906. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  907. package/dist/unstable/http/HttpEffect.d.ts +42 -16
  908. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  909. package/dist/unstable/http/HttpEffect.js +33 -13
  910. package/dist/unstable/http/HttpEffect.js.map +1 -1
  911. package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
  912. package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
  913. package/dist/unstable/http/HttpIncomingMessage.js +44 -6
  914. package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
  915. package/dist/unstable/http/HttpMethod.d.ts +35 -5
  916. package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
  917. package/dist/unstable/http/HttpMethod.js +23 -1
  918. package/dist/unstable/http/HttpMethod.js.map +1 -1
  919. package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
  920. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  921. package/dist/unstable/http/HttpMiddleware.js +52 -10
  922. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  923. package/dist/unstable/http/HttpPlatform.d.ts +34 -3
  924. package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
  925. package/dist/unstable/http/HttpPlatform.js +34 -3
  926. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  927. package/dist/unstable/http/HttpRouter.d.ts +194 -45
  928. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  929. package/dist/unstable/http/HttpRouter.js +118 -24
  930. package/dist/unstable/http/HttpRouter.js.map +1 -1
  931. package/dist/unstable/http/HttpServer.d.ts +151 -22
  932. package/dist/unstable/http/HttpServer.d.ts.map +1 -1
  933. package/dist/unstable/http/HttpServer.js +76 -11
  934. package/dist/unstable/http/HttpServer.js.map +1 -1
  935. package/dist/unstable/http/HttpServerError.d.ts +90 -10
  936. package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
  937. package/dist/unstable/http/HttpServerError.js +82 -8
  938. package/dist/unstable/http/HttpServerError.js.map +1 -1
  939. package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
  940. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  941. package/dist/unstable/http/HttpServerRequest.js +101 -20
  942. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  943. package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
  944. package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
  945. package/dist/unstable/http/HttpServerRespondable.js +43 -5
  946. package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
  947. package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
  948. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  949. package/dist/unstable/http/HttpServerResponse.js +204 -33
  950. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  951. package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
  952. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
  953. package/dist/unstable/http/HttpStaticServer.js +22 -4
  954. package/dist/unstable/http/HttpStaticServer.js.map +1 -1
  955. package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
  956. package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
  957. package/dist/unstable/http/HttpTraceContext.js +47 -5
  958. package/dist/unstable/http/HttpTraceContext.js.map +1 -1
  959. package/dist/unstable/http/Multipart.d.ts +178 -28
  960. package/dist/unstable/http/Multipart.d.ts.map +1 -1
  961. package/dist/unstable/http/Multipart.js +129 -19
  962. package/dist/unstable/http/Multipart.js.map +1 -1
  963. package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
  964. package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
  965. package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
  966. package/dist/unstable/http/Multipasta/Node.js +1 -1
  967. package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
  968. package/dist/unstable/http/Multipasta/Search.js +1 -1
  969. package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
  970. package/dist/unstable/http/Multipasta/Web.js +1 -1
  971. package/dist/unstable/http/Multipasta.d.ts +1 -1
  972. package/dist/unstable/http/Multipasta.js +1 -1
  973. package/dist/unstable/http/Template.d.ts +53 -0
  974. package/dist/unstable/http/Template.d.ts.map +1 -1
  975. package/dist/unstable/http/Template.js +26 -0
  976. package/dist/unstable/http/Template.js.map +1 -1
  977. package/dist/unstable/http/Url.d.ts +56 -42
  978. package/dist/unstable/http/Url.d.ts.map +1 -1
  979. package/dist/unstable/http/Url.js +29 -15
  980. package/dist/unstable/http/Url.js.map +1 -1
  981. package/dist/unstable/http/UrlParams.d.ts +233 -49
  982. package/dist/unstable/http/UrlParams.d.ts.map +1 -1
  983. package/dist/unstable/http/UrlParams.js +116 -23
  984. package/dist/unstable/http/UrlParams.js.map +1 -1
  985. package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
  986. package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
  987. package/dist/unstable/httpapi/HttpApi.js +14 -8
  988. package/dist/unstable/httpapi/HttpApi.js.map +1 -1
  989. package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
  990. package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
  991. package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
  992. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  993. package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
  994. package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
  995. package/dist/unstable/httpapi/HttpApiClient.js +42 -6
  996. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  997. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
  998. package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
  999. package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
  1000. package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
  1001. package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
  1002. package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
  1003. package/dist/unstable/httpapi/HttpApiError.js +98 -1
  1004. package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
  1005. package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
  1006. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  1007. package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
  1008. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  1009. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +111 -22
  1010. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  1011. package/dist/unstable/httpapi/HttpApiMiddleware.js +47 -5
  1012. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  1013. package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
  1014. package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
  1015. package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
  1016. package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
  1017. package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
  1018. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  1019. package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
  1020. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  1021. package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
  1022. package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
  1023. package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
  1024. package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
  1025. package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
  1026. package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
  1027. package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
  1028. package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
  1029. package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
  1030. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  1031. package/dist/unstable/httpapi/HttpApiTest.js +26 -1
  1032. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  1033. package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
  1034. package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
  1035. package/dist/unstable/httpapi/OpenApi.js +73 -15
  1036. package/dist/unstable/httpapi/OpenApi.js.map +1 -1
  1037. package/dist/unstable/observability/Otlp.d.ts +33 -3
  1038. package/dist/unstable/observability/Otlp.d.ts.map +1 -1
  1039. package/dist/unstable/observability/Otlp.js +14 -3
  1040. package/dist/unstable/observability/Otlp.js.map +1 -1
  1041. package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
  1042. package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
  1043. package/dist/unstable/observability/OtlpExporter.js +32 -1
  1044. package/dist/unstable/observability/OtlpExporter.js.map +1 -1
  1045. package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
  1046. package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
  1047. package/dist/unstable/observability/OtlpLogger.js +29 -2
  1048. package/dist/unstable/observability/OtlpLogger.js.map +1 -1
  1049. package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
  1050. package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
  1051. package/dist/unstable/observability/OtlpMetrics.js +32 -2
  1052. package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
  1053. package/dist/unstable/observability/OtlpResource.d.ts +49 -12
  1054. package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
  1055. package/dist/unstable/observability/OtlpResource.js +47 -5
  1056. package/dist/unstable/observability/OtlpResource.js.map +1 -1
  1057. package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
  1058. package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
  1059. package/dist/unstable/observability/OtlpSerialization.js +28 -3
  1060. package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
  1061. package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
  1062. package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
  1063. package/dist/unstable/observability/OtlpTracer.js +32 -2
  1064. package/dist/unstable/observability/OtlpTracer.js.map +1 -1
  1065. package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
  1066. package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
  1067. package/dist/unstable/observability/PrometheusMetrics.js +7 -5
  1068. package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
  1069. package/dist/unstable/observability/index.d.ts +2 -1
  1070. package/dist/unstable/observability/index.d.ts.map +1 -1
  1071. package/dist/unstable/observability/index.js +2 -1
  1072. package/dist/unstable/observability/index.js.map +1 -1
  1073. package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
  1074. package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
  1075. package/dist/unstable/persistence/KeyValueStore.js +81 -21
  1076. package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
  1077. package/dist/unstable/persistence/Persistable.d.ts +76 -15
  1078. package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
  1079. package/dist/unstable/persistence/Persistable.js +22 -5
  1080. package/dist/unstable/persistence/Persistable.js.map +1 -1
  1081. package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
  1082. package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
  1083. package/dist/unstable/persistence/PersistedCache.js +24 -1
  1084. package/dist/unstable/persistence/PersistedCache.js.map +1 -1
  1085. package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
  1086. package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
  1087. package/dist/unstable/persistence/PersistedQueue.js +60 -13
  1088. package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
  1089. package/dist/unstable/persistence/Persistence.d.ts +97 -16
  1090. package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
  1091. package/dist/unstable/persistence/Persistence.js +90 -14
  1092. package/dist/unstable/persistence/Persistence.js.map +1 -1
  1093. package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
  1094. package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
  1095. package/dist/unstable/persistence/RateLimiter.js +81 -16
  1096. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  1097. package/dist/unstable/persistence/Redis.d.ts +26 -5
  1098. package/dist/unstable/persistence/Redis.d.ts.map +1 -1
  1099. package/dist/unstable/persistence/Redis.js +36 -4
  1100. package/dist/unstable/persistence/Redis.js.map +1 -1
  1101. package/dist/unstable/process/ChildProcess.d.ts +87 -64
  1102. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  1103. package/dist/unstable/process/ChildProcess.js +24 -17
  1104. package/dist/unstable/process/ChildProcess.js.map +1 -1
  1105. package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
  1106. package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
  1107. package/dist/unstable/process/ChildProcessSpawner.js +11 -6
  1108. package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
  1109. package/dist/unstable/process/index.d.ts +2 -1
  1110. package/dist/unstable/process/index.d.ts.map +1 -1
  1111. package/dist/unstable/process/index.js +2 -1
  1112. package/dist/unstable/process/index.js.map +1 -1
  1113. package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
  1114. package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
  1115. package/dist/unstable/reactivity/AsyncResult.js +121 -36
  1116. package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
  1117. package/dist/unstable/reactivity/Atom.d.ts +539 -130
  1118. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  1119. package/dist/unstable/reactivity/Atom.js +252 -58
  1120. package/dist/unstable/reactivity/Atom.js.map +1 -1
  1121. package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
  1122. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  1123. package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
  1124. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  1125. package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
  1126. package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
  1127. package/dist/unstable/reactivity/AtomRef.js +29 -3
  1128. package/dist/unstable/reactivity/AtomRef.js.map +1 -1
  1129. package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
  1130. package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
  1131. package/dist/unstable/reactivity/AtomRegistry.js +69 -10
  1132. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  1133. package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
  1134. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  1135. package/dist/unstable/reactivity/AtomRpc.js +29 -1
  1136. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  1137. package/dist/unstable/reactivity/Hydration.d.ts +28 -5
  1138. package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
  1139. package/dist/unstable/reactivity/Hydration.js +35 -3
  1140. package/dist/unstable/reactivity/Hydration.js.map +1 -1
  1141. package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
  1142. package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
  1143. package/dist/unstable/reactivity/Reactivity.js +61 -7
  1144. package/dist/unstable/reactivity/Reactivity.js.map +1 -1
  1145. package/dist/unstable/rpc/Rpc.d.ts +255 -56
  1146. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  1147. package/dist/unstable/rpc/Rpc.js +44 -11
  1148. package/dist/unstable/rpc/Rpc.js.map +1 -1
  1149. package/dist/unstable/rpc/RpcClient.d.ts +81 -19
  1150. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  1151. package/dist/unstable/rpc/RpcClient.js +52 -12
  1152. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  1153. package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
  1154. package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
  1155. package/dist/unstable/rpc/RpcClientError.js +26 -2
  1156. package/dist/unstable/rpc/RpcClientError.js.map +1 -1
  1157. package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
  1158. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  1159. package/dist/unstable/rpc/RpcGroup.js +3 -1
  1160. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  1161. package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
  1162. package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
  1163. package/dist/unstable/rpc/RpcMessage.js +23 -7
  1164. package/dist/unstable/rpc/RpcMessage.js.map +1 -1
  1165. package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
  1166. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  1167. package/dist/unstable/rpc/RpcMiddleware.js +39 -3
  1168. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  1169. package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
  1170. package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
  1171. package/dist/unstable/rpc/RpcSchema.js +34 -3
  1172. package/dist/unstable/rpc/RpcSchema.js.map +1 -1
  1173. package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
  1174. package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
  1175. package/dist/unstable/rpc/RpcSerialization.js +56 -12
  1176. package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
  1177. package/dist/unstable/rpc/RpcServer.d.ts +73 -23
  1178. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  1179. package/dist/unstable/rpc/RpcServer.js +69 -22
  1180. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  1181. package/dist/unstable/rpc/RpcTest.d.ts +20 -1
  1182. package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
  1183. package/dist/unstable/rpc/RpcTest.js +20 -1
  1184. package/dist/unstable/rpc/RpcTest.js.map +1 -1
  1185. package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
  1186. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  1187. package/dist/unstable/rpc/RpcWorker.js +16 -4
  1188. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  1189. package/dist/unstable/rpc/Utils.d.ts +8 -0
  1190. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  1191. package/dist/unstable/rpc/Utils.js +8 -0
  1192. package/dist/unstable/rpc/Utils.js.map +1 -1
  1193. package/dist/unstable/schema/Model.d.ts +130 -52
  1194. package/dist/unstable/schema/Model.d.ts.map +1 -1
  1195. package/dist/unstable/schema/Model.js +79 -34
  1196. package/dist/unstable/schema/Model.js.map +1 -1
  1197. package/dist/unstable/schema/VariantSchema.d.ts +104 -24
  1198. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  1199. package/dist/unstable/schema/VariantSchema.js +22 -6
  1200. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  1201. package/dist/unstable/socket/Socket.d.ts +167 -34
  1202. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  1203. package/dist/unstable/socket/Socket.js +123 -28
  1204. package/dist/unstable/socket/Socket.js.map +1 -1
  1205. package/dist/unstable/socket/SocketServer.d.ts +58 -10
  1206. package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
  1207. package/dist/unstable/socket/SocketServer.js +43 -5
  1208. package/dist/unstable/socket/SocketServer.js.map +1 -1
  1209. package/dist/unstable/sql/Migrator.d.ts +35 -4
  1210. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  1211. package/dist/unstable/sql/Migrator.js +44 -4
  1212. package/dist/unstable/sql/Migrator.js.map +1 -1
  1213. package/dist/unstable/sql/SqlClient.d.ts +34 -2
  1214. package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
  1215. package/dist/unstable/sql/SqlClient.js +38 -1
  1216. package/dist/unstable/sql/SqlClient.js.map +1 -1
  1217. package/dist/unstable/sql/SqlConnection.d.ts +31 -0
  1218. package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
  1219. package/dist/unstable/sql/SqlConnection.js +22 -0
  1220. package/dist/unstable/sql/SqlConnection.js.map +1 -1
  1221. package/dist/unstable/sql/SqlError.d.ts +99 -0
  1222. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  1223. package/dist/unstable/sql/SqlError.js +114 -0
  1224. package/dist/unstable/sql/SqlError.js.map +1 -1
  1225. package/dist/unstable/sql/SqlModel.d.ts +26 -5
  1226. package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
  1227. package/dist/unstable/sql/SqlModel.js +8 -4
  1228. package/dist/unstable/sql/SqlModel.js.map +1 -1
  1229. package/dist/unstable/sql/SqlResolver.d.ts +56 -13
  1230. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  1231. package/dist/unstable/sql/SqlResolver.js +44 -10
  1232. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  1233. package/dist/unstable/sql/SqlSchema.d.ts +29 -8
  1234. package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
  1235. package/dist/unstable/sql/SqlSchema.js +29 -8
  1236. package/dist/unstable/sql/SqlSchema.js.map +1 -1
  1237. package/dist/unstable/sql/SqlStream.d.ts +3 -0
  1238. package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
  1239. package/dist/unstable/sql/SqlStream.js +23 -0
  1240. package/dist/unstable/sql/SqlStream.js.map +1 -1
  1241. package/dist/unstable/sql/Statement.d.ts +124 -0
  1242. package/dist/unstable/sql/Statement.d.ts.map +1 -1
  1243. package/dist/unstable/sql/Statement.js +82 -0
  1244. package/dist/unstable/sql/Statement.js.map +1 -1
  1245. package/dist/unstable/sql/index.d.ts +1 -1
  1246. package/dist/unstable/sql/index.js +1 -1
  1247. package/dist/unstable/workers/Transferable.d.ts +65 -13
  1248. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  1249. package/dist/unstable/workers/Transferable.js +53 -10
  1250. package/dist/unstable/workers/Transferable.js.map +1 -1
  1251. package/dist/unstable/workers/Worker.d.ts +60 -8
  1252. package/dist/unstable/workers/Worker.d.ts.map +1 -1
  1253. package/dist/unstable/workers/Worker.js +43 -4
  1254. package/dist/unstable/workers/Worker.js.map +1 -1
  1255. package/dist/unstable/workers/WorkerError.d.ts +31 -9
  1256. package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
  1257. package/dist/unstable/workers/WorkerError.js +44 -7
  1258. package/dist/unstable/workers/WorkerError.js.map +1 -1
  1259. package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
  1260. package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
  1261. package/dist/unstable/workers/WorkerRunner.js +24 -1
  1262. package/dist/unstable/workers/WorkerRunner.js.map +1 -1
  1263. package/dist/unstable/workers/index.d.ts +1 -1
  1264. package/dist/unstable/workers/index.js +1 -1
  1265. package/dist/unstable/workflow/Activity.d.ts +61 -10
  1266. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  1267. package/dist/unstable/workflow/Activity.js +20 -5
  1268. package/dist/unstable/workflow/Activity.js.map +1 -1
  1269. package/dist/unstable/workflow/DurableClock.d.ts +12 -3
  1270. package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
  1271. package/dist/unstable/workflow/DurableClock.js +22 -2
  1272. package/dist/unstable/workflow/DurableClock.js.map +1 -1
  1273. package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
  1274. package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
  1275. package/dist/unstable/workflow/DurableDeferred.js +76 -13
  1276. package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
  1277. package/dist/unstable/workflow/DurableQueue.d.ts +30 -7
  1278. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
  1279. package/dist/unstable/workflow/DurableQueue.js +23 -5
  1280. package/dist/unstable/workflow/DurableQueue.js.map +1 -1
  1281. package/dist/unstable/workflow/Workflow.d.ts +100 -31
  1282. package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
  1283. package/dist/unstable/workflow/Workflow.js +75 -19
  1284. package/dist/unstable/workflow/Workflow.js.map +1 -1
  1285. package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
  1286. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  1287. package/dist/unstable/workflow/WorkflowEngine.js +16 -4
  1288. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  1289. package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
  1290. package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
  1291. package/dist/unstable/workflow/WorkflowProxy.js +2 -2
  1292. package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
  1293. package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
  1294. package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
  1295. package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
  1296. package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
  1297. package/package.json +11 -11
  1298. package/src/Array.ts +113 -67
  1299. package/src/BigDecimal.ts +404 -337
  1300. package/src/BigInt.ts +167 -97
  1301. package/src/Boolean.ts +62 -31
  1302. package/src/Brand.ts +20 -1
  1303. package/src/Cache.ts +331 -164
  1304. package/src/Cause.ts +74 -62
  1305. package/src/Channel.ts +1585 -607
  1306. package/src/ChannelSchema.ts +137 -12
  1307. package/src/Chunk.ts +549 -380
  1308. package/src/Clock.ts +15 -8
  1309. package/src/Combiner.ts +2 -4
  1310. package/src/Config.ts +4 -2
  1311. package/src/ConfigProvider.ts +1 -1
  1312. package/src/Console.ts +88 -58
  1313. package/src/Context.ts +384 -135
  1314. package/src/Cron.ts +111 -48
  1315. package/src/Data.ts +3 -2
  1316. package/src/DateTime.ts +874 -443
  1317. package/src/Deferred.ts +367 -174
  1318. package/src/Differ.ts +42 -0
  1319. package/src/Duration.ts +329 -185
  1320. package/src/Effect.ts +2127 -1957
  1321. package/src/Effectable.ts +37 -2
  1322. package/src/Encoding.ts +78 -28
  1323. package/src/Equivalence.ts +14 -19
  1324. package/src/ErrorReporter.ts +66 -82
  1325. package/src/ExecutionPlan.ts +94 -9
  1326. package/src/Exit.ts +7 -5
  1327. package/src/Fiber.ts +72 -40
  1328. package/src/FiberHandle.ts +156 -56
  1329. package/src/FiberMap.ts +327 -162
  1330. package/src/FiberSet.ts +129 -51
  1331. package/src/FileSystem.ts +106 -74
  1332. package/src/Filter.ts +166 -88
  1333. package/src/Function.ts +154 -86
  1334. package/src/Graph.ts +682 -365
  1335. package/src/HKT.ts +29 -13
  1336. package/src/Hash.ts +31 -18
  1337. package/src/HashMap.ts +444 -256
  1338. package/src/HashRing.ts +94 -17
  1339. package/src/HashSet.ts +194 -104
  1340. package/src/Inspectable.ts +22 -10
  1341. package/src/Iterable.ts +309 -149
  1342. package/src/JsonPatch.ts +4 -3
  1343. package/src/Latch.ts +98 -15
  1344. package/src/Layer.ts +487 -344
  1345. package/src/LayerMap.ts +95 -21
  1346. package/src/LogLevel.ts +92 -131
  1347. package/src/Logger.ts +357 -288
  1348. package/src/ManagedRuntime.ts +75 -17
  1349. package/src/Match.ts +133 -157
  1350. package/src/Metric.ts +355 -304
  1351. package/src/MutableHashMap.ts +161 -84
  1352. package/src/MutableHashSet.ts +122 -52
  1353. package/src/MutableList.ts +141 -81
  1354. package/src/MutableRef.ts +130 -90
  1355. package/src/Newtype.ts +3 -0
  1356. package/src/NonEmptyIterable.ts +36 -39
  1357. package/src/Number.ts +116 -64
  1358. package/src/Optic.ts +1 -2
  1359. package/src/Option.ts +28 -47
  1360. package/src/Ordering.ts +43 -28
  1361. package/src/PartitionedSemaphore.ts +225 -40
  1362. package/src/Path.ts +77 -13
  1363. package/src/Pipeable.ts +76 -21
  1364. package/src/PlatformError.ts +74 -6
  1365. package/src/Pool.ts +94 -31
  1366. package/src/Predicate.ts +16 -21
  1367. package/src/PrimaryKey.ts +9 -2
  1368. package/src/PubSub.ts +364 -262
  1369. package/src/Pull.ts +94 -25
  1370. package/src/Queue.ts +284 -150
  1371. package/src/Random.ts +54 -35
  1372. package/src/RcMap.ts +151 -141
  1373. package/src/RcRef.ts +69 -32
  1374. package/src/Record.ts +273 -129
  1375. package/src/Redactable.ts +3 -3
  1376. package/src/Redacted.ts +63 -33
  1377. package/src/Ref.ts +161 -104
  1378. package/src/References.ts +73 -31
  1379. package/src/RegExp.ts +11 -5
  1380. package/src/Request.ts +158 -34
  1381. package/src/RequestResolver.ts +277 -119
  1382. package/src/Resource.ts +45 -7
  1383. package/src/Result.ts +18 -16
  1384. package/src/Runtime.ts +45 -19
  1385. package/src/Schedule.ts +574 -599
  1386. package/src/Scheduler.ts +43 -6
  1387. package/src/Schema.ts +819 -295
  1388. package/src/SchemaAST.ts +25 -16
  1389. package/src/SchemaGetter.ts +29 -14
  1390. package/src/SchemaIssue.ts +1 -8
  1391. package/src/SchemaParser.ts +262 -38
  1392. package/src/SchemaTransformation.ts +61 -41
  1393. package/src/SchemaUtils.ts +23 -0
  1394. package/src/Scope.ts +102 -43
  1395. package/src/ScopedCache.ts +192 -56
  1396. package/src/ScopedRef.ts +28 -8
  1397. package/src/Semaphore.ts +64 -28
  1398. package/src/Sink.ts +458 -200
  1399. package/src/Stdio.ts +43 -6
  1400. package/src/Stream.ts +2039 -1252
  1401. package/src/String.ts +171 -95
  1402. package/src/SubscriptionRef.ts +308 -203
  1403. package/src/Symbol.ts +13 -5
  1404. package/src/SynchronizedRef.ts +278 -62
  1405. package/src/Take.ts +26 -2
  1406. package/src/Terminal.ts +40 -7
  1407. package/src/Tracer.ts +229 -55
  1408. package/src/Trie.ts +213 -142
  1409. package/src/TxChunk.ts +182 -146
  1410. package/src/TxDeferred.ts +43 -29
  1411. package/src/TxHashMap.ts +370 -230
  1412. package/src/TxHashSet.ts +250 -152
  1413. package/src/TxPriorityQueue.ts +96 -64
  1414. package/src/TxPubSub.ts +77 -49
  1415. package/src/TxQueue.ts +279 -241
  1416. package/src/TxReentrantLock.ts +70 -47
  1417. package/src/TxRef.ts +69 -40
  1418. package/src/TxSemaphore.ts +101 -54
  1419. package/src/TxSubscriptionRef.ts +72 -48
  1420. package/src/Types.ts +34 -34
  1421. package/src/UndefinedOr.ts +48 -25
  1422. package/src/Unify.ts +71 -116
  1423. package/src/Utils.ts +4 -0
  1424. package/src/index.ts +81 -32
  1425. package/src/internal/schema/schema.ts +1 -1
  1426. package/src/testing/FastCheck.ts +6 -3
  1427. package/src/testing/TestClock.ts +63 -34
  1428. package/src/testing/TestConsole.ts +49 -30
  1429. package/src/testing/TestSchema.ts +8 -8
  1430. package/src/unstable/ai/AiError.ts +187 -120
  1431. package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
  1432. package/src/unstable/ai/Chat.ts +69 -43
  1433. package/src/unstable/ai/EmbeddingModel.ts +12 -11
  1434. package/src/unstable/ai/IdGenerator.ts +28 -18
  1435. package/src/unstable/ai/LanguageModel.ts +35 -27
  1436. package/src/unstable/ai/McpSchema.ts +339 -119
  1437. package/src/unstable/ai/McpServer.ts +76 -19
  1438. package/src/unstable/ai/Model.ts +8 -6
  1439. package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
  1440. package/src/unstable/ai/Prompt.ts +210 -184
  1441. package/src/unstable/ai/Response.ts +159 -147
  1442. package/src/unstable/ai/ResponseIdTracker.ts +43 -4
  1443. package/src/unstable/ai/Telemetry.ts +42 -32
  1444. package/src/unstable/ai/Tokenizer.ts +13 -8
  1445. package/src/unstable/ai/Tool.ts +154 -85
  1446. package/src/unstable/ai/Toolkit.ts +51 -46
  1447. package/src/unstable/ai/index.ts +42 -24
  1448. package/src/unstable/cli/Argument.ts +226 -134
  1449. package/src/unstable/cli/CliError.ts +96 -26
  1450. package/src/unstable/cli/CliOutput.ts +43 -13
  1451. package/src/unstable/cli/Command.ts +194 -113
  1452. package/src/unstable/cli/Completions.ts +7 -7
  1453. package/src/unstable/cli/Flag.ts +235 -142
  1454. package/src/unstable/cli/GlobalFlag.ts +41 -13
  1455. package/src/unstable/cli/HelpDoc.ts +35 -10
  1456. package/src/unstable/cli/Param.ts +327 -189
  1457. package/src/unstable/cli/Primitive.ts +79 -42
  1458. package/src/unstable/cli/Prompt.ts +201 -45
  1459. package/src/unstable/cli/internal/ansi.ts +13 -0
  1460. package/src/unstable/cli/internal/command.ts +5 -1
  1461. package/src/unstable/cli/internal/config.ts +3 -0
  1462. package/src/unstable/cli/internal/lexer.ts +11 -0
  1463. package/src/unstable/cluster/ClusterCron.ts +35 -1
  1464. package/src/unstable/cluster/ClusterError.ts +56 -7
  1465. package/src/unstable/cluster/ClusterMetrics.ts +39 -5
  1466. package/src/unstable/cluster/ClusterSchema.ts +61 -8
  1467. package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
  1468. package/src/unstable/cluster/DeliverAt.ts +39 -4
  1469. package/src/unstable/cluster/Entity.ts +107 -16
  1470. package/src/unstable/cluster/EntityAddress.ts +30 -2
  1471. package/src/unstable/cluster/EntityId.ts +18 -3
  1472. package/src/unstable/cluster/EntityProxy.ts +34 -2
  1473. package/src/unstable/cluster/EntityProxyServer.ts +44 -8
  1474. package/src/unstable/cluster/EntityResource.ts +43 -6
  1475. package/src/unstable/cluster/EntityType.ts +27 -3
  1476. package/src/unstable/cluster/Envelope.ts +128 -23
  1477. package/src/unstable/cluster/HttpRunner.ts +88 -13
  1478. package/src/unstable/cluster/K8sHttpClient.ts +49 -6
  1479. package/src/unstable/cluster/MachineId.ts +24 -3
  1480. package/src/unstable/cluster/Message.ts +102 -13
  1481. package/src/unstable/cluster/MessageStorage.ts +127 -21
  1482. package/src/unstable/cluster/Reply.ts +101 -12
  1483. package/src/unstable/cluster/Runner.ts +47 -17
  1484. package/src/unstable/cluster/RunnerAddress.ts +34 -2
  1485. package/src/unstable/cluster/RunnerHealth.ts +40 -12
  1486. package/src/unstable/cluster/RunnerServer.ts +31 -4
  1487. package/src/unstable/cluster/RunnerStorage.ts +42 -5
  1488. package/src/unstable/cluster/Runners.ts +73 -10
  1489. package/src/unstable/cluster/ShardId.ts +51 -5
  1490. package/src/unstable/cluster/Sharding.ts +35 -4
  1491. package/src/unstable/cluster/ShardingConfig.ts +75 -10
  1492. package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
  1493. package/src/unstable/cluster/SingleRunner.ts +23 -1
  1494. package/src/unstable/cluster/Singleton.ts +15 -1
  1495. package/src/unstable/cluster/SingletonAddress.ts +21 -1
  1496. package/src/unstable/cluster/Snowflake.ts +89 -19
  1497. package/src/unstable/cluster/SocketRunner.ts +29 -2
  1498. package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
  1499. package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
  1500. package/src/unstable/cluster/TestRunner.ts +18 -1
  1501. package/src/unstable/cluster/internal/hash.ts +12 -0
  1502. package/src/unstable/devtools/DevTools.ts +26 -3
  1503. package/src/unstable/devtools/DevToolsClient.ts +32 -5
  1504. package/src/unstable/devtools/DevToolsSchema.ts +201 -44
  1505. package/src/unstable/devtools/DevToolsServer.ts +27 -2
  1506. package/src/unstable/encoding/Msgpack.ts +97 -12
  1507. package/src/unstable/encoding/Ndjson.ts +149 -21
  1508. package/src/unstable/encoding/Sse.ts +109 -18
  1509. package/src/unstable/eventlog/Event.ts +131 -30
  1510. package/src/unstable/eventlog/EventGroup.ts +50 -17
  1511. package/src/unstable/eventlog/EventJournal.ts +120 -20
  1512. package/src/unstable/eventlog/EventLog.ts +151 -31
  1513. package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
  1514. package/src/unstable/eventlog/EventLogMessage.ts +92 -18
  1515. package/src/unstable/eventlog/EventLogRemote.ts +54 -8
  1516. package/src/unstable/eventlog/EventLogServer.ts +33 -3
  1517. package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
  1518. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
  1519. package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
  1520. package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
  1521. package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
  1522. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
  1523. package/src/unstable/http/Cookies.ts +156 -77
  1524. package/src/unstable/http/Etag.ts +40 -7
  1525. package/src/unstable/http/FetchHttpClient.ts +33 -4
  1526. package/src/unstable/http/FindMyWay.ts +1 -1
  1527. package/src/unstable/http/Headers.ts +252 -50
  1528. package/src/unstable/http/HttpBody.ts +128 -26
  1529. package/src/unstable/http/HttpClient.ts +205 -96
  1530. package/src/unstable/http/HttpClientError.ts +80 -12
  1531. package/src/unstable/http/HttpClientRequest.ts +318 -100
  1532. package/src/unstable/http/HttpClientResponse.ts +59 -16
  1533. package/src/unstable/http/HttpEffect.ts +66 -18
  1534. package/src/unstable/http/HttpIncomingMessage.ts +47 -7
  1535. package/src/unstable/http/HttpMethod.ts +35 -5
  1536. package/src/unstable/http/HttpMiddleware.ts +59 -11
  1537. package/src/unstable/http/HttpPlatform.ts +34 -3
  1538. package/src/unstable/http/HttpRouter.ts +217 -52
  1539. package/src/unstable/http/HttpServer.ts +151 -22
  1540. package/src/unstable/http/HttpServerError.ts +90 -10
  1541. package/src/unstable/http/HttpServerRequest.ts +125 -21
  1542. package/src/unstable/http/HttpServerRespondable.ts +49 -6
  1543. package/src/unstable/http/HttpServerResponse.ts +390 -67
  1544. package/src/unstable/http/HttpStaticServer.ts +22 -4
  1545. package/src/unstable/http/HttpTraceContext.ts +53 -6
  1546. package/src/unstable/http/Multipart.ts +178 -28
  1547. package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
  1548. package/src/unstable/http/Multipasta/Node.ts +1 -1
  1549. package/src/unstable/http/Multipasta/Search.ts +1 -1
  1550. package/src/unstable/http/Multipasta/Web.ts +1 -1
  1551. package/src/unstable/http/Multipasta.ts +1 -1
  1552. package/src/unstable/http/Template.ts +53 -0
  1553. package/src/unstable/http/Url.ts +56 -42
  1554. package/src/unstable/http/UrlParams.ts +233 -49
  1555. package/src/unstable/httpapi/HttpApi.ts +49 -14
  1556. package/src/unstable/httpapi/HttpApiBuilder.ts +82 -16
  1557. package/src/unstable/httpapi/HttpApiClient.ts +79 -15
  1558. package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
  1559. package/src/unstable/httpapi/HttpApiError.ts +100 -1
  1560. package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
  1561. package/src/unstable/httpapi/HttpApiMiddleware.ts +111 -22
  1562. package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
  1563. package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
  1564. package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
  1565. package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
  1566. package/src/unstable/httpapi/HttpApiTest.ts +26 -1
  1567. package/src/unstable/httpapi/OpenApi.ts +115 -15
  1568. package/src/unstable/observability/Otlp.ts +33 -3
  1569. package/src/unstable/observability/OtlpExporter.ts +32 -1
  1570. package/src/unstable/observability/OtlpLogger.ts +31 -2
  1571. package/src/unstable/observability/OtlpMetrics.ts +37 -4
  1572. package/src/unstable/observability/OtlpResource.ts +68 -12
  1573. package/src/unstable/observability/OtlpSerialization.ts +28 -3
  1574. package/src/unstable/observability/OtlpTracer.ts +38 -2
  1575. package/src/unstable/observability/PrometheusMetrics.ts +32 -12
  1576. package/src/unstable/observability/index.ts +2 -1
  1577. package/src/unstable/persistence/KeyValueStore.ts +108 -28
  1578. package/src/unstable/persistence/Persistable.ts +76 -15
  1579. package/src/unstable/persistence/PersistedCache.ts +27 -2
  1580. package/src/unstable/persistence/PersistedQueue.ts +98 -16
  1581. package/src/unstable/persistence/Persistence.ts +97 -16
  1582. package/src/unstable/persistence/RateLimiter.ts +97 -21
  1583. package/src/unstable/persistence/Redis.ts +42 -5
  1584. package/src/unstable/process/ChildProcess.ts +89 -65
  1585. package/src/unstable/process/ChildProcessSpawner.ts +22 -11
  1586. package/src/unstable/process/index.ts +2 -1
  1587. package/src/unstable/reactivity/AsyncResult.ts +202 -61
  1588. package/src/unstable/reactivity/Atom.ts +593 -139
  1589. package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
  1590. package/src/unstable/reactivity/AtomRef.ts +51 -7
  1591. package/src/unstable/reactivity/AtomRegistry.ts +141 -22
  1592. package/src/unstable/reactivity/AtomRpc.ts +36 -2
  1593. package/src/unstable/reactivity/Hydration.ts +45 -5
  1594. package/src/unstable/reactivity/Reactivity.ts +95 -13
  1595. package/src/unstable/rpc/Rpc.ts +255 -56
  1596. package/src/unstable/rpc/RpcClient.ts +107 -19
  1597. package/src/unstable/rpc/RpcClientError.ts +26 -2
  1598. package/src/unstable/rpc/RpcGroup.ts +51 -8
  1599. package/src/unstable/rpc/RpcMessage.ts +128 -32
  1600. package/src/unstable/rpc/RpcMiddleware.ts +100 -20
  1601. package/src/unstable/rpc/RpcSchema.ts +38 -4
  1602. package/src/unstable/rpc/RpcSerialization.ts +60 -13
  1603. package/src/unstable/rpc/RpcServer.ts +107 -23
  1604. package/src/unstable/rpc/RpcTest.ts +20 -1
  1605. package/src/unstable/rpc/RpcWorker.ts +40 -6
  1606. package/src/unstable/rpc/Utils.ts +31 -0
  1607. package/src/unstable/schema/Model.ts +148 -52
  1608. package/src/unstable/schema/VariantSchema.ts +104 -24
  1609. package/src/unstable/socket/Socket.ts +167 -34
  1610. package/src/unstable/socket/SocketServer.ts +58 -10
  1611. package/src/unstable/sql/Migrator.ts +56 -4
  1612. package/src/unstable/sql/SqlClient.ts +55 -2
  1613. package/src/unstable/sql/SqlConnection.ts +31 -0
  1614. package/src/unstable/sql/SqlError.ts +117 -0
  1615. package/src/unstable/sql/SqlModel.ts +26 -5
  1616. package/src/unstable/sql/SqlResolver.ts +56 -13
  1617. package/src/unstable/sql/SqlSchema.ts +29 -8
  1618. package/src/unstable/sql/SqlStream.ts +23 -0
  1619. package/src/unstable/sql/Statement.ts +141 -0
  1620. package/src/unstable/sql/index.ts +1 -1
  1621. package/src/unstable/workers/Transferable.ts +65 -13
  1622. package/src/unstable/workers/Worker.ts +60 -8
  1623. package/src/unstable/workers/WorkerError.ts +50 -9
  1624. package/src/unstable/workers/WorkerRunner.ts +32 -3
  1625. package/src/unstable/workers/index.ts +1 -1
  1626. package/src/unstable/workflow/Activity.ts +61 -10
  1627. package/src/unstable/workflow/DurableClock.ts +26 -3
  1628. package/src/unstable/workflow/DurableDeferred.ts +146 -31
  1629. package/src/unstable/workflow/DurableQueue.ts +30 -7
  1630. package/src/unstable/workflow/Workflow.ts +121 -31
  1631. package/src/unstable/workflow/WorkflowEngine.ts +40 -5
  1632. package/src/unstable/workflow/WorkflowProxy.ts +32 -2
  1633. package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
package/src/Chunk.ts CHANGED
@@ -28,7 +28,8 @@
28
28
  * - **Iteration**: O(n)
29
29
  * - **Memory**: Structural sharing minimizes allocation
30
30
  *
31
- * @example
31
+ * **Example** (Creating and combining chunks)
32
+ *
32
33
  * ```ts
33
34
  * import { Chunk } from "effect"
34
35
  *
@@ -42,7 +43,8 @@
42
43
  * console.log(Chunk.toReadonlyArray(combined)) // [1, 2, 3, 4, 5, 6]
43
44
  * ```
44
45
  *
45
- * @example
46
+ * **Example** (Transforming chunks)
47
+ *
46
48
  * ```ts
47
49
  * import { Chunk } from "effect"
48
50
  *
@@ -53,17 +55,17 @@
53
55
  * const sum = Chunk.reduce(evens, 0, (acc, n) => acc + n) // 12
54
56
  * ```
55
57
  *
56
- * @example
58
+ * **Example** (Processing chunks with Effect)
59
+ *
57
60
  * ```ts
58
61
  * import { Chunk, Effect } from "effect"
59
62
  *
60
63
  * // Working with Effects
61
- * const processChunk = (chunk: Chunk.Chunk<number>) =>
62
- * Effect.gen(function*() {
63
- * const mapped = Chunk.map(chunk, (n) => n * 2)
64
- * const filtered = Chunk.filter(mapped, (n) => n > 5)
65
- * return Chunk.toReadonlyArray(filtered)
66
- * })
64
+ * const processChunk = Effect.fnUntraced(function*(chunk: Chunk.Chunk<number>) {
65
+ * const mapped = Chunk.map(chunk, (n) => n * 2)
66
+ * const filtered = Chunk.filter(mapped, (n) => n > 5)
67
+ * return Chunk.toReadonlyArray(filtered)
68
+ * })
67
69
  * ```
68
70
  *
69
71
  * @since 2.0.0
@@ -94,7 +96,8 @@ const TypeId = "~effect/collections/Chunk"
94
96
  /**
95
97
  * A Chunk is an immutable, ordered collection optimized for efficient concatenation and access patterns.
96
98
  *
97
- * @example
99
+ * **Example** (Inspecting chunk values)
100
+ *
98
101
  * ```ts
99
102
  * import { Chunk } from "effect"
100
103
  *
@@ -120,7 +123,8 @@ export interface Chunk<out A> extends Iterable<A>, Equal.Equal, Pipeable, Inspec
120
123
  /**
121
124
  * A non-empty Chunk guaranteed to contain at least one element.
122
125
  *
123
- * @example
126
+ * **Example** (Working with non-empty chunks)
127
+ *
124
128
  * ```ts
125
129
  * import { Chunk } from "effect"
126
130
  *
@@ -137,7 +141,8 @@ export interface NonEmptyChunk<out A> extends Chunk<A>, NonEmptyIterable<A> {}
137
141
  /**
138
142
  * Type lambda for Chunk, used for higher-kinded type operations.
139
143
  *
140
- * @example
144
+ * **Example** (Applying the Chunk type lambda)
145
+ *
141
146
  * ```ts
142
147
  * import type { ChunkTypeLambda } from "effect/Chunk"
143
148
  * import type { Kind } from "effect/HKT"
@@ -204,9 +209,11 @@ function copy<A>(
204
209
  const emptyArray: ReadonlyArray<never> = []
205
210
 
206
211
  /**
207
- * Compares the two chunks of equal length using the specified function
212
+ * Creates an `Equivalence` for chunks that compares chunk lengths and then
213
+ * compares corresponding elements with the provided element equivalence.
214
+ *
215
+ * **Example** (Comparing chunks for equivalence)
208
216
  *
209
- * @example
210
217
  * ```ts
211
218
  * import { Chunk } from "effect"
212
219
  * import * as Equivalence from "effect/Equivalence"
@@ -316,7 +323,8 @@ const makeChunk = <A>(backing: Backing<A>): Chunk<A> => {
316
323
  /**
317
324
  * Checks if `u` is a `Chunk<unknown>`
318
325
  *
319
- * @example
326
+ * **Example** (Checking for chunks)
327
+ *
320
328
  * ```ts
321
329
  * import { Chunk } from "effect"
322
330
  *
@@ -335,7 +343,8 @@ export const isChunk: {
335
343
  /**
336
344
  * Checks if `u` is a `Chunk<unknown>`
337
345
  *
338
- * @example
346
+ * **Example** (Checking for chunks)
347
+ *
339
348
  * ```ts
340
349
  * import { Chunk } from "effect"
341
350
  *
@@ -354,7 +363,8 @@ export const isChunk: {
354
363
  /**
355
364
  * Checks if `u` is a `Chunk<unknown>`
356
365
  *
357
- * @example
366
+ * **Example** (Checking for chunks)
367
+ *
358
368
  * ```ts
359
369
  * import { Chunk } from "effect"
360
370
  *
@@ -377,7 +387,8 @@ const _empty = makeChunk<never>({ _tag: "IEmpty" })
377
387
  /**
378
388
  * Creates an empty `Chunk`.
379
389
  *
380
- * @example
390
+ * **Example** (Creating an empty chunk)
391
+ *
381
392
  * ```ts
382
393
  * import { Chunk } from "effect"
383
394
  *
@@ -393,13 +404,13 @@ export const empty: <A = never>() => Chunk<A> = () => _empty
393
404
  /**
394
405
  * Builds a `NonEmptyChunk` from an non-empty collection of elements.
395
406
  *
396
- * @example
407
+ * **Example** (Creating a non-empty chunk)
408
+ *
397
409
  * ```ts
398
410
  * import { Chunk } from "effect"
399
411
  *
400
412
  * const chunk = Chunk.make(1, 2, 3, 4)
401
- * console.log(chunk)
402
- * // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
413
+ * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4]
403
414
  * ```
404
415
  *
405
416
  * @category constructors
@@ -411,13 +422,13 @@ export const make = <As extends readonly [any, ...Array<any>]>(...as: As): NonEm
411
422
  /**
412
423
  * Builds a `NonEmptyChunk` from a single element.
413
424
  *
414
- * @example
425
+ * **Example** (Creating a single-element chunk)
426
+ *
415
427
  * ```ts
416
428
  * import { Chunk } from "effect"
417
429
  *
418
430
  * const chunk = Chunk.of("hello")
419
- * console.log(chunk)
420
- * // { _id: 'Chunk', values: [ "hello" ] }
431
+ * console.log(Chunk.toArray(chunk)) // ["hello"]
421
432
  * ```
422
433
  *
423
434
  * @category constructors
@@ -428,13 +439,13 @@ export const of = <A>(a: A): NonEmptyChunk<A> => makeChunk({ _tag: "ISingleton",
428
439
  /**
429
440
  * Creates a new `Chunk` from an iterable collection of values.
430
441
  *
431
- * @example
442
+ * **Example** (Creating chunks from iterables)
443
+ *
432
444
  * ```ts
433
445
  * import { Chunk } from "effect"
434
446
  *
435
447
  * const chunk = Chunk.fromIterable([1, 2, 3])
436
- * console.log(chunk)
437
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
448
+ * console.log(Chunk.toArray(chunk)) // [1, 2, 3]
438
449
  * ```
439
450
  *
440
451
  * @category constructors
@@ -478,7 +489,8 @@ const toArray_ = <A>(self: Chunk<A>): Array<A> => toReadonlyArray(self).slice()
478
489
  * (`NonEmptyChunk`), the function will return a `NonEmptyArray`, ensuring the
479
490
  * non-empty property is preserved.
480
491
  *
481
- * @example
492
+ * **Example** (Converting chunks to mutable arrays)
493
+ *
482
494
  * ```ts
483
495
  * import { Chunk } from "effect"
484
496
  *
@@ -527,7 +539,8 @@ const toReadonlyArray_ = <A>(self: Chunk<A>): ReadonlyArray<A> => {
527
539
  * non-empty (`NonEmptyChunk`), the function will return a
528
540
  * `NonEmptyReadonlyArray`, ensuring the non-empty property is preserved.
529
541
  *
530
- * @example
542
+ * **Example** (Converting chunks to readonly arrays)
543
+ *
531
544
  * ```ts
532
545
  * import { Chunk } from "effect"
533
546
  *
@@ -571,7 +584,7 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
571
584
  * Reverses the order of elements in a `Chunk`.
572
585
  * Importantly, if the input chunk is a `NonEmptyChunk`, the reversed chunk will also be a `NonEmptyChunk`.
573
586
  *
574
- * @example
587
+ * **Example** (Reversing chunks)
575
588
  *
576
589
  * ```ts
577
590
  * import { Chunk } from "effect"
@@ -579,19 +592,19 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
579
592
  * const chunk = Chunk.make(1, 2, 3)
580
593
  * const result = Chunk.reverse(chunk)
581
594
  *
582
- * console.log(result)
583
- * // { _id: 'Chunk', values: [ 3, 2, 1 ] }
595
+ * console.log(Chunk.toArray(result)) // [3, 2, 1]
584
596
  * ```
585
597
  *
586
- * @since 2.0.0
587
598
  * @category elements
599
+ * @since 2.0.0
588
600
  */
589
601
  export const reverse: <S extends Chunk<any>>(self: S) => Chunk.With<S, Chunk.Infer<S>> = reverseChunk as any
590
602
 
591
603
  /**
592
604
  * This function provides a safe way to read a value at a particular index from a `Chunk`.
593
605
  *
594
- * @example
606
+ * **Example** (Accessing elements safely)
607
+ *
595
608
  * ```ts
596
609
  * import { Chunk } from "effect"
597
610
  *
@@ -613,7 +626,8 @@ export const get: {
613
626
  /**
614
627
  * This function provides a safe way to read a value at a particular index from a `Chunk`.
615
628
  *
616
- * @example
629
+ * **Example** (Accessing elements safely)
630
+ *
617
631
  * ```ts
618
632
  * import { Chunk } from "effect"
619
633
  *
@@ -635,7 +649,8 @@ export const get: {
635
649
  /**
636
650
  * This function provides a safe way to read a value at a particular index from a `Chunk`.
637
651
  *
638
- * @example
652
+ * **Example** (Accessing elements safely)
653
+ *
639
654
  * ```ts
640
655
  * import { Chunk } from "effect"
641
656
  *
@@ -663,7 +678,8 @@ export const get: {
663
678
  /**
664
679
  * Wraps an array into a chunk without copying, unsafe on mutable arrays
665
680
  *
666
- * @example
681
+ * **Example** (Creating chunks without copying arrays)
682
+ *
667
683
  * ```ts
668
684
  * import { Chunk } from "effect"
669
685
  *
@@ -676,8 +692,8 @@ export const get: {
676
692
  * console.log(Chunk.toArray(chunk)) // [999, 2, 3, 4, 5]
677
693
  * ```
678
694
  *
679
- * @since 2.0.0
680
695
  * @category unsafe
696
+ * @since 2.0.0
681
697
  */
682
698
  export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
683
699
  self.length === 0 ? empty() : self.length === 1 ? of(self[0]) : makeChunk({ _tag: "IArray", array: self })
@@ -685,7 +701,8 @@ export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
685
701
  /**
686
702
  * Wraps an array into a chunk without copying, unsafe on mutable arrays
687
703
  *
688
- * @example
704
+ * **Example** (Creating non-empty chunks without copying arrays)
705
+ *
689
706
  * ```ts
690
707
  * import { Chunk } from "effect"
691
708
  * import * as Array from "effect/Array"
@@ -698,8 +715,8 @@ export const fromArrayUnsafe = <A>(self: ReadonlyArray<A>): Chunk<A> =>
698
715
  * console.log(Chunk.isNonEmpty(chunk)) // true
699
716
  * ```
700
717
  *
701
- * @since 2.0.0
702
718
  * @category unsafe
719
+ * @since 2.0.0
703
720
  */
704
721
  export const fromNonEmptyArrayUnsafe = <A>(self: NonEmptyReadonlyArray<A>): NonEmptyChunk<A> =>
705
722
  fromArrayUnsafe(self) as any
@@ -707,73 +724,64 @@ export const fromNonEmptyArrayUnsafe = <A>(self: NonEmptyReadonlyArray<A>): NonE
707
724
  /**
708
725
  * Gets an element unsafely, will throw on out of bounds
709
726
  *
710
- * @example
727
+ * **Example** (Accessing elements unsafely)
728
+ *
711
729
  * ```ts
712
- * import { Chunk } from "effect"
730
+ * import { Chunk, Option } from "effect"
713
731
  *
714
732
  * const chunk = Chunk.make("a", "b", "c", "d")
715
733
  *
716
734
  * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
717
735
  * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
718
736
  *
719
- * // Warning: This will throw an error for invalid indices
720
- * try {
721
- * Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
722
- * } catch (error) {
723
- * console.log((error as Error).message) // "Index out of bounds"
724
- * }
737
+ * // Use Chunk.get when the index may be out of bounds
738
+ * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
725
739
  * ```
726
740
  *
727
- * @since 2.0.0
728
741
  * @category unsafe
742
+ * @since 2.0.0
729
743
  */
730
744
  export const getUnsafe: {
731
745
  /**
732
746
  * Gets an element unsafely, will throw on out of bounds
733
747
  *
734
- * @example
748
+ * **Example** (Accessing elements unsafely)
749
+ *
735
750
  * ```ts
736
- * import { Chunk } from "effect"
751
+ * import { Chunk, Option } from "effect"
737
752
  *
738
753
  * const chunk = Chunk.make("a", "b", "c", "d")
739
754
  *
740
755
  * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
741
756
  * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
742
757
  *
743
- * // Warning: This will throw an error for invalid indices
744
- * try {
745
- * Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
746
- * } catch (error) {
747
- * console.log((error as Error).message) // "Index out of bounds"
748
- * }
758
+ * // Use Chunk.get when the index may be out of bounds
759
+ * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
749
760
  * ```
750
761
  *
751
- * @since 2.0.0
752
762
  * @category unsafe
763
+ * @since 2.0.0
753
764
  */
754
765
  (index: number): <A>(self: Chunk<A>) => A
755
766
  /**
756
767
  * Gets an element unsafely, will throw on out of bounds
757
768
  *
758
- * @example
769
+ * **Example** (Accessing elements unsafely)
770
+ *
759
771
  * ```ts
760
- * import { Chunk } from "effect"
772
+ * import { Chunk, Option } from "effect"
761
773
  *
762
774
  * const chunk = Chunk.make("a", "b", "c", "d")
763
775
  *
764
776
  * console.log(Chunk.getUnsafe(chunk, 1)) // "b"
765
777
  * console.log(Chunk.getUnsafe(chunk, 3)) // "d"
766
778
  *
767
- * // Warning: This will throw an error for invalid indices
768
- * try {
769
- * Chunk.getUnsafe(chunk, 10) // throws "Index out of bounds"
770
- * } catch (error) {
771
- * console.log((error as Error).message) // "Index out of bounds"
772
- * }
779
+ * // Use Chunk.get when the index may be out of bounds
780
+ * console.log(Option.isNone(Chunk.get(chunk, 10))) // true
773
781
  * ```
774
782
  *
775
- * @since 2.0.0
776
783
  * @category unsafe
784
+ * @since 2.0.0
777
785
  */
778
786
  <A>(self: Chunk<A>, index: number): A
779
787
  } = dual(2, <A>(self: Chunk<A>, index: number): A => {
@@ -808,7 +816,8 @@ export const getUnsafe: {
808
816
  /**
809
817
  * Appends the specified element to the end of the `Chunk`.
810
818
  *
811
- * @example
819
+ * **Example** (Appending an element)
820
+ *
812
821
  * ```ts
813
822
  * import { Chunk } from "effect"
814
823
  *
@@ -829,7 +838,8 @@ export const append: {
829
838
  /**
830
839
  * Appends the specified element to the end of the `Chunk`.
831
840
  *
832
- * @example
841
+ * **Example** (Appending an element)
842
+ *
833
843
  * ```ts
834
844
  * import { Chunk } from "effect"
835
845
  *
@@ -850,7 +860,8 @@ export const append: {
850
860
  /**
851
861
  * Appends the specified element to the end of the `Chunk`.
852
862
  *
853
- * @example
863
+ * **Example** (Appending an element)
864
+ *
854
865
  * ```ts
855
866
  * import { Chunk } from "effect"
856
867
  *
@@ -873,7 +884,8 @@ export const append: {
873
884
  /**
874
885
  * Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
875
886
  *
876
- * @example
887
+ * **Example** (Prepending an element)
888
+ *
877
889
  * ```ts
878
890
  * import { Chunk } from "effect"
879
891
  *
@@ -894,7 +906,8 @@ export const prepend: {
894
906
  /**
895
907
  * Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
896
908
  *
897
- * @example
909
+ * **Example** (Prepending an element)
910
+ *
898
911
  * ```ts
899
912
  * import { Chunk } from "effect"
900
913
  *
@@ -915,7 +928,8 @@ export const prepend: {
915
928
  /**
916
929
  * Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.
917
930
  *
918
- * @example
931
+ * **Example** (Prepending an element)
932
+ *
919
933
  * ```ts
920
934
  * import { Chunk } from "effect"
921
935
  *
@@ -938,14 +952,14 @@ export const prepend: {
938
952
  /**
939
953
  * Takes the first up to `n` elements from the chunk.
940
954
  *
941
- * @example
955
+ * **Example** (Taking elements from the start)
956
+ *
942
957
  * ```ts
943
958
  * import { Chunk } from "effect"
944
959
  *
945
960
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
946
961
  * const result = Chunk.take(chunk, 3)
947
- * console.log(result)
948
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
962
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
949
963
  * ```
950
964
  *
951
965
  * @category elements
@@ -955,14 +969,14 @@ export const take: {
955
969
  /**
956
970
  * Takes the first up to `n` elements from the chunk.
957
971
  *
958
- * @example
972
+ * **Example** (Taking elements from the start)
973
+ *
959
974
  * ```ts
960
975
  * import { Chunk } from "effect"
961
976
  *
962
977
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
963
978
  * const result = Chunk.take(chunk, 3)
964
- * console.log(result)
965
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
979
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
966
980
  * ```
967
981
  *
968
982
  * @category elements
@@ -972,14 +986,14 @@ export const take: {
972
986
  /**
973
987
  * Takes the first up to `n` elements from the chunk.
974
988
  *
975
- * @example
989
+ * **Example** (Taking elements from the start)
990
+ *
976
991
  * ```ts
977
992
  * import { Chunk } from "effect"
978
993
  *
979
994
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
980
995
  * const result = Chunk.take(chunk, 3)
981
- * console.log(result)
982
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
996
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
983
997
  * ```
984
998
  *
985
999
  * @category elements
@@ -1027,14 +1041,14 @@ export const take: {
1027
1041
  /**
1028
1042
  * Drops the first up to `n` elements from the chunk.
1029
1043
  *
1030
- * @example
1044
+ * **Example** (Dropping elements from the start)
1045
+ *
1031
1046
  * ```ts
1032
1047
  * import { Chunk } from "effect"
1033
1048
  *
1034
1049
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1035
1050
  * const result = Chunk.drop(chunk, 2)
1036
- * console.log(result)
1037
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1051
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1038
1052
  * ```
1039
1053
  *
1040
1054
  * @category elements
@@ -1044,14 +1058,14 @@ export const drop: {
1044
1058
  /**
1045
1059
  * Drops the first up to `n` elements from the chunk.
1046
1060
  *
1047
- * @example
1061
+ * **Example** (Dropping elements from the start)
1062
+ *
1048
1063
  * ```ts
1049
1064
  * import { Chunk } from "effect"
1050
1065
  *
1051
1066
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1052
1067
  * const result = Chunk.drop(chunk, 2)
1053
- * console.log(result)
1054
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1068
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1055
1069
  * ```
1056
1070
  *
1057
1071
  * @category elements
@@ -1061,14 +1075,14 @@ export const drop: {
1061
1075
  /**
1062
1076
  * Drops the first up to `n` elements from the chunk.
1063
1077
  *
1064
- * @example
1078
+ * **Example** (Dropping elements from the start)
1079
+ *
1065
1080
  * ```ts
1066
1081
  * import { Chunk } from "effect"
1067
1082
  *
1068
1083
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1069
1084
  * const result = Chunk.drop(chunk, 2)
1070
- * console.log(result)
1071
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1085
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1072
1086
  * ```
1073
1087
  *
1074
1088
  * @category elements
@@ -1115,14 +1129,14 @@ export const drop: {
1115
1129
  /**
1116
1130
  * Drops the last `n` elements.
1117
1131
  *
1118
- * @example
1132
+ * **Example** (Dropping elements from the end)
1133
+ *
1119
1134
  * ```ts
1120
1135
  * import { Chunk } from "effect"
1121
1136
  *
1122
1137
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1123
1138
  * const result = Chunk.dropRight(chunk, 2)
1124
- * console.log(result)
1125
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1139
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
1126
1140
  * ```
1127
1141
  *
1128
1142
  * @category elements
@@ -1132,14 +1146,14 @@ export const dropRight: {
1132
1146
  /**
1133
1147
  * Drops the last `n` elements.
1134
1148
  *
1135
- * @example
1149
+ * **Example** (Dropping elements from the end)
1150
+ *
1136
1151
  * ```ts
1137
1152
  * import { Chunk } from "effect"
1138
1153
  *
1139
1154
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1140
1155
  * const result = Chunk.dropRight(chunk, 2)
1141
- * console.log(result)
1142
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1156
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
1143
1157
  * ```
1144
1158
  *
1145
1159
  * @category elements
@@ -1149,14 +1163,14 @@ export const dropRight: {
1149
1163
  /**
1150
1164
  * Drops the last `n` elements.
1151
1165
  *
1152
- * @example
1166
+ * **Example** (Dropping elements from the end)
1167
+ *
1153
1168
  * ```ts
1154
1169
  * import { Chunk } from "effect"
1155
1170
  *
1156
1171
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1157
1172
  * const result = Chunk.dropRight(chunk, 2)
1158
- * console.log(result)
1159
- * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1173
+ * console.log(Chunk.toArray(result)) // [1, 2, 3]
1160
1174
  * ```
1161
1175
  *
1162
1176
  * @category elements
@@ -1168,14 +1182,14 @@ export const dropRight: {
1168
1182
  /**
1169
1183
  * Drops all elements so long as the predicate returns true.
1170
1184
  *
1171
- * @example
1185
+ * **Example** (Dropping elements while a predicate matches)
1186
+ *
1172
1187
  * ```ts
1173
1188
  * import { Chunk } from "effect"
1174
1189
  *
1175
1190
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1176
1191
  * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1177
- * console.log(result)
1178
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1192
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1179
1193
  * ```
1180
1194
  *
1181
1195
  * @category elements
@@ -1185,14 +1199,14 @@ export const dropWhile: {
1185
1199
  /**
1186
1200
  * Drops all elements so long as the predicate returns true.
1187
1201
  *
1188
- * @example
1202
+ * **Example** (Dropping elements while a predicate matches)
1203
+ *
1189
1204
  * ```ts
1190
1205
  * import { Chunk } from "effect"
1191
1206
  *
1192
1207
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1193
1208
  * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1194
- * console.log(result)
1195
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1209
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1196
1210
  * ```
1197
1211
  *
1198
1212
  * @category elements
@@ -1202,14 +1216,14 @@ export const dropWhile: {
1202
1216
  /**
1203
1217
  * Drops all elements so long as the predicate returns true.
1204
1218
  *
1205
- * @example
1219
+ * **Example** (Dropping elements while a predicate matches)
1220
+ *
1206
1221
  * ```ts
1207
1222
  * import { Chunk } from "effect"
1208
1223
  *
1209
1224
  * const chunk = Chunk.make(1, 2, 3, 4, 5)
1210
1225
  * const result = Chunk.dropWhile(chunk, (n) => n < 3)
1211
- * console.log(result)
1212
- * // { _id: 'Chunk', values: [ 3, 4, 5 ] }
1226
+ * console.log(Chunk.toArray(result)) // [3, 4, 5]
1213
1227
  * ```
1214
1228
  *
1215
1229
  * @category elements
@@ -1230,7 +1244,7 @@ export const dropWhile: {
1230
1244
  * Prepends the specified prefix chunk to the beginning of the specified chunk.
1231
1245
  * If either chunk is non-empty, the result is also a non-empty chunk.
1232
1246
  *
1233
- * @example
1247
+ * **Example** (Prepending all elements)
1234
1248
  *
1235
1249
  * ```ts
1236
1250
  * import { Chunk } from "effect"
@@ -1252,7 +1266,7 @@ export const prependAll: {
1252
1266
  * Prepends the specified prefix chunk to the beginning of the specified chunk.
1253
1267
  * If either chunk is non-empty, the result is also a non-empty chunk.
1254
1268
  *
1255
- * @example
1269
+ * **Example** (Prepending all elements)
1256
1270
  *
1257
1271
  * ```ts
1258
1272
  * import { Chunk } from "effect"
@@ -1274,7 +1288,7 @@ export const prependAll: {
1274
1288
  * Prepends the specified prefix chunk to the beginning of the specified chunk.
1275
1289
  * If either chunk is non-empty, the result is also a non-empty chunk.
1276
1290
  *
1277
- * @example
1291
+ * **Example** (Prepending all elements)
1278
1292
  *
1279
1293
  * ```ts
1280
1294
  * import { Chunk } from "effect"
@@ -1296,7 +1310,7 @@ export const prependAll: {
1296
1310
  * Prepends the specified prefix chunk to the beginning of the specified chunk.
1297
1311
  * If either chunk is non-empty, the result is also a non-empty chunk.
1298
1312
  *
1299
- * @example
1313
+ * **Example** (Prepending all elements)
1300
1314
  *
1301
1315
  * ```ts
1302
1316
  * import { Chunk } from "effect"
@@ -1318,7 +1332,7 @@ export const prependAll: {
1318
1332
  * Prepends the specified prefix chunk to the beginning of the specified chunk.
1319
1333
  * If either chunk is non-empty, the result is also a non-empty chunk.
1320
1334
  *
1321
- * @example
1335
+ * **Example** (Prepending all elements)
1322
1336
  *
1323
1337
  * ```ts
1324
1338
  * import { Chunk } from "effect"
@@ -1342,7 +1356,7 @@ export const prependAll: {
1342
1356
  * Concatenates two chunks, combining their elements.
1343
1357
  * If either chunk is non-empty, the result is also a non-empty chunk.
1344
1358
  *
1345
- * @example
1359
+ * **Example** (Appending all elements)
1346
1360
  *
1347
1361
  * ```ts
1348
1362
  * import { Chunk } from "effect"
@@ -1364,7 +1378,7 @@ export const appendAll: {
1364
1378
  * Concatenates two chunks, combining their elements.
1365
1379
  * If either chunk is non-empty, the result is also a non-empty chunk.
1366
1380
  *
1367
- * @example
1381
+ * **Example** (Appending all elements)
1368
1382
  *
1369
1383
  * ```ts
1370
1384
  * import { Chunk } from "effect"
@@ -1386,7 +1400,7 @@ export const appendAll: {
1386
1400
  * Concatenates two chunks, combining their elements.
1387
1401
  * If either chunk is non-empty, the result is also a non-empty chunk.
1388
1402
  *
1389
- * @example
1403
+ * **Example** (Appending all elements)
1390
1404
  *
1391
1405
  * ```ts
1392
1406
  * import { Chunk } from "effect"
@@ -1408,7 +1422,7 @@ export const appendAll: {
1408
1422
  * Concatenates two chunks, combining their elements.
1409
1423
  * If either chunk is non-empty, the result is also a non-empty chunk.
1410
1424
  *
1411
- * @example
1425
+ * **Example** (Appending all elements)
1412
1426
  *
1413
1427
  * ```ts
1414
1428
  * import { Chunk } from "effect"
@@ -1430,7 +1444,7 @@ export const appendAll: {
1430
1444
  * Concatenates two chunks, combining their elements.
1431
1445
  * If either chunk is non-empty, the result is also a non-empty chunk.
1432
1446
  *
1433
- * @example
1447
+ * **Example** (Appending all elements)
1434
1448
  *
1435
1449
  * ```ts
1436
1450
  * import { Chunk } from "effect"
@@ -1461,7 +1475,7 @@ export const appendAll: {
1461
1475
  * Concatenates two chunks, combining their elements.
1462
1476
  * If either chunk is non-empty, the result is also a non-empty chunk.
1463
1477
  *
1464
- * @example
1478
+ * **Example** (Appending all elements)
1465
1479
  *
1466
1480
  * ```ts
1467
1481
  * import { Chunk } from "effect"
@@ -1513,7 +1527,8 @@ export const appendAll: {
1513
1527
  /**
1514
1528
  * Returns a filtered and mapped subset of the elements.
1515
1529
  *
1516
- * @example
1530
+ * **Example** (Filtering and mapping values)
1531
+ *
1517
1532
  * ```ts
1518
1533
  * import { Chunk } from "effect"
1519
1534
  * import * as Result from "effect/Result"
@@ -1533,14 +1548,15 @@ export const appendAll: {
1533
1548
  * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1534
1549
  * ```
1535
1550
  *
1536
- * @since 2.0.0
1537
1551
  * @category filtering
1552
+ * @since 2.0.0
1538
1553
  */
1539
1554
  export const filterMap: {
1540
1555
  /**
1541
1556
  * Returns a filtered and mapped subset of the elements.
1542
1557
  *
1543
- * @example
1558
+ * **Example** (Filtering and mapping values)
1559
+ *
1544
1560
  * ```ts
1545
1561
  * import { Chunk } from "effect"
1546
1562
  * import * as Result from "effect/Result"
@@ -1560,14 +1576,15 @@ export const filterMap: {
1560
1576
  * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1561
1577
  * ```
1562
1578
  *
1563
- * @since 2.0.0
1564
1579
  * @category filtering
1580
+ * @since 2.0.0
1565
1581
  */
1566
1582
  <A, B, X>(f: (input: A, i: number) => Result<B, X>): (self: Chunk<A>) => Chunk<B>
1567
1583
  /**
1568
1584
  * Returns a filtered and mapped subset of the elements.
1569
1585
  *
1570
- * @example
1586
+ * **Example** (Filtering and mapping values)
1587
+ *
1571
1588
  * ```ts
1572
1589
  * import { Chunk } from "effect"
1573
1590
  * import * as Result from "effect/Result"
@@ -1587,8 +1604,8 @@ export const filterMap: {
1587
1604
  * console.log(Chunk.toArray(evenIndexNumbers)) // [1]
1588
1605
  * ```
1589
1606
  *
1590
- * @since 2.0.0
1591
1607
  * @category filtering
1608
+ * @since 2.0.0
1592
1609
  */
1593
1610
  <A, B, X>(self: Chunk<A>, f: (input: A, i: number) => Result<B, X>): Chunk<B>
1594
1611
  } = dual(
@@ -1609,7 +1626,8 @@ export const filterMap: {
1609
1626
  /**
1610
1627
  * Returns a filtered subset of the elements.
1611
1628
  *
1612
- * @example
1629
+ * **Example** (Filtering values)
1630
+ *
1613
1631
  * ```ts
1614
1632
  * import { Chunk } from "effect"
1615
1633
  *
@@ -1623,14 +1641,15 @@ export const filterMap: {
1623
1641
  * console.log(Chunk.toArray(numbers)) // [42, 100]
1624
1642
  * ```
1625
1643
  *
1626
- * @since 2.0.0
1627
1644
  * @category filtering
1645
+ * @since 2.0.0
1628
1646
  */
1629
1647
  export const filter: {
1630
1648
  /**
1631
1649
  * Returns a filtered subset of the elements.
1632
1650
  *
1633
- * @example
1651
+ * **Example** (Filtering values)
1652
+ *
1634
1653
  * ```ts
1635
1654
  * import { Chunk } from "effect"
1636
1655
  *
@@ -1644,14 +1663,15 @@ export const filter: {
1644
1663
  * console.log(Chunk.toArray(numbers)) // [42, 100]
1645
1664
  * ```
1646
1665
  *
1647
- * @since 2.0.0
1648
1666
  * @category filtering
1667
+ * @since 2.0.0
1649
1668
  */
1650
1669
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Chunk<B>
1651
1670
  /**
1652
1671
  * Returns a filtered subset of the elements.
1653
1672
  *
1654
- * @example
1673
+ * **Example** (Filtering values)
1674
+ *
1655
1675
  * ```ts
1656
1676
  * import { Chunk } from "effect"
1657
1677
  *
@@ -1665,14 +1685,15 @@ export const filter: {
1665
1685
  * console.log(Chunk.toArray(numbers)) // [42, 100]
1666
1686
  * ```
1667
1687
  *
1668
- * @since 2.0.0
1669
1688
  * @category filtering
1689
+ * @since 2.0.0
1670
1690
  */
1671
1691
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
1672
1692
  /**
1673
1693
  * Returns a filtered subset of the elements.
1674
1694
  *
1675
- * @example
1695
+ * **Example** (Filtering values)
1696
+ *
1676
1697
  * ```ts
1677
1698
  * import { Chunk } from "effect"
1678
1699
  *
@@ -1686,14 +1707,15 @@ export const filter: {
1686
1707
  * console.log(Chunk.toArray(numbers)) // [42, 100]
1687
1708
  * ```
1688
1709
  *
1689
- * @since 2.0.0
1690
1710
  * @category filtering
1711
+ * @since 2.0.0
1691
1712
  */
1692
1713
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Chunk<B>
1693
1714
  /**
1694
1715
  * Returns a filtered subset of the elements.
1695
1716
  *
1696
- * @example
1717
+ * **Example** (Filtering values)
1718
+ *
1697
1719
  * ```ts
1698
1720
  * import { Chunk } from "effect"
1699
1721
  *
@@ -1707,8 +1729,8 @@ export const filter: {
1707
1729
  * console.log(Chunk.toArray(numbers)) // [42, 100]
1708
1730
  * ```
1709
1731
  *
1710
- * @since 2.0.0
1711
1732
  * @category filtering
1733
+ * @since 2.0.0
1712
1734
  */
1713
1735
  <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
1714
1736
  } = dual(
@@ -1719,7 +1741,8 @@ export const filter: {
1719
1741
  /**
1720
1742
  * Transforms all elements of the chunk for as long as the specified function succeeds.
1721
1743
  *
1722
- * @example
1744
+ * **Example** (Filtering and mapping while values match)
1745
+ *
1723
1746
  * ```ts
1724
1747
  * import { Chunk } from "effect"
1725
1748
  * import * as Result from "effect/Result"
@@ -1740,14 +1763,15 @@ export const filter: {
1740
1763
  * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1741
1764
  * ```
1742
1765
  *
1743
- * @since 2.0.0
1744
1766
  * @category filtering
1767
+ * @since 2.0.0
1745
1768
  */
1746
1769
  export const filterMapWhile: {
1747
1770
  /**
1748
1771
  * Transforms all elements of the chunk for as long as the specified function succeeds.
1749
1772
  *
1750
- * @example
1773
+ * **Example** (Filtering and mapping while values match)
1774
+ *
1751
1775
  * ```ts
1752
1776
  * import { Chunk } from "effect"
1753
1777
  * import * as Result from "effect/Result"
@@ -1768,14 +1792,15 @@ export const filterMapWhile: {
1768
1792
  * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1769
1793
  * ```
1770
1794
  *
1771
- * @since 2.0.0
1772
1795
  * @category filtering
1796
+ * @since 2.0.0
1773
1797
  */
1774
1798
  <A, B, X>(f: Filter.Filter<A, B, X>): (self: Chunk<A>) => Chunk<B>
1775
1799
  /**
1776
1800
  * Transforms all elements of the chunk for as long as the specified function succeeds.
1777
1801
  *
1778
- * @example
1802
+ * **Example** (Filtering and mapping while values match)
1803
+ *
1779
1804
  * ```ts
1780
1805
  * import { Chunk } from "effect"
1781
1806
  * import * as Result from "effect/Result"
@@ -1796,8 +1821,8 @@ export const filterMapWhile: {
1796
1821
  * console.log(Chunk.toArray(allNumbers)) // [1, 2, 3, 4]
1797
1822
  * ```
1798
1823
  *
1799
- * @since 2.0.0
1800
1824
  * @category filtering
1825
+ * @since 2.0.0
1801
1826
  */
1802
1827
  <A, B, X>(self: Chunk<A>, f: Filter.Filter<A, B, X>): Chunk<B>
1803
1828
  } = dual(2, <A, B, X>(self: Chunk<A>, f: Filter.Filter<A, B, X>): Chunk<B> => {
@@ -1816,15 +1841,15 @@ export const filterMapWhile: {
1816
1841
  /**
1817
1842
  * Filter out optional values
1818
1843
  *
1819
- * @example
1844
+ * **Example** (Compacting optional values)
1845
+ *
1820
1846
  * ```ts
1821
1847
  * import { Chunk } from "effect"
1822
1848
  * import * as Option from "effect/Option"
1823
1849
  *
1824
1850
  * const chunk = Chunk.make(Option.some(1), Option.none(), Option.some(3))
1825
1851
  * const result = Chunk.compact(chunk)
1826
- * console.log(result)
1827
- * // { _id: 'Chunk', values: [ 1, 3 ] }
1852
+ * console.log(Chunk.toArray(result)) // [1, 3]
1828
1853
  * ```
1829
1854
  *
1830
1855
  * @category filtering
@@ -1843,7 +1868,8 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
1843
1868
  /**
1844
1869
  * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
1845
1870
  *
1846
- * @example
1871
+ * **Example** (Flat mapping chunks)
1872
+ *
1847
1873
  * ```ts
1848
1874
  * import { Chunk } from "effect"
1849
1875
  *
@@ -1864,14 +1890,15 @@ export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => {
1864
1890
  * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1865
1891
  * ```
1866
1892
  *
1867
- * @since 2.0.0
1868
1893
  * @category sequencing
1894
+ * @since 2.0.0
1869
1895
  */
1870
1896
  export const flatMap: {
1871
1897
  /**
1872
1898
  * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
1873
1899
  *
1874
- * @example
1900
+ * **Example** (Flat mapping chunks)
1901
+ *
1875
1902
  * ```ts
1876
1903
  * import { Chunk } from "effect"
1877
1904
  *
@@ -1892,14 +1919,15 @@ export const flatMap: {
1892
1919
  * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1893
1920
  * ```
1894
1921
  *
1895
- * @since 2.0.0
1896
1922
  * @category sequencing
1923
+ * @since 2.0.0
1897
1924
  */
1898
1925
  <S extends Chunk<any>, T extends Chunk<any>>(f: (a: Chunk.Infer<S>, i: number) => T): (self: S) => Chunk.AndNonEmpty<S, T, Chunk.Infer<T>>
1899
1926
  /**
1900
1927
  * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
1901
1928
  *
1902
- * @example
1929
+ * **Example** (Flat mapping chunks)
1930
+ *
1903
1931
  * ```ts
1904
1932
  * import { Chunk } from "effect"
1905
1933
  *
@@ -1920,14 +1948,15 @@ export const flatMap: {
1920
1948
  * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1921
1949
  * ```
1922
1950
  *
1923
- * @since 2.0.0
1924
1951
  * @category sequencing
1952
+ * @since 2.0.0
1925
1953
  */
1926
1954
  <A, B>(self: NonEmptyChunk<A>, f: (a: A, i: number) => NonEmptyChunk<B>): NonEmptyChunk<B>
1927
1955
  /**
1928
1956
  * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.
1929
1957
  *
1930
- * @example
1958
+ * **Example** (Flat mapping chunks)
1959
+ *
1931
1960
  * ```ts
1932
1961
  * import { Chunk } from "effect"
1933
1962
  *
@@ -1948,8 +1977,8 @@ export const flatMap: {
1948
1977
  * console.log(Chunk.toArray(indexed)) // [1, 3, 5]
1949
1978
  * ```
1950
1979
  *
1951
- * @since 2.0.0
1952
1980
  * @category sequencing
1981
+ * @since 2.0.0
1953
1982
  */
1954
1983
  <A, B>(self: Chunk<A>, f: (a: A, i: number) => Chunk<B>): Chunk<B>
1955
1984
  } = dual(2, <A, B>(self: Chunk<A>, f: (a: A, i: number) => Chunk<B>) => {
@@ -1974,7 +2003,8 @@ export const flatMap: {
1974
2003
  * instead, it is primarily used for side effects, such as logging or
1975
2004
  * accumulating data in an external variable.
1976
2005
  *
1977
- * @example
2006
+ * **Example** (Iterating over chunk values)
2007
+ *
1978
2008
  * ```ts
1979
2009
  * import { Chunk } from "effect"
1980
2010
  *
@@ -1997,8 +2027,8 @@ export const flatMap: {
1997
2027
  * // Index 3: 4
1998
2028
  * ```
1999
2029
  *
2000
- * @since 2.0.0
2001
2030
  * @category combinators
2031
+ * @since 2.0.0
2002
2032
  */
2003
2033
  export const forEach: {
2004
2034
  /**
@@ -2011,7 +2041,8 @@ export const forEach: {
2011
2041
  * instead, it is primarily used for side effects, such as logging or
2012
2042
  * accumulating data in an external variable.
2013
2043
  *
2014
- * @example
2044
+ * **Example** (Iterating over chunk values)
2045
+ *
2015
2046
  * ```ts
2016
2047
  * import { Chunk } from "effect"
2017
2048
  *
@@ -2034,8 +2065,8 @@ export const forEach: {
2034
2065
  * // Index 3: 4
2035
2066
  * ```
2036
2067
  *
2037
- * @since 2.0.0
2038
2068
  * @category combinators
2069
+ * @since 2.0.0
2039
2070
  */
2040
2071
  <A, B>(f: (a: A, index: number) => B): (self: Chunk<A>) => void
2041
2072
  /**
@@ -2048,7 +2079,8 @@ export const forEach: {
2048
2079
  * instead, it is primarily used for side effects, such as logging or
2049
2080
  * accumulating data in an external variable.
2050
2081
  *
2051
- * @example
2082
+ * **Example** (Iterating over chunk values)
2083
+ *
2052
2084
  * ```ts
2053
2085
  * import { Chunk } from "effect"
2054
2086
  *
@@ -2071,8 +2103,8 @@ export const forEach: {
2071
2103
  * // Index 3: 4
2072
2104
  * ```
2073
2105
  *
2074
- * @since 2.0.0
2075
2106
  * @category combinators
2107
+ * @since 2.0.0
2076
2108
  */
2077
2109
  <A, B>(self: Chunk<A>, f: (a: A, index: number) => B): void
2078
2110
  } = dual(2, <A, B>(self: Chunk<A>, f: (a: A) => B): void => toReadonlyArray(self).forEach(f))
@@ -2080,7 +2112,8 @@ export const forEach: {
2080
2112
  /**
2081
2113
  * Flattens a chunk of chunks into a single chunk by concatenating all chunks.
2082
2114
  *
2083
- * @example
2115
+ * **Example** (Flattening nested chunks)
2116
+ *
2084
2117
  * ```ts
2085
2118
  * import { Chunk } from "effect"
2086
2119
  *
@@ -2101,15 +2134,16 @@ export const forEach: {
2101
2134
  * console.log(Chunk.toArray(Chunk.flatten(withEmpty))) // [1, 2, 3, 4]
2102
2135
  * ```
2103
2136
  *
2104
- * @since 2.0.0
2105
2137
  * @category sequencing
2138
+ * @since 2.0.0
2106
2139
  */
2107
2140
  export const flatten: <S extends Chunk<Chunk<any>>>(self: S) => Chunk.Flatten<S> = flatMap(identity) as any
2108
2141
 
2109
2142
  /**
2110
2143
  * Groups elements in chunks of up to `n` elements.
2111
2144
  *
2112
- * @example
2145
+ * **Example** (Splitting into fixed-size chunks)
2146
+ *
2113
2147
  * ```ts
2114
2148
  * import { Chunk } from "effect"
2115
2149
  *
@@ -2126,14 +2160,15 @@ export const flatten: <S extends Chunk<Chunk<any>>>(self: S) => Chunk.Flatten<S>
2126
2160
  * // [[1, 2], [3, 4], [5]]
2127
2161
  * ```
2128
2162
  *
2129
- * @since 2.0.0
2130
2163
  * @category elements
2164
+ * @since 2.0.0
2131
2165
  */
2132
2166
  export const chunksOf: {
2133
2167
  /**
2134
2168
  * Groups elements in chunks of up to `n` elements.
2135
2169
  *
2136
- * @example
2170
+ * **Example** (Splitting into fixed-size chunks)
2171
+ *
2137
2172
  * ```ts
2138
2173
  * import { Chunk } from "effect"
2139
2174
  *
@@ -2150,14 +2185,15 @@ export const chunksOf: {
2150
2185
  * // [[1, 2], [3, 4], [5]]
2151
2186
  * ```
2152
2187
  *
2153
- * @since 2.0.0
2154
2188
  * @category elements
2189
+ * @since 2.0.0
2155
2190
  */
2156
2191
  (n: number): <A>(self: Chunk<A>) => Chunk<Chunk<A>>
2157
2192
  /**
2158
2193
  * Groups elements in chunks of up to `n` elements.
2159
2194
  *
2160
- * @example
2195
+ * **Example** (Splitting into fixed-size chunks)
2196
+ *
2161
2197
  * ```ts
2162
2198
  * import { Chunk } from "effect"
2163
2199
  *
@@ -2174,8 +2210,8 @@ export const chunksOf: {
2174
2210
  * // [[1, 2], [3, 4], [5]]
2175
2211
  * ```
2176
2212
  *
2177
- * @since 2.0.0
2178
2213
  * @category elements
2214
+ * @since 2.0.0
2179
2215
  */
2180
2216
  <A>(self: Chunk<A>, n: number): Chunk<Chunk<A>>
2181
2217
  } = dual(2, <A>(self: Chunk<A>, n: number) => {
@@ -2199,7 +2235,8 @@ export const chunksOf: {
2199
2235
  *
2200
2236
  * The order and references of result values are determined by the Chunk.
2201
2237
  *
2202
- * @example
2238
+ * **Example** (Intersecting chunks)
2239
+ *
2203
2240
  * ```ts
2204
2241
  * import { Chunk } from "effect"
2205
2242
  *
@@ -2219,8 +2256,8 @@ export const chunksOf: {
2219
2256
  * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2220
2257
  * ```
2221
2258
  *
2222
- * @since 2.0.0
2223
2259
  * @category elements
2260
+ * @since 2.0.0
2224
2261
  */
2225
2262
  export const intersection: {
2226
2263
  /**
@@ -2228,7 +2265,8 @@ export const intersection: {
2228
2265
  *
2229
2266
  * The order and references of result values are determined by the Chunk.
2230
2267
  *
2231
- * @example
2268
+ * **Example** (Intersecting chunks)
2269
+ *
2232
2270
  * ```ts
2233
2271
  * import { Chunk } from "effect"
2234
2272
  *
@@ -2248,8 +2286,8 @@ export const intersection: {
2248
2286
  * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2249
2287
  * ```
2250
2288
  *
2251
- * @since 2.0.0
2252
2289
  * @category elements
2290
+ * @since 2.0.0
2253
2291
  */
2254
2292
  <A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A & B>
2255
2293
  /**
@@ -2257,7 +2295,8 @@ export const intersection: {
2257
2295
  *
2258
2296
  * The order and references of result values are determined by the Chunk.
2259
2297
  *
2260
- * @example
2298
+ * **Example** (Intersecting chunks)
2299
+ *
2261
2300
  * ```ts
2262
2301
  * import { Chunk } from "effect"
2263
2302
  *
@@ -2277,8 +2316,8 @@ export const intersection: {
2277
2316
  * console.log(Chunk.toArray(Chunk.intersection(chunk3, chunk4))) // []
2278
2317
  * ```
2279
2318
  *
2280
- * @since 2.0.0
2281
2319
  * @category elements
2320
+ * @since 2.0.0
2282
2321
  */
2283
2322
  <A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A & B>
2284
2323
  } = dual(
@@ -2290,7 +2329,8 @@ export const intersection: {
2290
2329
  /**
2291
2330
  * Determines if the chunk is empty.
2292
2331
  *
2293
- * @example
2332
+ * **Example** (Checking for empty chunks)
2333
+ *
2294
2334
  * ```ts
2295
2335
  * import { Chunk } from "effect"
2296
2336
  *
@@ -2306,7 +2346,8 @@ export const isEmpty = <A>(self: Chunk<A>): boolean => self.length === 0
2306
2346
  /**
2307
2347
  * Determines if the chunk is not empty.
2308
2348
  *
2309
- * @example
2349
+ * **Example** (Checking for non-empty chunks)
2350
+ *
2310
2351
  * ```ts
2311
2352
  * import { Chunk } from "effect"
2312
2353
  *
@@ -2322,7 +2363,8 @@ export const isNonEmpty = <A>(self: Chunk<A>): self is NonEmptyChunk<A> => self.
2322
2363
  /**
2323
2364
  * Returns the first element of this chunk if it exists.
2324
2365
  *
2325
- * @example
2366
+ * **Example** (Getting the first element)
2367
+ *
2326
2368
  * ```ts
2327
2369
  * import { Chunk } from "effect"
2328
2370
  *
@@ -2340,9 +2382,10 @@ export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
2340
2382
  *
2341
2383
  * It will throw an error if the chunk is empty.
2342
2384
  *
2343
- * @example
2385
+ * **Example** (Getting the first element unsafely)
2386
+ *
2344
2387
  * ```ts
2345
- * import { Chunk } from "effect"
2388
+ * import { Chunk, Option } from "effect"
2346
2389
  *
2347
2390
  * const chunk = Chunk.make(1, 2, 3, 4)
2348
2391
  * console.log(Chunk.headUnsafe(chunk)) // 1
@@ -2350,23 +2393,20 @@ export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
2350
2393
  * const singleElement = Chunk.make("hello")
2351
2394
  * console.log(Chunk.headUnsafe(singleElement)) // "hello"
2352
2395
  *
2353
- * // Warning: This will throw for empty chunks
2354
- * try {
2355
- * Chunk.headUnsafe(Chunk.empty())
2356
- * } catch (error) {
2357
- * console.log((error as Error).message) // "Index out of bounds"
2358
- * }
2396
+ * // Use Chunk.head when the chunk may be empty
2397
+ * console.log(Option.isNone(Chunk.head(Chunk.empty()))) // true
2359
2398
  * ```
2360
2399
  *
2361
- * @since 2.0.0
2362
2400
  * @category unsafe
2401
+ * @since 2.0.0
2363
2402
  */
2364
2403
  export const headUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, 0)
2365
2404
 
2366
2405
  /**
2367
2406
  * Returns the first element of this non empty chunk.
2368
2407
  *
2369
- * @example
2408
+ * **Example** (Getting the first element of a non-empty chunk)
2409
+ *
2370
2410
  * ```ts
2371
2411
  * import { Chunk } from "effect"
2372
2412
  *
@@ -2380,15 +2420,16 @@ export const headUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, 0)
2380
2420
  * // Chunk.headNonEmpty(Chunk.empty()) // TypeScript error
2381
2421
  * ```
2382
2422
  *
2383
- * @since 2.0.0
2384
2423
  * @category elements
2424
+ * @since 2.0.0
2385
2425
  */
2386
2426
  export const headNonEmpty: <A>(self: NonEmptyChunk<A>) => A = headUnsafe
2387
2427
 
2388
2428
  /**
2389
2429
  * Returns the last element of this chunk if it exists.
2390
2430
  *
2391
- * @example
2431
+ * **Example** (Getting the last element)
2432
+ *
2392
2433
  * ```ts
2393
2434
  * import { Chunk } from "effect"
2394
2435
  *
@@ -2406,9 +2447,10 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
2406
2447
  *
2407
2448
  * It will throw an error if the chunk is empty.
2408
2449
  *
2409
- * @example
2450
+ * **Example** (Getting the last element unsafely)
2451
+ *
2410
2452
  * ```ts
2411
- * import { Chunk } from "effect"
2453
+ * import { Chunk, Option } from "effect"
2412
2454
  *
2413
2455
  * const chunk = Chunk.make(1, 2, 3, 4)
2414
2456
  * console.log(Chunk.lastUnsafe(chunk)) // 4
@@ -2416,23 +2458,20 @@ export const last = <A>(self: Chunk<A>): Option<A> => get(self, self.length - 1)
2416
2458
  * const singleElement = Chunk.make("hello")
2417
2459
  * console.log(Chunk.lastUnsafe(singleElement)) // "hello"
2418
2460
  *
2419
- * // Warning: This will throw for empty chunks
2420
- * try {
2421
- * Chunk.lastUnsafe(Chunk.empty())
2422
- * } catch (error) {
2423
- * console.log((error as Error).message) // "Index out of bounds"
2424
- * }
2461
+ * // Use Chunk.last when the chunk may be empty
2462
+ * console.log(Option.isNone(Chunk.last(Chunk.empty()))) // true
2425
2463
  * ```
2426
2464
  *
2427
- * @since 2.0.0
2428
2465
  * @category unsafe
2466
+ * @since 2.0.0
2429
2467
  */
2430
2468
  export const lastUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, self.length - 1)
2431
2469
 
2432
2470
  /**
2433
2471
  * Returns the last element of this non empty chunk.
2434
2472
  *
2435
- * @example
2473
+ * **Example** (Getting the last element of a non-empty chunk)
2474
+ *
2436
2475
  * ```ts
2437
2476
  * import { Chunk } from "effect"
2438
2477
  *
@@ -2446,15 +2485,16 @@ export const lastUnsafe = <A>(self: Chunk<A>): A => getUnsafe(self, self.length
2446
2485
  * // Chunk.lastNonEmpty(Chunk.empty()) // TypeScript error
2447
2486
  * ```
2448
2487
  *
2449
- * @since 3.4.0
2450
2488
  * @category elements
2489
+ * @since 3.4.0
2451
2490
  */
2452
2491
  export const lastNonEmpty: <A>(self: NonEmptyChunk<A>) => A = lastUnsafe
2453
2492
 
2454
2493
  /**
2455
2494
  * A namespace containing utility types for Chunk operations.
2456
2495
  *
2457
- * @example
2496
+ * **Example** (Working with Chunk utility types)
2497
+ *
2458
2498
  * ```ts
2459
2499
  * import type { Chunk } from "effect"
2460
2500
  *
@@ -2474,7 +2514,8 @@ export declare namespace Chunk {
2474
2514
  /**
2475
2515
  * Infers the element type of a Chunk.
2476
2516
  *
2477
- * @example
2517
+ * **Example** (Inferring element types)
2518
+ *
2478
2519
  * ```ts
2479
2520
  * import type { Chunk } from "effect"
2480
2521
  *
@@ -2493,7 +2534,8 @@ export declare namespace Chunk {
2493
2534
  /**
2494
2535
  * Constructs a Chunk type preserving non-emptiness.
2495
2536
  *
2496
- * @example
2537
+ * **Example** (Preserving non-emptiness)
2538
+ *
2497
2539
  * ```ts
2498
2540
  * import type { Chunk } from "effect"
2499
2541
  *
@@ -2512,7 +2554,8 @@ export declare namespace Chunk {
2512
2554
  /**
2513
2555
  * Creates a non-empty Chunk if either input is non-empty.
2514
2556
  *
2515
- * @example
2557
+ * **Example** (Preserving non-emptiness from either input)
2558
+ *
2516
2559
  * ```ts
2517
2560
  * import type { Chunk } from "effect"
2518
2561
  *
@@ -2547,7 +2590,8 @@ export declare namespace Chunk {
2547
2590
  /**
2548
2591
  * Creates a non-empty Chunk only if both inputs are non-empty.
2549
2592
  *
2550
- * @example
2593
+ * **Example** (Requiring non-emptiness from both inputs)
2594
+ *
2551
2595
  * ```ts
2552
2596
  * import type { Chunk } from "effect"
2553
2597
  *
@@ -2582,7 +2626,8 @@ export declare namespace Chunk {
2582
2626
  /**
2583
2627
  * Flattens a nested Chunk type.
2584
2628
  *
2585
- * @example
2629
+ * **Example** (Flattening nested chunk types)
2630
+ *
2586
2631
  * ```ts
2587
2632
  * import type { Chunk } from "effect"
2588
2633
  *
@@ -2605,76 +2650,72 @@ export declare namespace Chunk {
2605
2650
  * Transforms the elements of a chunk using the specified mapping function.
2606
2651
  * If the input chunk is non-empty, the resulting chunk will also be non-empty.
2607
2652
  *
2608
- * @example
2653
+ * **Example** (Mapping values)
2609
2654
  *
2610
2655
  * ```ts
2611
2656
  * import { Chunk } from "effect"
2612
2657
  *
2613
2658
  * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2614
2659
  *
2615
- * console.log(result)
2616
- * // { _id: 'Chunk', values: [ 2, 3 ] }
2660
+ * console.log(Chunk.toArray(result)) // [2, 3]
2617
2661
  * ```
2618
2662
  *
2619
- * @since 2.0.0
2620
2663
  * @category mapping
2664
+ * @since 2.0.0
2621
2665
  */
2622
2666
  export const map: {
2623
2667
  /**
2624
2668
  * Transforms the elements of a chunk using the specified mapping function.
2625
2669
  * If the input chunk is non-empty, the resulting chunk will also be non-empty.
2626
2670
  *
2627
- * @example
2671
+ * **Example** (Mapping values)
2628
2672
  *
2629
2673
  * ```ts
2630
2674
  * import { Chunk } from "effect"
2631
2675
  *
2632
2676
  * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2633
2677
  *
2634
- * console.log(result)
2635
- * // { _id: 'Chunk', values: [ 2, 3 ] }
2678
+ * console.log(Chunk.toArray(result)) // [2, 3]
2636
2679
  * ```
2637
2680
  *
2638
- * @since 2.0.0
2639
2681
  * @category mapping
2682
+ * @since 2.0.0
2640
2683
  */
2641
2684
  <S extends Chunk<any>, B>(f: (a: Chunk.Infer<S>, i: number) => B): (self: S) => Chunk.With<S, B>
2642
2685
  /**
2643
2686
  * Transforms the elements of a chunk using the specified mapping function.
2644
2687
  * If the input chunk is non-empty, the resulting chunk will also be non-empty.
2645
2688
  *
2646
- * @example
2689
+ * **Example** (Mapping values)
2647
2690
  *
2648
2691
  * ```ts
2649
2692
  * import { Chunk } from "effect"
2650
2693
  *
2651
2694
  * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2652
2695
  *
2653
- * console.log(result)
2654
- * // { _id: 'Chunk', values: [ 2, 3 ] }
2696
+ * console.log(Chunk.toArray(result)) // [2, 3]
2655
2697
  * ```
2656
2698
  *
2657
- * @since 2.0.0
2658
2699
  * @category mapping
2700
+ * @since 2.0.0
2659
2701
  */
2660
2702
  <A, B>(self: NonEmptyChunk<A>, f: (a: A, i: number) => B): NonEmptyChunk<B>
2661
2703
  /**
2662
2704
  * Transforms the elements of a chunk using the specified mapping function.
2663
2705
  * If the input chunk is non-empty, the resulting chunk will also be non-empty.
2664
2706
  *
2665
- * @example
2707
+ * **Example** (Mapping values)
2666
2708
  *
2667
2709
  * ```ts
2668
2710
  * import { Chunk } from "effect"
2669
2711
  *
2670
2712
  * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
2671
2713
  *
2672
- * console.log(result)
2673
- * // { _id: 'Chunk', values: [ 2, 3 ] }
2714
+ * console.log(Chunk.toArray(result)) // [2, 3]
2674
2715
  * ```
2675
2716
  *
2676
- * @since 2.0.0
2677
2717
  * @category mapping
2718
+ * @since 2.0.0
2678
2719
  */
2679
2720
  <A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B>
2680
2721
  } = dual(2, <A, B>(self: Chunk<A>, f: (a: A, i: number) => B): Chunk<B> =>
@@ -2685,7 +2726,8 @@ export const map: {
2685
2726
  /**
2686
2727
  * Statefully maps over the chunk, producing new elements of type `B`.
2687
2728
  *
2688
- * @example
2729
+ * **Example** (Mapping with accumulated state)
2730
+ *
2689
2731
  * ```ts
2690
2732
  * import { Chunk } from "effect"
2691
2733
  *
@@ -2708,14 +2750,15 @@ export const map: {
2708
2750
  * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2709
2751
  * ```
2710
2752
  *
2711
- * @since 2.0.0
2712
2753
  * @category folding
2754
+ * @since 2.0.0
2713
2755
  */
2714
2756
  export const mapAccum: {
2715
2757
  /**
2716
2758
  * Statefully maps over the chunk, producing new elements of type `B`.
2717
2759
  *
2718
- * @example
2760
+ * **Example** (Mapping with accumulated state)
2761
+ *
2719
2762
  * ```ts
2720
2763
  * import { Chunk } from "effect"
2721
2764
  *
@@ -2738,14 +2781,15 @@ export const mapAccum: {
2738
2781
  * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2739
2782
  * ```
2740
2783
  *
2741
- * @since 2.0.0
2742
2784
  * @category folding
2785
+ * @since 2.0.0
2743
2786
  */
2744
2787
  <S, A, B>(s: S, f: (s: S, a: A) => readonly [S, B]): (self: Chunk<A>) => [S, Chunk<B>]
2745
2788
  /**
2746
2789
  * Statefully maps over the chunk, producing new elements of type `B`.
2747
2790
  *
2748
- * @example
2791
+ * **Example** (Mapping with accumulated state)
2792
+ *
2749
2793
  * ```ts
2750
2794
  * import { Chunk } from "effect"
2751
2795
  *
@@ -2768,8 +2812,8 @@ export const mapAccum: {
2768
2812
  * console.log(Chunk.toArray(indexed)) // ["0: hello", "1: world", "2: effect"]
2769
2813
  * ```
2770
2814
  *
2771
- * @since 2.0.0
2772
2815
  * @category folding
2816
+ * @since 2.0.0
2773
2817
  */
2774
2818
  <S, A, B>(self: Chunk<A>, s: S, f: (s: S, a: A) => readonly [S, B]): [S, Chunk<B>]
2775
2819
  } = dual(3, <S, A, B>(self: Chunk<A>, s: S, f: (s: S, a: A) => readonly [S, B]): [S, Chunk<B>] => {
@@ -2783,7 +2827,8 @@ export const mapAccum: {
2783
2827
  * - Returns `[excluded, satisfying]`.
2784
2828
  * - The filter receives `(element, index)`.
2785
2829
  *
2786
- * @example
2830
+ * **Example** (Partitioning with a Result)
2831
+ *
2787
2832
  * ```ts
2788
2833
  * import { Chunk, Result } from "effect"
2789
2834
  *
@@ -2805,7 +2850,8 @@ export const partition: {
2805
2850
  * - Returns `[excluded, satisfying]`.
2806
2851
  * - The filter receives `(element, index)`.
2807
2852
  *
2808
- * @example
2853
+ * **Example** (Partitioning with a Result)
2854
+ *
2809
2855
  * ```ts
2810
2856
  * import { Chunk, Result } from "effect"
2811
2857
  *
@@ -2827,7 +2873,8 @@ export const partition: {
2827
2873
  * - Returns `[excluded, satisfying]`.
2828
2874
  * - The filter receives `(element, index)`.
2829
2875
  *
2830
- * @example
2876
+ * **Example** (Partitioning with a Result)
2877
+ *
2831
2878
  * ```ts
2832
2879
  * import { Chunk, Result } from "effect"
2833
2880
  *
@@ -2855,9 +2902,14 @@ export const partition: {
2855
2902
  )
2856
2903
 
2857
2904
  /**
2858
- * Partitions the elements of this chunk into two chunks.
2905
+ * Separates a chunk of `Result` values into a chunk of failures and a chunk of
2906
+ * successes.
2907
+ *
2908
+ * The returned tuple is `[failures, successes]`, preserving the original order
2909
+ * within each side.
2910
+ *
2911
+ * **Example** (Separating failures and successes)
2859
2912
  *
2860
- * @example
2861
2913
  * ```ts
2862
2914
  * import { Chunk } from "effect"
2863
2915
  * import * as Result from "effect/Result"
@@ -2893,7 +2945,8 @@ export const separate = <A, B>(self: Chunk<Result<B, A>>): [Chunk<A>, Chunk<B>]
2893
2945
  /**
2894
2946
  * Retrieves the size of the chunk.
2895
2947
  *
2896
- * @example
2948
+ * **Example** (Getting chunk size)
2949
+ *
2897
2950
  * ```ts
2898
2951
  * import { Chunk } from "effect"
2899
2952
  *
@@ -2909,7 +2962,8 @@ export const size = <A>(self: Chunk<A>): number => self.length
2909
2962
  /**
2910
2963
  * Sort the elements of a Chunk in increasing order, creating a new Chunk.
2911
2964
  *
2912
- * @example
2965
+ * **Example** (Sorting chunks)
2966
+ *
2913
2967
  * ```ts
2914
2968
  * import { Chunk } from "effect"
2915
2969
  * import * as Order from "effect/Order"
@@ -2928,14 +2982,15 @@ export const size = <A>(self: Chunk<A>): number => self.length
2928
2982
  * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
2929
2983
  * ```
2930
2984
  *
2931
- * @since 2.0.0
2932
2985
  * @category sorting
2986
+ * @since 2.0.0
2933
2987
  */
2934
2988
  export const sort: {
2935
2989
  /**
2936
2990
  * Sort the elements of a Chunk in increasing order, creating a new Chunk.
2937
2991
  *
2938
- * @example
2992
+ * **Example** (Sorting chunks)
2993
+ *
2939
2994
  * ```ts
2940
2995
  * import { Chunk } from "effect"
2941
2996
  * import * as Order from "effect/Order"
@@ -2954,14 +3009,15 @@ export const sort: {
2954
3009
  * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
2955
3010
  * ```
2956
3011
  *
2957
- * @since 2.0.0
2958
3012
  * @category sorting
3013
+ * @since 2.0.0
2959
3014
  */
2960
3015
  <B>(O: Order.Order<B>): <A extends B>(self: Chunk<A>) => Chunk<A>
2961
3016
  /**
2962
3017
  * Sort the elements of a Chunk in increasing order, creating a new Chunk.
2963
3018
  *
2964
- * @example
3019
+ * **Example** (Sorting chunks)
3020
+ *
2965
3021
  * ```ts
2966
3022
  * import { Chunk } from "effect"
2967
3023
  * import * as Order from "effect/Order"
@@ -2980,8 +3036,8 @@ export const sort: {
2980
3036
  * console.log(Chunk.toArray(sortedWords)) // ["apple", "banana", "cherry"]
2981
3037
  * ```
2982
3038
  *
2983
- * @since 2.0.0
2984
3039
  * @category sorting
3040
+ * @since 2.0.0
2985
3041
  */
2986
3042
  <A extends B, B>(self: Chunk<A>, O: Order.Order<B>): Chunk<A>
2987
3043
  } = dual(
@@ -2992,7 +3048,8 @@ export const sort: {
2992
3048
  /**
2993
3049
  * Sorts the elements of a Chunk based on a projection function.
2994
3050
  *
2995
- * @example
3051
+ * **Example** (Sorting chunks by a derived value)
3052
+ *
2996
3053
  * ```ts
2997
3054
  * import { Chunk } from "effect"
2998
3055
  * import * as Order from "effect/Order"
@@ -3019,14 +3076,15 @@ export const sort: {
3019
3076
  * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3020
3077
  * ```
3021
3078
  *
3022
- * @since 2.0.0
3023
3079
  * @category sorting
3080
+ * @since 2.0.0
3024
3081
  */
3025
3082
  export const sortWith: {
3026
3083
  /**
3027
3084
  * Sorts the elements of a Chunk based on a projection function.
3028
3085
  *
3029
- * @example
3086
+ * **Example** (Sorting chunks by a derived value)
3087
+ *
3030
3088
  * ```ts
3031
3089
  * import { Chunk } from "effect"
3032
3090
  * import * as Order from "effect/Order"
@@ -3053,14 +3111,15 @@ export const sortWith: {
3053
3111
  * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3054
3112
  * ```
3055
3113
  *
3056
- * @since 2.0.0
3057
3114
  * @category sorting
3115
+ * @since 2.0.0
3058
3116
  */
3059
3117
  <A, B>(f: (a: A) => B, order: Order.Order<B>): (self: Chunk<A>) => Chunk<A>
3060
3118
  /**
3061
3119
  * Sorts the elements of a Chunk based on a projection function.
3062
3120
  *
3063
- * @example
3121
+ * **Example** (Sorting chunks by a derived value)
3122
+ *
3064
3123
  * ```ts
3065
3124
  * import { Chunk } from "effect"
3066
3125
  * import * as Order from "effect/Order"
@@ -3087,8 +3146,8 @@ export const sortWith: {
3087
3146
  * console.log(Chunk.toArray(byLength)) // ["a", "ab", "abc"]
3088
3147
  * ```
3089
3148
  *
3090
- * @since 2.0.0
3091
3149
  * @category sorting
3150
+ * @since 2.0.0
3092
3151
  */
3093
3152
  <A, B>(self: Chunk<A>, f: (a: A) => B, order: Order.Order<B>): Chunk<A>
3094
3153
  } = dual(
@@ -3099,7 +3158,8 @@ export const sortWith: {
3099
3158
  /**
3100
3159
  * Returns two splits of this chunk at the specified index.
3101
3160
  *
3102
- * @example
3161
+ * **Example** (Splitting at an index)
3162
+ *
3103
3163
  * ```ts
3104
3164
  * import { Chunk } from "effect"
3105
3165
  *
@@ -3119,14 +3179,15 @@ export const sortWith: {
3119
3179
  * console.log(Chunk.toArray(empty2)) // []
3120
3180
  * ```
3121
3181
  *
3122
- * @since 2.0.0
3123
3182
  * @category splitting
3183
+ * @since 2.0.0
3124
3184
  */
3125
3185
  export const splitAt: {
3126
3186
  /**
3127
3187
  * Returns two splits of this chunk at the specified index.
3128
3188
  *
3129
- * @example
3189
+ * **Example** (Splitting at an index)
3190
+ *
3130
3191
  * ```ts
3131
3192
  * import { Chunk } from "effect"
3132
3193
  *
@@ -3146,14 +3207,15 @@ export const splitAt: {
3146
3207
  * console.log(Chunk.toArray(empty2)) // []
3147
3208
  * ```
3148
3209
  *
3149
- * @since 2.0.0
3150
3210
  * @category splitting
3211
+ * @since 2.0.0
3151
3212
  */
3152
3213
  (n: number): <A>(self: Chunk<A>) => [beforeIndex: Chunk<A>, fromIndex: Chunk<A>]
3153
3214
  /**
3154
3215
  * Returns two splits of this chunk at the specified index.
3155
3216
  *
3156
- * @example
3217
+ * **Example** (Splitting at an index)
3218
+ *
3157
3219
  * ```ts
3158
3220
  * import { Chunk } from "effect"
3159
3221
  *
@@ -3173,17 +3235,22 @@ export const splitAt: {
3173
3235
  * console.log(Chunk.toArray(empty2)) // []
3174
3236
  * ```
3175
3237
  *
3176
- * @since 2.0.0
3177
3238
  * @category splitting
3239
+ * @since 2.0.0
3178
3240
  */
3179
3241
  <A>(self: Chunk<A>, n: number): [beforeIndex: Chunk<A>, fromIndex: Chunk<A>]
3180
3242
  } = dual(2, <A>(self: Chunk<A>, n: number): [Chunk<A>, Chunk<A>] => [take(self, n), drop(self, n)])
3181
3243
 
3182
3244
  /**
3183
- * Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements.
3184
- * The value of `n` must be `>= 1`.
3245
+ * Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
3246
+ * remaining suffix.
3247
+ *
3248
+ * `n` is floored and normalized to at least `1`. If `n` is greater than or
3249
+ * equal to the chunk length, the first result is the original chunk and the
3250
+ * second result is empty.
3251
+ *
3252
+ * **Example** (Splitting non-empty chunks at an index)
3185
3253
  *
3186
- * @example
3187
3254
  * ```ts
3188
3255
  * import { Chunk } from "effect"
3189
3256
  *
@@ -3206,10 +3273,15 @@ export const splitAt: {
3206
3273
  */
3207
3274
  export const splitNonEmptyAt: {
3208
3275
  /**
3209
- * Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements.
3210
- * The value of `n` must be `>= 1`.
3276
+ * Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
3277
+ * remaining suffix.
3278
+ *
3279
+ * `n` is floored and normalized to at least `1`. If `n` is greater than or
3280
+ * equal to the chunk length, the first result is the original chunk and the
3281
+ * second result is empty.
3282
+ *
3283
+ * **Example** (Splitting non-empty chunks at an index)
3211
3284
  *
3212
- * @example
3213
3285
  * ```ts
3214
3286
  * import { Chunk } from "effect"
3215
3287
  *
@@ -3232,10 +3304,15 @@ export const splitNonEmptyAt: {
3232
3304
  */
3233
3305
  (n: number): <A>(self: NonEmptyChunk<A>) => [beforeIndex: NonEmptyChunk<A>, fromIndex: Chunk<A>]
3234
3306
  /**
3235
- * Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements.
3236
- * The value of `n` must be `>= 1`.
3307
+ * Splits a `NonEmptyChunk` at `n`, returning a non-empty prefix and the
3308
+ * remaining suffix.
3309
+ *
3310
+ * `n` is floored and normalized to at least `1`. If `n` is greater than or
3311
+ * equal to the chunk length, the first result is the original chunk and the
3312
+ * second result is empty.
3313
+ *
3314
+ * **Example** (Splitting non-empty chunks at an index)
3237
3315
  *
3238
- * @example
3239
3316
  * ```ts
3240
3317
  * import { Chunk } from "effect"
3241
3318
  *
@@ -3265,9 +3342,13 @@ export const splitNonEmptyAt: {
3265
3342
  })
3266
3343
 
3267
3344
  /**
3268
- * Splits this chunk into `n` equally sized chunks.
3345
+ * Splits a chunk into up to `n` chunks, distributing elements in order.
3346
+ *
3347
+ * The chunk size is derived from the input length and `n`; the final chunk may
3348
+ * contain fewer elements than the others.
3349
+ *
3350
+ * **Example** (Splitting chunks into groups)
3269
3351
  *
3270
- * @example
3271
3352
  * ```ts
3272
3353
  * import { Chunk } from "effect"
3273
3354
  *
@@ -3288,14 +3369,18 @@ export const splitNonEmptyAt: {
3288
3369
  * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3289
3370
  * ```
3290
3371
  *
3291
- * @since 2.0.0
3292
3372
  * @category splitting
3373
+ * @since 2.0.0
3293
3374
  */
3294
3375
  export const split: {
3295
3376
  /**
3296
- * Splits this chunk into `n` equally sized chunks.
3377
+ * Splits a chunk into up to `n` chunks, distributing elements in order.
3378
+ *
3379
+ * The chunk size is derived from the input length and `n`; the final chunk may
3380
+ * contain fewer elements than the others.
3381
+ *
3382
+ * **Example** (Splitting chunks into groups)
3297
3383
  *
3298
- * @example
3299
3384
  * ```ts
3300
3385
  * import { Chunk } from "effect"
3301
3386
  *
@@ -3316,14 +3401,18 @@ export const split: {
3316
3401
  * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3317
3402
  * ```
3318
3403
  *
3319
- * @since 2.0.0
3320
3404
  * @category splitting
3405
+ * @since 2.0.0
3321
3406
  */
3322
3407
  (n: number): <A>(self: Chunk<A>) => Chunk<Chunk<A>>
3323
3408
  /**
3324
- * Splits this chunk into `n` equally sized chunks.
3409
+ * Splits a chunk into up to `n` chunks, distributing elements in order.
3410
+ *
3411
+ * The chunk size is derived from the input length and `n`; the final chunk may
3412
+ * contain fewer elements than the others.
3413
+ *
3414
+ * **Example** (Splitting chunks into groups)
3325
3415
  *
3326
- * @example
3327
3416
  * ```ts
3328
3417
  * import { Chunk } from "effect"
3329
3418
  *
@@ -3344,8 +3433,8 @@ export const split: {
3344
3433
  * // [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
3345
3434
  * ```
3346
3435
  *
3347
- * @since 2.0.0
3348
3436
  * @category splitting
3437
+ * @since 2.0.0
3349
3438
  */
3350
3439
  <A>(self: Chunk<A>, n: number): Chunk<Chunk<A>>
3351
3440
  } = dual(2, <A>(self: Chunk<A>, n: number) => chunksOf(self, Math.ceil(self.length / Math.floor(n))))
@@ -3354,7 +3443,8 @@ export const split: {
3354
3443
  * Splits this chunk on the first element that matches this predicate.
3355
3444
  * Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
3356
3445
  *
3357
- * @example
3446
+ * **Example** (Splitting at a matching element)
3447
+ *
3358
3448
  * ```ts
3359
3449
  * import { Chunk } from "effect"
3360
3450
  *
@@ -3382,7 +3472,8 @@ export const splitWhere: {
3382
3472
  * Splits this chunk on the first element that matches this predicate.
3383
3473
  * Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
3384
3474
  *
3385
- * @example
3475
+ * **Example** (Splitting at a matching element)
3476
+ *
3386
3477
  * ```ts
3387
3478
  * import { Chunk } from "effect"
3388
3479
  *
@@ -3410,7 +3501,8 @@ export const splitWhere: {
3410
3501
  * Splits this chunk on the first element that matches this predicate.
3411
3502
  * Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.
3412
3503
  *
3413
- * @example
3504
+ * **Example** (Splitting at a matching element)
3505
+ *
3414
3506
  * ```ts
3415
3507
  * import { Chunk } from "effect"
3416
3508
  *
@@ -3449,7 +3541,8 @@ export const splitWhere: {
3449
3541
  /**
3450
3542
  * Returns every elements after the first.
3451
3543
  *
3452
- * @example
3544
+ * **Example** (Getting the tail safely)
3545
+ *
3453
3546
  * ```ts
3454
3547
  * import { Chunk } from "effect"
3455
3548
  *
@@ -3463,15 +3556,16 @@ export const splitWhere: {
3463
3556
  * console.log(Chunk.tail(empty)) // Option.none()
3464
3557
  * ```
3465
3558
  *
3466
- * @since 2.0.0
3467
3559
  * @category elements
3560
+ * @since 2.0.0
3468
3561
  */
3469
3562
  export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ? O.some(drop(self, 1)) : O.none()
3470
3563
 
3471
3564
  /**
3472
3565
  * Returns every elements after the first.
3473
3566
  *
3474
- * @example
3567
+ * **Example** (Getting the tail of a non-empty chunk)
3568
+ *
3475
3569
  * ```ts
3476
3570
  * import { Chunk } from "effect"
3477
3571
  *
@@ -3487,15 +3581,16 @@ export const tail = <A>(self: Chunk<A>): O.Option<Chunk<A>> => self.length > 0 ?
3487
3581
  * // Chunk.tailNonEmpty(Chunk.empty()) // TypeScript error
3488
3582
  * ```
3489
3583
  *
3490
- * @since 2.0.0
3491
3584
  * @category elements
3585
+ * @since 2.0.0
3492
3586
  */
3493
3587
  export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self, 1)
3494
3588
 
3495
3589
  /**
3496
3590
  * Takes the last `n` elements.
3497
3591
  *
3498
- * @example
3592
+ * **Example** (Taking elements from the end)
3593
+ *
3499
3594
  * ```ts
3500
3595
  * import { Chunk } from "effect"
3501
3596
  *
@@ -3512,14 +3607,15 @@ export const tailNonEmpty = <A>(self: NonEmptyChunk<A>): Chunk<A> => drop(self,
3512
3607
  * console.log(Chunk.toArray(none)) // []
3513
3608
  * ```
3514
3609
  *
3515
- * @since 2.0.0
3516
3610
  * @category elements
3611
+ * @since 2.0.0
3517
3612
  */
3518
3613
  export const takeRight: {
3519
3614
  /**
3520
3615
  * Takes the last `n` elements.
3521
3616
  *
3522
- * @example
3617
+ * **Example** (Taking elements from the end)
3618
+ *
3523
3619
  * ```ts
3524
3620
  * import { Chunk } from "effect"
3525
3621
  *
@@ -3536,14 +3632,15 @@ export const takeRight: {
3536
3632
  * console.log(Chunk.toArray(none)) // []
3537
3633
  * ```
3538
3634
  *
3539
- * @since 2.0.0
3540
3635
  * @category elements
3636
+ * @since 2.0.0
3541
3637
  */
3542
3638
  (n: number): <A>(self: Chunk<A>) => Chunk<A>
3543
3639
  /**
3544
3640
  * Takes the last `n` elements.
3545
3641
  *
3546
- * @example
3642
+ * **Example** (Taking elements from the end)
3643
+ *
3547
3644
  * ```ts
3548
3645
  * import { Chunk } from "effect"
3549
3646
  *
@@ -3560,8 +3657,8 @@ export const takeRight: {
3560
3657
  * console.log(Chunk.toArray(none)) // []
3561
3658
  * ```
3562
3659
  *
3563
- * @since 2.0.0
3564
3660
  * @category elements
3661
+ * @since 2.0.0
3565
3662
  */
3566
3663
  <A>(self: Chunk<A>, n: number): Chunk<A>
3567
3664
  } = dual(2, <A>(self: Chunk<A>, n: number): Chunk<A> => drop(self, self.length - n))
@@ -3569,7 +3666,8 @@ export const takeRight: {
3569
3666
  /**
3570
3667
  * Takes all elements so long as the predicate returns true.
3571
3668
  *
3572
- * @example
3669
+ * **Example** (Taking elements while a predicate matches)
3670
+ *
3573
3671
  * ```ts
3574
3672
  * import { Chunk } from "effect"
3575
3673
  *
@@ -3587,14 +3685,15 @@ export const takeRight: {
3587
3685
  * console.log(Chunk.toArray(all)) // [1, 2, 3]
3588
3686
  * ```
3589
3687
  *
3590
- * @since 2.0.0
3591
3688
  * @category elements
3689
+ * @since 2.0.0
3592
3690
  */
3593
3691
  export const takeWhile: {
3594
3692
  /**
3595
3693
  * Takes all elements so long as the predicate returns true.
3596
3694
  *
3597
- * @example
3695
+ * **Example** (Taking elements while a predicate matches)
3696
+ *
3598
3697
  * ```ts
3599
3698
  * import { Chunk } from "effect"
3600
3699
  *
@@ -3612,14 +3711,15 @@ export const takeWhile: {
3612
3711
  * console.log(Chunk.toArray(all)) // [1, 2, 3]
3613
3712
  * ```
3614
3713
  *
3615
- * @since 2.0.0
3616
3714
  * @category elements
3715
+ * @since 2.0.0
3617
3716
  */
3618
3717
  <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Chunk<A>) => Chunk<B>
3619
3718
  /**
3620
3719
  * Takes all elements so long as the predicate returns true.
3621
3720
  *
3622
- * @example
3721
+ * **Example** (Taking elements while a predicate matches)
3722
+ *
3623
3723
  * ```ts
3624
3724
  * import { Chunk } from "effect"
3625
3725
  *
@@ -3637,14 +3737,15 @@ export const takeWhile: {
3637
3737
  * console.log(Chunk.toArray(all)) // [1, 2, 3]
3638
3738
  * ```
3639
3739
  *
3640
- * @since 2.0.0
3641
3740
  * @category elements
3741
+ * @since 2.0.0
3642
3742
  */
3643
3743
  <A>(predicate: Predicate<NoInfer<A>>): (self: Chunk<A>) => Chunk<A>
3644
3744
  /**
3645
3745
  * Takes all elements so long as the predicate returns true.
3646
3746
  *
3647
- * @example
3747
+ * **Example** (Taking elements while a predicate matches)
3748
+ *
3648
3749
  * ```ts
3649
3750
  * import { Chunk } from "effect"
3650
3751
  *
@@ -3662,14 +3763,15 @@ export const takeWhile: {
3662
3763
  * console.log(Chunk.toArray(all)) // [1, 2, 3]
3663
3764
  * ```
3664
3765
  *
3665
- * @since 2.0.0
3666
3766
  * @category elements
3767
+ * @since 2.0.0
3667
3768
  */
3668
3769
  <A, B extends A>(self: Chunk<A>, refinement: Refinement<A, B>): Chunk<B>
3669
3770
  /**
3670
3771
  * Takes all elements so long as the predicate returns true.
3671
3772
  *
3672
- * @example
3773
+ * **Example** (Taking elements while a predicate matches)
3774
+ *
3673
3775
  * ```ts
3674
3776
  * import { Chunk } from "effect"
3675
3777
  *
@@ -3687,8 +3789,8 @@ export const takeWhile: {
3687
3789
  * console.log(Chunk.toArray(all)) // [1, 2, 3]
3688
3790
  * ```
3689
3791
  *
3690
- * @since 2.0.0
3691
3792
  * @category elements
3793
+ * @since 2.0.0
3692
3794
  */
3693
3795
  <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A>
3694
3796
  } = dual(2, <A>(self: Chunk<A>, predicate: Predicate<A>): Chunk<A> => {
@@ -3706,7 +3808,8 @@ export const takeWhile: {
3706
3808
  /**
3707
3809
  * Creates a Chunks of unique values, in order, from all given Chunks.
3708
3810
  *
3709
- * @example
3811
+ * **Example** (Unioning chunks)
3812
+ *
3710
3813
  * ```ts
3711
3814
  * import { Chunk } from "effect"
3712
3815
  *
@@ -3722,14 +3825,15 @@ export const takeWhile: {
3722
3825
  * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3723
3826
  * ```
3724
3827
  *
3725
- * @since 2.0.0
3726
3828
  * @category elements
3829
+ * @since 2.0.0
3727
3830
  */
3728
3831
  export const union: {
3729
3832
  /**
3730
3833
  * Creates a Chunks of unique values, in order, from all given Chunks.
3731
3834
  *
3732
- * @example
3835
+ * **Example** (Unioning chunks)
3836
+ *
3733
3837
  * ```ts
3734
3838
  * import { Chunk } from "effect"
3735
3839
  *
@@ -3745,14 +3849,15 @@ export const union: {
3745
3849
  * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3746
3850
  * ```
3747
3851
  *
3748
- * @since 2.0.0
3749
3852
  * @category elements
3853
+ * @since 2.0.0
3750
3854
  */
3751
3855
  <A>(that: Chunk<A>): <B>(self: Chunk<B>) => Chunk<A | B>
3752
3856
  /**
3753
3857
  * Creates a Chunks of unique values, in order, from all given Chunks.
3754
3858
  *
3755
- * @example
3859
+ * **Example** (Unioning chunks)
3860
+ *
3756
3861
  * ```ts
3757
3862
  * import { Chunk } from "effect"
3758
3863
  *
@@ -3768,8 +3873,8 @@ export const union: {
3768
3873
  * console.log(Chunk.toArray(unified)) // [1, 2, 3]
3769
3874
  * ```
3770
3875
  *
3771
- * @since 2.0.0
3772
3876
  * @category elements
3877
+ * @since 2.0.0
3773
3878
  */
3774
3879
  <A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<A | B>
3775
3880
  } = dual(
@@ -3778,9 +3883,11 @@ export const union: {
3778
3883
  )
3779
3884
 
3780
3885
  /**
3781
- * Remove duplicates from an array, keeping the first occurrence of an element.
3886
+ * Removes duplicate elements from a `Chunk`, preserving the first occurrence
3887
+ * of each value.
3888
+ *
3889
+ * **Example** (Removing duplicate values)
3782
3890
  *
3783
- * @example
3784
3891
  * ```ts
3785
3892
  * import { Chunk } from "effect"
3786
3893
  *
@@ -3799,15 +3906,16 @@ export const union: {
3799
3906
  * console.log(Chunk.toArray(uniqueDeduped)) // [1, 2, 3]
3800
3907
  * ```
3801
3908
  *
3802
- * @since 2.0.0
3803
3909
  * @category elements
3910
+ * @since 2.0.0
3804
3911
  */
3805
3912
  export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe(toReadonlyArray(self)))
3806
3913
 
3807
3914
  /**
3808
3915
  * Deduplicates adjacent elements that are identical.
3809
3916
  *
3810
- * @example
3917
+ * **Example** (Removing adjacent duplicates)
3918
+ *
3811
3919
  * ```ts
3812
3920
  * import { Chunk } from "effect"
3813
3921
  *
@@ -3821,8 +3929,8 @@ export const dedupe = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupe
3821
3929
  * console.log(Chunk.toArray(mixedResult)) // ["a", "b", "a"]
3822
3930
  * ```
3823
3931
  *
3824
- * @since 2.0.0
3825
3932
  * @category filtering
3933
+ * @since 2.0.0
3826
3934
  */
3827
3935
  export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(RA.dedupeAdjacent(self))
3828
3936
 
@@ -3831,7 +3939,8 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
3831
3939
  *
3832
3940
  * Note: The function is reverse of `zip`.
3833
3941
  *
3834
- * @example
3942
+ * **Example** (Unzipping pairs)
3943
+ *
3835
3944
  * ```ts
3836
3945
  * import { Chunk } from "effect"
3837
3946
  *
@@ -3851,8 +3960,8 @@ export const dedupeAdjacent = <A>(self: Chunk<A>): Chunk<A> => fromArrayUnsafe(R
3851
3960
  * console.log(Chunk.toArray(emptyStrs)) // []
3852
3961
  * ```
3853
3962
  *
3854
- * @since 2.0.0
3855
3963
  * @category elements
3964
+ * @since 2.0.0
3856
3965
  */
3857
3966
  export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>] => {
3858
3967
  const [left, right] = RA.unzip(self)
@@ -3862,7 +3971,8 @@ export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>]
3862
3971
  /**
3863
3972
  * Zips this chunk pointwise with the specified chunk using the specified combiner.
3864
3973
  *
3865
- * @example
3974
+ * **Example** (Zipping chunks with a function)
3975
+ *
3866
3976
  * ```ts
3867
3977
  * import { Chunk } from "effect"
3868
3978
  *
@@ -3878,14 +3988,15 @@ export const unzip = <A, B>(self: Chunk<readonly [A, B]>): [Chunk<A>, Chunk<B>]
3878
3988
  * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3879
3989
  * ```
3880
3990
  *
3881
- * @since 2.0.0
3882
3991
  * @category zipping
3992
+ * @since 2.0.0
3883
3993
  */
3884
3994
  export const zipWith: {
3885
3995
  /**
3886
3996
  * Zips this chunk pointwise with the specified chunk using the specified combiner.
3887
3997
  *
3888
- * @example
3998
+ * **Example** (Zipping chunks with a function)
3999
+ *
3889
4000
  * ```ts
3890
4001
  * import { Chunk } from "effect"
3891
4002
  *
@@ -3901,14 +4012,15 @@ export const zipWith: {
3901
4012
  * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3902
4013
  * ```
3903
4014
  *
3904
- * @since 2.0.0
3905
4015
  * @category zipping
4016
+ * @since 2.0.0
3906
4017
  */
3907
4018
  <A, B, C>(that: Chunk<B>, f: (a: A, b: B) => C): (self: Chunk<A>) => Chunk<C>
3908
4019
  /**
3909
4020
  * Zips this chunk pointwise with the specified chunk using the specified combiner.
3910
4021
  *
3911
- * @example
4022
+ * **Example** (Zipping chunks with a function)
4023
+ *
3912
4024
  * ```ts
3913
4025
  * import { Chunk } from "effect"
3914
4026
  *
@@ -3924,8 +4036,8 @@ export const zipWith: {
3924
4036
  * console.log(Chunk.toArray(mixed)) // [[1, "a"], [2, "b"]]
3925
4037
  * ```
3926
4038
  *
3927
- * @since 2.0.0
3928
4039
  * @category zipping
4040
+ * @since 2.0.0
3929
4041
  */
3930
4042
  <A, B, C>(self: Chunk<A>, that: Chunk<B>, f: (a: A, b: B) => C): Chunk<C>
3931
4043
  } = dual(
@@ -3937,7 +4049,8 @@ export const zipWith: {
3937
4049
  /**
3938
4050
  * Zips this chunk pointwise with the specified chunk.
3939
4051
  *
3940
- * @example
4052
+ * **Example** (Zipping chunks)
4053
+ *
3941
4054
  * ```ts
3942
4055
  * import { Chunk } from "effect"
3943
4056
  *
@@ -3953,14 +4066,15 @@ export const zipWith: {
3953
4066
  * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
3954
4067
  * ```
3955
4068
  *
3956
- * @since 2.0.0
3957
4069
  * @category zipping
4070
+ * @since 2.0.0
3958
4071
  */
3959
4072
  export const zip: {
3960
4073
  /**
3961
4074
  * Zips this chunk pointwise with the specified chunk.
3962
4075
  *
3963
- * @example
4076
+ * **Example** (Zipping chunks)
4077
+ *
3964
4078
  * ```ts
3965
4079
  * import { Chunk } from "effect"
3966
4080
  *
@@ -3976,14 +4090,15 @@ export const zip: {
3976
4090
  * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
3977
4091
  * ```
3978
4092
  *
3979
- * @since 2.0.0
3980
4093
  * @category zipping
4094
+ * @since 2.0.0
3981
4095
  */
3982
4096
  <B>(that: Chunk<B>): <A>(self: Chunk<A>) => Chunk<[A, B]>
3983
4097
  /**
3984
4098
  * Zips this chunk pointwise with the specified chunk.
3985
4099
  *
3986
- * @example
4100
+ * **Example** (Zipping chunks)
4101
+ *
3987
4102
  * ```ts
3988
4103
  * import { Chunk } from "effect"
3989
4104
  *
@@ -3999,8 +4114,8 @@ export const zip: {
3999
4114
  * console.log(Chunk.toArray(zipped)) // [[1, "a"], [2, "b"]]
4000
4115
  * ```
4001
4116
  *
4002
- * @since 2.0.0
4003
4117
  * @category zipping
4118
+ * @since 2.0.0
4004
4119
  */
4005
4120
  <A, B>(self: Chunk<A>, that: Chunk<B>): Chunk<[A, B]>
4006
4121
  } = dual(
@@ -4011,7 +4126,8 @@ export const zip: {
4011
4126
  /**
4012
4127
  * Delete the element at the specified index, creating a new `Chunk`.
4013
4128
  *
4014
- * @example
4129
+ * **Example** (Removing an element)
4130
+ *
4015
4131
  * ```ts
4016
4132
  * import { Chunk } from "effect"
4017
4133
  *
@@ -4035,7 +4151,8 @@ export const remove: {
4035
4151
  /**
4036
4152
  * Delete the element at the specified index, creating a new `Chunk`.
4037
4153
  *
4038
- * @example
4154
+ * **Example** (Removing an element)
4155
+ *
4039
4156
  * ```ts
4040
4157
  * import { Chunk } from "effect"
4041
4158
  *
@@ -4059,7 +4176,8 @@ export const remove: {
4059
4176
  /**
4060
4177
  * Delete the element at the specified index, creating a new `Chunk`.
4061
4178
  *
4062
- * @example
4179
+ * **Example** (Removing an element)
4180
+ *
4063
4181
  * ```ts
4064
4182
  * import { Chunk } from "effect"
4065
4183
  *
@@ -4089,7 +4207,8 @@ export const remove: {
4089
4207
  * Applies a function to the element at the specified index, creating a new `Chunk`,
4090
4208
  * or returns `None` if the index is out of bounds.
4091
4209
  *
4092
- * @example
4210
+ * **Example** (Modifying an element)
4211
+ *
4093
4212
  * ```ts
4094
4213
  * import { Chunk } from "effect"
4095
4214
  *
@@ -4114,7 +4233,8 @@ export const modify: {
4114
4233
  * Applies a function to the element at the specified index, creating a new `Chunk`,
4115
4234
  * or returns `None` if the index is out of bounds.
4116
4235
  *
4117
- * @example
4236
+ * **Example** (Modifying an element)
4237
+ *
4118
4238
  * ```ts
4119
4239
  * import { Chunk } from "effect"
4120
4240
  *
@@ -4139,7 +4259,8 @@ export const modify: {
4139
4259
  * Applies a function to the element at the specified index, creating a new `Chunk`,
4140
4260
  * or returns `None` if the index is out of bounds.
4141
4261
  *
4142
- * @example
4262
+ * **Example** (Modifying an element)
4263
+ *
4143
4264
  * ```ts
4144
4265
  * import { Chunk } from "effect"
4145
4266
  *
@@ -4170,7 +4291,8 @@ export const modify: {
4170
4291
  * Change the element at the specified index, creating a new `Chunk`,
4171
4292
  * or returns `None` if the index is out of bounds.
4172
4293
  *
4173
- * @example
4294
+ * **Example** (Replacing an element)
4295
+ *
4174
4296
  * ```ts
4175
4297
  * import { Chunk } from "effect"
4176
4298
  *
@@ -4195,7 +4317,8 @@ export const replace: {
4195
4317
  * Change the element at the specified index, creating a new `Chunk`,
4196
4318
  * or returns `None` if the index is out of bounds.
4197
4319
  *
4198
- * @example
4320
+ * **Example** (Replacing an element)
4321
+ *
4199
4322
  * ```ts
4200
4323
  * import { Chunk } from "effect"
4201
4324
  *
@@ -4220,7 +4343,8 @@ export const replace: {
4220
4343
  * Change the element at the specified index, creating a new `Chunk`,
4221
4344
  * or returns `None` if the index is out of bounds.
4222
4345
  *
4223
- * @example
4346
+ * **Example** (Replacing an element)
4347
+ *
4224
4348
  * ```ts
4225
4349
  * import { Chunk } from "effect"
4226
4350
  *
@@ -4248,13 +4372,13 @@ export const replace: {
4248
4372
  *
4249
4373
  * **Note**. `n` is normalized to an integer >= 1.
4250
4374
  *
4251
- * @example
4375
+ * **Example** (Generating chunks from indices)
4376
+ *
4252
4377
  * ```ts
4253
4378
  * import { Chunk } from "effect"
4254
4379
  *
4255
4380
  * const chunk = Chunk.makeBy(5, (i) => i * 2)
4256
- * console.log(chunk)
4257
- * // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
4381
+ * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4258
4382
  * ```
4259
4383
  *
4260
4384
  * @category constructors
@@ -4266,13 +4390,13 @@ export const makeBy: {
4266
4390
  *
4267
4391
  * **Note**. `n` is normalized to an integer >= 1.
4268
4392
  *
4269
- * @example
4393
+ * **Example** (Generating chunks from indices)
4394
+ *
4270
4395
  * ```ts
4271
4396
  * import { Chunk } from "effect"
4272
4397
  *
4273
4398
  * const chunk = Chunk.makeBy(5, (i) => i * 2)
4274
- * console.log(chunk)
4275
- * // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
4399
+ * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4276
4400
  * ```
4277
4401
  *
4278
4402
  * @category constructors
@@ -4284,13 +4408,13 @@ export const makeBy: {
4284
4408
  *
4285
4409
  * **Note**. `n` is normalized to an integer >= 1.
4286
4410
  *
4287
- * @example
4411
+ * **Example** (Generating chunks from indices)
4412
+ *
4288
4413
  * ```ts
4289
4414
  * import { Chunk } from "effect"
4290
4415
  *
4291
4416
  * const chunk = Chunk.makeBy(5, (i) => i * 2)
4292
- * console.log(chunk)
4293
- * // { _id: 'Chunk', values: [ 0, 2, 4, 6, 8 ] }
4417
+ * console.log(Chunk.toArray(chunk)) // [0, 2, 4, 6, 8]
4294
4418
  * ```
4295
4419
  *
4296
4420
  * @category constructors
@@ -4300,15 +4424,19 @@ export const makeBy: {
4300
4424
  } = dual(2, (n, f) => fromIterable(RA.makeBy(n, f)))
4301
4425
 
4302
4426
  /**
4303
- * Create a non empty `Chunk` containing a range of integers, including both endpoints.
4427
+ * Creates a non-empty `Chunk` of consecutive integers from `start` through
4428
+ * `end`, inclusive.
4429
+ *
4430
+ * If `start` is greater than `end`, returns a single-element chunk containing
4431
+ * `start`.
4432
+ *
4433
+ * **Example** (Creating a range)
4304
4434
  *
4305
- * @example
4306
4435
  * ```ts
4307
4436
  * import { Chunk } from "effect"
4308
4437
  *
4309
4438
  * const chunk = Chunk.range(1, 5)
4310
- * console.log(chunk)
4311
- * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
4439
+ * console.log(Chunk.toArray(chunk)) // [1, 2, 3, 4, 5]
4312
4440
  * ```
4313
4441
  *
4314
4442
  * @category constructors
@@ -4324,7 +4452,8 @@ export const range = (start: number, end: number): NonEmptyChunk<number> =>
4324
4452
  /**
4325
4453
  * Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
4326
4454
  *
4327
- * @example
4455
+ * **Example** (Checking membership)
4456
+ *
4328
4457
  * ```ts
4329
4458
  * import { Chunk } from "effect"
4330
4459
  *
@@ -4353,7 +4482,8 @@ export const contains: {
4353
4482
  /**
4354
4483
  * Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
4355
4484
  *
4356
- * @example
4485
+ * **Example** (Checking membership)
4486
+ *
4357
4487
  * ```ts
4358
4488
  * import { Chunk } from "effect"
4359
4489
  *
@@ -4382,7 +4512,8 @@ export const contains: {
4382
4512
  /**
4383
4513
  * Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.
4384
4514
  *
4385
- * @example
4515
+ * **Example** (Checking membership)
4516
+ *
4386
4517
  * ```ts
4387
4518
  * import { Chunk } from "effect"
4388
4519
  *
@@ -4409,7 +4540,8 @@ export const contains: {
4409
4540
  /**
4410
4541
  * Returns a function that checks if a `Chunk` contains a given value using a provided `isEquivalent` function.
4411
4542
  *
4412
- * @example
4543
+ * **Example** (Checking membership with custom equivalence)
4544
+ *
4413
4545
  * ```ts
4414
4546
  * import { Chunk } from "effect"
4415
4547
  *
@@ -4445,7 +4577,8 @@ export const containsWith: <A>(
4445
4577
  * Returns the first element that satisfies the specified
4446
4578
  * predicate, or `None` if no such element exists.
4447
4579
  *
4448
- * @example
4580
+ * **Example** (Finding the first matching element)
4581
+ *
4449
4582
  * ```ts
4450
4583
  * import { Chunk, Option } from "effect"
4451
4584
  *
@@ -4475,7 +4608,8 @@ export const findFirst: {
4475
4608
  * Returns the first element that satisfies the specified
4476
4609
  * predicate, or `None` if no such element exists.
4477
4610
  *
4478
- * @example
4611
+ * **Example** (Finding the first matching element)
4612
+ *
4479
4613
  * ```ts
4480
4614
  * import { Chunk, Option } from "effect"
4481
4615
  *
@@ -4505,7 +4639,8 @@ export const findFirst: {
4505
4639
  * Returns the first element that satisfies the specified
4506
4640
  * predicate, or `None` if no such element exists.
4507
4641
  *
4508
- * @example
4642
+ * **Example** (Finding the first matching element)
4643
+ *
4509
4644
  * ```ts
4510
4645
  * import { Chunk, Option } from "effect"
4511
4646
  *
@@ -4535,7 +4670,8 @@ export const findFirst: {
4535
4670
  * Returns the first element that satisfies the specified
4536
4671
  * predicate, or `None` if no such element exists.
4537
4672
  *
4538
- * @example
4673
+ * **Example** (Finding the first matching element)
4674
+ *
4539
4675
  * ```ts
4540
4676
  * import { Chunk, Option } from "effect"
4541
4677
  *
@@ -4565,7 +4701,8 @@ export const findFirst: {
4565
4701
  * Returns the first element that satisfies the specified
4566
4702
  * predicate, or `None` if no such element exists.
4567
4703
  *
4568
- * @example
4704
+ * **Example** (Finding the first matching element)
4705
+ *
4569
4706
  * ```ts
4570
4707
  * import { Chunk, Option } from "effect"
4571
4708
  *
@@ -4596,7 +4733,8 @@ export const findFirst: {
4596
4733
  /**
4597
4734
  * Return the first index for which a predicate holds.
4598
4735
  *
4599
- * @example
4736
+ * **Example** (Finding the first matching index)
4737
+ *
4600
4738
  * ```ts
4601
4739
  * import { Chunk } from "effect"
4602
4740
  *
@@ -4620,7 +4758,8 @@ export const findFirstIndex: {
4620
4758
  /**
4621
4759
  * Return the first index for which a predicate holds.
4622
4760
  *
4623
- * @example
4761
+ * **Example** (Finding the first matching index)
4762
+ *
4624
4763
  * ```ts
4625
4764
  * import { Chunk } from "effect"
4626
4765
  *
@@ -4644,7 +4783,8 @@ export const findFirstIndex: {
4644
4783
  /**
4645
4784
  * Return the first index for which a predicate holds.
4646
4785
  *
4647
- * @example
4786
+ * **Example** (Finding the first matching index)
4787
+ *
4648
4788
  * ```ts
4649
4789
  * import { Chunk } from "effect"
4650
4790
  *
@@ -4673,7 +4813,8 @@ export const findFirstIndex: {
4673
4813
  /**
4674
4814
  * Find the last element for which a predicate holds.
4675
4815
  *
4676
- * @example
4816
+ * **Example** (Finding the last matching element)
4817
+ *
4677
4818
  * ```ts
4678
4819
  * import { Chunk } from "effect"
4679
4820
  * import * as Option from "effect/Option"
@@ -4699,7 +4840,8 @@ export const findLast: {
4699
4840
  /**
4700
4841
  * Find the last element for which a predicate holds.
4701
4842
  *
4702
- * @example
4843
+ * **Example** (Finding the last matching element)
4844
+ *
4703
4845
  * ```ts
4704
4846
  * import { Chunk } from "effect"
4705
4847
  * import * as Option from "effect/Option"
@@ -4725,7 +4867,8 @@ export const findLast: {
4725
4867
  /**
4726
4868
  * Find the last element for which a predicate holds.
4727
4869
  *
4728
- * @example
4870
+ * **Example** (Finding the last matching element)
4871
+ *
4729
4872
  * ```ts
4730
4873
  * import { Chunk } from "effect"
4731
4874
  * import * as Option from "effect/Option"
@@ -4751,7 +4894,8 @@ export const findLast: {
4751
4894
  /**
4752
4895
  * Find the last element for which a predicate holds.
4753
4896
  *
4754
- * @example
4897
+ * **Example** (Finding the last matching element)
4898
+ *
4755
4899
  * ```ts
4756
4900
  * import { Chunk } from "effect"
4757
4901
  * import * as Option from "effect/Option"
@@ -4777,7 +4921,8 @@ export const findLast: {
4777
4921
  /**
4778
4922
  * Find the last element for which a predicate holds.
4779
4923
  *
4780
- * @example
4924
+ * **Example** (Finding the last matching element)
4925
+ *
4781
4926
  * ```ts
4782
4927
  * import { Chunk } from "effect"
4783
4928
  * import * as Option from "effect/Option"
@@ -4805,7 +4950,8 @@ export const findLast: {
4805
4950
  /**
4806
4951
  * Return the last index for which a predicate holds.
4807
4952
  *
4808
- * @example
4953
+ * **Example** (Finding the last matching index)
4954
+ *
4809
4955
  * ```ts
4810
4956
  * import { Chunk } from "effect"
4811
4957
  *
@@ -4829,7 +4975,8 @@ export const findLastIndex: {
4829
4975
  /**
4830
4976
  * Return the last index for which a predicate holds.
4831
4977
  *
4832
- * @example
4978
+ * **Example** (Finding the last matching index)
4979
+ *
4833
4980
  * ```ts
4834
4981
  * import { Chunk } from "effect"
4835
4982
  *
@@ -4853,7 +5000,8 @@ export const findLastIndex: {
4853
5000
  /**
4854
5001
  * Return the last index for which a predicate holds.
4855
5002
  *
4856
- * @example
5003
+ * **Example** (Finding the last matching index)
5004
+ *
4857
5005
  * ```ts
4858
5006
  * import { Chunk } from "effect"
4859
5007
  *
@@ -4882,7 +5030,8 @@ export const findLastIndex: {
4882
5030
  /**
4883
5031
  * Check if a predicate holds true for every `Chunk` element.
4884
5032
  *
4885
- * @example
5033
+ * **Example** (Checking every element)
5034
+ *
4886
5035
  * ```ts
4887
5036
  * import { Chunk } from "effect"
4888
5037
  *
@@ -4909,7 +5058,8 @@ export const every: {
4909
5058
  /**
4910
5059
  * Check if a predicate holds true for every `Chunk` element.
4911
5060
  *
4912
- * @example
5061
+ * **Example** (Checking every element)
5062
+ *
4913
5063
  * ```ts
4914
5064
  * import { Chunk } from "effect"
4915
5065
  *
@@ -4936,7 +5086,8 @@ export const every: {
4936
5086
  /**
4937
5087
  * Check if a predicate holds true for every `Chunk` element.
4938
5088
  *
4939
- * @example
5089
+ * **Example** (Checking every element)
5090
+ *
4940
5091
  * ```ts
4941
5092
  * import { Chunk } from "effect"
4942
5093
  *
@@ -4963,7 +5114,8 @@ export const every: {
4963
5114
  /**
4964
5115
  * Check if a predicate holds true for every `Chunk` element.
4965
5116
  *
4966
- * @example
5117
+ * **Example** (Checking every element)
5118
+ *
4967
5119
  * ```ts
4968
5120
  * import { Chunk } from "effect"
4969
5121
  *
@@ -4990,7 +5142,8 @@ export const every: {
4990
5142
  /**
4991
5143
  * Check if a predicate holds true for every `Chunk` element.
4992
5144
  *
4993
- * @example
5145
+ * **Example** (Checking every element)
5146
+ *
4994
5147
  * ```ts
4995
5148
  * import { Chunk } from "effect"
4996
5149
  *
@@ -5023,7 +5176,8 @@ export const every: {
5023
5176
  /**
5024
5177
  * Check if a predicate holds true for some `Chunk` element.
5025
5178
  *
5026
- * @example
5179
+ * **Example** (Checking for some matching element)
5180
+ *
5027
5181
  * ```ts
5028
5182
  * import { Chunk } from "effect"
5029
5183
  *
@@ -5047,7 +5201,8 @@ export const some: {
5047
5201
  /**
5048
5202
  * Check if a predicate holds true for some `Chunk` element.
5049
5203
  *
5050
- * @example
5204
+ * **Example** (Checking for some matching element)
5205
+ *
5051
5206
  * ```ts
5052
5207
  * import { Chunk } from "effect"
5053
5208
  *
@@ -5071,7 +5226,8 @@ export const some: {
5071
5226
  /**
5072
5227
  * Check if a predicate holds true for some `Chunk` element.
5073
5228
  *
5074
- * @example
5229
+ * **Example** (Checking for some matching element)
5230
+ *
5075
5231
  * ```ts
5076
5232
  * import { Chunk } from "effect"
5077
5233
  *
@@ -5100,7 +5256,8 @@ export const some: {
5100
5256
  /**
5101
5257
  * Joins the elements together with "sep" in the middle.
5102
5258
  *
5103
- * @example
5259
+ * **Example** (Joining chunks into a string)
5260
+ *
5104
5261
  * ```ts
5105
5262
  * import { Chunk } from "effect"
5106
5263
  *
@@ -5128,7 +5285,8 @@ export const join: {
5128
5285
  /**
5129
5286
  * Joins the elements together with "sep" in the middle.
5130
5287
  *
5131
- * @example
5288
+ * **Example** (Joining chunks into a string)
5289
+ *
5132
5290
  * ```ts
5133
5291
  * import { Chunk } from "effect"
5134
5292
  *
@@ -5156,7 +5314,8 @@ export const join: {
5156
5314
  /**
5157
5315
  * Joins the elements together with "sep" in the middle.
5158
5316
  *
5159
- * @example
5317
+ * **Example** (Joining chunks into a string)
5318
+ *
5160
5319
  * ```ts
5161
5320
  * import { Chunk } from "effect"
5162
5321
  *
@@ -5186,7 +5345,8 @@ export const join: {
5186
5345
  /**
5187
5346
  * Reduces the elements of a chunk from left to right.
5188
5347
  *
5189
- * @example
5348
+ * **Example** (Reducing from the left)
5349
+ *
5190
5350
  * ```ts
5191
5351
  * import { Chunk } from "effect"
5192
5352
  *
@@ -5211,7 +5371,8 @@ export const reduce: {
5211
5371
  /**
5212
5372
  * Reduces the elements of a chunk from left to right.
5213
5373
  *
5214
- * @example
5374
+ * **Example** (Reducing from the left)
5375
+ *
5215
5376
  * ```ts
5216
5377
  * import { Chunk } from "effect"
5217
5378
  *
@@ -5236,7 +5397,8 @@ export const reduce: {
5236
5397
  /**
5237
5398
  * Reduces the elements of a chunk from left to right.
5238
5399
  *
5239
- * @example
5400
+ * **Example** (Reducing from the left)
5401
+ *
5240
5402
  * ```ts
5241
5403
  * import { Chunk } from "effect"
5242
5404
  *
@@ -5263,7 +5425,8 @@ export const reduce: {
5263
5425
  /**
5264
5426
  * Reduces the elements of a chunk from right to left.
5265
5427
  *
5266
- * @example
5428
+ * **Example** (Reducing from the right)
5429
+ *
5267
5430
  * ```ts
5268
5431
  * import { Chunk } from "effect"
5269
5432
  *
@@ -5292,7 +5455,8 @@ export const reduceRight: {
5292
5455
  /**
5293
5456
  * Reduces the elements of a chunk from right to left.
5294
5457
  *
5295
- * @example
5458
+ * **Example** (Reducing from the right)
5459
+ *
5296
5460
  * ```ts
5297
5461
  * import { Chunk } from "effect"
5298
5462
  *
@@ -5321,7 +5485,8 @@ export const reduceRight: {
5321
5485
  /**
5322
5486
  * Reduces the elements of a chunk from right to left.
5323
5487
  *
5324
- * @example
5488
+ * **Example** (Reducing from the right)
5489
+ *
5325
5490
  * ```ts
5326
5491
  * import { Chunk } from "effect"
5327
5492
  *
@@ -5353,7 +5518,8 @@ export const reduceRight: {
5353
5518
  * Creates a `Chunk` of values not included in the other given `Chunk` using the provided `isEquivalent` function.
5354
5519
  * The order and references of result values are determined by the first `Chunk`.
5355
5520
  *
5356
- * @example
5521
+ * **Example** (Computing difference with custom equivalence)
5522
+ *
5357
5523
  * ```ts
5358
5524
  * import { Chunk } from "effect"
5359
5525
  *
@@ -5394,7 +5560,8 @@ export const differenceWith = <A>(isEquivalent: (self: A, that: A) => boolean):
5394
5560
  * Creates a `Chunk` of values not included in the other given `Chunk`.
5395
5561
  * The order and references of result values are determined by the first `Chunk`.
5396
5562
  *
5397
- * @example
5563
+ * **Example** (Computing chunk difference)
5564
+ *
5398
5565
  * ```ts
5399
5566
  * import { Chunk } from "effect"
5400
5567
  *
@@ -5423,7 +5590,8 @@ export const difference: {
5423
5590
  * Creates a `Chunk` of values not included in the other given `Chunk`.
5424
5591
  * The order and references of result values are determined by the first `Chunk`.
5425
5592
  *
5426
- * @example
5593
+ * **Example** (Computing chunk difference)
5594
+ *
5427
5595
  * ```ts
5428
5596
  * import { Chunk } from "effect"
5429
5597
  *
@@ -5452,7 +5620,8 @@ export const difference: {
5452
5620
  * Creates a `Chunk` of values not included in the other given `Chunk`.
5453
5621
  * The order and references of result values are determined by the first `Chunk`.
5454
5622
  *
5455
- * @example
5623
+ * **Example** (Computing chunk difference)
5624
+ *
5456
5625
  * ```ts
5457
5626
  * import { Chunk } from "effect"
5458
5627
  *