effect 3.10.18 → 3.11.0

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 (448) hide show
  1. package/dist/cjs/Array.js +206 -0
  2. package/dist/cjs/Array.js.map +1 -1
  3. package/dist/cjs/BigDecimal.js +181 -24
  4. package/dist/cjs/BigDecimal.js.map +1 -1
  5. package/dist/cjs/BigInt.js +54 -0
  6. package/dist/cjs/BigInt.js.map +1 -1
  7. package/dist/cjs/Boolean.js +24 -0
  8. package/dist/cjs/Boolean.js.map +1 -1
  9. package/dist/cjs/Brand.js +4 -0
  10. package/dist/cjs/Brand.js.map +1 -1
  11. package/dist/cjs/Channel.js +44 -4
  12. package/dist/cjs/Channel.js.map +1 -1
  13. package/dist/cjs/Chunk.js +8 -0
  14. package/dist/cjs/Chunk.js.map +1 -1
  15. package/dist/cjs/Config.js +10 -1
  16. package/dist/cjs/Config.js.map +1 -1
  17. package/dist/cjs/Context.js +50 -1
  18. package/dist/cjs/Context.js.map +1 -1
  19. package/dist/cjs/Cron.js +81 -67
  20. package/dist/cjs/Cron.js.map +1 -1
  21. package/dist/cjs/Data.js +14 -0
  22. package/dist/cjs/Data.js.map +1 -1
  23. package/dist/cjs/DateTime.js +178 -664
  24. package/dist/cjs/DateTime.js.map +1 -1
  25. package/dist/cjs/Duration.js +2 -0
  26. package/dist/cjs/Duration.js.map +1 -1
  27. package/dist/cjs/Effect.js +296 -4
  28. package/dist/cjs/Effect.js.map +1 -1
  29. package/dist/cjs/Either.js +38 -2
  30. package/dist/cjs/Either.js.map +1 -1
  31. package/dist/cjs/FiberHandle.js +6 -0
  32. package/dist/cjs/FiberHandle.js.map +1 -1
  33. package/dist/cjs/FiberMap.js +6 -0
  34. package/dist/cjs/FiberMap.js.map +1 -1
  35. package/dist/cjs/FiberSet.js +6 -0
  36. package/dist/cjs/FiberSet.js.map +1 -1
  37. package/dist/cjs/Function.js +34 -0
  38. package/dist/cjs/Function.js.map +1 -1
  39. package/dist/cjs/GlobalValue.js +2 -0
  40. package/dist/cjs/GlobalValue.js.map +1 -1
  41. package/dist/cjs/HashMap.js.map +1 -1
  42. package/dist/cjs/Inspectable.js +8 -4
  43. package/dist/cjs/Inspectable.js.map +1 -1
  44. package/dist/cjs/Iterable.js +18 -0
  45. package/dist/cjs/Iterable.js.map +1 -1
  46. package/dist/cjs/JSONSchema.js.map +1 -1
  47. package/dist/cjs/List.js +4 -0
  48. package/dist/cjs/List.js.map +1 -1
  49. package/dist/cjs/Logger.js +26 -0
  50. package/dist/cjs/Logger.js.map +1 -1
  51. package/dist/cjs/Mailbox.js +2 -0
  52. package/dist/cjs/Mailbox.js.map +1 -1
  53. package/dist/cjs/ManagedRuntime.js +2 -0
  54. package/dist/cjs/ManagedRuntime.js.map +1 -1
  55. package/dist/cjs/Metric.js +10 -0
  56. package/dist/cjs/Metric.js.map +1 -1
  57. package/dist/cjs/Micro.js +1104 -1069
  58. package/dist/cjs/Micro.js.map +1 -1
  59. package/dist/cjs/Number.js +44 -0
  60. package/dist/cjs/Number.js.map +1 -1
  61. package/dist/cjs/Option.js +70 -0
  62. package/dist/cjs/Option.js.map +1 -1
  63. package/dist/cjs/Order.js +2 -0
  64. package/dist/cjs/Order.js.map +1 -1
  65. package/dist/cjs/Ordering.js +4 -0
  66. package/dist/cjs/Ordering.js.map +1 -1
  67. package/dist/cjs/Predicate.js +68 -0
  68. package/dist/cjs/Predicate.js.map +1 -1
  69. package/dist/cjs/Random.js +4 -0
  70. package/dist/cjs/Random.js.map +1 -1
  71. package/dist/cjs/RateLimiter.js +4 -0
  72. package/dist/cjs/RateLimiter.js.map +1 -1
  73. package/dist/cjs/RcMap.js +2 -0
  74. package/dist/cjs/RcMap.js.map +1 -1
  75. package/dist/cjs/RcRef.js +2 -0
  76. package/dist/cjs/RcRef.js.map +1 -1
  77. package/dist/cjs/Record.js +56 -0
  78. package/dist/cjs/Record.js.map +1 -1
  79. package/dist/cjs/Redacted.js +8 -0
  80. package/dist/cjs/Redacted.js.map +1 -1
  81. package/dist/cjs/RegExp.js +4 -0
  82. package/dist/cjs/RegExp.js.map +1 -1
  83. package/dist/cjs/Request.js +4 -0
  84. package/dist/cjs/Request.js.map +1 -1
  85. package/dist/cjs/RequestResolver.js +2 -0
  86. package/dist/cjs/RequestResolver.js.map +1 -1
  87. package/dist/cjs/Runtime.js +6 -0
  88. package/dist/cjs/Runtime.js.map +1 -1
  89. package/dist/cjs/STM.js.map +1 -1
  90. package/dist/cjs/Schema.js +91 -8
  91. package/dist/cjs/Schema.js.map +1 -1
  92. package/dist/cjs/Sink.js +9 -1
  93. package/dist/cjs/Sink.js.map +1 -1
  94. package/dist/cjs/Stream.js +179 -7
  95. package/dist/cjs/Stream.js.map +1 -1
  96. package/dist/cjs/String.js +62 -0
  97. package/dist/cjs/String.js.map +1 -1
  98. package/dist/cjs/Struct.js +12 -0
  99. package/dist/cjs/Struct.js.map +1 -1
  100. package/dist/cjs/Symbol.js +2 -0
  101. package/dist/cjs/Symbol.js.map +1 -1
  102. package/dist/cjs/Trie.js +56 -0
  103. package/dist/cjs/Trie.js.map +1 -1
  104. package/dist/cjs/Tuple.js +18 -0
  105. package/dist/cjs/Tuple.js.map +1 -1
  106. package/dist/cjs/Utils.js +7 -1
  107. package/dist/cjs/Utils.js.map +1 -1
  108. package/dist/cjs/internal/channel/channelExecutor.js +5 -9
  109. package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
  110. package/dist/cjs/internal/channel.js +156 -130
  111. package/dist/cjs/internal/channel.js.map +1 -1
  112. package/dist/cjs/internal/config.js +13 -4
  113. package/dist/cjs/internal/config.js.map +1 -1
  114. package/dist/cjs/internal/context.js +46 -3
  115. package/dist/cjs/internal/context.js.map +1 -1
  116. package/dist/cjs/internal/dateTime.js +747 -0
  117. package/dist/cjs/internal/dateTime.js.map +1 -0
  118. package/dist/cjs/internal/fiberRuntime.js +34 -11
  119. package/dist/cjs/internal/fiberRuntime.js.map +1 -1
  120. package/dist/cjs/internal/groupBy.js +9 -3
  121. package/dist/cjs/internal/groupBy.js.map +1 -1
  122. package/dist/cjs/internal/layer.js +1 -1
  123. package/dist/cjs/internal/layer.js.map +1 -1
  124. package/dist/cjs/internal/mailbox.js +1 -1
  125. package/dist/cjs/internal/mailbox.js.map +1 -1
  126. package/dist/cjs/internal/sink.js +25 -21
  127. package/dist/cjs/internal/sink.js.map +1 -1
  128. package/dist/cjs/internal/stream.js +70 -71
  129. package/dist/cjs/internal/stream.js.map +1 -1
  130. package/dist/cjs/internal/version.js +1 -1
  131. package/dist/cjs/internal/version.js.map +1 -1
  132. package/dist/dts/Array.d.ts +534 -0
  133. package/dist/dts/Array.d.ts.map +1 -1
  134. package/dist/dts/BigDecimal.d.ts +172 -1
  135. package/dist/dts/BigDecimal.d.ts.map +1 -1
  136. package/dist/dts/BigInt.d.ts +114 -0
  137. package/dist/dts/BigInt.d.ts.map +1 -1
  138. package/dist/dts/Boolean.d.ts +56 -0
  139. package/dist/dts/Boolean.d.ts.map +1 -1
  140. package/dist/dts/Brand.d.ts +6 -0
  141. package/dist/dts/Brand.d.ts.map +1 -1
  142. package/dist/dts/Channel.d.ts +66 -5
  143. package/dist/dts/Channel.d.ts.map +1 -1
  144. package/dist/dts/Chunk.d.ts +30 -0
  145. package/dist/dts/Chunk.d.ts.map +1 -1
  146. package/dist/dts/Config.d.ts +25 -1
  147. package/dist/dts/Config.d.ts.map +1 -1
  148. package/dist/dts/Context.d.ts +155 -0
  149. package/dist/dts/Context.d.ts.map +1 -1
  150. package/dist/dts/Cron.d.ts +21 -6
  151. package/dist/dts/Cron.d.ts.map +1 -1
  152. package/dist/dts/Data.d.ts +26 -0
  153. package/dist/dts/Data.d.ts.map +1 -1
  154. package/dist/dts/DateTime.d.ts +192 -49
  155. package/dist/dts/DateTime.d.ts.map +1 -1
  156. package/dist/dts/Duration.d.ts +2 -0
  157. package/dist/dts/Duration.d.ts.map +1 -1
  158. package/dist/dts/Effect.d.ts +658 -1
  159. package/dist/dts/Effect.d.ts.map +1 -1
  160. package/dist/dts/Either.d.ts +84 -2
  161. package/dist/dts/Either.d.ts.map +1 -1
  162. package/dist/dts/FiberHandle.d.ts +6 -0
  163. package/dist/dts/FiberHandle.d.ts.map +1 -1
  164. package/dist/dts/FiberMap.d.ts +6 -0
  165. package/dist/dts/FiberMap.d.ts.map +1 -1
  166. package/dist/dts/FiberSet.d.ts +6 -0
  167. package/dist/dts/FiberSet.d.ts.map +1 -1
  168. package/dist/dts/Function.d.ts +50 -0
  169. package/dist/dts/Function.d.ts.map +1 -1
  170. package/dist/dts/GlobalValue.d.ts +2 -0
  171. package/dist/dts/GlobalValue.d.ts.map +1 -1
  172. package/dist/dts/HashMap.d.ts +6 -0
  173. package/dist/dts/HashMap.d.ts.map +1 -1
  174. package/dist/dts/Inspectable.d.ts.map +1 -1
  175. package/dist/dts/Iterable.d.ts +26 -0
  176. package/dist/dts/Iterable.d.ts.map +1 -1
  177. package/dist/dts/JSONSchema.d.ts +1 -0
  178. package/dist/dts/JSONSchema.d.ts.map +1 -1
  179. package/dist/dts/List.d.ts +20 -0
  180. package/dist/dts/List.d.ts.map +1 -1
  181. package/dist/dts/Logger.d.ts +34 -0
  182. package/dist/dts/Logger.d.ts.map +1 -1
  183. package/dist/dts/Mailbox.d.ts +2 -0
  184. package/dist/dts/Mailbox.d.ts.map +1 -1
  185. package/dist/dts/ManagedRuntime.d.ts +2 -0
  186. package/dist/dts/ManagedRuntime.d.ts.map +1 -1
  187. package/dist/dts/Metric.d.ts +18 -0
  188. package/dist/dts/Metric.d.ts.map +1 -1
  189. package/dist/dts/Micro.d.ts +880 -863
  190. package/dist/dts/Micro.d.ts.map +1 -1
  191. package/dist/dts/Number.d.ts +104 -0
  192. package/dist/dts/Number.d.ts.map +1 -1
  193. package/dist/dts/Option.d.ts +142 -0
  194. package/dist/dts/Option.d.ts.map +1 -1
  195. package/dist/dts/Order.d.ts +2 -0
  196. package/dist/dts/Order.d.ts.map +1 -1
  197. package/dist/dts/Ordering.d.ts +8 -0
  198. package/dist/dts/Ordering.d.ts.map +1 -1
  199. package/dist/dts/Predicate.d.ts +104 -0
  200. package/dist/dts/Predicate.d.ts.map +1 -1
  201. package/dist/dts/Random.d.ts +4 -0
  202. package/dist/dts/Random.d.ts.map +1 -1
  203. package/dist/dts/RateLimiter.d.ts +4 -0
  204. package/dist/dts/RateLimiter.d.ts.map +1 -1
  205. package/dist/dts/RcMap.d.ts +6 -0
  206. package/dist/dts/RcMap.d.ts.map +1 -1
  207. package/dist/dts/RcRef.d.ts +2 -0
  208. package/dist/dts/RcRef.d.ts.map +1 -1
  209. package/dist/dts/Record.d.ts +136 -0
  210. package/dist/dts/Record.d.ts.map +1 -1
  211. package/dist/dts/Redacted.d.ts +8 -0
  212. package/dist/dts/Redacted.d.ts.map +1 -1
  213. package/dist/dts/RegExp.d.ts +4 -0
  214. package/dist/dts/RegExp.d.ts.map +1 -1
  215. package/dist/dts/Request.d.ts +4 -0
  216. package/dist/dts/Request.d.ts.map +1 -1
  217. package/dist/dts/RequestResolver.d.ts +6 -0
  218. package/dist/dts/RequestResolver.d.ts.map +1 -1
  219. package/dist/dts/Runtime.d.ts +18 -0
  220. package/dist/dts/Runtime.d.ts.map +1 -1
  221. package/dist/dts/STM.d.ts +2 -0
  222. package/dist/dts/STM.d.ts.map +1 -1
  223. package/dist/dts/Schema.d.ts +90 -0
  224. package/dist/dts/Schema.d.ts.map +1 -1
  225. package/dist/dts/Sink.d.ts +8 -0
  226. package/dist/dts/Sink.d.ts.map +1 -1
  227. package/dist/dts/Stream.d.ts +394 -32
  228. package/dist/dts/Stream.d.ts.map +1 -1
  229. package/dist/dts/String.d.ts +94 -0
  230. package/dist/dts/String.d.ts.map +1 -1
  231. package/dist/dts/Struct.d.ts +24 -0
  232. package/dist/dts/Struct.d.ts.map +1 -1
  233. package/dist/dts/Symbol.d.ts +2 -0
  234. package/dist/dts/Symbol.d.ts.map +1 -1
  235. package/dist/dts/Trie.d.ts +132 -0
  236. package/dist/dts/Trie.d.ts.map +1 -1
  237. package/dist/dts/Tuple.d.ts +42 -0
  238. package/dist/dts/Tuple.d.ts.map +1 -1
  239. package/dist/dts/Types.d.ts +24 -0
  240. package/dist/dts/Types.d.ts.map +1 -1
  241. package/dist/dts/Utils.d.ts +4 -0
  242. package/dist/dts/Utils.d.ts.map +1 -1
  243. package/dist/dts/internal/context.d.ts +1 -1
  244. package/dist/dts/internal/context.d.ts.map +1 -1
  245. package/dist/dts/internal/dateTime.d.ts +2 -0
  246. package/dist/dts/internal/dateTime.d.ts.map +1 -0
  247. package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
  248. package/dist/dts/internal/stream.d.ts.map +1 -1
  249. package/dist/esm/Array.js +208 -0
  250. package/dist/esm/Array.js.map +1 -1
  251. package/dist/esm/BigDecimal.js +175 -20
  252. package/dist/esm/BigDecimal.js.map +1 -1
  253. package/dist/esm/BigInt.js +54 -0
  254. package/dist/esm/BigInt.js.map +1 -1
  255. package/dist/esm/Boolean.js +24 -0
  256. package/dist/esm/Boolean.js.map +1 -1
  257. package/dist/esm/Brand.js +4 -0
  258. package/dist/esm/Brand.js.map +1 -1
  259. package/dist/esm/Channel.js +42 -2
  260. package/dist/esm/Channel.js.map +1 -1
  261. package/dist/esm/Chunk.js +8 -0
  262. package/dist/esm/Chunk.js.map +1 -1
  263. package/dist/esm/Config.js +9 -0
  264. package/dist/esm/Config.js.map +1 -1
  265. package/dist/esm/Context.js +49 -0
  266. package/dist/esm/Context.js.map +1 -1
  267. package/dist/esm/Cron.js +81 -67
  268. package/dist/esm/Cron.js.map +1 -1
  269. package/dist/esm/Data.js +16 -0
  270. package/dist/esm/Data.js.map +1 -1
  271. package/dist/esm/DateTime.js +176 -627
  272. package/dist/esm/DateTime.js.map +1 -1
  273. package/dist/esm/Duration.js +2 -0
  274. package/dist/esm/Duration.js.map +1 -1
  275. package/dist/esm/Effect.js +297 -0
  276. package/dist/esm/Effect.js.map +1 -1
  277. package/dist/esm/Either.js +40 -2
  278. package/dist/esm/Either.js.map +1 -1
  279. package/dist/esm/FiberHandle.js +6 -0
  280. package/dist/esm/FiberHandle.js.map +1 -1
  281. package/dist/esm/FiberMap.js +6 -0
  282. package/dist/esm/FiberMap.js.map +1 -1
  283. package/dist/esm/FiberSet.js +6 -0
  284. package/dist/esm/FiberSet.js.map +1 -1
  285. package/dist/esm/Function.js +34 -0
  286. package/dist/esm/Function.js.map +1 -1
  287. package/dist/esm/GlobalValue.js +2 -0
  288. package/dist/esm/GlobalValue.js.map +1 -1
  289. package/dist/esm/HashMap.js.map +1 -1
  290. package/dist/esm/Inspectable.js +8 -4
  291. package/dist/esm/Inspectable.js.map +1 -1
  292. package/dist/esm/Iterable.js +18 -0
  293. package/dist/esm/Iterable.js.map +1 -1
  294. package/dist/esm/JSONSchema.js.map +1 -1
  295. package/dist/esm/List.js +4 -0
  296. package/dist/esm/List.js.map +1 -1
  297. package/dist/esm/Logger.js +26 -0
  298. package/dist/esm/Logger.js.map +1 -1
  299. package/dist/esm/Mailbox.js +2 -0
  300. package/dist/esm/Mailbox.js.map +1 -1
  301. package/dist/esm/ManagedRuntime.js +2 -0
  302. package/dist/esm/ManagedRuntime.js.map +1 -1
  303. package/dist/esm/Metric.js +10 -0
  304. package/dist/esm/Metric.js.map +1 -1
  305. package/dist/esm/Micro.js +1077 -1037
  306. package/dist/esm/Micro.js.map +1 -1
  307. package/dist/esm/Number.js +44 -0
  308. package/dist/esm/Number.js.map +1 -1
  309. package/dist/esm/Option.js +72 -0
  310. package/dist/esm/Option.js.map +1 -1
  311. package/dist/esm/Order.js +2 -0
  312. package/dist/esm/Order.js.map +1 -1
  313. package/dist/esm/Ordering.js +4 -0
  314. package/dist/esm/Ordering.js.map +1 -1
  315. package/dist/esm/Predicate.js +68 -0
  316. package/dist/esm/Predicate.js.map +1 -1
  317. package/dist/esm/Random.js +4 -0
  318. package/dist/esm/Random.js.map +1 -1
  319. package/dist/esm/RateLimiter.js +4 -0
  320. package/dist/esm/RateLimiter.js.map +1 -1
  321. package/dist/esm/RcMap.js +2 -0
  322. package/dist/esm/RcMap.js.map +1 -1
  323. package/dist/esm/RcRef.js +2 -0
  324. package/dist/esm/RcRef.js.map +1 -1
  325. package/dist/esm/Record.js +56 -0
  326. package/dist/esm/Record.js.map +1 -1
  327. package/dist/esm/Redacted.js +8 -0
  328. package/dist/esm/Redacted.js.map +1 -1
  329. package/dist/esm/RegExp.js +4 -0
  330. package/dist/esm/RegExp.js.map +1 -1
  331. package/dist/esm/Request.js +4 -0
  332. package/dist/esm/Request.js.map +1 -1
  333. package/dist/esm/RequestResolver.js +2 -0
  334. package/dist/esm/RequestResolver.js.map +1 -1
  335. package/dist/esm/Runtime.js +6 -0
  336. package/dist/esm/Runtime.js.map +1 -1
  337. package/dist/esm/STM.js.map +1 -1
  338. package/dist/esm/Schema.js +88 -0
  339. package/dist/esm/Schema.js.map +1 -1
  340. package/dist/esm/Sink.js +8 -0
  341. package/dist/esm/Sink.js.map +1 -1
  342. package/dist/esm/Stream.js +183 -5
  343. package/dist/esm/Stream.js.map +1 -1
  344. package/dist/esm/String.js +62 -0
  345. package/dist/esm/String.js.map +1 -1
  346. package/dist/esm/Struct.js +12 -0
  347. package/dist/esm/Struct.js.map +1 -1
  348. package/dist/esm/Symbol.js +2 -0
  349. package/dist/esm/Symbol.js.map +1 -1
  350. package/dist/esm/Trie.js +56 -0
  351. package/dist/esm/Trie.js.map +1 -1
  352. package/dist/esm/Tuple.js +22 -0
  353. package/dist/esm/Tuple.js.map +1 -1
  354. package/dist/esm/Utils.js +5 -0
  355. package/dist/esm/Utils.js.map +1 -1
  356. package/dist/esm/internal/channel/channelExecutor.js +5 -7
  357. package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
  358. package/dist/esm/internal/channel.js +152 -129
  359. package/dist/esm/internal/channel.js.map +1 -1
  360. package/dist/esm/internal/config.js +11 -3
  361. package/dist/esm/internal/config.js.map +1 -1
  362. package/dist/esm/internal/context.js +42 -2
  363. package/dist/esm/internal/context.js.map +1 -1
  364. package/dist/esm/internal/dateTime.js +704 -0
  365. package/dist/esm/internal/dateTime.js.map +1 -0
  366. package/dist/esm/internal/fiberRuntime.js +31 -9
  367. package/dist/esm/internal/fiberRuntime.js.map +1 -1
  368. package/dist/esm/internal/groupBy.js +9 -3
  369. package/dist/esm/internal/groupBy.js.map +1 -1
  370. package/dist/esm/internal/layer.js +1 -1
  371. package/dist/esm/internal/layer.js.map +1 -1
  372. package/dist/esm/internal/mailbox.js +1 -1
  373. package/dist/esm/internal/mailbox.js.map +1 -1
  374. package/dist/esm/internal/sink.js +23 -20
  375. package/dist/esm/internal/sink.js.map +1 -1
  376. package/dist/esm/internal/stream.js +66 -69
  377. package/dist/esm/internal/stream.js.map +1 -1
  378. package/dist/esm/internal/version.js +1 -1
  379. package/dist/esm/internal/version.js.map +1 -1
  380. package/package.json +1 -1
  381. package/src/Array.ts +534 -0
  382. package/src/BigDecimal.ts +247 -21
  383. package/src/BigInt.ts +114 -0
  384. package/src/Boolean.ts +56 -0
  385. package/src/Brand.ts +6 -0
  386. package/src/Channel.ts +81 -5
  387. package/src/Chunk.ts +32 -0
  388. package/src/Config.ts +26 -1
  389. package/src/Context.ts +163 -0
  390. package/src/Cron.ts +91 -68
  391. package/src/Data.ts +26 -0
  392. package/src/DateTime.ts +307 -757
  393. package/src/Duration.ts +2 -0
  394. package/src/Effect.ts +910 -1
  395. package/src/Either.ts +84 -2
  396. package/src/FiberHandle.ts +6 -0
  397. package/src/FiberMap.ts +6 -0
  398. package/src/FiberSet.ts +6 -0
  399. package/src/Function.ts +50 -0
  400. package/src/GlobalValue.ts +2 -0
  401. package/src/HashMap.ts +6 -0
  402. package/src/Inspectable.ts +11 -7
  403. package/src/Iterable.ts +26 -0
  404. package/src/JSONSchema.ts +1 -0
  405. package/src/List.ts +24 -0
  406. package/src/Logger.ts +34 -0
  407. package/src/Mailbox.ts +2 -0
  408. package/src/ManagedRuntime.ts +2 -0
  409. package/src/Metric.ts +18 -0
  410. package/src/Micro.ts +2007 -1745
  411. package/src/Number.ts +104 -0
  412. package/src/Option.ts +142 -0
  413. package/src/Order.ts +2 -0
  414. package/src/Ordering.ts +8 -0
  415. package/src/Predicate.ts +104 -0
  416. package/src/Random.ts +4 -0
  417. package/src/RateLimiter.ts +4 -0
  418. package/src/RcMap.ts +6 -0
  419. package/src/RcRef.ts +2 -0
  420. package/src/Record.ts +136 -0
  421. package/src/Redacted.ts +8 -0
  422. package/src/RegExp.ts +4 -0
  423. package/src/Request.ts +4 -0
  424. package/src/RequestResolver.ts +6 -0
  425. package/src/Runtime.ts +18 -0
  426. package/src/STM.ts +2 -0
  427. package/src/Schema.ts +124 -0
  428. package/src/Sink.ts +11 -0
  429. package/src/Stream.ts +399 -44
  430. package/src/String.ts +94 -0
  431. package/src/Struct.ts +24 -0
  432. package/src/Symbol.ts +2 -0
  433. package/src/Trie.ts +132 -0
  434. package/src/Tuple.ts +42 -0
  435. package/src/Types.ts +24 -0
  436. package/src/Utils.ts +8 -0
  437. package/src/internal/channel/channelExecutor.ts +37 -33
  438. package/src/internal/channel.ts +504 -467
  439. package/src/internal/config.ts +18 -6
  440. package/src/internal/context.ts +56 -4
  441. package/src/internal/dateTime.ts +1126 -0
  442. package/src/internal/fiberRuntime.ts +35 -16
  443. package/src/internal/groupBy.ts +13 -22
  444. package/src/internal/layer.ts +5 -8
  445. package/src/internal/mailbox.ts +6 -4
  446. package/src/internal/sink.ts +55 -35
  447. package/src/internal/stream.ts +299 -299
  448. package/src/internal/version.ts +1 -1
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.fromIterableEffect = exports.fromIterable = exports.fromEventListener = exports.fromEffectOption = exports.fromEffect = exports.fromChunks = exports.fromChunkQueue = exports.fromChunkPubSub = exports.fromChunk = exports.fromChannel = exports.fromAsyncIterable = exports.forever = exports.flattenTake = exports.flattenIterables = exports.flattenExitOption = exports.flattenEffect = exports.flattenChunks = exports.flatten = exports.flatMap = exports.findEffect = exports.find = exports.finalizer = exports.filterMapWhileEffect = exports.filterMapWhile = exports.filterMapEffect = exports.filterMap = exports.filterEffect = exports.filter = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.execute = exports.ensuringWith = exports.ensuring = exports.encodeText = exports.empty = exports.either = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropRight = exports.drop = exports.drainFork = exports.drain = exports.distributedWithDynamic = exports.distributedWith = exports.dieSync = exports.dieMessage = exports.die = exports.decodeText = exports.debounce = exports.crossWith = exports.crossRight = exports.crossLeft = exports.cross = exports.contextWithStream = exports.contextWithEffect = exports.contextWith = exports.context = exports.concatAll = exports.concat = exports.combineChunks = exports.combine = exports.chunksWith = exports.chunks = exports.changesWithEffect = exports.changesWith = exports.changes = exports.catchTags = exports.catchTag = exports.catchSomeCause = exports.catchSome = exports.catchAllCause = exports.catchAll = exports.bufferChunks = exports.buffer = exports.broadcastedQueuesDynamic = exports.broadcastedQueues = exports.broadcastDynamic = exports.broadcast = exports.branchAfter = exports.bindTo = exports.bindEffect = exports.bind = exports.asyncScoped = exports.asyncPush = exports.asyncEffect = exports.async = exports.as = exports.aggregateWithinEither = exports.aggregateWithin = exports.aggregate = exports.acquireRelease = exports.accumulateChunks = exports.accumulate = exports.StreamTypeId = exports.Do = exports.DefaultChunkSize = void 0;
7
7
  exports.run = exports.retry = exports.repeatWith = exports.repeatValue = exports.repeatElementsWith = exports.repeatElements = exports.repeatEither = exports.repeatEffectWithSchedule = exports.repeatEffectOption = exports.repeatEffectChunkOption = exports.repeatEffectChunk = exports.repeatEffect = exports.repeat = exports.refineOrDieWith = exports.refineOrDie = exports.rechunk = exports.range = exports.raceAll = exports.race = exports.provideSomeLayer = exports.provideServiceStream = exports.provideServiceEffect = exports.provideService = exports.provideLayer = exports.provideContext = exports.prepend = exports.pipeThroughChannelOrFail = exports.pipeThroughChannel = exports.pipeThrough = exports.peel = exports.partitionEither = exports.partition = exports.paginateEffect = exports.paginateChunkEffect = exports.paginateChunk = exports.paginate = exports.orElseSucceed = exports.orElseIfEmptyStream = exports.orElseIfEmptyChunk = exports.orElseIfEmpty = exports.orElseFail = exports.orElseEither = exports.orElse = exports.orDieWith = exports.orDie = exports.onStart = exports.onError = exports.onEnd = exports.onDone = exports.never = exports.mkString = exports.mergeWithTag = exports.mergeWith = exports.mergeRight = exports.mergeLeft = exports.mergeEither = exports.mergeAll = exports.merge = exports.mapInputContext = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.mapConcatEffect = exports.mapConcatChunkEffect = exports.mapConcatChunk = exports.mapConcat = exports.mapChunksEffect = exports.mapChunks = exports.mapBoth = exports.mapAccumEffect = exports.mapAccum = exports.map = exports.make = exports.let = exports.iterate = exports.intersperseAffixes = exports.intersperse = exports.interruptWhenDeferred = exports.interruptWhen = exports.interruptAfter = exports.interleaveWith = exports.interleave = exports.identity = exports.haltWhenDeferred = exports.haltWhen = exports.haltAfter = exports.groupedWithin = exports.grouped = exports.groupByKey = exports.groupBy = exports.groupAdjacentBy = exports.fromTQueue = exports.fromTPubSub = exports.fromSchedule = exports.fromReadableStreamByob = exports.fromReadableStream = exports.fromQueue = exports.fromPull = exports.fromPubSub = exports.fromIteratorSucceed = void 0;
8
- exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipLatestWith = exports.zipLatestAll = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.void = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStreamRuntime = exports.toReadableStreamEffect = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.share = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect = exports.runFoldScoped = exports.runFoldEffect = exports.runFold = exports.runDrain = exports.runCount = exports.runCollect = void 0;
9
- exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = void 0;
8
+ exports.zipLeft = exports.zipLatestWith = exports.zipLatestAll = exports.zipLatest = exports.zipFlatten = exports.zipAllWith = exports.zipAllSortedByKeyWith = exports.zipAllSortedByKeyRight = exports.zipAllSortedByKeyLeft = exports.zipAllSortedByKey = exports.zipAllRight = exports.zipAllLeft = exports.zipAll = exports.zip = exports.withSpan = exports.whenEffect = exports.whenCaseEffect = exports.whenCase = exports.when = exports.void = exports.updateService = exports.unwrapScopedWith = exports.unwrapScoped = exports.unwrap = exports.unfoldEffect = exports.unfoldChunkEffect = exports.unfoldChunk = exports.unfold = exports.transduce = exports.toReadableStreamRuntime = exports.toReadableStreamEffect = exports.toReadableStream = exports.toQueueOfElements = exports.toQueue = exports.toPull = exports.toPubSub = exports.toChannel = exports.timeoutTo = exports.timeoutFailCause = exports.timeoutFail = exports.timeout = exports.tick = exports.throttleEffect = exports.throttle = exports.tapSink = exports.tapErrorCause = exports.tapError = exports.tapBoth = exports.tap = exports.takeWhile = exports.takeUntilEffect = exports.takeUntil = exports.takeRight = exports.take = exports.sync = exports.suspend = exports.succeed = exports.splitOnChunk = exports.splitLines = exports.split = exports.someOrFail = exports.someOrElse = exports.some = exports.slidingSize = exports.sliding = exports.share = exports.scopedWith = exports.scoped = exports.scheduleWith = exports.schedule = exports.scanReduceEffect = exports.scanReduce = exports.scanEffect = exports.scan = exports.runSum = exports.runScoped = exports.runLast = exports.runIntoQueueScoped = exports.runIntoQueueElementsScoped = exports.runIntoQueue = exports.runIntoPubSubScoped = exports.runIntoPubSub = exports.runHead = exports.runForEachWhileScoped = exports.runForEachWhile = exports.runForEachScoped = exports.runForEachChunkScoped = exports.runForEachChunk = exports.runForEach = exports.runFoldWhileScopedEffect = exports.runFoldWhileScoped = exports.runFoldWhileEffect = exports.runFoldWhile = exports.runFoldScopedEffect = exports.runFoldScoped = exports.runFoldEffect = exports.runFold = exports.runDrain = exports.runCount = exports.runCollect = void 0;
9
+ exports.zipWithPreviousAndNext = exports.zipWithPrevious = exports.zipWithNext = exports.zipWithIndex = exports.zipWithChunks = exports.zipWith = exports.zipRight = void 0;
10
10
  var _groupBy = _interopRequireWildcard(require("./internal/groupBy.js"));
11
11
  var internal = _interopRequireWildcard(require("./internal/stream.js"));
12
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -44,6 +44,7 @@ const accumulateChunks = exports.accumulateChunks = internal.accumulateChunks;
44
44
  * stream is consumed.
45
45
  *
46
46
  * @example
47
+ * ```ts
47
48
  * import { Console, Effect, Stream } from "effect"
48
49
  *
49
50
  * // Simulating File operations
@@ -65,6 +66,7 @@ const accumulateChunks = exports.accumulateChunks = internal.accumulateChunks;
65
66
  * // Opening file.txt
66
67
  * // Closing file.txt
67
68
  * // { _id: 'Chunk', values: [ [ 'Line 1', 'Line 2', 'Line 3' ] ] }
69
+ * ```
68
70
  *
69
71
  * @since 2.0.0
70
72
  * @category constructors
@@ -118,12 +120,14 @@ const aggregateWithinEither = exports.aggregateWithinEither = internal.aggregate
118
120
  * Maps the success values of this stream to the specified constant value.
119
121
  *
120
122
  * @example
123
+ * ```ts
121
124
  * import { Effect, Stream } from "effect"
122
125
  *
123
126
  * const stream = Stream.range(1, 5).pipe(Stream.as(null))
124
127
  *
125
128
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
126
129
  * // { _id: 'Chunk', values: [ null, null, null, null, null ] }
130
+ * ```
127
131
  *
128
132
  * @since 2.0.0
129
133
  * @category mapping
@@ -154,6 +158,7 @@ const asyncEffect = exports.asyncEffect = internal.asyncEffect;
154
158
  * second argument with the `bufferSize` and `strategy` fields.
155
159
  *
156
160
  * @example
161
+ * ```ts
157
162
  * import { Effect, Stream } from "effect"
158
163
  *
159
164
  * Stream.asyncPush<string>((emit) =>
@@ -168,6 +173,7 @@ const asyncEffect = exports.asyncEffect = internal.asyncEffect;
168
173
  * clearInterval(handle)
169
174
  * })
170
175
  * ), { bufferSize: 16, strategy: "dropping" })
176
+ * ```
171
177
  *
172
178
  * @since 3.6.0
173
179
  * @category constructors
@@ -198,6 +204,7 @@ const branchAfter = exports.branchAfter = internal.branchAfter;
198
204
  * chunks before the slowest downstream stream.
199
205
  *
200
206
  * @example
207
+ * ```ts
201
208
  * import { Console, Effect, Fiber, Schedule, Stream } from "effect"
202
209
  *
203
210
  * const numbers = Effect.scoped(
@@ -267,6 +274,7 @@ const branchAfter = exports.branchAfter = internal.branchAfter;
267
274
  * // Logging to the Console: 19
268
275
  * // Logging to the Console: 20
269
276
  * // { _id: 'Chunk', values: [ undefined ] }
277
+ * ```
270
278
  *
271
279
  * @since 2.0.0
272
280
  * @category utils
@@ -321,6 +329,7 @@ const broadcastedQueuesDynamic = exports.broadcastedQueuesDynamic = internal.bro
321
329
  * of 2 for better performance.
322
330
  *
323
331
  * @example
332
+ * ```ts
324
333
  * import { Console, Effect, Schedule, Stream } from "effect"
325
334
  *
326
335
  * const stream = Stream.range(1, 10).pipe(
@@ -347,6 +356,7 @@ const broadcastedQueuesDynamic = exports.broadcastedQueuesDynamic = internal.bro
347
356
  * // after buffering: 5
348
357
  * // before buffering: 10
349
358
  * // ...
359
+ * ```
350
360
  *
351
361
  * @since 2.0.0
352
362
  * @category utils
@@ -417,12 +427,14 @@ const catchSomeCause = exports.catchSomeCause = internal.catchSomeCause;
417
427
  * elements are equal.
418
428
  *
419
429
  * @example
430
+ * ```ts
420
431
  * import { Effect, Stream } from "effect"
421
432
  *
422
433
  * const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)
423
434
  *
424
435
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
425
436
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
437
+ * ```
426
438
  *
427
439
  * @since 2.0.0
428
440
  * @category utils
@@ -493,6 +505,7 @@ const combineChunks = exports.combineChunks = internal.combineChunks;
493
505
  * specified stream.
494
506
  *
495
507
  * @example
508
+ * ```ts
496
509
  * import { Effect, Stream } from "effect"
497
510
  *
498
511
  * const s1 = Stream.make(1, 2, 3)
@@ -502,6 +515,7 @@ const combineChunks = exports.combineChunks = internal.combineChunks;
502
515
  *
503
516
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
504
517
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
518
+ * ```
505
519
  *
506
520
  * @since 2.0.0
507
521
  * @category utils
@@ -511,6 +525,7 @@ const concat = exports.concat = internal.concat;
511
525
  * Concatenates all of the streams in the chunk to one stream.
512
526
  *
513
527
  * @example
528
+ * ```ts
514
529
  * import { Chunk, Effect, Stream } from "effect"
515
530
  *
516
531
  * const s1 = Stream.make(1, 2, 3)
@@ -527,6 +542,7 @@ const concat = exports.concat = internal.concat;
527
542
  * // 5, 6, 7, 8
528
543
  * // ]
529
544
  * // }
545
+ * ```
530
546
  *
531
547
  * @since 2.0.0
532
548
  * @category constructors
@@ -540,6 +556,7 @@ const concatAll = exports.concatAll = internal.concatAll;
540
556
  * See also `Stream.zip` for the more common point-wise variant.
541
557
  *
542
558
  * @example
559
+ * ```ts
543
560
  * import { Effect, Stream } from "effect"
544
561
  *
545
562
  * const s1 = Stream.make(1, 2, 3)
@@ -554,6 +571,7 @@ const concatAll = exports.concatAll = internal.concatAll;
554
571
  * // [ 1, "a" ], [ 1, "b" ], [ 2, "a" ], [ 2, "b" ], [ 3, "a" ], [ 3, "b" ]
555
572
  * // ]
556
573
  * // }
574
+ * ```
557
575
  *
558
576
  * @since 2.0.0
559
577
  * @category utils
@@ -605,6 +623,7 @@ const crossWith = exports.crossWith = internal.crossWith;
605
623
  * has paused typing so as to not prematurely recommend results.
606
624
  *
607
625
  * @example
626
+ * ```ts
608
627
  * import { Effect, Stream } from "effect"
609
628
  *
610
629
  * let last = Date.now()
@@ -642,6 +661,7 @@ const crossWith = exports.crossWith = internal.crossWith;
642
661
  * // Received 8 after 1ms
643
662
  * // > Emitted 8 after 101ms
644
663
  * // { _id: 'Chunk', values: [ 3, 6, 8 ] }
664
+ * ```
645
665
  *
646
666
  * @since 2.0.0
647
667
  * @category utils
@@ -694,6 +714,7 @@ const distributedWithDynamic = exports.distributedWithDynamic = internal.distrib
694
714
  * elements. Useful for sequencing effects using streams:
695
715
  *
696
716
  * @example
717
+ * ```ts
697
718
  * import { Effect, Stream } from "effect"
698
719
  *
699
720
  * // We create a stream and immediately drain it.
@@ -701,6 +722,7 @@ const distributedWithDynamic = exports.distributedWithDynamic = internal.distrib
701
722
  *
702
723
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
703
724
  * // { _id: 'Chunk', values: [] }
725
+ * ```
704
726
  *
705
727
  * @since 2.0.0
706
728
  * @category utils
@@ -778,12 +800,14 @@ const either = exports.either = internal.either;
778
800
  * The empty stream.
779
801
  *
780
802
  * @example
803
+ * ```ts
781
804
  * import { Effect, Stream } from "effect"
782
805
  *
783
806
  * const stream = Stream.empty
784
807
  *
785
808
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
786
809
  * // { _id: 'Chunk', values: [] }
810
+ * ```
787
811
  *
788
812
  * @since 2.0.0
789
813
  * @category constructors
@@ -793,6 +817,7 @@ const empty = exports.empty = internal.empty;
793
817
  * Executes the provided finalizer after this stream's finalizers run.
794
818
  *
795
819
  * @example
820
+ * ```ts
796
821
  * import { Console, Effect, Stream } from "effect"
797
822
  *
798
823
  * const program = Stream.fromEffect(Console.log("Application Logic.")).pipe(
@@ -807,6 +832,7 @@ const empty = exports.empty = internal.empty;
807
832
  * // Finalizing the stream
808
833
  * // Doing some other works after stream's finalization
809
834
  * // { _id: 'Chunk', values: [ undefined, undefined ] }
835
+ * ```
810
836
  *
811
837
  * @since 2.0.0
812
838
  * @category utils
@@ -858,6 +884,7 @@ const execute = exports.execute = internal.execute;
858
884
  * Terminates with the specified error.
859
885
  *
860
886
  * @example
887
+ * ```ts
861
888
  * import { Effect, Stream } from "effect"
862
889
  *
863
890
  * const stream = Stream.fail("Uh oh!")
@@ -868,6 +895,7 @@ const execute = exports.execute = internal.execute;
868
895
  * // _tag: 'Failure',
869
896
  * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Uh oh!' }
870
897
  * // }
898
+ * ```
871
899
  *
872
900
  * @since 2.0.0
873
901
  * @category constructors
@@ -898,12 +926,14 @@ const failCauseSync = exports.failCauseSync = internal.failCauseSync;
898
926
  * Filters the elements emitted by this stream using the provided function.
899
927
  *
900
928
  * @example
929
+ * ```ts
901
930
  * import { Effect, Stream } from "effect"
902
931
  *
903
932
  * const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))
904
933
  *
905
934
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
906
935
  * // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
936
+ * ```
907
937
  *
908
938
  * @since 2.0.0
909
939
  * @category filtering
@@ -951,6 +981,7 @@ const filterMapWhileEffect = exports.filterMapWhileEffect = internal.filterMapWh
951
981
  * when it ends.
952
982
  *
953
983
  * @example
984
+ * ```ts
954
985
  * import { Console, Effect, Stream } from "effect"
955
986
  *
956
987
  * const application = Stream.fromEffect(Console.log("Application Logic."))
@@ -972,6 +1003,7 @@ const filterMapWhileEffect = exports.filterMapWhileEffect = internal.filterMapWh
972
1003
  * // Deleting dir: tmp
973
1004
  * // Temporary directory was deleted.
974
1005
  * // { _id: 'Chunk', values: [ undefined, undefined ] }
1006
+ * ```
975
1007
  *
976
1008
  * @since 2.0.0
977
1009
  * @category constructors
@@ -1065,6 +1097,7 @@ const forever = exports.forever = internal.forever;
1065
1097
  * Creates a stream from an `AsyncIterable`.
1066
1098
  *
1067
1099
  * @example
1100
+ * ```ts
1068
1101
  * import { Effect, Stream } from "effect"
1069
1102
  *
1070
1103
  * const myAsyncIterable = async function*() {
@@ -1079,6 +1112,7 @@ const forever = exports.forever = internal.forever;
1079
1112
  *
1080
1113
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1081
1114
  * // { _id: 'Chunk', values: [ 1, 2 ] }
1115
+ * ```
1082
1116
  *
1083
1117
  * @since 2.0.0
1084
1118
  * @category constructors
@@ -1102,6 +1136,7 @@ const toChannel = exports.toChannel = internal.toChannel;
1102
1136
  * Creates a stream from a `Chunk` of values.
1103
1137
  *
1104
1138
  * @example
1139
+ * ```ts
1105
1140
  * import { Chunk, Effect, Stream } from "effect"
1106
1141
  *
1107
1142
  * // Creating a stream with values from a single Chunk
@@ -1109,6 +1144,7 @@ const toChannel = exports.toChannel = internal.toChannel;
1109
1144
  *
1110
1145
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1111
1146
  * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1147
+ * ```
1112
1148
  *
1113
1149
  * @since 2.0.0
1114
1150
  * @category constructors
@@ -1134,6 +1170,7 @@ const fromChunkQueue = exports.fromChunkQueue = internal.fromChunkQueue;
1134
1170
  * Creates a stream from an arbitrary number of chunks.
1135
1171
  *
1136
1172
  * @example
1173
+ * ```ts
1137
1174
  * import { Chunk, Effect, Stream } from "effect"
1138
1175
  *
1139
1176
  * // Creating a stream with values from multiple Chunks
@@ -1141,6 +1178,7 @@ const fromChunkQueue = exports.fromChunkQueue = internal.fromChunkQueue;
1141
1178
  *
1142
1179
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1143
1180
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
1181
+ * ```
1144
1182
  *
1145
1183
  * @since 2.0.0
1146
1184
  * @category constructors
@@ -1151,12 +1189,14 @@ const fromChunks = exports.fromChunks = internal.fromChunks;
1151
1189
  * with the failure value of this effect.
1152
1190
  *
1153
1191
  * @example
1192
+ * ```ts
1154
1193
  * import { Effect, Random, Stream } from "effect"
1155
1194
  *
1156
1195
  * const stream = Stream.fromEffect(Random.nextInt)
1157
1196
  *
1158
1197
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1159
1198
  * // Example Output: { _id: 'Chunk', values: [ 922694024 ] }
1199
+ * ```
1160
1200
  *
1161
1201
  * @since 2.0.0
1162
1202
  * @category constructors
@@ -1189,6 +1229,7 @@ const fromTPubSub = exports.fromTPubSub = internal.fromTPubSub;
1189
1229
  * Creates a new `Stream` from an iterable collection of values.
1190
1230
  *
1191
1231
  * @example
1232
+ * ```ts
1192
1233
  * import { Effect, Stream } from "effect"
1193
1234
  *
1194
1235
  * const numbers = [1, 2, 3]
@@ -1197,6 +1238,7 @@ const fromTPubSub = exports.fromTPubSub = internal.fromTPubSub;
1197
1238
  *
1198
1239
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1199
1240
  * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1241
+ * ```
1200
1242
  *
1201
1243
  * @since 2.0.0
1202
1244
  * @category constructors
@@ -1206,6 +1248,7 @@ const fromIterable = exports.fromIterable = internal.fromIterable;
1206
1248
  * Creates a stream from an effect producing a value of type `Iterable<A>`.
1207
1249
  *
1208
1250
  * @example
1251
+ * ```ts
1209
1252
  * import { Context, Effect, Stream } from "effect"
1210
1253
  *
1211
1254
  * class Database extends Context.Tag("Database")<
@@ -1221,6 +1264,7 @@ const fromIterable = exports.fromIterable = internal.fromIterable;
1221
1264
  * // Stream.runCollect(stream.pipe(Stream.provideService(Database, { getUsers: Effect.succeed(["user1", "user2"]) })))
1222
1265
  * // ).then(console.log)
1223
1266
  * // { _id: 'Chunk', values: [ 'user1', 'user2' ] }
1267
+ * ```
1224
1268
  *
1225
1269
  * @since 2.0.0
1226
1270
  * @category constructors
@@ -1283,6 +1327,7 @@ const fromReadableStreamByob = exports.fromReadableStreamByob = internal.fromRea
1283
1327
  * schedule, continuing for as long as the schedule continues.
1284
1328
  *
1285
1329
  * @example
1330
+ * ```ts
1286
1331
  * import { Effect, Schedule, Stream } from "effect"
1287
1332
  *
1288
1333
  * // Emits values every 1 second for a total of 5 emissions
@@ -1294,6 +1339,7 @@ const fromReadableStreamByob = exports.fromReadableStreamByob = internal.fromRea
1294
1339
  *
1295
1340
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1296
1341
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
1342
+ * ```
1297
1343
  *
1298
1344
  * @since 2.0.0
1299
1345
  * @category constructors
@@ -1311,6 +1357,7 @@ const groupAdjacentBy = exports.groupAdjacentBy = internal.groupAdjacentBy;
1311
1357
  * More powerful version of `Stream.groupByKey`.
1312
1358
  *
1313
1359
  * @example
1360
+ * ```ts
1314
1361
  * import { Chunk, Effect, GroupBy, Stream } from "effect"
1315
1362
  *
1316
1363
  * const groupByKeyResult = Stream.fromIterable([
@@ -1338,6 +1385,7 @@ const groupAdjacentBy = exports.groupAdjacentBy = internal.groupAdjacentBy;
1338
1385
  * // _id: 'Chunk',
1339
1386
  * // values: [ [ 'M', 1 ], [ 'J', 3 ], [ 'R', 2 ], [ 'P', 2 ] ]
1340
1387
  * // }
1388
+ * ```
1341
1389
  *
1342
1390
  * @since 2.0.0
1343
1391
  * @category grouping
@@ -1385,6 +1433,7 @@ const groupByKey = exports.groupByKey = _groupBy.groupByKey;
1385
1433
  * Partitions the stream with specified `chunkSize`.
1386
1434
  *
1387
1435
  * @example
1436
+ * ```ts
1388
1437
  * import { Effect, Stream } from "effect"
1389
1438
  *
1390
1439
  * const stream = Stream.range(0, 8).pipe(Stream.grouped(3))
@@ -1399,6 +1448,7 @@ const groupByKey = exports.groupByKey = _groupBy.groupByKey;
1399
1448
  * // [length]: 3
1400
1449
  * // ]
1401
1450
  * // }
1451
+ * ```
1402
1452
  *
1403
1453
  * @since 2.0.0
1404
1454
  * @category grouping
@@ -1409,6 +1459,7 @@ const grouped = exports.grouped = internal.grouped;
1409
1459
  * `duration` has passed, whichever is satisfied first.
1410
1460
  *
1411
1461
  * @example
1462
+ * ```ts
1412
1463
  * import { Chunk, Effect, Schedule, Stream } from "effect"
1413
1464
  *
1414
1465
  * const stream = Stream.range(0, 9).pipe(
@@ -1444,6 +1495,7 @@ const grouped = exports.grouped = internal.grouped;
1444
1495
  * // ]
1445
1496
  * // }
1446
1497
  * // ]
1498
+ * ```
1447
1499
  *
1448
1500
  * @since 2.0.0
1449
1501
  * @category grouping
@@ -1497,6 +1549,7 @@ const identity = exports.identity = internal.identityStream;
1497
1549
  * pulled.
1498
1550
  *
1499
1551
  * @example
1552
+ * ```ts
1500
1553
  * import { Effect, Stream } from "effect"
1501
1554
  *
1502
1555
  * const s1 = Stream.make(1, 2, 3)
@@ -1506,6 +1559,7 @@ const identity = exports.identity = internal.identityStream;
1506
1559
  *
1507
1560
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1508
1561
  * // { _id: 'Chunk', values: [ 1, 4, 2, 5, 3, 6 ] }
1562
+ * ```
1509
1563
  * @since 2.0.0
1510
1564
  * @category utils
1511
1565
  */
@@ -1520,6 +1574,7 @@ const interleave = exports.interleave = internal.interleave;
1520
1574
  * ignored.
1521
1575
  *
1522
1576
  * @example
1577
+ * ```ts
1523
1578
  * import { Effect, Stream } from "effect"
1524
1579
  *
1525
1580
  * const s1 = Stream.make(1, 3, 5, 7, 9)
@@ -1537,6 +1592,7 @@ const interleave = exports.interleave = internal.interleave;
1537
1592
  * // 8, 5, 10, 7, 9
1538
1593
  * // ]
1539
1594
  * // }
1595
+ * ```
1540
1596
  *
1541
1597
  * @since 2.0.0
1542
1598
  * @category utils
@@ -1546,6 +1602,7 @@ const interleaveWith = exports.interleaveWith = internal.interleaveWith;
1546
1602
  * Intersperse stream with provided `element`.
1547
1603
  *
1548
1604
  * @example
1605
+ * ```ts
1549
1606
  * import { Effect, Stream } from "effect"
1550
1607
  *
1551
1608
  * const stream = Stream.make(1, 2, 3, 4, 5).pipe(Stream.intersperse(0))
@@ -1558,6 +1615,7 @@ const interleaveWith = exports.interleaveWith = internal.interleaveWith;
1558
1615
  * // 0, 4, 0, 5
1559
1616
  * // ]
1560
1617
  * // }
1618
+ * ```
1561
1619
  *
1562
1620
  * @since 2.0.0
1563
1621
  * @category utils
@@ -1567,6 +1625,7 @@ const intersperse = exports.intersperse = internal.intersperse;
1567
1625
  * Intersperse the specified element, also adding a prefix and a suffix.
1568
1626
  *
1569
1627
  * @example
1628
+ * ```ts
1570
1629
  * import { Effect, Stream } from "effect"
1571
1630
  *
1572
1631
  * const stream = Stream.make(1, 2, 3, 4, 5).pipe(
@@ -1586,6 +1645,7 @@ const intersperse = exports.intersperse = internal.intersperse;
1586
1645
  * // ']'
1587
1646
  * // ]
1588
1647
  * // }
1648
+ * ```
1589
1649
  *
1590
1650
  * @since 2.0.0
1591
1651
  * @category utils
@@ -1628,6 +1688,7 @@ const interruptWhenDeferred = exports.interruptWhenDeferred = internal.interrupt
1628
1688
  * f(f(f(a))), ...
1629
1689
  *
1630
1690
  * @example
1691
+ * ```ts
1631
1692
  * import { Effect, Stream } from "effect"
1632
1693
  *
1633
1694
  * // An infinite Stream of numbers starting from 1 and incrementing
@@ -1635,6 +1696,7 @@ const interruptWhenDeferred = exports.interruptWhenDeferred = internal.interrupt
1635
1696
  *
1636
1697
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(10)))).then(console.log)
1637
1698
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }
1699
+ * ```
1638
1700
  *
1639
1701
  * @since 2.0.0
1640
1702
  * @category constructors
@@ -1644,12 +1706,14 @@ const iterate = exports.iterate = internal.iterate;
1644
1706
  * Creates a stream from an sequence of values.
1645
1707
  *
1646
1708
  * @example
1709
+ * ```ts
1647
1710
  * import { Effect, Stream } from "effect"
1648
1711
  *
1649
1712
  * const stream = Stream.make(1, 2, 3)
1650
1713
  *
1651
1714
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1652
1715
  * // { _id: 'Chunk', values: [ 1, 2, 3 ] }
1716
+ * ```
1653
1717
  *
1654
1718
  * @since 2.0.0
1655
1719
  * @category constructors
@@ -1659,12 +1723,14 @@ const make = exports.make = internal.make;
1659
1723
  * Transforms the elements of this stream using the supplied function.
1660
1724
  *
1661
1725
  * @example
1726
+ * ```ts
1662
1727
  * import { Effect, Stream } from "effect"
1663
1728
  *
1664
1729
  * const stream = Stream.make(1, 2, 3).pipe(Stream.map((n) => n + 1))
1665
1730
  *
1666
1731
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1667
1732
  * // { _id: 'Chunk', values: [ 2, 3, 4 ] }
1733
+ * ```
1668
1734
  *
1669
1735
  * @since 2.0.0
1670
1736
  * @category mapping
@@ -1674,6 +1740,7 @@ const map = exports.map = internal.map;
1674
1740
  * Statefully maps over the elements of this stream to produce new elements.
1675
1741
  *
1676
1742
  * @example
1743
+ * ```ts
1677
1744
  * import { Effect, Stream } from "effect"
1678
1745
  *
1679
1746
  * const runningTotal = (stream: Stream.Stream<number>): Stream.Stream<number> =>
@@ -1684,6 +1751,7 @@ const map = exports.map = internal.map;
1684
1751
  * // console.log
1685
1752
  * // )
1686
1753
  * // { _id: "Chunk", values: [ 0, 1, 3, 6, 10, 15, 21 ] }
1754
+ * ```
1687
1755
  *
1688
1756
  * @since 2.0.0
1689
1757
  * @category mapping
@@ -1724,6 +1792,7 @@ const mapChunksEffect = exports.mapChunksEffect = internal.mapChunksEffect;
1724
1792
  * output of this stream.
1725
1793
  *
1726
1794
  * @example
1795
+ * ```ts
1727
1796
  * import { Effect, Stream } from "effect"
1728
1797
  *
1729
1798
  * const numbers = Stream.make("1-2-3", "4-5", "6").pipe(
@@ -1733,6 +1802,7 @@ const mapChunksEffect = exports.mapChunksEffect = internal.mapChunksEffect;
1733
1802
  *
1734
1803
  * // Effect.runPromise(Stream.runCollect(numbers)).then(console.log)
1735
1804
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5, 6 ] }
1805
+ * ```
1736
1806
  *
1737
1807
  * @since 2.0.0
1738
1808
  * @category mapping
@@ -1766,6 +1836,7 @@ const mapConcatEffect = exports.mapConcatEffect = internal.mapConcatEffect;
1766
1836
  * Maps over elements of the stream with the specified effectful function.
1767
1837
  *
1768
1838
  * @example
1839
+ * ```ts
1769
1840
  * import { Effect, Random, Stream } from "effect"
1770
1841
  *
1771
1842
  * const stream = Stream.make(10, 20, 30).pipe(
@@ -1774,6 +1845,7 @@ const mapConcatEffect = exports.mapConcatEffect = internal.mapConcatEffect;
1774
1845
  *
1775
1846
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1776
1847
  * // Example Output: { _id: 'Chunk', values: [ 7, 19, 8 ] }
1848
+ * ```
1777
1849
  *
1778
1850
  * @since 2.0.0
1779
1851
  * @category mapping
@@ -1800,6 +1872,7 @@ const mapErrorCause = exports.mapErrorCause = internal.mapErrorCause;
1800
1872
  * no termination strategy is specified.
1801
1873
  *
1802
1874
  * @example
1875
+ * ```ts
1803
1876
  * import { Effect, Schedule, Stream } from "effect"
1804
1877
  *
1805
1878
  * const s1 = Stream.make(1, 2, 3).pipe(
@@ -1813,6 +1886,7 @@ const mapErrorCause = exports.mapErrorCause = internal.mapErrorCause;
1813
1886
  *
1814
1887
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1815
1888
  * // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
1889
+ * ```
1816
1890
  *
1817
1891
  * @since 2.0.0
1818
1892
  * @category utils
@@ -1833,12 +1907,14 @@ const mergeAll = exports.mergeAll = internal.mergeAll;
1833
1907
  * @since 3.8.5
1834
1908
  *
1835
1909
  * @example
1910
+ * ```ts
1836
1911
  * import { Stream } from "effect"
1837
1912
  * // Stream.Stream<{ _tag: "a"; value: number; } | { _tag: "b"; value: string; }>
1838
1913
  * const res = Stream.mergeWithTag({
1839
1914
  * a: Stream.make(0),
1840
1915
  * b: Stream.make("")
1841
1916
  * }, { concurrency: "unbounded" })
1917
+ * ```
1842
1918
  */
1843
1919
  const mergeWithTag = exports.mergeWithTag = internal.mergeWithTag;
1844
1920
  /**
@@ -1849,6 +1925,7 @@ const mergeWithTag = exports.mergeWithTag = internal.mergeWithTag;
1849
1925
  * no termination strategy is specified.
1850
1926
  *
1851
1927
  * @example
1928
+ * ```ts
1852
1929
  * import { Effect, Schedule, Stream } from "effect"
1853
1930
  *
1854
1931
  * const s1 = Stream.make("1", "2", "3").pipe(
@@ -1865,6 +1942,7 @@ const mergeWithTag = exports.mergeWithTag = internal.mergeWithTag;
1865
1942
  *
1866
1943
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
1867
1944
  * // { _id: 'Chunk', values: [ 1, 4, 2, 3, 5, 6 ] }
1945
+ * ```
1868
1946
  *
1869
1947
  * @since 2.0.0
1870
1948
  * @category utils
@@ -1913,6 +1991,7 @@ const never = exports.never = internal.never;
1913
1991
  * Adds an effect to be executed at the end of the stream.
1914
1992
  *
1915
1993
  * @example
1994
+ * ```ts
1916
1995
  * import { Console, Effect, Stream } from "effect"
1917
1996
  *
1918
1997
  * const stream = Stream.make(1, 2, 3).pipe(
@@ -1927,6 +2006,7 @@ const never = exports.never = internal.never;
1927
2006
  * // after mapping: 6
1928
2007
  * // Stream ended
1929
2008
  * // { _id: 'Chunk', values: [ 2, 4, 6 ] }
2009
+ * ```
1930
2010
  *
1931
2011
  * @since 3.6.0
1932
2012
  * @category sequencing
@@ -1954,6 +2034,7 @@ const onDone = exports.onDone = internal.onDone;
1954
2034
  * Adds an effect to be executed at the start of the stream.
1955
2035
  *
1956
2036
  * @example
2037
+ * ```ts
1957
2038
  * import { Console, Effect, Stream } from "effect"
1958
2039
  *
1959
2040
  * const stream = Stream.make(1, 2, 3).pipe(
@@ -1968,6 +2049,7 @@ const onDone = exports.onDone = internal.onDone;
1968
2049
  * // after mapping: 4
1969
2050
  * // after mapping: 6
1970
2051
  * // { _id: 'Chunk', values: [ 2, 4, 6 ] }
2052
+ * ```
1971
2053
  *
1972
2054
  * @since 3.6.0
1973
2055
  * @category sequencing
@@ -2050,6 +2132,7 @@ const orElseSucceed = exports.orElseSucceed = internal.orElseSucceed;
2050
2132
  * APIs, hence the name.
2051
2133
  *
2052
2134
  * @example
2135
+ * ```ts
2053
2136
  * import { Effect, Option, Stream } from "effect"
2054
2137
  *
2055
2138
  * const stream = Stream.paginate(0, (n) => [
@@ -2059,6 +2142,7 @@ const orElseSucceed = exports.orElseSucceed = internal.orElseSucceed;
2059
2142
  *
2060
2143
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2061
2144
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3 ] }
2145
+ * ```
2062
2146
  *
2063
2147
  * @since 2.0.0
2064
2148
  * @category constructors
@@ -2093,11 +2177,12 @@ const paginateChunkEffect = exports.paginateChunkEffect = internal.paginateChunk
2093
2177
  const paginateEffect = exports.paginateEffect = internal.paginateEffect;
2094
2178
  /**
2095
2179
  * Partition a stream using a predicate. The first stream will contain all
2096
- * element evaluated to true and the second one will contain all element
2097
- * evaluated to false. The faster stream may advance by up to buffer elements
2180
+ * element evaluated to false and the second one will contain all element
2181
+ * evaluated to true. The faster stream may advance by up to buffer elements
2098
2182
  * further than the slower one.
2099
2183
  *
2100
2184
  * @example
2185
+ * ```ts
2101
2186
  * import { Effect, Stream } from "effect"
2102
2187
  *
2103
2188
  * const partition = Stream.range(1, 10).pipe(
@@ -2106,15 +2191,16 @@ const paginateEffect = exports.paginateEffect = internal.paginateEffect;
2106
2191
  *
2107
2192
  * const program = Effect.scoped(
2108
2193
  * Effect.gen(function*() {
2109
- * const [evens, odds] = yield* partition
2110
- * console.log(yield* Stream.runCollect(evens))
2194
+ * const [odds, evens] = yield* partition
2111
2195
  * console.log(yield* Stream.runCollect(odds))
2196
+ * console.log(yield* Stream.runCollect(evens))
2112
2197
  * })
2113
2198
  * )
2114
2199
  *
2115
2200
  * // Effect.runPromise(program)
2116
- * // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
2117
2201
  * // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
2202
+ * // { _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
2203
+ * ```
2118
2204
  *
2119
2205
  * @since 2.0.0
2120
2206
  * @category utils
@@ -2125,6 +2211,7 @@ const partition = exports.partition = internal.partition;
2125
2211
  * up to buffer elements further than the slower one.
2126
2212
  *
2127
2213
  * @example
2214
+ * ```ts
2128
2215
  * import { Effect, Either, Stream } from "effect"
2129
2216
  *
2130
2217
  * const partition = Stream.range(1, 9).pipe(
@@ -2145,6 +2232,7 @@ const partition = exports.partition = internal.partition;
2145
2232
  * // Effect.runPromise(program)
2146
2233
  * // { _id: 'Chunk', values: [ 2, 4, 6, 8 ] }
2147
2234
  * // { _id: 'Chunk', values: [ 1, 3, 5, 7, 9 ] }
2235
+ * ```
2148
2236
  *
2149
2237
  * @since 2.0.0
2150
2238
  * @category utils
@@ -2253,6 +2341,7 @@ const provideSomeLayer = exports.provideSomeLayer = internal.provideSomeLayer;
2253
2341
  * Any upstream failures will cause the returned stream to fail.
2254
2342
  *
2255
2343
  * @example
2344
+ * ```ts
2256
2345
  * import { Stream, Schedule, Console, Effect } from "effect"
2257
2346
  *
2258
2347
  * const stream = Stream.fromSchedule(Schedule.spaced('2 millis')).pipe(
@@ -2269,6 +2358,7 @@ const provideSomeLayer = exports.provideSomeLayer = internal.provideSomeLayer;
2269
2358
  * // 3
2270
2359
  * // 4
2271
2360
  * // 5
2361
+ * ```
2272
2362
  * @since 3.7.0
2273
2363
  * @category racing
2274
2364
  */
@@ -2280,6 +2370,7 @@ const race = exports.race = internal.race;
2280
2370
  * Any upstream failures will cause the returned stream to fail.
2281
2371
  *
2282
2372
  * @example
2373
+ * ```ts
2283
2374
  * import { Stream, Schedule, Console, Effect } from "effect"
2284
2375
  *
2285
2376
  * const stream = Stream.raceAll(
@@ -2296,6 +2387,7 @@ const race = exports.race = internal.race;
2296
2387
  * // 3
2297
2388
  * // 4
2298
2389
  * // 5
2390
+ * ```
2299
2391
  * @since 3.5.0
2300
2392
  * @category racing
2301
2393
  */
@@ -2304,6 +2396,7 @@ const raceAll = exports.raceAll = internal.raceAll;
2304
2396
  * Constructs a stream from a range of integers, including both endpoints.
2305
2397
  *
2306
2398
  * @example
2399
+ * ```ts
2307
2400
  * import { Effect, Stream } from "effect"
2308
2401
  *
2309
2402
  * // A Stream with a range of numbers from 1 to 5
@@ -2311,6 +2404,7 @@ const raceAll = exports.raceAll = internal.raceAll;
2311
2404
  *
2312
2405
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2313
2406
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
2407
+ * ```
2314
2408
  *
2315
2409
  * @since 2.0.0
2316
2410
  * @category constructors
@@ -2344,12 +2438,14 @@ const refineOrDieWith = exports.refineOrDieWith = internal.refineOrDieWith;
2344
2438
  * execute normally, and then repeat again according to the provided schedule.
2345
2439
  *
2346
2440
  * @example
2441
+ * ```ts
2347
2442
  * import { Effect, Schedule, Stream } from "effect"
2348
2443
  *
2349
2444
  * const stream = Stream.repeat(Stream.succeed(1), Schedule.forever)
2350
2445
  *
2351
2446
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
2352
2447
  * // { _id: 'Chunk', values: [ 1, 1, 1, 1, 1 ] }
2448
+ * ```
2353
2449
  *
2354
2450
  * @since 2.0.0
2355
2451
  * @category utils
@@ -2360,12 +2456,14 @@ const repeat = exports.repeat = internal.repeat;
2360
2456
  * forever.
2361
2457
  *
2362
2458
  * @example
2459
+ * ```ts
2363
2460
  * import { Effect, Random, Stream } from "effect"
2364
2461
  *
2365
2462
  * const stream = Stream.repeatEffect(Random.nextInt)
2366
2463
  *
2367
2464
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
2368
2465
  * // Example Output: { _id: 'Chunk', values: [ 3891571149, 4239494205, 2352981603, 2339111046, 1488052210 ] }
2466
+ * ```
2369
2467
  *
2370
2468
  * @since 2.0.0
2371
2469
  * @category constructors
@@ -2392,6 +2490,7 @@ const repeatEffectChunkOption = exports.repeatEffectChunkOption = internal.repea
2392
2490
  * with `None`.
2393
2491
  *
2394
2492
  * @example
2493
+ * ```ts
2395
2494
  * // In this example, we're draining an Iterator to create a stream from it
2396
2495
  * import { Stream, Effect, Option } from "effect"
2397
2496
  *
@@ -2406,6 +2505,7 @@ const repeatEffectChunkOption = exports.repeatEffectChunkOption = internal.repea
2406
2505
  * })
2407
2506
  * )
2408
2507
  * )
2508
+ * ```
2409
2509
  *
2410
2510
  * @since 2.0.0
2411
2511
  * @category constructors
@@ -2459,12 +2559,14 @@ const repeatElementsWith = exports.repeatElementsWith = internal.repeatElementsW
2459
2559
  * Repeats the provided value infinitely.
2460
2560
  *
2461
2561
  * @example
2562
+ * ```ts
2462
2563
  * import { Effect, Stream } from "effect"
2463
2564
  *
2464
2565
  * const stream = Stream.repeatValue(0)
2465
2566
  *
2466
2567
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
2467
2568
  * // { _id: 'Chunk', values: [ 0, 0, 0, 0, 0 ] }
2569
+ * ```
2468
2570
  *
2469
2571
  * @since 2.0.0
2470
2572
  * @category constructors
@@ -2708,12 +2810,14 @@ const runSum = exports.runSum = internal.runSum;
2708
2810
  * intermediate results of type `S` given an initial S.
2709
2811
  *
2710
2812
  * @example
2813
+ * ```ts
2711
2814
  * import { Effect, Stream } from "effect"
2712
2815
  *
2713
2816
  * const stream = Stream.range(1, 6).pipe(Stream.scan(0, (a, b) => a + b))
2714
2817
  *
2715
2818
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2716
2819
  * // { _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15, 21 ] }
2820
+ * ```
2717
2821
  *
2718
2822
  * @since 2.0.0
2719
2823
  * @category utils
@@ -2767,6 +2871,7 @@ const scheduleWith = exports.scheduleWith = internal.scheduleWith;
2767
2871
  * Creates a single-valued stream from a scoped resource.
2768
2872
  *
2769
2873
  * @example
2874
+ * ```ts
2770
2875
  * import { Console, Effect, Stream } from "effect"
2771
2876
  *
2772
2877
  * // Creating a single-valued stream from a scoped resource
@@ -2783,11 +2888,21 @@ const scheduleWith = exports.scheduleWith = internal.scheduleWith;
2783
2888
  * // use
2784
2889
  * // release
2785
2890
  * // { _id: 'Chunk', values: [ undefined ] }
2891
+ * ```
2786
2892
  *
2787
2893
  * @since 2.0.0
2788
2894
  * @category constructors
2789
2895
  */
2790
2896
  const scoped = exports.scoped = internal.scoped;
2897
+ /**
2898
+ * Use a function that receives a scope and returns an effect to emit an output
2899
+ * element. The output element will be the result of the returned effect, if
2900
+ * successful.
2901
+ *
2902
+ * @since 3.11.0
2903
+ * @category constructors
2904
+ */
2905
+ const scopedWith = exports.scopedWith = internal.scopedWith;
2791
2906
  /**
2792
2907
  * Emits a sliding window of `n` elements.
2793
2908
  *
@@ -2873,6 +2988,7 @@ const splitLines = exports.splitLines = internal.splitLines;
2873
2988
  * Creates a single-valued pure stream.
2874
2989
  *
2875
2990
  * @example
2991
+ * ```ts
2876
2992
  * import { Effect, Stream } from "effect"
2877
2993
  *
2878
2994
  * // A Stream with a single number
@@ -2880,6 +2996,7 @@ const splitLines = exports.splitLines = internal.splitLines;
2880
2996
  *
2881
2997
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2882
2998
  * // { _id: 'Chunk', values: [ 3 ] }
2999
+ * ```
2883
3000
  *
2884
3001
  * @since 2.0.0
2885
3002
  * @category constructors
@@ -2903,12 +3020,14 @@ const suspend = exports.suspend = internal.suspend;
2903
3020
  * Takes the specified number of elements from this stream.
2904
3021
  *
2905
3022
  * @example
3023
+ * ```ts
2906
3024
  * import { Effect, Stream } from "effect"
2907
3025
  *
2908
3026
  * const stream = Stream.take(Stream.iterate(0, (n) => n + 1), 5)
2909
3027
  *
2910
3028
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2911
3029
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
3030
+ * ```
2912
3031
  *
2913
3032
  * @since 2.0.0
2914
3033
  * @category utils
@@ -2918,12 +3037,14 @@ const take = exports.take = internal.take;
2918
3037
  * Takes the last specified number of elements from this stream.
2919
3038
  *
2920
3039
  * @example
3040
+ * ```ts
2921
3041
  * import { Effect, Stream } from "effect"
2922
3042
  *
2923
3043
  * const stream = Stream.takeRight(Stream.make(1, 2, 3, 4, 5, 6), 3)
2924
3044
  *
2925
3045
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2926
3046
  * // { _id: 'Chunk', values: [ 4, 5, 6 ] }
3047
+ * ```
2927
3048
  *
2928
3049
  * @since 2.0.0
2929
3050
  * @category utils
@@ -2934,12 +3055,14 @@ const takeRight = exports.takeRight = internal.takeRight;
2934
3055
  * `true`.
2935
3056
  *
2936
3057
  * @example
3058
+ * ```ts
2937
3059
  * import { Effect, Stream } from "effect"
2938
3060
  *
2939
3061
  * const stream = Stream.takeUntil(Stream.iterate(0, (n) => n + 1), (n) => n === 4)
2940
3062
  *
2941
3063
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2942
3064
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
3065
+ * ```
2943
3066
  *
2944
3067
  * @since 2.0.0
2945
3068
  * @category utils
@@ -2958,12 +3081,14 @@ const takeUntilEffect = exports.takeUntilEffect = internal.takeUntilEffect;
2958
3081
  * evaluates to `true`.
2959
3082
  *
2960
3083
  * @example
3084
+ * ```ts
2961
3085
  * import { Effect, Stream } from "effect"
2962
3086
  *
2963
3087
  * const stream = Stream.takeWhile(Stream.iterate(0, (n) => n + 1), (n) => n < 5)
2964
3088
  *
2965
3089
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
2966
3090
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4 ] }
3091
+ * ```
2967
3092
  *
2968
3093
  * @since 2.0.0
2969
3094
  * @category utils
@@ -2973,6 +3098,7 @@ const takeWhile = exports.takeWhile = internal.takeWhile;
2973
3098
  * Adds an effect to consumption of every element of the stream.
2974
3099
  *
2975
3100
  * @example
3101
+ * ```ts
2976
3102
  * import { Console, Effect, Stream } from "effect"
2977
3103
  *
2978
3104
  * const stream = Stream.make(1, 2, 3).pipe(
@@ -2989,6 +3115,7 @@ const takeWhile = exports.takeWhile = internal.takeWhile;
2989
3115
  * // before mapping: 3
2990
3116
  * // after mapping: 6
2991
3117
  * // { _id: 'Chunk', values: [ 2, 4, 6 ] }
3118
+ * ```
2992
3119
  *
2993
3120
  * @since 2.0.0
2994
3121
  * @category sequencing
@@ -3039,6 +3166,7 @@ const tapSink = exports.tapSink = internal.tapSink;
3039
3166
  * Defaults to the "shape" strategy.
3040
3167
  *
3041
3168
  * @example
3169
+ * ```ts
3042
3170
  * import { Chunk, Effect, Schedule, Stream } from "effect"
3043
3171
  *
3044
3172
  * let last = Date.now()
@@ -3074,6 +3202,7 @@ const tapSink = exports.tapSink = internal.tapSink;
3074
3202
  * // Received 5 after 52ms
3075
3203
  * // > Emitted 5 after 49ms
3076
3204
  * // { _id: 'Chunk', values: [ 0, 1, 2, 3, 4, 5 ] }
3205
+ * ```
3077
3206
  *
3078
3207
  * @since 2.0.0
3079
3208
  * @category utils
@@ -3100,6 +3229,7 @@ const throttleEffect = exports.throttleEffect = internal.throttleEffect;
3100
3229
  * A stream that emits void values spaced by the specified duration.
3101
3230
  *
3102
3231
  * @example
3232
+ * ```ts
3103
3233
  * import { Effect, Stream } from "effect"
3104
3234
  *
3105
3235
  * let last = Date.now()
@@ -3119,6 +3249,7 @@ const throttleEffect = exports.throttleEffect = internal.throttleEffect;
3119
3249
  * // tick after 1002ms
3120
3250
  * // tick after 1002ms
3121
3251
  * // { _id: 'Chunk', values: [ undefined, undefined, undefined, undefined, undefined ] }
3252
+ * ```
3122
3253
  *
3123
3254
  * @since 2.0.0
3124
3255
  * @category constructors
@@ -3170,6 +3301,7 @@ const toPubSub = exports.toPubSub = internal.toPubSub;
3170
3301
  * the stream's output.
3171
3302
  *
3172
3303
  * @example
3304
+ * ```ts
3173
3305
  * import { Effect, Stream } from "effect"
3174
3306
  *
3175
3307
  * // Simulate a chunked stream
@@ -3194,6 +3326,7 @@ const toPubSub = exports.toPubSub = internal.toPubSub;
3194
3326
  * // "_id": "Option",
3195
3327
  * // "_tag": "None"
3196
3328
  * // }
3329
+ * ```
3197
3330
  *
3198
3331
  * @since 2.0.0
3199
3332
  * @category destructors
@@ -3257,12 +3390,14 @@ const transduce = exports.transduce = internal.transduce;
3257
3390
  * Creates a stream by peeling off the "layers" of a value of type `S`.
3258
3391
  *
3259
3392
  * @example
3393
+ * ```ts
3260
3394
  * import { Effect, Option, Stream } from "effect"
3261
3395
  *
3262
3396
  * const stream = Stream.unfold(1, (n) => Option.some([n, n + 1]))
3263
3397
  *
3264
3398
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
3265
3399
  * // { _id: 'Chunk', values: [ 1, 2, 3, 4, 5 ] }
3400
+ * ```
3266
3401
  *
3267
3402
  * @since 2.0.0
3268
3403
  * @category constructors
@@ -3288,6 +3423,7 @@ const unfoldChunkEffect = exports.unfoldChunkEffect = internal.unfoldChunkEffect
3288
3423
  * `S`.
3289
3424
  *
3290
3425
  * @example
3426
+ * ```ts
3291
3427
  * import { Effect, Option, Random, Stream } from "effect"
3292
3428
  *
3293
3429
  * const stream = Stream.unfoldEffect(1, (n) =>
@@ -3297,6 +3433,7 @@ const unfoldChunkEffect = exports.unfoldChunkEffect = internal.unfoldChunkEffect
3297
3433
  *
3298
3434
  * // Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(5)))).then(console.log)
3299
3435
  * // { _id: 'Chunk', values: [ 1, -1, -1, -1, -1 ] }
3436
+ * ```
3300
3437
  *
3301
3438
  * @since 2.0.0
3302
3439
  * @category constructors
@@ -3317,6 +3454,15 @@ const unwrap = exports.unwrap = internal.unwrap;
3317
3454
  * @category constructors
3318
3455
  */
3319
3456
  const unwrapScoped = exports.unwrapScoped = internal.unwrapScoped;
3457
+ /**
3458
+ * Creates a stream produced from a function which receives a `Scope` and
3459
+ * returns an `Effect`. The resulting stream will emit a single element, which
3460
+ * will be the result of the returned effect, if successful.
3461
+ *
3462
+ * @since 3.11.0
3463
+ * @category constructors
3464
+ */
3465
+ const unwrapScopedWith = exports.unwrapScopedWith = internal.unwrapScopedWith;
3320
3466
  /**
3321
3467
  * Updates the specified service within the context of the `Stream`.
3322
3468
  *
@@ -3370,6 +3516,7 @@ const withSpan = exports.withSpan = internal.withSpan;
3370
3516
  * The new stream will end when one of the sides ends.
3371
3517
  *
3372
3518
  * @example
3519
+ * ```ts
3373
3520
  * import { Effect, Stream } from "effect"
3374
3521
  *
3375
3522
  * // We create two streams and zip them together.
@@ -3380,6 +3527,7 @@ const withSpan = exports.withSpan = internal.withSpan;
3380
3527
  *
3381
3528
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
3382
3529
  * // { _id: 'Chunk', values: [ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ] }
3530
+ * ```
3383
3531
  *
3384
3532
  * @since 2.0.0
3385
3533
  * @category zipping
@@ -3403,6 +3551,7 @@ const zipFlatten = exports.zipFlatten = internal.zipFlatten;
3403
3551
  * have different lengths and one of the streams has ended before the other.
3404
3552
  *
3405
3553
  * @example
3554
+ * ```ts
3406
3555
  * import { Effect, Stream } from "effect"
3407
3556
  *
3408
3557
  * const stream = Stream.zipAll(Stream.make(1, 2, 3, 4, 5, 6), {
@@ -3413,6 +3562,7 @@ const zipFlatten = exports.zipFlatten = internal.zipFlatten;
3413
3562
  *
3414
3563
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
3415
3564
  * // { _id: "Chunk", values: [ [ 1, "a" ], [ 2, "b" ], [ 3, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
3565
+ * ```
3416
3566
  *
3417
3567
  * @since 2.0.0
3418
3568
  * @category zipping
@@ -3506,6 +3656,7 @@ const zipAllSortedByKeyWith = exports.zipAllSortedByKeyWith = internal.zipAllSor
3506
3656
  * lengths and one of the streams has ended before the other.
3507
3657
  *
3508
3658
  * @example
3659
+ * ```ts
3509
3660
  * import { Effect, Stream } from "effect"
3510
3661
  *
3511
3662
  * const stream = Stream.zipAllWith(Stream.make(1, 2, 3, 4, 5, 6), {
@@ -3517,6 +3668,7 @@ const zipAllSortedByKeyWith = exports.zipAllSortedByKeyWith = internal.zipAllSor
3517
3668
  *
3518
3669
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
3519
3670
  * // { _id: "Chunk", values: [ [ 0, "a" ], [ 1, "b" ], [ 2, "c" ], [ 4, "x" ], [ 5, "x" ], [ 6, "x" ] ] }
3671
+ * ```
3520
3672
  *
3521
3673
  * @since 2.0.0
3522
3674
  * @category zipping
@@ -3532,6 +3684,7 @@ const zipAllWith = exports.zipAllWith = internal.zipAllWith;
3532
3684
  * used for zipping.
3533
3685
  *
3534
3686
  * @example
3687
+ * ```ts
3535
3688
  * import { Effect, Schedule, Stream } from "effect"
3536
3689
  *
3537
3690
  * const s1 = Stream.make(1, 2, 3).pipe(
@@ -3546,6 +3699,7 @@ const zipAllWith = exports.zipAllWith = internal.zipAllWith;
3546
3699
  *
3547
3700
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
3548
3701
  * // { _id: "Chunk", values: [ [ 1, "a" ], [ 1, "b" ], [ 2, "b" ], [ 2, "c" ], [ 2, "d" ], [ 3, "d" ] ] }
3702
+ * ```
3549
3703
  *
3550
3704
  * @since 2.0.0
3551
3705
  * @category zipping
@@ -3560,6 +3714,7 @@ const zipLatest = exports.zipLatest = internal.zipLatest;
3560
3714
  * used for zipping.
3561
3715
  *
3562
3716
  * @example
3717
+ * ```ts
3563
3718
  * import { Stream, Schedule, Console, Effect } from "effect"
3564
3719
  *
3565
3720
  * const stream = Stream.zipLatestAll(
@@ -3577,6 +3732,7 @@ const zipLatest = exports.zipLatest = internal.zipLatest;
3577
3732
  * // [ 3, 1, 0 ]
3578
3733
  * // [ 3, 1, 1 ]
3579
3734
  * // .....
3735
+ * ```
3580
3736
  *
3581
3737
  * @since 3.3.0
3582
3738
  * @category zipping
@@ -3622,6 +3778,7 @@ const zipRight = exports.zipRight = internal.zipRight;
3622
3778
  * The new stream will end when one of the sides ends.
3623
3779
  *
3624
3780
  * @example
3781
+ * ```ts
3625
3782
  * import { Effect, Stream } from "effect"
3626
3783
  *
3627
3784
  * // We create two streams and zip them with custom logic.
@@ -3633,6 +3790,7 @@ const zipRight = exports.zipRight = internal.zipRight;
3633
3790
  *
3634
3791
  * // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
3635
3792
  * // { _id: 'Chunk', values: [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ] ] }
3793
+ * ```
3636
3794
  *
3637
3795
  * @since 2.0.0
3638
3796
  * @category zipping
@@ -3652,6 +3810,7 @@ const zipWithChunks = exports.zipWithChunks = internal.zipWithChunks;
3652
3810
  * Zips each element with the next element if present.
3653
3811
  *
3654
3812
  * @example
3813
+ * ```ts
3655
3814
  * import { Chunk, Effect, Stream } from "effect"
3656
3815
  *
3657
3816
  * const stream = Stream.zipWithNext(Stream.make(1, 2, 3, 4))
@@ -3663,6 +3822,7 @@ const zipWithChunks = exports.zipWithChunks = internal.zipWithChunks;
3663
3822
  * // [ 3, { _id: 'Option', _tag: 'Some', value: 4 } ],
3664
3823
  * // [ 4, { _id: 'Option', _tag: 'None' } ]
3665
3824
  * // ]
3825
+ * ```
3666
3826
  *
3667
3827
  * @since 2.0.0
3668
3828
  * @category zipping
@@ -3673,6 +3833,7 @@ const zipWithNext = exports.zipWithNext = internal.zipWithNext;
3673
3833
  * `None`.
3674
3834
  *
3675
3835
  * @example
3836
+ * ```ts
3676
3837
  * import { Chunk, Effect, Stream } from "effect"
3677
3838
  *
3678
3839
  * const stream = Stream.zipWithPrevious(Stream.make(1, 2, 3, 4))
@@ -3684,6 +3845,7 @@ const zipWithNext = exports.zipWithNext = internal.zipWithNext;
3684
3845
  * // [ { _id: 'Option', _tag: 'Some', value: 2 }, 3 ],
3685
3846
  * // [ { _id: 'Option', _tag: 'Some', value: 3 }, 4 ]
3686
3847
  * // ]
3848
+ * ```
3687
3849
  *
3688
3850
  * @since 2.0.0
3689
3851
  * @category zipping
@@ -3693,6 +3855,7 @@ const zipWithPrevious = exports.zipWithPrevious = internal.zipWithPrevious;
3693
3855
  * Zips each element with both the previous and next element.
3694
3856
  *
3695
3857
  * @example
3858
+ * ```ts
3696
3859
  * import { Chunk, Effect, Stream } from "effect"
3697
3860
  *
3698
3861
  * const stream = Stream.zipWithPreviousAndNext(Stream.make(1, 2, 3, 4))
@@ -3720,6 +3883,7 @@ const zipWithPrevious = exports.zipWithPrevious = internal.zipWithPrevious;
3720
3883
  * // { _id: 'Option', _tag: 'None' }
3721
3884
  * // ]
3722
3885
  * // ]
3886
+ * ```
3723
3887
  *
3724
3888
  * @since 2.0.0
3725
3889
  * @category zipping
@@ -3729,6 +3893,7 @@ const zipWithPreviousAndNext = exports.zipWithPreviousAndNext = internal.zipWith
3729
3893
  * Zips this stream together with the index of elements.
3730
3894
  *
3731
3895
  * @example
3896
+ * ```ts
3732
3897
  * import { Effect, Stream } from "effect"
3733
3898
  *
3734
3899
  * const stream = Stream.make("Mary", "James", "Robert", "Patricia")
@@ -3740,6 +3905,7 @@ const zipWithPreviousAndNext = exports.zipWithPreviousAndNext = internal.zipWith
3740
3905
  * // _id: 'Chunk',
3741
3906
  * // values: [ [ 'Mary', 0 ], [ 'James', 1 ], [ 'Robert', 2 ], [ 'Patricia', 3 ] ]
3742
3907
  * // }
3908
+ * ```
3743
3909
  *
3744
3910
  * @since 2.0.0
3745
3911
  * @category zipping
@@ -3764,6 +3930,7 @@ const zipWithIndex = exports.zipWithIndex = internal.zipWithIndex;
3764
3930
  * @see {@link let_ let}
3765
3931
  *
3766
3932
  * @example
3933
+ * ```ts
3767
3934
  * import { Chunk, Effect, pipe, Stream } from "effect"
3768
3935
  *
3769
3936
  * const result = pipe(
@@ -3773,6 +3940,7 @@ const zipWithIndex = exports.zipWithIndex = internal.zipWithIndex;
3773
3940
  * Stream.let("sum", ({ x, y }) => x + y)
3774
3941
  * )
3775
3942
  * assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
3943
+ * ```
3776
3944
  *
3777
3945
  * @category do notation
3778
3946
  * @since 2.0.0
@@ -3794,6 +3962,7 @@ const Do = exports.Do = internal.Do;
3794
3962
  * @see {@link let_ let}
3795
3963
  *
3796
3964
  * @example
3965
+ * ```ts
3797
3966
  * import { Chunk, Effect, pipe, Stream } from "effect"
3798
3967
  *
3799
3968
  * const result = pipe(
@@ -3803,6 +3972,7 @@ const Do = exports.Do = internal.Do;
3803
3972
  * Stream.let("sum", ({ x, y }) => x + y)
3804
3973
  * )
3805
3974
  * assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
3975
+ * ```
3806
3976
  *
3807
3977
  * @category do notation
3808
3978
  * @since 2.0.0
@@ -3836,6 +4006,7 @@ const bindEffect = exports.bindEffect = _groupBy.bindEffect;
3836
4006
  * @see {@link let_ let}
3837
4007
  *
3838
4008
  * @example
4009
+ * ```ts
3839
4010
  * import { Chunk, Effect, pipe, Stream } from "effect"
3840
4011
  *
3841
4012
  * const result = pipe(
@@ -3845,6 +4016,7 @@ const bindEffect = exports.bindEffect = _groupBy.bindEffect;
3845
4016
  * Stream.let("sum", ({ x, y }) => x + y)
3846
4017
  * )
3847
4018
  * assert.deepStrictEqual(Effect.runSync(Stream.runCollect(result)), Chunk.of({ x: 2, y: 3, sum: 5 }))
4019
+ * ```
3848
4020
  *
3849
4021
  * @category do notation
3850
4022
  * @since 2.0.0