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
@@ -47,7 +47,7 @@ import type * as Supervisor from "./Supervisor.js";
47
47
  import type * as Tracer from "./Tracer.js";
48
48
  import type { Concurrency, Contravariant, Covariant, NoExcessProperties, NoInfer, NotFunction } from "./Types.js";
49
49
  import type * as Unify from "./Unify.js";
50
- import type { YieldWrap } from "./Utils.js";
50
+ import { type YieldWrap } from "./Utils.js";
51
51
  /**
52
52
  * @since 2.0.0
53
53
  * @category Symbols
@@ -130,6 +130,9 @@ declare module "./Context.js" {
130
130
  interface Tag<Id, Value> extends Effect<Value, never, Id> {
131
131
  [Symbol.iterator](): EffectGenerator<Tag<Id, Value>>;
132
132
  }
133
+ interface Reference<Id, Value> extends Effect<Value> {
134
+ [Symbol.iterator](): EffectGenerator<Reference<Id, Value>>;
135
+ }
133
136
  interface TagUnifyIgnore {
134
137
  Effect?: true;
135
138
  Either?: true;
@@ -230,6 +233,7 @@ export declare const isEffect: (u: unknown) => u is Effect<unknown, unknown, unk
230
233
  * be recomputed upon next evaluation.
231
234
  *
232
235
  * @example
236
+ * ```ts
233
237
  * import { Effect, Console } from "effect"
234
238
  *
235
239
  * let i = 1
@@ -257,6 +261,7 @@ export declare const isEffect: (u: unknown) => u is Effect<unknown, unknown, unk
257
261
  * // result 1
258
262
  * // expensive task...
259
263
  * // result 2
264
+ * ```
260
265
  *
261
266
  * @since 2.0.0
262
267
  * @category Caching
@@ -268,6 +273,7 @@ export declare const cachedWithTTL: {
268
273
  * be recomputed upon next evaluation.
269
274
  *
270
275
  * @example
276
+ * ```ts
271
277
  * import { Effect, Console } from "effect"
272
278
  *
273
279
  * let i = 1
@@ -295,6 +301,7 @@ export declare const cachedWithTTL: {
295
301
  * // result 1
296
302
  * // expensive task...
297
303
  * // result 2
304
+ * ```
298
305
  *
299
306
  * @since 2.0.0
300
307
  * @category Caching
@@ -306,6 +313,7 @@ export declare const cachedWithTTL: {
306
313
  * be recomputed upon next evaluation.
307
314
  *
308
315
  * @example
316
+ * ```ts
309
317
  * import { Effect, Console } from "effect"
310
318
  *
311
319
  * let i = 1
@@ -333,6 +341,7 @@ export declare const cachedWithTTL: {
333
341
  * // result 1
334
342
  * // expensive task...
335
343
  * // result 2
344
+ * ```
336
345
  *
337
346
  * @since 2.0.0
338
347
  * @category Caching
@@ -345,6 +354,7 @@ export declare const cachedWithTTL: {
345
354
  * invalidating the cached value before it naturally expires.
346
355
  *
347
356
  * @example
357
+ * ```ts
348
358
  * import { Effect, Console } from "effect"
349
359
  *
350
360
  * let i = 1
@@ -375,6 +385,7 @@ export declare const cachedWithTTL: {
375
385
  * // result 1
376
386
  * // expensive task...
377
387
  * // result 2
388
+ * ```
378
389
  *
379
390
  * @since 2.0.0
380
391
  * @category Caching
@@ -386,6 +397,7 @@ export declare const cachedInvalidateWithTTL: {
386
397
  * invalidating the cached value before it naturally expires.
387
398
  *
388
399
  * @example
400
+ * ```ts
389
401
  * import { Effect, Console } from "effect"
390
402
  *
391
403
  * let i = 1
@@ -416,6 +428,7 @@ export declare const cachedInvalidateWithTTL: {
416
428
  * // result 1
417
429
  * // expensive task...
418
430
  * // result 2
431
+ * ```
419
432
  *
420
433
  * @since 2.0.0
421
434
  * @category Caching
@@ -427,6 +440,7 @@ export declare const cachedInvalidateWithTTL: {
427
440
  * invalidating the cached value before it naturally expires.
428
441
  *
429
442
  * @example
443
+ * ```ts
430
444
  * import { Effect, Console } from "effect"
431
445
  *
432
446
  * let i = 1
@@ -457,6 +471,7 @@ export declare const cachedInvalidateWithTTL: {
457
471
  * // result 1
458
472
  * // expensive task...
459
473
  * // result 2
474
+ * ```
460
475
  *
461
476
  * @since 2.0.0
462
477
  * @category Caching
@@ -469,6 +484,7 @@ export declare const cachedInvalidateWithTTL: {
469
484
  * the logic.
470
485
  *
471
486
  * @example
487
+ * ```ts
472
488
  * import { Effect, Console } from "effect"
473
489
  *
474
490
  * let i = 1
@@ -502,6 +518,7 @@ export declare const cachedInvalidateWithTTL: {
502
518
  * // expensive task...
503
519
  * // result 3
504
520
  * // result 3
521
+ * ```
505
522
  *
506
523
  * @since 2.0.0
507
524
  * @category Caching
@@ -513,6 +530,7 @@ export declare const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A
513
530
  * recompute them.
514
531
  *
515
532
  * @example
533
+ * ```ts
516
534
  * import { Effect, Random } from "effect"
517
535
  *
518
536
  * const program = Effect.gen(function* () {
@@ -535,6 +553,7 @@ export declare const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A
535
553
  * // memoized version:
536
554
  * // 5
537
555
  * // 5
556
+ * ```
538
557
  *
539
558
  * @since 2.0.0
540
559
  * @category Caching
@@ -545,6 +564,7 @@ export declare const cachedFunction: <A, B, E, R>(f: (a: A) => Effect<B, E, R>,
545
564
  * called.
546
565
  *
547
566
  * @example
567
+ * ```ts
548
568
  * import { Effect, Console } from "effect"
549
569
  *
550
570
  * const program = Effect.gen(function* () {
@@ -560,6 +580,7 @@ export declare const cachedFunction: <A, B, E, R>(f: (a: A) => Effect<B, E, R>,
560
580
  * // task1
561
581
  * // task1
562
582
  * // task2
583
+ * ```
563
584
  *
564
585
  * @since 2.0.0
565
586
  * @category Caching
@@ -615,6 +636,7 @@ export declare const once: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<voi
615
636
  * @see {@link forEach} for iterating over elements and applying an effect.
616
637
  *
617
638
  * @example
639
+ * ```ts
618
640
  * // Title: Combining Effects in Tuples
619
641
  * import { Effect, Console } from "effect"
620
642
  *
@@ -632,6 +654,7 @@ export declare const once: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<voi
632
654
  * // 42
633
655
  * // Hello
634
656
  * // [ 42, 'Hello' ]
657
+ * ```
635
658
  *
636
659
  * @example
637
660
  * // Title: Combining Effects in Iterables
@@ -786,6 +809,7 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
786
809
  * your data and then apply operations to it.
787
810
  *
788
811
  * @example
812
+ * ```ts
789
813
  * import { Effect, pipe } from "effect"
790
814
  *
791
815
  * const task1 = Effect.succeed(1).pipe(
@@ -809,6 +833,7 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
809
833
  * // timestamp=... level=INFO fiber=#3 message="task2 done"
810
834
  * // timestamp=... level=INFO fiber=#2 message="task1 done"
811
835
  * // [ 1, 'hello' ]
836
+ * ```
812
837
  *
813
838
  * @since 2.0.0
814
839
  * @category Collecting
@@ -1052,6 +1077,7 @@ export declare const filter: {
1052
1077
  * @see {@link filter} for concurrent filtering without mapping.
1053
1078
  *
1054
1079
  * @example
1080
+ * ```ts
1055
1081
  * import { Console, Effect, Option } from "effect"
1056
1082
  *
1057
1083
  * const task = (n: number) =>
@@ -1072,6 +1098,7 @@ export declare const filter: {
1072
1098
  * // task3 done
1073
1099
  * // task4 done
1074
1100
  * // [ 2, 4 ]
1101
+ * ```
1075
1102
  *
1076
1103
  * @since 2.0.0
1077
1104
  * @category Filtering
@@ -1088,6 +1115,7 @@ export declare const filterMap: {
1088
1115
  * @see {@link filter} for concurrent filtering without mapping.
1089
1116
  *
1090
1117
  * @example
1118
+ * ```ts
1091
1119
  * import { Console, Effect, Option } from "effect"
1092
1120
  *
1093
1121
  * const task = (n: number) =>
@@ -1108,6 +1136,7 @@ export declare const filterMap: {
1108
1136
  * // task3 done
1109
1137
  * // task4 done
1110
1138
  * // [ 2, 4 ]
1139
+ * ```
1111
1140
  *
1112
1141
  * @since 2.0.0
1113
1142
  * @category Filtering
@@ -1124,6 +1153,7 @@ export declare const filterMap: {
1124
1153
  * @see {@link filter} for concurrent filtering without mapping.
1125
1154
  *
1126
1155
  * @example
1156
+ * ```ts
1127
1157
  * import { Console, Effect, Option } from "effect"
1128
1158
  *
1129
1159
  * const task = (n: number) =>
@@ -1144,6 +1174,7 @@ export declare const filterMap: {
1144
1174
  * // task3 done
1145
1175
  * // task4 done
1146
1176
  * // [ 2, 4 ]
1177
+ * ```
1147
1178
  *
1148
1179
  * @since 2.0.0
1149
1180
  * @category Filtering
@@ -1196,6 +1227,7 @@ export declare const findFirst: {
1196
1227
  * @see {@link all} for combining multiple effects into one.
1197
1228
  *
1198
1229
  * @example
1230
+ * ```ts
1199
1231
  * // Title: Applying Effects to Iterable Elements
1200
1232
  * import { Effect, Console } from "effect"
1201
1233
  *
@@ -1211,6 +1243,7 @@ export declare const findFirst: {
1211
1243
  * // Currently at index 3
1212
1244
  * // Currently at index 4
1213
1245
  * // [ 2, 4, 6, 8, 10 ]
1246
+ * ```
1214
1247
  *
1215
1248
  * @example
1216
1249
  * // Title: Using discard to Ignore Results
@@ -1261,6 +1294,7 @@ export declare const forEach: {
1261
1294
  * @see {@link all} for combining multiple effects into one.
1262
1295
  *
1263
1296
  * @example
1297
+ * ```ts
1264
1298
  * // Title: Applying Effects to Iterable Elements
1265
1299
  * import { Effect, Console } from "effect"
1266
1300
  *
@@ -1276,6 +1310,7 @@ export declare const forEach: {
1276
1310
  * // Currently at index 3
1277
1311
  * // Currently at index 4
1278
1312
  * // [ 2, 4, 6, 8, 10 ]
1313
+ * ```
1279
1314
  *
1280
1315
  * @example
1281
1316
  * // Title: Using discard to Ignore Results
@@ -1331,6 +1366,7 @@ export declare const forEach: {
1331
1366
  * @see {@link all} for combining multiple effects into one.
1332
1367
  *
1333
1368
  * @example
1369
+ * ```ts
1334
1370
  * // Title: Applying Effects to Iterable Elements
1335
1371
  * import { Effect, Console } from "effect"
1336
1372
  *
@@ -1346,6 +1382,7 @@ export declare const forEach: {
1346
1382
  * // Currently at index 3
1347
1383
  * // Currently at index 4
1348
1384
  * // [ 2, 4, 6, 8, 10 ]
1385
+ * ```
1349
1386
  *
1350
1387
  * @example
1351
1388
  * // Title: Using discard to Ignore Results
@@ -1401,6 +1438,7 @@ export declare const forEach: {
1401
1438
  * @see {@link all} for combining multiple effects into one.
1402
1439
  *
1403
1440
  * @example
1441
+ * ```ts
1404
1442
  * // Title: Applying Effects to Iterable Elements
1405
1443
  * import { Effect, Console } from "effect"
1406
1444
  *
@@ -1416,6 +1454,7 @@ export declare const forEach: {
1416
1454
  * // Currently at index 3
1417
1455
  * // Currently at index 4
1418
1456
  * // [ 2, 4, 6, 8, 10 ]
1457
+ * ```
1419
1458
  *
1420
1459
  * @example
1421
1460
  * // Title: Using discard to Ignore Results
@@ -1471,6 +1510,7 @@ export declare const forEach: {
1471
1510
  * @see {@link all} for combining multiple effects into one.
1472
1511
  *
1473
1512
  * @example
1513
+ * ```ts
1474
1514
  * // Title: Applying Effects to Iterable Elements
1475
1515
  * import { Effect, Console } from "effect"
1476
1516
  *
@@ -1486,6 +1526,7 @@ export declare const forEach: {
1486
1526
  * // Currently at index 3
1487
1527
  * // Currently at index 4
1488
1528
  * // [ 2, 4, 6, 8, 10 ]
1529
+ * ```
1489
1530
  *
1490
1531
  * @example
1491
1532
  * // Title: Using discard to Ignore Results
@@ -1575,6 +1616,7 @@ export declare const mergeAll: {
1575
1616
  * @see {@link validateFirst} for a function that stops at the first success.
1576
1617
  *
1577
1618
  * @example
1619
+ * ```ts
1578
1620
  * import { Effect } from "effect"
1579
1621
  *
1580
1622
  * // ┌─── Effect<[string[], number[]], never, never>
@@ -1590,6 +1632,7 @@ export declare const mergeAll: {
1590
1632
  * Effect.runPromise(program).then(console.log, console.error)
1591
1633
  * // Output:
1592
1634
  * // [ [ '1 is not even', '3 is not even' ], [ 0, 2, 4 ] ]
1635
+ * ```
1593
1636
  *
1594
1637
  * @since 2.0.0
1595
1638
  * @category Error Accumulation
@@ -1611,6 +1654,7 @@ export declare const partition: {
1611
1654
  * @see {@link validateFirst} for a function that stops at the first success.
1612
1655
  *
1613
1656
  * @example
1657
+ * ```ts
1614
1658
  * import { Effect } from "effect"
1615
1659
  *
1616
1660
  * // ┌─── Effect<[string[], number[]], never, never>
@@ -1626,6 +1670,7 @@ export declare const partition: {
1626
1670
  * Effect.runPromise(program).then(console.log, console.error)
1627
1671
  * // Output:
1628
1672
  * // [ [ '1 is not even', '3 is not even' ], [ 0, 2, 4 ] ]
1673
+ * ```
1629
1674
  *
1630
1675
  * @since 2.0.0
1631
1676
  * @category Error Accumulation
@@ -1651,6 +1696,7 @@ export declare const partition: {
1651
1696
  * @see {@link validateFirst} for a function that stops at the first success.
1652
1697
  *
1653
1698
  * @example
1699
+ * ```ts
1654
1700
  * import { Effect } from "effect"
1655
1701
  *
1656
1702
  * // ┌─── Effect<[string[], number[]], never, never>
@@ -1666,6 +1712,7 @@ export declare const partition: {
1666
1712
  * Effect.runPromise(program).then(console.log, console.error)
1667
1713
  * // Output:
1668
1714
  * // [ [ '1 is not even', '3 is not even' ], [ 0, 2, 4 ] ]
1715
+ * ```
1669
1716
  *
1670
1717
  * @since 2.0.0
1671
1718
  * @category Error Accumulation
@@ -1925,6 +1972,7 @@ export declare const takeWhile: {
1925
1972
  * @see {@link partition} when you need to separate successes and failures instead of losing successes with errors.
1926
1973
  *
1927
1974
  * @example
1975
+ * ```ts
1928
1976
  * import { Effect, Console } from "effect"
1929
1977
  *
1930
1978
  * // ┌─── Effect<number[], string[], never>
@@ -1951,6 +1999,7 @@ export declare const takeWhile: {
1951
1999
  * // failure: [ '4 is not less that 4', '5 is not less that 4' ]
1952
2000
  * // }
1953
2001
  * // }
2002
+ * ```
1954
2003
  *
1955
2004
  * @since 2.0.0
1956
2005
  * @category Error Accumulation
@@ -1973,6 +2022,7 @@ export declare const validateAll: {
1973
2022
  * @see {@link partition} when you need to separate successes and failures instead of losing successes with errors.
1974
2023
  *
1975
2024
  * @example
2025
+ * ```ts
1976
2026
  * import { Effect, Console } from "effect"
1977
2027
  *
1978
2028
  * // ┌─── Effect<number[], string[], never>
@@ -1999,6 +2049,7 @@ export declare const validateAll: {
1999
2049
  * // failure: [ '4 is not less that 4', '5 is not less that 4' ]
2000
2050
  * // }
2001
2051
  * // }
2052
+ * ```
2002
2053
  *
2003
2054
  * @since 2.0.0
2004
2055
  * @category Error Accumulation
@@ -2026,6 +2077,7 @@ export declare const validateAll: {
2026
2077
  * @see {@link partition} when you need to separate successes and failures instead of losing successes with errors.
2027
2078
  *
2028
2079
  * @example
2080
+ * ```ts
2029
2081
  * import { Effect, Console } from "effect"
2030
2082
  *
2031
2083
  * // ┌─── Effect<number[], string[], never>
@@ -2052,6 +2104,7 @@ export declare const validateAll: {
2052
2104
  * // failure: [ '4 is not less that 4', '5 is not less that 4' ]
2053
2105
  * // }
2054
2106
  * // }
2107
+ * ```
2055
2108
  *
2056
2109
  * @since 2.0.0
2057
2110
  * @category Error Accumulation
@@ -2079,6 +2132,7 @@ export declare const validateAll: {
2079
2132
  * @see {@link partition} when you need to separate successes and failures instead of losing successes with errors.
2080
2133
  *
2081
2134
  * @example
2135
+ * ```ts
2082
2136
  * import { Effect, Console } from "effect"
2083
2137
  *
2084
2138
  * // ┌─── Effect<number[], string[], never>
@@ -2105,6 +2159,7 @@ export declare const validateAll: {
2105
2159
  * // failure: [ '4 is not less that 4', '5 is not less that 4' ]
2106
2160
  * // }
2107
2161
  * // }
2162
+ * ```
2108
2163
  *
2109
2164
  * @since 2.0.0
2110
2165
  * @category Error Accumulation
@@ -2132,6 +2187,7 @@ export declare const validateAll: {
2132
2187
  * @see {@link partition} when you need to separate successes and failures instead of losing successes with errors.
2133
2188
  *
2134
2189
  * @example
2190
+ * ```ts
2135
2191
  * import { Effect, Console } from "effect"
2136
2192
  *
2137
2193
  * // ┌─── Effect<number[], string[], never>
@@ -2158,6 +2214,7 @@ export declare const validateAll: {
2158
2214
  * // failure: [ '4 is not less that 4', '5 is not less that 4' ]
2159
2215
  * // }
2160
2216
  * // }
2217
+ * ```
2161
2218
  *
2162
2219
  * @since 2.0.0
2163
2220
  * @category Error Accumulation
@@ -2185,6 +2242,7 @@ export declare const validateAll: {
2185
2242
  * @see {@link firstSuccessOf} for a similar function that processes multiple effects and returns the first successful one or the last error.
2186
2243
  *
2187
2244
  * @example
2245
+ * ```ts
2188
2246
  * import { Effect, Console } from "effect"
2189
2247
  *
2190
2248
  * // ┌─── Effect<number, string[], never>
@@ -2201,6 +2259,7 @@ export declare const validateAll: {
2201
2259
  * // Output:
2202
2260
  * // item 4
2203
2261
  * // 4
2262
+ * ```
2204
2263
  *
2205
2264
  * @since 2.0.0
2206
2265
  * @category Error Accumulation
@@ -2222,6 +2281,7 @@ export declare const validateFirst: {
2222
2281
  * @see {@link firstSuccessOf} for a similar function that processes multiple effects and returns the first successful one or the last error.
2223
2282
  *
2224
2283
  * @example
2284
+ * ```ts
2225
2285
  * import { Effect, Console } from "effect"
2226
2286
  *
2227
2287
  * // ┌─── Effect<number, string[], never>
@@ -2238,6 +2298,7 @@ export declare const validateFirst: {
2238
2298
  * // Output:
2239
2299
  * // item 4
2240
2300
  * // 4
2301
+ * ```
2241
2302
  *
2242
2303
  * @since 2.0.0
2243
2304
  * @category Error Accumulation
@@ -2263,6 +2324,7 @@ export declare const validateFirst: {
2263
2324
  * @see {@link firstSuccessOf} for a similar function that processes multiple effects and returns the first successful one or the last error.
2264
2325
  *
2265
2326
  * @example
2327
+ * ```ts
2266
2328
  * import { Effect, Console } from "effect"
2267
2329
  *
2268
2330
  * // ┌─── Effect<number, string[], never>
@@ -2279,6 +2341,7 @@ export declare const validateFirst: {
2279
2341
  * // Output:
2280
2342
  * // item 4
2281
2343
  * // 4
2344
+ * ```
2282
2345
  *
2283
2346
  * @since 2.0.0
2284
2347
  * @category Error Accumulation
@@ -2314,6 +2377,7 @@ export declare const validateFirst: {
2314
2377
  * behavior of the returned effect.
2315
2378
  *
2316
2379
  * @example
2380
+ * ```ts
2317
2381
  * // Title: Wrapping a Callback API
2318
2382
  * import { Effect } from "effect"
2319
2383
  * import * as NodeFS from "node:fs"
@@ -2334,6 +2398,7 @@ export declare const validateFirst: {
2334
2398
  * // ┌─── Effect<Buffer, Error, never>
2335
2399
  * // ▼
2336
2400
  * const program = readFile("example.txt")
2401
+ * ```
2337
2402
  *
2338
2403
  * @example
2339
2404
  * // Title: Handling Interruption with Cleanup
@@ -2424,12 +2489,14 @@ export declare const asyncEffect: <A, E, R, R3, E2, R2>(register: (callback: (_:
2424
2489
  * the "this" of the effect.
2425
2490
  *
2426
2491
  * @example
2492
+ * ```ts
2427
2493
  * import { Effect } from "effect"
2428
2494
  *
2429
2495
  * const throwingFunction = () => { throw new Error() }
2430
2496
  * const blowUp = Effect.custom(throwingFunction, function() {
2431
2497
  * return Effect.succeed(this.effect_instruction_i0())
2432
2498
  * })
2499
+ * ```
2433
2500
  *
2434
2501
  * @since 2.0.0
2435
2502
  * @category Creating Effects
@@ -2442,12 +2509,14 @@ export declare const custom: {
2442
2509
  * the "this" of the effect.
2443
2510
  *
2444
2511
  * @example
2512
+ * ```ts
2445
2513
  * import { Effect } from "effect"
2446
2514
  *
2447
2515
  * const throwingFunction = () => { throw new Error() }
2448
2516
  * const blowUp = Effect.custom(throwingFunction, function() {
2449
2517
  * return Effect.succeed(this.effect_instruction_i0())
2450
2518
  * })
2519
+ * ```
2451
2520
  *
2452
2521
  * @since 2.0.0
2453
2522
  * @category Creating Effects
@@ -2462,12 +2531,14 @@ export declare const custom: {
2462
2531
  * the "this" of the effect.
2463
2532
  *
2464
2533
  * @example
2534
+ * ```ts
2465
2535
  * import { Effect } from "effect"
2466
2536
  *
2467
2537
  * const throwingFunction = () => { throw new Error() }
2468
2538
  * const blowUp = Effect.custom(throwingFunction, function() {
2469
2539
  * return Effect.succeed(this.effect_instruction_i0())
2470
2540
  * })
2541
+ * ```
2471
2542
  *
2472
2543
  * @since 2.0.0
2473
2544
  * @category Creating Effects
@@ -2483,12 +2554,14 @@ export declare const custom: {
2483
2554
  * the "this" of the effect.
2484
2555
  *
2485
2556
  * @example
2557
+ * ```ts
2486
2558
  * import { Effect } from "effect"
2487
2559
  *
2488
2560
  * const throwingFunction = () => { throw new Error() }
2489
2561
  * const blowUp = Effect.custom(throwingFunction, function() {
2490
2562
  * return Effect.succeed(this.effect_instruction_i0())
2491
2563
  * })
2564
+ * ```
2492
2565
  *
2493
2566
  * @since 2.0.0
2494
2567
  * @category Creating Effects
@@ -2516,6 +2589,7 @@ export declare const withFiberRuntime: <A, E = never, R = never>(withRuntime: (f
2516
2589
  * @see {@link succeed} to create an effect that represents a successful value.
2517
2590
  *
2518
2591
  * @example
2592
+ * ```ts
2519
2593
  * // Title: Creating a Failed Effect
2520
2594
  * import { Effect } from "effect"
2521
2595
  *
@@ -2524,6 +2598,7 @@ export declare const withFiberRuntime: <A, E = never, R = never>(withRuntime: (f
2524
2598
  * const failure = Effect.fail(
2525
2599
  * new Error("Operation failed due to network error")
2526
2600
  * )
2601
+ * ```
2527
2602
  *
2528
2603
  * @since 2.0.0
2529
2604
  * @category Creating Effects
@@ -2565,6 +2640,7 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ef
2565
2640
  * @see {@link dieMessage} for a variant that throws a `RuntimeException` with a message.
2566
2641
  *
2567
2642
  * @example
2643
+ * ```ts
2568
2644
  * // Title: Terminating on Division by Zero with a Specified Error
2569
2645
  * import { Effect } from "effect"
2570
2646
  *
@@ -2581,6 +2657,7 @@ export declare const failCauseSync: <E>(evaluate: LazyArg<Cause.Cause<E>>) => Ef
2581
2657
  * // Output:
2582
2658
  * // (FiberFailure) Error: Cannot divide by zero
2583
2659
  * // ...stack trace...
2660
+ * ```
2584
2661
  *
2585
2662
  * @since 2.0.0
2586
2663
  * @category Creating Effects
@@ -2609,6 +2686,7 @@ export declare const die: (defect: unknown) => Effect<never>;
2609
2686
  * lazily.
2610
2687
  *
2611
2688
  * @example
2689
+ * ```ts
2612
2690
  * // Title: Terminating on Division by Zero with a Specified Message
2613
2691
  * import { Effect } from "effect"
2614
2692
  *
@@ -2625,6 +2703,7 @@ export declare const die: (defect: unknown) => Effect<never>;
2625
2703
  * // Output:
2626
2704
  * // (FiberFailure) RuntimeException: Cannot divide by zero
2627
2705
  * // ...stack trace...
2706
+ * ```
2628
2707
  *
2629
2708
  * @since 2.0.0
2630
2709
  * @category Creating Effects
@@ -2658,6 +2737,7 @@ export declare const dieSync: (evaluate: LazyArg<unknown>) => Effect<never>;
2658
2737
  * effects and return the final result at the end.
2659
2738
  *
2660
2739
  * @example
2740
+ * ```ts
2661
2741
  * import { Effect } from "effect"
2662
2742
  *
2663
2743
  * const addServiceCharge = (amount: number) => amount + 1
@@ -2684,6 +2764,7 @@ export declare const dieSync: (evaluate: LazyArg<unknown>) => Effect<never>;
2684
2764
  * const finalAmount = addServiceCharge(discountedAmount)
2685
2765
  * return `Final amount to charge: ${finalAmount}`
2686
2766
  * })
2767
+ * ```
2687
2768
  *
2688
2769
  * @since 2.0.0
2689
2770
  * @category Creating Effects
@@ -2705,6 +2786,7 @@ export declare const gen: {
2705
2786
  * effects and return the final result at the end.
2706
2787
  *
2707
2788
  * @example
2789
+ * ```ts
2708
2790
  * import { Effect } from "effect"
2709
2791
  *
2710
2792
  * const addServiceCharge = (amount: number) => amount + 1
@@ -2731,6 +2813,7 @@ export declare const gen: {
2731
2813
  * const finalAmount = addServiceCharge(discountedAmount)
2732
2814
  * return `Final amount to charge: ${finalAmount}`
2733
2815
  * })
2816
+ * ```
2734
2817
  *
2735
2818
  * @since 2.0.0
2736
2819
  * @category Creating Effects
@@ -2756,6 +2839,7 @@ export declare const gen: {
2756
2839
  * effects and return the final result at the end.
2757
2840
  *
2758
2841
  * @example
2842
+ * ```ts
2759
2843
  * import { Effect } from "effect"
2760
2844
  *
2761
2845
  * const addServiceCharge = (amount: number) => amount + 1
@@ -2782,6 +2866,7 @@ export declare const gen: {
2782
2866
  * const finalAmount = addServiceCharge(discountedAmount)
2783
2867
  * return `Final amount to charge: ${finalAmount}`
2784
2868
  * })
2869
+ * ```
2785
2870
  *
2786
2871
  * @since 2.0.0
2787
2872
  * @category Creating Effects
@@ -2860,6 +2945,7 @@ export declare const none: <A, E, R>(self: Effect<Option.Option<A>, E, R>) => Ef
2860
2945
  * @see {@link tryPromise} for a version that can handle failures.
2861
2946
  *
2862
2947
  * @example
2948
+ * ```ts
2863
2949
  * // Title: Delayed Message
2864
2950
  * import { Effect } from "effect"
2865
2951
  *
@@ -2876,6 +2962,7 @@ export declare const none: <A, E, R>(self: Effect<Option.Option<A>, E, R>) => Ef
2876
2962
  * // ┌─── Effect<string, never, never>
2877
2963
  * // ▼
2878
2964
  * const program = delay("Async operation completed successfully!")
2965
+ * ```
2879
2966
  *
2880
2967
  * @since 2.0.0
2881
2968
  * @category Creating Effects
@@ -2892,6 +2979,7 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
2892
2979
  * @see {@link fail} to create an effect that represents a failure.
2893
2980
  *
2894
2981
  * @example
2982
+ * ```ts
2895
2983
  * // Title: Creating a Successful Effect
2896
2984
  * import { Effect } from "effect"
2897
2985
  *
@@ -2900,6 +2988,7 @@ export declare const promise: <A>(evaluate: (signal: AbortSignal) => PromiseLike
2900
2988
  * // ┌─── Effect<number, never, never>
2901
2989
  * // ▼
2902
2990
  * const success = Effect.succeed(42)
2991
+ * ```
2903
2992
  *
2904
2993
  * @since 2.0.0
2905
2994
  * @category Creating Effects
@@ -2934,6 +3023,7 @@ export declare const succeedSome: <A>(value: A) => Effect<Option.Option<A>>;
2934
3023
  * - **Unifying Return Types**: Can help TypeScript unify return types in situations where multiple branches of logic return different effects, simplifying type inference.
2935
3024
  *
2936
3025
  * @example
3026
+ * ```ts
2937
3027
  * // Title: Lazy Evaluation with Side Effects
2938
3028
  * import { Effect } from "effect"
2939
3029
  *
@@ -2948,6 +3038,7 @@ export declare const succeedSome: <A>(value: A) => Effect<Option.Option<A>>;
2948
3038
  *
2949
3039
  * console.log(Effect.runSync(good)) // Output: 1
2950
3040
  * console.log(Effect.runSync(good)) // Output: 2
3041
+ * ```
2951
3042
  *
2952
3043
  * @example
2953
3044
  * // Title: Recursive Fibonacci
@@ -3020,6 +3111,7 @@ export declare const suspend: <A, E, R>(effect: LazyArg<Effect<A, E, R>>) => Eff
3020
3111
  * @see {@link try_ | try} for a version that can handle failures.
3021
3112
  *
3022
3113
  * @example
3114
+ * ```ts
3023
3115
  * // Title: Logging a Message
3024
3116
  * import { Effect } from "effect"
3025
3117
  *
@@ -3031,6 +3123,7 @@ export declare const suspend: <A, E, R>(effect: LazyArg<Effect<A, E, R>>) => Eff
3031
3123
  * // ┌─── Effect<void, never, never>
3032
3124
  * // ▼
3033
3125
  * const program = log("Hello, World!")
3126
+ * ```
3034
3127
  *
3035
3128
  * @since 2.0.0
3036
3129
  * @category Creating Effects
@@ -3092,6 +3185,7 @@ _catch as catch };
3092
3185
  * @see {@link catchAllCause} for a version that can recover from both recoverable and unrecoverable errors.
3093
3186
  *
3094
3187
  * @example
3188
+ * ```ts
3095
3189
  * // Title: Providing Recovery Logic for Recoverable Errors
3096
3190
  * import { Effect, Random } from "effect"
3097
3191
  *
@@ -3124,6 +3218,7 @@ _catch as catch };
3124
3218
  * Effect.succeed(`Recovering from ${error._tag}`)
3125
3219
  * )
3126
3220
  * )
3221
+ * ```
3127
3222
  *
3128
3223
  * @since 2.0.0
3129
3224
  * @category Error handling
@@ -3145,6 +3240,7 @@ export declare const catchAll: {
3145
3240
  * @see {@link catchAllCause} for a version that can recover from both recoverable and unrecoverable errors.
3146
3241
  *
3147
3242
  * @example
3243
+ * ```ts
3148
3244
  * // Title: Providing Recovery Logic for Recoverable Errors
3149
3245
  * import { Effect, Random } from "effect"
3150
3246
  *
@@ -3177,6 +3273,7 @@ export declare const catchAll: {
3177
3273
  * Effect.succeed(`Recovering from ${error._tag}`)
3178
3274
  * )
3179
3275
  * )
3276
+ * ```
3180
3277
  *
3181
3278
  * @since 2.0.0
3182
3279
  * @category Error handling
@@ -3198,6 +3295,7 @@ export declare const catchAll: {
3198
3295
  * @see {@link catchAllCause} for a version that can recover from both recoverable and unrecoverable errors.
3199
3296
  *
3200
3297
  * @example
3298
+ * ```ts
3201
3299
  * // Title: Providing Recovery Logic for Recoverable Errors
3202
3300
  * import { Effect, Random } from "effect"
3203
3301
  *
@@ -3230,6 +3328,7 @@ export declare const catchAll: {
3230
3328
  * Effect.succeed(`Recovering from ${error._tag}`)
3231
3329
  * )
3232
3330
  * )
3331
+ * ```
3233
3332
  *
3234
3333
  * @since 2.0.0
3235
3334
  * @category Error handling
@@ -3254,6 +3353,7 @@ export declare const catchAll: {
3254
3353
  * dynamically loaded plugins, controlled recovery might be needed.
3255
3354
  *
3256
3355
  * @example
3356
+ * ```ts
3257
3357
  * // Title: Recovering from All Errors
3258
3358
  * import { Cause, Effect } from "effect"
3259
3359
  *
@@ -3271,6 +3371,7 @@ export declare const catchAll: {
3271
3371
  *
3272
3372
  * Effect.runPromise(recovered).then(console.log)
3273
3373
  * // Output: "Recovered from a regular error"
3374
+ * ```
3274
3375
  *
3275
3376
  * @since 2.0.0
3276
3377
  * @category Error handling
@@ -3294,6 +3395,7 @@ export declare const catchAllCause: {
3294
3395
  * dynamically loaded plugins, controlled recovery might be needed.
3295
3396
  *
3296
3397
  * @example
3398
+ * ```ts
3297
3399
  * // Title: Recovering from All Errors
3298
3400
  * import { Cause, Effect } from "effect"
3299
3401
  *
@@ -3311,6 +3413,7 @@ export declare const catchAllCause: {
3311
3413
  *
3312
3414
  * Effect.runPromise(recovered).then(console.log)
3313
3415
  * // Output: "Recovered from a regular error"
3416
+ * ```
3314
3417
  *
3315
3418
  * @since 2.0.0
3316
3419
  * @category Error handling
@@ -3334,6 +3437,7 @@ export declare const catchAllCause: {
3334
3437
  * dynamically loaded plugins, controlled recovery might be needed.
3335
3438
  *
3336
3439
  * @example
3440
+ * ```ts
3337
3441
  * // Title: Recovering from All Errors
3338
3442
  * import { Cause, Effect } from "effect"
3339
3443
  *
@@ -3351,6 +3455,7 @@ export declare const catchAllCause: {
3351
3455
  *
3352
3456
  * Effect.runPromise(recovered).then(console.log)
3353
3457
  * // Output: "Recovered from a regular error"
3458
+ * ```
3354
3459
  *
3355
3460
  * @since 2.0.0
3356
3461
  * @category Error handling
@@ -3381,6 +3486,7 @@ export declare const catchAllCause: {
3381
3486
  * dynamically loaded plugins, controlled recovery might be needed.
3382
3487
  *
3383
3488
  * @example
3489
+ * ```ts
3384
3490
  * // Title: Handling All Defects
3385
3491
  * import { Effect, Cause, Console } from "effect"
3386
3492
  *
@@ -3405,6 +3511,7 @@ export declare const catchAllCause: {
3405
3511
  * // _tag: "Success",
3406
3512
  * // value: undefined
3407
3513
  * // }
3514
+ * ```
3408
3515
  *
3409
3516
  * @since 2.0.0
3410
3517
  * @category Error handling
@@ -3434,6 +3541,7 @@ export declare const catchAllDefect: {
3434
3541
  * dynamically loaded plugins, controlled recovery might be needed.
3435
3542
  *
3436
3543
  * @example
3544
+ * ```ts
3437
3545
  * // Title: Handling All Defects
3438
3546
  * import { Effect, Cause, Console } from "effect"
3439
3547
  *
@@ -3458,6 +3566,7 @@ export declare const catchAllDefect: {
3458
3566
  * // _tag: "Success",
3459
3567
  * // value: undefined
3460
3568
  * // }
3569
+ * ```
3461
3570
  *
3462
3571
  * @since 2.0.0
3463
3572
  * @category Error handling
@@ -3487,6 +3596,7 @@ export declare const catchAllDefect: {
3487
3596
  * dynamically loaded plugins, controlled recovery might be needed.
3488
3597
  *
3489
3598
  * @example
3599
+ * ```ts
3490
3600
  * // Title: Handling All Defects
3491
3601
  * import { Effect, Cause, Console } from "effect"
3492
3602
  *
@@ -3511,6 +3621,7 @@ export declare const catchAllDefect: {
3511
3621
  * // _tag: "Success",
3512
3622
  * // value: undefined
3513
3623
  * // }
3624
+ * ```
3514
3625
  *
3515
3626
  * @since 2.0.0
3516
3627
  * @category Error handling
@@ -3529,6 +3640,7 @@ export declare const catchAllDefect: {
3529
3640
  * error type unless a user-defined type guard is used to narrow the type.
3530
3641
  *
3531
3642
  * @example
3643
+ * ```ts
3532
3644
  * // Title: Catching Specific Errors with a Predicate
3533
3645
  * import { Effect, Random } from "effect"
3534
3646
  *
@@ -3563,6 +3675,7 @@ export declare const catchAllDefect: {
3563
3675
  * () => Effect.succeed("Recovering from HttpError")
3564
3676
  * )
3565
3677
  * )
3678
+ * ```
3566
3679
  *
3567
3680
  * @since 2.0.0
3568
3681
  * @category Error handling
@@ -3580,6 +3693,7 @@ export declare const catchIf: {
3580
3693
  * error type unless a user-defined type guard is used to narrow the type.
3581
3694
  *
3582
3695
  * @example
3696
+ * ```ts
3583
3697
  * // Title: Catching Specific Errors with a Predicate
3584
3698
  * import { Effect, Random } from "effect"
3585
3699
  *
@@ -3614,6 +3728,7 @@ export declare const catchIf: {
3614
3728
  * () => Effect.succeed("Recovering from HttpError")
3615
3729
  * )
3616
3730
  * )
3731
+ * ```
3617
3732
  *
3618
3733
  * @since 2.0.0
3619
3734
  * @category Error handling
@@ -3631,6 +3746,7 @@ export declare const catchIf: {
3631
3746
  * error type unless a user-defined type guard is used to narrow the type.
3632
3747
  *
3633
3748
  * @example
3749
+ * ```ts
3634
3750
  * // Title: Catching Specific Errors with a Predicate
3635
3751
  * import { Effect, Random } from "effect"
3636
3752
  *
@@ -3665,6 +3781,7 @@ export declare const catchIf: {
3665
3781
  * () => Effect.succeed("Recovering from HttpError")
3666
3782
  * )
3667
3783
  * )
3784
+ * ```
3668
3785
  *
3669
3786
  * @since 2.0.0
3670
3787
  * @category Error handling
@@ -3682,6 +3799,7 @@ export declare const catchIf: {
3682
3799
  * error type unless a user-defined type guard is used to narrow the type.
3683
3800
  *
3684
3801
  * @example
3802
+ * ```ts
3685
3803
  * // Title: Catching Specific Errors with a Predicate
3686
3804
  * import { Effect, Random } from "effect"
3687
3805
  *
@@ -3716,6 +3834,7 @@ export declare const catchIf: {
3716
3834
  * () => Effect.succeed("Recovering from HttpError")
3717
3835
  * )
3718
3836
  * )
3837
+ * ```
3719
3838
  *
3720
3839
  * @since 2.0.0
3721
3840
  * @category Error handling
@@ -3733,6 +3852,7 @@ export declare const catchIf: {
3733
3852
  * error type unless a user-defined type guard is used to narrow the type.
3734
3853
  *
3735
3854
  * @example
3855
+ * ```ts
3736
3856
  * // Title: Catching Specific Errors with a Predicate
3737
3857
  * import { Effect, Random } from "effect"
3738
3858
  *
@@ -3767,6 +3887,7 @@ export declare const catchIf: {
3767
3887
  * () => Effect.succeed("Recovering from HttpError")
3768
3888
  * )
3769
3889
  * )
3890
+ * ```
3770
3891
  *
3771
3892
  * @since 2.0.0
3772
3893
  * @category Error handling
@@ -3788,6 +3909,7 @@ export declare const catchIf: {
3788
3909
  * @see {@link catchIf} for a version that allows you to recover from errors based on a predicate.
3789
3910
  *
3790
3911
  * @example
3912
+ * ```ts
3791
3913
  * // Title: Handling Specific Errors with Effect.catchSome
3792
3914
  * import { Effect, Random, Option } from "effect"
3793
3915
  *
@@ -3825,6 +3947,7 @@ export declare const catchIf: {
3825
3947
  * }
3826
3948
  * })
3827
3949
  * )
3950
+ * ```
3828
3951
  *
3829
3952
  * @since 2.0.0
3830
3953
  * @category Error handling
@@ -3845,6 +3968,7 @@ export declare const catchSome: {
3845
3968
  * @see {@link catchIf} for a version that allows you to recover from errors based on a predicate.
3846
3969
  *
3847
3970
  * @example
3971
+ * ```ts
3848
3972
  * // Title: Handling Specific Errors with Effect.catchSome
3849
3973
  * import { Effect, Random, Option } from "effect"
3850
3974
  *
@@ -3882,6 +4006,7 @@ export declare const catchSome: {
3882
4006
  * }
3883
4007
  * })
3884
4008
  * )
4009
+ * ```
3885
4010
  *
3886
4011
  * @since 2.0.0
3887
4012
  * @category Error handling
@@ -3902,6 +4027,7 @@ export declare const catchSome: {
3902
4027
  * @see {@link catchIf} for a version that allows you to recover from errors based on a predicate.
3903
4028
  *
3904
4029
  * @example
4030
+ * ```ts
3905
4031
  * // Title: Handling Specific Errors with Effect.catchSome
3906
4032
  * import { Effect, Random, Option } from "effect"
3907
4033
  *
@@ -3939,6 +4065,7 @@ export declare const catchSome: {
3939
4065
  * }
3940
4066
  * })
3941
4067
  * )
4068
+ * ```
3942
4069
  *
3943
4070
  * @since 2.0.0
3944
4071
  * @category Error handling
@@ -3994,6 +4121,7 @@ export declare const catchSomeCause: {
3994
4121
  * - If the defect does not match, the function returns `Option.none`, allowing the defect to propagate.
3995
4122
  *
3996
4123
  * @example
4124
+ * ```ts
3997
4125
  * // Title: Handling Specific Defects
3998
4126
  * import { Effect, Cause, Option, Console } from "effect"
3999
4127
  *
@@ -4024,6 +4152,7 @@ export declare const catchSomeCause: {
4024
4152
  * // defect: { _tag: 'RuntimeException' }
4025
4153
  * // }
4026
4154
  * // }
4155
+ * ```
4027
4156
  *
4028
4157
  * @since 2.0.0
4029
4158
  * @category Error handling
@@ -4056,6 +4185,7 @@ export declare const catchSomeDefect: {
4056
4185
  * - If the defect does not match, the function returns `Option.none`, allowing the defect to propagate.
4057
4186
  *
4058
4187
  * @example
4188
+ * ```ts
4059
4189
  * // Title: Handling Specific Defects
4060
4190
  * import { Effect, Cause, Option, Console } from "effect"
4061
4191
  *
@@ -4086,6 +4216,7 @@ export declare const catchSomeDefect: {
4086
4216
  * // defect: { _tag: 'RuntimeException' }
4087
4217
  * // }
4088
4218
  * // }
4219
+ * ```
4089
4220
  *
4090
4221
  * @since 2.0.0
4091
4222
  * @category Error handling
@@ -4118,6 +4249,7 @@ export declare const catchSomeDefect: {
4118
4249
  * - If the defect does not match, the function returns `Option.none`, allowing the defect to propagate.
4119
4250
  *
4120
4251
  * @example
4252
+ * ```ts
4121
4253
  * // Title: Handling Specific Defects
4122
4254
  * import { Effect, Cause, Option, Console } from "effect"
4123
4255
  *
@@ -4148,6 +4280,7 @@ export declare const catchSomeDefect: {
4148
4280
  * // defect: { _tag: 'RuntimeException' }
4149
4281
  * // }
4150
4282
  * // }
4283
+ * ```
4151
4284
  *
4152
4285
  * @since 2.0.0
4153
4286
  * @category Error handling
@@ -4172,6 +4305,7 @@ export declare const catchSomeDefect: {
4172
4305
  * types at once.
4173
4306
  *
4174
4307
  * @example
4308
+ * ```ts
4175
4309
  * // Title: Handling Errors by Tag
4176
4310
  * import { Effect, Random } from "effect"
4177
4311
  *
@@ -4205,6 +4339,7 @@ export declare const catchSomeDefect: {
4205
4339
  * Effect.succeed("Recovering from HttpError")
4206
4340
  * )
4207
4341
  * )
4342
+ * ```
4208
4343
  *
4209
4344
  * @since 2.0.0
4210
4345
  * @category Error handling
@@ -4228,6 +4363,7 @@ export declare const catchTag: {
4228
4363
  * types at once.
4229
4364
  *
4230
4365
  * @example
4366
+ * ```ts
4231
4367
  * // Title: Handling Errors by Tag
4232
4368
  * import { Effect, Random } from "effect"
4233
4369
  *
@@ -4261,6 +4397,7 @@ export declare const catchTag: {
4261
4397
  * Effect.succeed("Recovering from HttpError")
4262
4398
  * )
4263
4399
  * )
4400
+ * ```
4264
4401
  *
4265
4402
  * @since 2.0.0
4266
4403
  * @category Error handling
@@ -4290,6 +4427,7 @@ export declare const catchTag: {
4290
4427
  * types at once.
4291
4428
  *
4292
4429
  * @example
4430
+ * ```ts
4293
4431
  * // Title: Handling Errors by Tag
4294
4432
  * import { Effect, Random } from "effect"
4295
4433
  *
@@ -4323,6 +4461,7 @@ export declare const catchTag: {
4323
4461
  * Effect.succeed("Recovering from HttpError")
4324
4462
  * )
4325
4463
  * )
4464
+ * ```
4326
4465
  *
4327
4466
  * @since 2.0.0
4328
4467
  * @category Error handling
@@ -4350,6 +4489,7 @@ export declare const catchTag: {
4350
4489
  * field is used to identify and match errors.
4351
4490
  *
4352
4491
  * @example
4492
+ * ```ts
4353
4493
  * // Title: Handling Multiple Tagged Error Types at Once
4354
4494
  * import { Effect, Random } from "effect"
4355
4495
  *
@@ -4385,6 +4525,7 @@ export declare const catchTag: {
4385
4525
  * Effect.succeed(`Recovering from ValidationError`)
4386
4526
  * })
4387
4527
  * )
4528
+ * ```
4388
4529
  *
4389
4530
  * @since 2.0.0
4390
4531
  * @category Error handling
@@ -4405,6 +4546,7 @@ export declare const catchTags: {
4405
4546
  * field is used to identify and match errors.
4406
4547
  *
4407
4548
  * @example
4549
+ * ```ts
4408
4550
  * // Title: Handling Multiple Tagged Error Types at Once
4409
4551
  * import { Effect, Random } from "effect"
4410
4552
  *
@@ -4440,6 +4582,7 @@ export declare const catchTags: {
4440
4582
  * Effect.succeed(`Recovering from ValidationError`)
4441
4583
  * })
4442
4584
  * )
4585
+ * ```
4443
4586
  *
4444
4587
  * @since 2.0.0
4445
4588
  * @category Error handling
@@ -4478,6 +4621,7 @@ export declare const catchTags: {
4478
4621
  * field is used to identify and match errors.
4479
4622
  *
4480
4623
  * @example
4624
+ * ```ts
4481
4625
  * // Title: Handling Multiple Tagged Error Types at Once
4482
4626
  * import { Effect, Random } from "effect"
4483
4627
  *
@@ -4513,6 +4657,7 @@ export declare const catchTags: {
4513
4657
  * Effect.succeed(`Recovering from ValidationError`)
4514
4658
  * })
4515
4659
  * )
4660
+ * ```
4516
4661
  *
4517
4662
  * @since 2.0.0
4518
4663
  * @category Error handling
@@ -4549,6 +4694,7 @@ export declare const catchTags: {
4549
4694
  * interruptions, etc.).
4550
4695
  *
4551
4696
  * @example
4697
+ * ```ts
4552
4698
  * import { Effect, Console } from "effect"
4553
4699
  *
4554
4700
  * // ┌─── Effect<number, string, never>
@@ -4561,6 +4707,7 @@ export declare const catchTags: {
4561
4707
  * const cause = yield* Effect.cause(program)
4562
4708
  * yield* Console.log(cause)
4563
4709
  * })
4710
+ * ```
4564
4711
  *
4565
4712
  * @since 2.0.0
4566
4713
  * @category Error handling
@@ -4582,6 +4729,7 @@ export declare const eventually: <A, E, R>(self: Effect<A, E, R>) => Effect<A, n
4582
4729
  * side effects of the effect and do not need to handle or process its outcome.
4583
4730
  *
4584
4731
  * @example
4732
+ * ```ts
4585
4733
  * import { Effect } from "effect"
4586
4734
  *
4587
4735
  * // ┌─── Effect<number, string, never>
@@ -4591,6 +4739,7 @@ export declare const eventually: <A, E, R>(self: Effect<A, E, R>) => Effect<A, n
4591
4739
  * // ┌─── Effect<void, never, never>
4592
4740
  * // ▼
4593
4741
  * const program = Effect.ignore(task)
4742
+ * ```
4594
4743
  *
4595
4744
  * @since 2.0.0
4596
4745
  * @category Error handling
@@ -4616,6 +4765,7 @@ export declare const ignoreLogged: <A, E, R>(self: Effect<A, E, R>) => Effect<vo
4616
4765
  * it easier to manage and respond to errors from multiple operations at once.
4617
4766
  *
4618
4767
  * @example
4768
+ * ```ts
4619
4769
  * import { Effect } from "effect"
4620
4770
  *
4621
4771
  * const fail1 = Effect.fail("Oh uh!")
@@ -4634,6 +4784,7 @@ export declare const ignoreLogged: <A, E, R>(self: Effect<A, E, R>) => Effect<vo
4634
4784
  * // _tag: 'Failure',
4635
4785
  * // cause: { _id: 'Cause', _tag: 'Fail', failure: [ 'Oh uh!', 'Oh no!' ] }
4636
4786
  * // }
4787
+ * ```
4637
4788
  *
4638
4789
  * @since 2.0.0
4639
4790
  * @category Error handling
@@ -4655,6 +4806,7 @@ export declare const parallelErrors: <A, E, R>(self: Effect<A, E, R>) => Effect<
4655
4806
  * @see {@link unsandbox} to restore the original error handling.
4656
4807
  *
4657
4808
  * @example
4809
+ * ```ts
4658
4810
  * import { Effect, Console } from "effect"
4659
4811
  *
4660
4812
  * // ┌─── Effect<string, Error, never>
@@ -4689,6 +4841,7 @@ export declare const parallelErrors: <A, E, R>(self: Effect<A, E, R>) => Effect<
4689
4841
  * // Output:
4690
4842
  * // Caught a defect: Oh uh!
4691
4843
  * // fallback result on failure
4844
+ * ```
4692
4845
  *
4693
4846
  * @since 2.0.0
4694
4847
  * @category Error handling
@@ -4746,6 +4899,7 @@ export declare namespace Retry {
4746
4899
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
4747
4900
  *
4748
4901
  * @example
4902
+ * ```ts
4749
4903
  * import { Effect, Schedule } from "effect"
4750
4904
  *
4751
4905
  * let count = 0
@@ -4774,6 +4928,7 @@ export declare namespace Retry {
4774
4928
  * // failure
4775
4929
  * // success
4776
4930
  * // yay!
4931
+ * ```
4777
4932
  *
4778
4933
  * @since 2.0.0
4779
4934
  * @category Error handling
@@ -4796,6 +4951,7 @@ export declare const retry: {
4796
4951
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
4797
4952
  *
4798
4953
  * @example
4954
+ * ```ts
4799
4955
  * import { Effect, Schedule } from "effect"
4800
4956
  *
4801
4957
  * let count = 0
@@ -4824,6 +4980,7 @@ export declare const retry: {
4824
4980
  * // failure
4825
4981
  * // success
4826
4982
  * // yay!
4983
+ * ```
4827
4984
  *
4828
4985
  * @since 2.0.0
4829
4986
  * @category Error handling
@@ -4846,6 +5003,7 @@ export declare const retry: {
4846
5003
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
4847
5004
  *
4848
5005
  * @example
5006
+ * ```ts
4849
5007
  * import { Effect, Schedule } from "effect"
4850
5008
  *
4851
5009
  * let count = 0
@@ -4874,6 +5032,7 @@ export declare const retry: {
4874
5032
  * // failure
4875
5033
  * // success
4876
5034
  * // yay!
5035
+ * ```
4877
5036
  *
4878
5037
  * @since 2.0.0
4879
5038
  * @category Error handling
@@ -4896,6 +5055,7 @@ export declare const retry: {
4896
5055
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
4897
5056
  *
4898
5057
  * @example
5058
+ * ```ts
4899
5059
  * import { Effect, Schedule } from "effect"
4900
5060
  *
4901
5061
  * let count = 0
@@ -4924,6 +5084,7 @@ export declare const retry: {
4924
5084
  * // failure
4925
5085
  * // success
4926
5086
  * // yay!
5087
+ * ```
4927
5088
  *
4928
5089
  * @since 2.0.0
4929
5090
  * @category Error handling
@@ -4946,6 +5107,7 @@ export declare const retry: {
4946
5107
  * @see {@link retryOrElse} for a version that allows you to run a fallback.
4947
5108
  *
4948
5109
  * @example
5110
+ * ```ts
4949
5111
  * import { Effect, Schedule } from "effect"
4950
5112
  *
4951
5113
  * let count = 0
@@ -4974,6 +5136,7 @@ export declare const retry: {
4974
5136
  * // failure
4975
5137
  * // success
4976
5138
  * // yay!
5139
+ * ```
4977
5140
  *
4978
5141
  * @since 2.0.0
4979
5142
  * @category Error handling
@@ -4992,6 +5155,7 @@ export declare const retry: {
4992
5155
  * @see {@link retry} for a version that does not run a fallback effect.
4993
5156
  *
4994
5157
  * @example
5158
+ * ```ts
4995
5159
  * import { Effect, Schedule, Console } from "effect"
4996
5160
  *
4997
5161
  * let count = 0
@@ -5023,6 +5187,7 @@ export declare const retry: {
5023
5187
  * // failure
5024
5188
  * // orElse
5025
5189
  * // default value
5190
+ * ```
5026
5191
  *
5027
5192
  * @since 2.0.0
5028
5193
  * @category Error handling
@@ -5040,6 +5205,7 @@ export declare const retryOrElse: {
5040
5205
  * @see {@link retry} for a version that does not run a fallback effect.
5041
5206
  *
5042
5207
  * @example
5208
+ * ```ts
5043
5209
  * import { Effect, Schedule, Console } from "effect"
5044
5210
  *
5045
5211
  * let count = 0
@@ -5071,6 +5237,7 @@ export declare const retryOrElse: {
5071
5237
  * // failure
5072
5238
  * // orElse
5073
5239
  * // default value
5240
+ * ```
5074
5241
  *
5075
5242
  * @since 2.0.0
5076
5243
  * @category Error handling
@@ -5088,6 +5255,7 @@ export declare const retryOrElse: {
5088
5255
  * @see {@link retry} for a version that does not run a fallback effect.
5089
5256
  *
5090
5257
  * @example
5258
+ * ```ts
5091
5259
  * import { Effect, Schedule, Console } from "effect"
5092
5260
  *
5093
5261
  * let count = 0
@@ -5119,6 +5287,7 @@ export declare const retryOrElse: {
5119
5287
  * // failure
5120
5288
  * // orElse
5121
5289
  * // default value
5290
+ * ```
5122
5291
  *
5123
5292
  * @since 2.0.0
5124
5293
  * @category Error handling
@@ -5157,6 +5326,7 @@ export {
5157
5326
  * throw errors.
5158
5327
  *
5159
5328
  * @example
5329
+ * ```ts
5160
5330
  * // Title: Safe JSON Parsing
5161
5331
  * import { Effect } from "effect"
5162
5332
  *
@@ -5168,6 +5338,7 @@ export {
5168
5338
  * // ▼
5169
5339
  * const program = parse("")
5170
5340
  *
5341
+ * ```
5171
5342
  * @example
5172
5343
  * // Title: Custom Error Handling
5173
5344
  * import { Effect } from "effect"
@@ -5294,6 +5465,7 @@ export declare const tryMapPromise: {
5294
5465
  * @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
5295
5466
  *
5296
5467
  * @example
5468
+ * ```ts
5297
5469
  * // Title: Fetching a TODO Item
5298
5470
  * import { Effect } from "effect"
5299
5471
  *
@@ -5306,6 +5478,7 @@ export declare const tryMapPromise: {
5306
5478
  * // ┌─── Effect<Response, UnknownException, never>
5307
5479
  * // ▼
5308
5480
  * const program = getTodo(1)
5481
+ * ```
5309
5482
  *
5310
5483
  * @example
5311
5484
  * // Title: Custom Error Handling
@@ -5355,6 +5528,7 @@ export declare const tryPromise: {
5355
5528
  * @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
5356
5529
  *
5357
5530
  * @example
5531
+ * ```ts
5358
5532
  * // Title: Fetching a TODO Item
5359
5533
  * import { Effect } from "effect"
5360
5534
  *
@@ -5367,6 +5541,7 @@ export declare const tryPromise: {
5367
5541
  * // ┌─── Effect<Response, UnknownException, never>
5368
5542
  * // ▼
5369
5543
  * const program = getTodo(1)
5544
+ * ```
5370
5545
  *
5371
5546
  * @example
5372
5547
  * // Title: Custom Error Handling
@@ -5419,6 +5594,7 @@ export declare const tryPromise: {
5419
5594
  * @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
5420
5595
  *
5421
5596
  * @example
5597
+ * ```ts
5422
5598
  * // Title: Fetching a TODO Item
5423
5599
  * import { Effect } from "effect"
5424
5600
  *
@@ -5431,6 +5607,7 @@ export declare const tryPromise: {
5431
5607
  * // ┌─── Effect<Response, UnknownException, never>
5432
5608
  * // ▼
5433
5609
  * const program = getTodo(1)
5610
+ * ```
5434
5611
  *
5435
5612
  * @example
5436
5613
  * // Title: Custom Error Handling
@@ -5514,6 +5691,7 @@ export declare const checkInterruptible: <A, E, R>(f: (isInterruptible: boolean)
5514
5691
  * @see {@link Effect.uninterruptible} for creating an uninterruptible effect.
5515
5692
  *
5516
5693
  * @example
5694
+ * ```ts
5517
5695
  * import { Effect } from "effect"
5518
5696
  *
5519
5697
  * const longRunningTask = Effect.gen(function* () {
@@ -5543,6 +5721,7 @@ export declare const checkInterruptible: <A, E, R>(f: (isInterruptible: boolean)
5543
5721
  * // }
5544
5722
  * // }
5545
5723
  * // Heavy processing done.
5724
+ * ```
5546
5725
  *
5547
5726
  * @since 2.0.0
5548
5727
  * @category Interruption
@@ -5599,6 +5778,7 @@ export declare const uninterruptibleMask: <A, E, R>(f: (restore: <AX, EX, RX>(ef
5599
5778
  * or failing with specified error if the predicate fails
5600
5779
  *
5601
5780
  * @example
5781
+ * ```ts
5602
5782
  * import { Effect } from "effect"
5603
5783
  *
5604
5784
  * const isPositive = (n: number): boolean => n > 0
@@ -5608,6 +5788,7 @@ export declare const uninterruptibleMask: <A, E, R>(f: (restore: <AX, EX, RX>(ef
5608
5788
  *
5609
5789
  * // fails with `"0 is not positive"`
5610
5790
  * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)
5791
+ * ```
5611
5792
  *
5612
5793
  * @category Condition Checking
5613
5794
  * @since 3.4.0
@@ -5618,6 +5799,7 @@ export declare const liftPredicate: {
5618
5799
  * or failing with specified error if the predicate fails
5619
5800
  *
5620
5801
  * @example
5802
+ * ```ts
5621
5803
  * import { Effect } from "effect"
5622
5804
  *
5623
5805
  * const isPositive = (n: number): boolean => n > 0
@@ -5627,6 +5809,7 @@ export declare const liftPredicate: {
5627
5809
  *
5628
5810
  * // fails with `"0 is not positive"`
5629
5811
  * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)
5812
+ * ```
5630
5813
  *
5631
5814
  * @category Condition Checking
5632
5815
  * @since 3.4.0
@@ -5637,6 +5820,7 @@ export declare const liftPredicate: {
5637
5820
  * or failing with specified error if the predicate fails
5638
5821
  *
5639
5822
  * @example
5823
+ * ```ts
5640
5824
  * import { Effect } from "effect"
5641
5825
  *
5642
5826
  * const isPositive = (n: number): boolean => n > 0
@@ -5646,6 +5830,7 @@ export declare const liftPredicate: {
5646
5830
  *
5647
5831
  * // fails with `"0 is not positive"`
5648
5832
  * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)
5833
+ * ```
5649
5834
  *
5650
5835
  * @category Condition Checking
5651
5836
  * @since 3.4.0
@@ -5656,6 +5841,7 @@ export declare const liftPredicate: {
5656
5841
  * or failing with specified error if the predicate fails
5657
5842
  *
5658
5843
  * @example
5844
+ * ```ts
5659
5845
  * import { Effect } from "effect"
5660
5846
  *
5661
5847
  * const isPositive = (n: number): boolean => n > 0
@@ -5665,6 +5851,7 @@ export declare const liftPredicate: {
5665
5851
  *
5666
5852
  * // fails with `"0 is not positive"`
5667
5853
  * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)
5854
+ * ```
5668
5855
  *
5669
5856
  * @category Condition Checking
5670
5857
  * @since 3.4.0
@@ -5675,6 +5862,7 @@ export declare const liftPredicate: {
5675
5862
  * or failing with specified error if the predicate fails
5676
5863
  *
5677
5864
  * @example
5865
+ * ```ts
5678
5866
  * import { Effect } from "effect"
5679
5867
  *
5680
5868
  * const isPositive = (n: number): boolean => n > 0
@@ -5684,6 +5872,7 @@ export declare const liftPredicate: {
5684
5872
  *
5685
5873
  * // fails with `"0 is not positive"`
5686
5874
  * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)
5875
+ * ```
5687
5876
  *
5688
5877
  * @category Condition Checking
5689
5878
  * @since 3.4.0
@@ -5697,6 +5886,7 @@ export declare const liftPredicate: {
5697
5886
  * replace it with a new constant value.
5698
5887
  *
5699
5888
  * @example
5889
+ * ```ts
5700
5890
  * // Title: Replacing a Value
5701
5891
  * import { pipe, Effect } from "effect"
5702
5892
  *
@@ -5705,6 +5895,7 @@ export declare const liftPredicate: {
5705
5895
  *
5706
5896
  * Effect.runPromise(program).then(console.log)
5707
5897
  * // Output: "new value"
5898
+ * ```
5708
5899
  *
5709
5900
  * @since 2.0.0
5710
5901
  * @category Mapping
@@ -5717,6 +5908,7 @@ export declare const as: {
5717
5908
  * replace it with a new constant value.
5718
5909
  *
5719
5910
  * @example
5911
+ * ```ts
5720
5912
  * // Title: Replacing a Value
5721
5913
  * import { pipe, Effect } from "effect"
5722
5914
  *
@@ -5725,6 +5917,7 @@ export declare const as: {
5725
5917
  *
5726
5918
  * Effect.runPromise(program).then(console.log)
5727
5919
  * // Output: "new value"
5920
+ * ```
5728
5921
  *
5729
5922
  * @since 2.0.0
5730
5923
  * @category Mapping
@@ -5737,6 +5930,7 @@ export declare const as: {
5737
5930
  * replace it with a new constant value.
5738
5931
  *
5739
5932
  * @example
5933
+ * ```ts
5740
5934
  * // Title: Replacing a Value
5741
5935
  * import { pipe, Effect } from "effect"
5742
5936
  *
@@ -5745,6 +5939,7 @@ export declare const as: {
5745
5939
  *
5746
5940
  * Effect.runPromise(program).then(console.log)
5747
5941
  * // Output: "new value"
5942
+ * ```
5748
5943
  *
5749
5944
  * @since 2.0.0
5750
5945
  * @category Mapping
@@ -5789,6 +5984,7 @@ export declare const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E,
5789
5984
  * treat an error as a valid result.
5790
5985
  *
5791
5986
  * @example
5987
+ * ```ts
5792
5988
  * import { Effect } from "effect"
5793
5989
  *
5794
5990
  * // ┌─── Effect<number, string, never>
@@ -5798,6 +5994,7 @@ export declare const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E,
5798
5994
  * // ┌─── Effect<string, number, never>
5799
5995
  * // ▼
5800
5996
  * const flipped = Effect.flip(program)
5997
+ * ```
5801
5998
  *
5802
5999
  * @since 2.0.0
5803
6000
  * @category Mapping
@@ -5855,6 +6052,7 @@ export declare const flipWith: {
5855
6052
  * @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
5856
6053
  *
5857
6054
  * @example
6055
+ * ```ts
5858
6056
  * // Title: Adding a Service Charge
5859
6057
  * import { pipe, Effect } from "effect"
5860
6058
  *
@@ -5869,6 +6067,7 @@ export declare const flipWith: {
5869
6067
  *
5870
6068
  * Effect.runPromise(finalAmount).then(console.log)
5871
6069
  * // Output: 101
6070
+ * ```
5872
6071
  * @since 2.0.0
5873
6072
  * @category Mapping
5874
6073
  */
@@ -5900,6 +6099,7 @@ export declare const map: {
5900
6099
  * @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
5901
6100
  *
5902
6101
  * @example
6102
+ * ```ts
5903
6103
  * // Title: Adding a Service Charge
5904
6104
  * import { pipe, Effect } from "effect"
5905
6105
  *
@@ -5914,6 +6114,7 @@ export declare const map: {
5914
6114
  *
5915
6115
  * Effect.runPromise(finalAmount).then(console.log)
5916
6116
  * // Output: 101
6117
+ * ```
5917
6118
  * @since 2.0.0
5918
6119
  * @category Mapping
5919
6120
  */
@@ -5945,6 +6146,7 @@ export declare const map: {
5945
6146
  * @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
5946
6147
  *
5947
6148
  * @example
6149
+ * ```ts
5948
6150
  * // Title: Adding a Service Charge
5949
6151
  * import { pipe, Effect } from "effect"
5950
6152
  *
@@ -5959,6 +6161,7 @@ export declare const map: {
5959
6161
  *
5960
6162
  * Effect.runPromise(finalAmount).then(console.log)
5961
6163
  * // Output: 101
6164
+ * ```
5962
6165
  * @since 2.0.0
5963
6166
  * @category Mapping
5964
6167
  */
@@ -5984,6 +6187,7 @@ export declare const map: {
5984
6187
  * input collection type.
5985
6188
  *
5986
6189
  * @example
6190
+ * ```ts
5987
6191
  * import { Effect } from "effect"
5988
6192
  *
5989
6193
  * // Define an initial state and a transformation function
@@ -6002,6 +6206,7 @@ export declare const map: {
6002
6206
  * // Output:
6003
6207
  * // 6
6004
6208
  * // [ 'A', 'BB', 'CCC' ]
6209
+ * ```
6005
6210
  *
6006
6211
  * @since 2.0.0
6007
6212
  * @category Mapping
@@ -6027,6 +6232,7 @@ export declare const mapAccum: {
6027
6232
  * input collection type.
6028
6233
  *
6029
6234
  * @example
6235
+ * ```ts
6030
6236
  * import { Effect } from "effect"
6031
6237
  *
6032
6238
  * // Define an initial state and a transformation function
@@ -6045,6 +6251,7 @@ export declare const mapAccum: {
6045
6251
  * // Output:
6046
6252
  * // 6
6047
6253
  * // [ 'A', 'BB', 'CCC' ]
6254
+ * ```
6048
6255
  *
6049
6256
  * @since 2.0.0
6050
6257
  * @category Mapping
@@ -6070,6 +6277,7 @@ export declare const mapAccum: {
6070
6277
  * input collection type.
6071
6278
  *
6072
6279
  * @example
6280
+ * ```ts
6073
6281
  * import { Effect } from "effect"
6074
6282
  *
6075
6283
  * // Define an initial state and a transformation function
@@ -6088,6 +6296,7 @@ export declare const mapAccum: {
6088
6296
  * // Output:
6089
6297
  * // 6
6090
6298
  * // [ 'A', 'BB', 'CCC' ]
6299
+ * ```
6091
6300
  *
6092
6301
  * @since 2.0.0
6093
6302
  * @category Mapping
@@ -6107,6 +6316,7 @@ export declare const mapAccum: {
6107
6316
  * @see {@link mapError} for a version that operates on the error channel.
6108
6317
  *
6109
6318
  * @example
6319
+ * ```ts
6110
6320
  * import { Effect } from "effect"
6111
6321
  *
6112
6322
  * // ┌─── Effect<number, string, never>
@@ -6119,6 +6329,7 @@ export declare const mapAccum: {
6119
6329
  * onFailure: (message) => new Error(message),
6120
6330
  * onSuccess: (n) => n > 0
6121
6331
  * })
6332
+ * ```
6122
6333
  *
6123
6334
  * @since 2.0.0
6124
6335
  * @category Mapping
@@ -6137,6 +6348,7 @@ export declare const mapBoth: {
6137
6348
  * @see {@link mapError} for a version that operates on the error channel.
6138
6349
  *
6139
6350
  * @example
6351
+ * ```ts
6140
6352
  * import { Effect } from "effect"
6141
6353
  *
6142
6354
  * // ┌─── Effect<number, string, never>
@@ -6149,6 +6361,7 @@ export declare const mapBoth: {
6149
6361
  * onFailure: (message) => new Error(message),
6150
6362
  * onSuccess: (n) => n > 0
6151
6363
  * })
6364
+ * ```
6152
6365
  *
6153
6366
  * @since 2.0.0
6154
6367
  * @category Mapping
@@ -6170,6 +6383,7 @@ export declare const mapBoth: {
6170
6383
  * @see {@link mapError} for a version that operates on the error channel.
6171
6384
  *
6172
6385
  * @example
6386
+ * ```ts
6173
6387
  * import { Effect } from "effect"
6174
6388
  *
6175
6389
  * // ┌─── Effect<number, string, never>
@@ -6182,6 +6396,7 @@ export declare const mapBoth: {
6182
6396
  * onFailure: (message) => new Error(message),
6183
6397
  * onSuccess: (n) => n > 0
6184
6398
  * })
6399
+ * ```
6185
6400
  *
6186
6401
  * @since 2.0.0
6187
6402
  * @category Mapping
@@ -6205,6 +6420,7 @@ export declare const mapBoth: {
6205
6420
  * @see {@link orElseFail} if you want to replace the error with a new one.
6206
6421
  *
6207
6422
  * @example
6423
+ * ```ts
6208
6424
  * import { Effect } from "effect"
6209
6425
  *
6210
6426
  * // ┌─── Effect<number, string, never>
@@ -6217,6 +6433,7 @@ export declare const mapBoth: {
6217
6433
  * simulatedTask,
6218
6434
  * (message) => new Error(message)
6219
6435
  * )
6436
+ * ```
6220
6437
  *
6221
6438
  * @since 2.0.0
6222
6439
  * @category Mapping
@@ -6236,6 +6453,7 @@ export declare const mapError: {
6236
6453
  * @see {@link orElseFail} if you want to replace the error with a new one.
6237
6454
  *
6238
6455
  * @example
6456
+ * ```ts
6239
6457
  * import { Effect } from "effect"
6240
6458
  *
6241
6459
  * // ┌─── Effect<number, string, never>
@@ -6248,6 +6466,7 @@ export declare const mapError: {
6248
6466
  * simulatedTask,
6249
6467
  * (message) => new Error(message)
6250
6468
  * )
6469
+ * ```
6251
6470
  *
6252
6471
  * @since 2.0.0
6253
6472
  * @category Mapping
@@ -6267,6 +6486,7 @@ export declare const mapError: {
6267
6486
  * @see {@link orElseFail} if you want to replace the error with a new one.
6268
6487
  *
6269
6488
  * @example
6489
+ * ```ts
6270
6490
  * import { Effect } from "effect"
6271
6491
  *
6272
6492
  * // ┌─── Effect<number, string, never>
@@ -6279,6 +6499,7 @@ export declare const mapError: {
6279
6499
  * simulatedTask,
6280
6500
  * (message) => new Error(message)
6281
6501
  * )
6502
+ * ```
6282
6503
  *
6283
6504
  * @since 2.0.0
6284
6505
  * @category Mapping
@@ -6330,6 +6551,7 @@ export declare const mapErrorCause: {
6330
6551
  * errors as part of the outcome.
6331
6552
  *
6332
6553
  * @example
6554
+ * ```ts
6333
6555
  * import { Effect } from "effect"
6334
6556
  *
6335
6557
  * // ┌─── Effect<number, string, never>
@@ -6339,6 +6561,7 @@ export declare const mapErrorCause: {
6339
6561
  * // ┌─── Effect<number | string, never, never>
6340
6562
  * // ▼
6341
6563
  * const recovered = Effect.merge(program)
6564
+ * ```
6342
6565
  *
6343
6566
  * @since 2.0.0
6344
6567
  * @category Mapping
@@ -6681,6 +6904,15 @@ export declare const scope: Effect<Scope.Scope, never, Scope.Scope>;
6681
6904
  * @category scoping, resources & finalization
6682
6905
  */
6683
6906
  export declare const scopeWith: <A, E, R>(f: (scope: Scope.Scope) => Effect<A, E, R>) => Effect<A, E, R | Scope.Scope>;
6907
+ /**
6908
+ * Creates a `Scope`, passes it to the specified effectful function, and then
6909
+ * closes the scope as soon as the effect is complete (whether through success,
6910
+ * failure, or interruption).
6911
+ *
6912
+ * @since 3.11.0
6913
+ * @category scoping, resources & finalization
6914
+ */
6915
+ export declare const scopedWith: <A, E, R>(f: (scope: Scope.Scope) => Effect<A, E, R>) => Effect<A, E, R>;
6684
6916
  /**
6685
6917
  * Scopes all resources used in this workflow to the lifetime of the workflow,
6686
6918
  * ensuring that their finalizers are run as soon as this workflow completes
@@ -7269,6 +7501,7 @@ export declare const timedWith: {
7269
7501
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7270
7502
  *
7271
7503
  * @example
7504
+ * ```ts
7272
7505
  * import { Effect } from "effect"
7273
7506
  *
7274
7507
  * const task = Effect.gen(function* () {
@@ -7294,6 +7527,7 @@ export declare const timedWith: {
7294
7527
  * // failure: { _tag: 'TimeoutException' }
7295
7528
  * // }
7296
7529
  * // }
7530
+ * ```
7297
7531
  *
7298
7532
  * @since 2.0.0
7299
7533
  * @category delays & timeouts
@@ -7314,6 +7548,7 @@ export declare const timeout: {
7314
7548
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7315
7549
  *
7316
7550
  * @example
7551
+ * ```ts
7317
7552
  * import { Effect } from "effect"
7318
7553
  *
7319
7554
  * const task = Effect.gen(function* () {
@@ -7339,6 +7574,7 @@ export declare const timeout: {
7339
7574
  * // failure: { _tag: 'TimeoutException' }
7340
7575
  * // }
7341
7576
  * // }
7577
+ * ```
7342
7578
  *
7343
7579
  * @since 2.0.0
7344
7580
  * @category delays & timeouts
@@ -7359,6 +7595,7 @@ export declare const timeout: {
7359
7595
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7360
7596
  *
7361
7597
  * @example
7598
+ * ```ts
7362
7599
  * import { Effect } from "effect"
7363
7600
  *
7364
7601
  * const task = Effect.gen(function* () {
@@ -7384,6 +7621,7 @@ export declare const timeout: {
7384
7621
  * // failure: { _tag: 'TimeoutException' }
7385
7622
  * // }
7386
7623
  * // }
7624
+ * ```
7387
7625
  *
7388
7626
  * @since 2.0.0
7389
7627
  * @category delays & timeouts
@@ -7410,6 +7648,7 @@ export declare const timeout: {
7410
7648
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7411
7649
  *
7412
7650
  * @example
7651
+ * ```ts
7413
7652
  * import { Effect } from "effect"
7414
7653
  *
7415
7654
  * const task = Effect.gen(function* () {
@@ -7433,6 +7672,7 @@ export declare const timeout: {
7433
7672
  * // { _id: 'Option', _tag: 'Some', value: 'Result' },
7434
7673
  * // { _id: 'Option', _tag: 'None' }
7435
7674
  * // ]
7675
+ * ```
7436
7676
  *
7437
7677
  * @since 3.1.0
7438
7678
  * @category delays & timeouts
@@ -7458,6 +7698,7 @@ export declare const timeoutOption: {
7458
7698
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7459
7699
  *
7460
7700
  * @example
7701
+ * ```ts
7461
7702
  * import { Effect } from "effect"
7462
7703
  *
7463
7704
  * const task = Effect.gen(function* () {
@@ -7481,6 +7722,7 @@ export declare const timeoutOption: {
7481
7722
  * // { _id: 'Option', _tag: 'Some', value: 'Result' },
7482
7723
  * // { _id: 'Option', _tag: 'None' }
7483
7724
  * // ]
7725
+ * ```
7484
7726
  *
7485
7727
  * @since 3.1.0
7486
7728
  * @category delays & timeouts
@@ -7506,6 +7748,7 @@ export declare const timeoutOption: {
7506
7748
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7507
7749
  *
7508
7750
  * @example
7751
+ * ```ts
7509
7752
  * import { Effect } from "effect"
7510
7753
  *
7511
7754
  * const task = Effect.gen(function* () {
@@ -7529,6 +7772,7 @@ export declare const timeoutOption: {
7529
7772
  * // { _id: 'Option', _tag: 'Some', value: 'Result' },
7530
7773
  * // { _id: 'Option', _tag: 'None' }
7531
7774
  * // ]
7775
+ * ```
7532
7776
  *
7533
7777
  * @since 3.1.0
7534
7778
  * @category delays & timeouts
@@ -7554,6 +7798,7 @@ export declare const timeoutOption: {
7554
7798
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7555
7799
  *
7556
7800
  * @example
7801
+ * ```ts
7557
7802
  * import { Effect } from "effect"
7558
7803
  *
7559
7804
  * const task = Effect.gen(function* () {
@@ -7586,6 +7831,7 @@ export declare const timeoutOption: {
7586
7831
  * // failure: MyTimeoutError { _tag: 'MyTimeoutError' }
7587
7832
  * // }
7588
7833
  * // }
7834
+ * ```
7589
7835
  *
7590
7836
  * @since 2.0.0
7591
7837
  * @category delays & timeouts
@@ -7610,6 +7856,7 @@ export declare const timeoutFail: {
7610
7856
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7611
7857
  *
7612
7858
  * @example
7859
+ * ```ts
7613
7860
  * import { Effect } from "effect"
7614
7861
  *
7615
7862
  * const task = Effect.gen(function* () {
@@ -7642,6 +7889,7 @@ export declare const timeoutFail: {
7642
7889
  * // failure: MyTimeoutError { _tag: 'MyTimeoutError' }
7643
7890
  * // }
7644
7891
  * // }
7892
+ * ```
7645
7893
  *
7646
7894
  * @since 2.0.0
7647
7895
  * @category delays & timeouts
@@ -7669,6 +7917,7 @@ export declare const timeoutFail: {
7669
7917
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7670
7918
  *
7671
7919
  * @example
7920
+ * ```ts
7672
7921
  * import { Effect } from "effect"
7673
7922
  *
7674
7923
  * const task = Effect.gen(function* () {
@@ -7701,6 +7950,7 @@ export declare const timeoutFail: {
7701
7950
  * // failure: MyTimeoutError { _tag: 'MyTimeoutError' }
7702
7951
  * // }
7703
7952
  * // }
7953
+ * ```
7704
7954
  *
7705
7955
  * @since 2.0.0
7706
7956
  * @category delays & timeouts
@@ -7728,6 +7978,7 @@ export declare const timeoutFail: {
7728
7978
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7729
7979
  *
7730
7980
  * @example
7981
+ * ```ts
7731
7982
  * import { Effect, Cause } from "effect"
7732
7983
  *
7733
7984
  * const task = Effect.gen(function* () {
@@ -7752,6 +8003,7 @@ export declare const timeoutFail: {
7752
8003
  * // _tag: 'Failure',
7753
8004
  * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Timed out!' }
7754
8005
  * // }
8006
+ * ```
7755
8007
  *
7756
8008
  * @since 2.0.0
7757
8009
  * @category delays & timeouts
@@ -7775,6 +8027,7 @@ export declare const timeoutFailCause: {
7775
8027
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7776
8028
  *
7777
8029
  * @example
8030
+ * ```ts
7778
8031
  * import { Effect, Cause } from "effect"
7779
8032
  *
7780
8033
  * const task = Effect.gen(function* () {
@@ -7799,6 +8052,7 @@ export declare const timeoutFailCause: {
7799
8052
  * // _tag: 'Failure',
7800
8053
  * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Timed out!' }
7801
8054
  * // }
8055
+ * ```
7802
8056
  *
7803
8057
  * @since 2.0.0
7804
8058
  * @category delays & timeouts
@@ -7825,6 +8079,7 @@ export declare const timeoutFailCause: {
7825
8079
  * @see {@link timeoutTo} for a version that allows specifying both success and timeout handlers.
7826
8080
  *
7827
8081
  * @example
8082
+ * ```ts
7828
8083
  * import { Effect, Cause } from "effect"
7829
8084
  *
7830
8085
  * const task = Effect.gen(function* () {
@@ -7849,6 +8104,7 @@ export declare const timeoutFailCause: {
7849
8104
  * // _tag: 'Failure',
7850
8105
  * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Timed out!' }
7851
8106
  * // }
8107
+ * ```
7852
8108
  *
7853
8109
  * @since 2.0.0
7854
8110
  * @category delays & timeouts
@@ -7880,6 +8136,7 @@ export declare const timeoutFailCause: {
7880
8136
  * @see {@link timeoutFailCause} for a version that raises a custom defect.
7881
8137
  *
7882
8138
  * @example
8139
+ * ```ts
7883
8140
  * import { Effect, Either } from "effect"
7884
8141
  *
7885
8142
  * const task = Effect.gen(function* () {
@@ -7907,6 +8164,7 @@ export declare const timeoutFailCause: {
7907
8164
  * // _tag: "Left",
7908
8165
  * // left: "Timed out!"
7909
8166
  * // }
8167
+ * ```
7910
8168
  *
7911
8169
  * @since 2.0.0
7912
8170
  * @category delays & timeouts
@@ -7934,6 +8192,7 @@ export declare const timeoutTo: {
7934
8192
  * @see {@link timeoutFailCause} for a version that raises a custom defect.
7935
8193
  *
7936
8194
  * @example
8195
+ * ```ts
7937
8196
  * import { Effect, Either } from "effect"
7938
8197
  *
7939
8198
  * const task = Effect.gen(function* () {
@@ -7961,6 +8220,7 @@ export declare const timeoutTo: {
7961
8220
  * // _tag: "Left",
7962
8221
  * // left: "Timed out!"
7963
8222
  * // }
8223
+ * ```
7964
8224
  *
7965
8225
  * @since 2.0.0
7966
8226
  * @category delays & timeouts
@@ -7992,6 +8252,7 @@ export declare const timeoutTo: {
7992
8252
  * @see {@link timeoutFailCause} for a version that raises a custom defect.
7993
8253
  *
7994
8254
  * @example
8255
+ * ```ts
7995
8256
  * import { Effect, Either } from "effect"
7996
8257
  *
7997
8258
  * const task = Effect.gen(function* () {
@@ -8019,6 +8280,7 @@ export declare const timeoutTo: {
8019
8280
  * // _tag: "Left",
8020
8281
  * // left: "Timed out!"
8021
8282
  * // }
8283
+ * ```
8022
8284
  *
8023
8285
  * @since 2.0.0
8024
8286
  * @category delays & timeouts
@@ -8122,6 +8384,7 @@ export declare const mapInputContext: {
8122
8384
  * @see {@link provideService} for providing a service to an effect.
8123
8385
  *
8124
8386
  * @example
8387
+ * ```ts
8125
8388
  * import { Context, Effect, Layer } from "effect"
8126
8389
  *
8127
8390
  * class Database extends Context.Tag("Database")<
@@ -8153,6 +8416,7 @@ export declare const mapInputContext: {
8153
8416
  * // Output:
8154
8417
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8155
8418
  * // []
8419
+ * ```
8156
8420
  *
8157
8421
  * @since 2.0.0
8158
8422
  * @category Context
@@ -8168,6 +8432,7 @@ export declare const provide: {
8168
8432
  * @see {@link provideService} for providing a service to an effect.
8169
8433
  *
8170
8434
  * @example
8435
+ * ```ts
8171
8436
  * import { Context, Effect, Layer } from "effect"
8172
8437
  *
8173
8438
  * class Database extends Context.Tag("Database")<
@@ -8199,6 +8464,7 @@ export declare const provide: {
8199
8464
  * // Output:
8200
8465
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8201
8466
  * // []
8467
+ * ```
8202
8468
  *
8203
8469
  * @since 2.0.0
8204
8470
  * @category Context
@@ -8220,6 +8486,7 @@ export declare const provide: {
8220
8486
  * @see {@link provideService} for providing a service to an effect.
8221
8487
  *
8222
8488
  * @example
8489
+ * ```ts
8223
8490
  * import { Context, Effect, Layer } from "effect"
8224
8491
  *
8225
8492
  * class Database extends Context.Tag("Database")<
@@ -8251,6 +8518,7 @@ export declare const provide: {
8251
8518
  * // Output:
8252
8519
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8253
8520
  * // []
8521
+ * ```
8254
8522
  *
8255
8523
  * @since 2.0.0
8256
8524
  * @category Context
@@ -8266,6 +8534,7 @@ export declare const provide: {
8266
8534
  * @see {@link provideService} for providing a service to an effect.
8267
8535
  *
8268
8536
  * @example
8537
+ * ```ts
8269
8538
  * import { Context, Effect, Layer } from "effect"
8270
8539
  *
8271
8540
  * class Database extends Context.Tag("Database")<
@@ -8297,6 +8566,7 @@ export declare const provide: {
8297
8566
  * // Output:
8298
8567
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8299
8568
  * // []
8569
+ * ```
8300
8570
  *
8301
8571
  * @since 2.0.0
8302
8572
  * @category Context
@@ -8312,6 +8582,7 @@ export declare const provide: {
8312
8582
  * @see {@link provideService} for providing a service to an effect.
8313
8583
  *
8314
8584
  * @example
8585
+ * ```ts
8315
8586
  * import { Context, Effect, Layer } from "effect"
8316
8587
  *
8317
8588
  * class Database extends Context.Tag("Database")<
@@ -8343,6 +8614,7 @@ export declare const provide: {
8343
8614
  * // Output:
8344
8615
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8345
8616
  * // []
8617
+ * ```
8346
8618
  *
8347
8619
  * @since 2.0.0
8348
8620
  * @category Context
@@ -8358,6 +8630,7 @@ export declare const provide: {
8358
8630
  * @see {@link provideService} for providing a service to an effect.
8359
8631
  *
8360
8632
  * @example
8633
+ * ```ts
8361
8634
  * import { Context, Effect, Layer } from "effect"
8362
8635
  *
8363
8636
  * class Database extends Context.Tag("Database")<
@@ -8389,6 +8662,7 @@ export declare const provide: {
8389
8662
  * // Output:
8390
8663
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8391
8664
  * // []
8665
+ * ```
8392
8666
  *
8393
8667
  * @since 2.0.0
8394
8668
  * @category Context
@@ -8404,6 +8678,7 @@ export declare const provide: {
8404
8678
  * @see {@link provideService} for providing a service to an effect.
8405
8679
  *
8406
8680
  * @example
8681
+ * ```ts
8407
8682
  * import { Context, Effect, Layer } from "effect"
8408
8683
  *
8409
8684
  * class Database extends Context.Tag("Database")<
@@ -8435,6 +8710,7 @@ export declare const provide: {
8435
8710
  * // Output:
8436
8711
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8437
8712
  * // []
8713
+ * ```
8438
8714
  *
8439
8715
  * @since 2.0.0
8440
8716
  * @category Context
@@ -8456,6 +8732,7 @@ export declare const provide: {
8456
8732
  * @see {@link provideService} for providing a service to an effect.
8457
8733
  *
8458
8734
  * @example
8735
+ * ```ts
8459
8736
  * import { Context, Effect, Layer } from "effect"
8460
8737
  *
8461
8738
  * class Database extends Context.Tag("Database")<
@@ -8487,6 +8764,7 @@ export declare const provide: {
8487
8764
  * // Output:
8488
8765
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8489
8766
  * // []
8767
+ * ```
8490
8768
  *
8491
8769
  * @since 2.0.0
8492
8770
  * @category Context
@@ -8502,6 +8780,7 @@ export declare const provide: {
8502
8780
  * @see {@link provideService} for providing a service to an effect.
8503
8781
  *
8504
8782
  * @example
8783
+ * ```ts
8505
8784
  * import { Context, Effect, Layer } from "effect"
8506
8785
  *
8507
8786
  * class Database extends Context.Tag("Database")<
@@ -8533,6 +8812,7 @@ export declare const provide: {
8533
8812
  * // Output:
8534
8813
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8535
8814
  * // []
8815
+ * ```
8536
8816
  *
8537
8817
  * @since 2.0.0
8538
8818
  * @category Context
@@ -8548,6 +8828,7 @@ export declare const provide: {
8548
8828
  * @see {@link provideService} for providing a service to an effect.
8549
8829
  *
8550
8830
  * @example
8831
+ * ```ts
8551
8832
  * import { Context, Effect, Layer } from "effect"
8552
8833
  *
8553
8834
  * class Database extends Context.Tag("Database")<
@@ -8579,6 +8860,7 @@ export declare const provide: {
8579
8860
  * // Output:
8580
8861
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8581
8862
  * // []
8863
+ * ```
8582
8864
  *
8583
8865
  * @since 2.0.0
8584
8866
  * @category Context
@@ -8594,6 +8876,7 @@ export declare const provide: {
8594
8876
  * @see {@link provideService} for providing a service to an effect.
8595
8877
  *
8596
8878
  * @example
8879
+ * ```ts
8597
8880
  * import { Context, Effect, Layer } from "effect"
8598
8881
  *
8599
8882
  * class Database extends Context.Tag("Database")<
@@ -8625,6 +8908,7 @@ export declare const provide: {
8625
8908
  * // Output:
8626
8909
  * // timestamp=... level=INFO fiber=#0 message="Executing query: SELECT * FROM users"
8627
8910
  * // []
8911
+ * ```
8628
8912
  *
8629
8913
  * @since 2.0.0
8630
8914
  * @category Context
@@ -8644,6 +8928,7 @@ export declare const provide: {
8644
8928
  * @see {@link provide} for providing multiple layers to an effect.
8645
8929
  *
8646
8930
  * @example
8931
+ * ```ts
8647
8932
  * import { Effect, Context } from "effect"
8648
8933
  *
8649
8934
  * // Declaring a tag for a service that generates random numbers
@@ -8671,6 +8956,7 @@ export declare const provide: {
8671
8956
  * Effect.runPromise(runnable)
8672
8957
  * // Example Output:
8673
8958
  * // random number: 0.8241872233134417
8959
+ * ```
8674
8960
  *
8675
8961
  * @since 2.0.0
8676
8962
  * @category Context
@@ -8689,6 +8975,7 @@ export declare const provideService: {
8689
8975
  * @see {@link provide} for providing multiple layers to an effect.
8690
8976
  *
8691
8977
  * @example
8978
+ * ```ts
8692
8979
  * import { Effect, Context } from "effect"
8693
8980
  *
8694
8981
  * // Declaring a tag for a service that generates random numbers
@@ -8716,6 +9003,7 @@ export declare const provideService: {
8716
9003
  * Effect.runPromise(runnable)
8717
9004
  * // Example Output:
8718
9005
  * // random number: 0.8241872233134417
9006
+ * ```
8719
9007
  *
8720
9008
  * @since 2.0.0
8721
9009
  * @category Context
@@ -8734,6 +9022,7 @@ export declare const provideService: {
8734
9022
  * @see {@link provide} for providing multiple layers to an effect.
8735
9023
  *
8736
9024
  * @example
9025
+ * ```ts
8737
9026
  * import { Effect, Context } from "effect"
8738
9027
  *
8739
9028
  * // Declaring a tag for a service that generates random numbers
@@ -8761,6 +9050,7 @@ export declare const provideService: {
8761
9050
  * Effect.runPromise(runnable)
8762
9051
  * // Example Output:
8763
9052
  * // random number: 0.8241872233134417
9053
+ * ```
8764
9054
  *
8765
9055
  * @since 2.0.0
8766
9056
  * @category Context
@@ -8879,6 +9169,7 @@ export declare const updateService: {
8879
9169
  * @see {@link let_ let}
8880
9170
  *
8881
9171
  * @example
9172
+ * ```ts
8882
9173
  * import { Effect, pipe } from "effect"
8883
9174
  *
8884
9175
  * const result = pipe(
@@ -8888,6 +9179,7 @@ export declare const updateService: {
8888
9179
  * Effect.let("sum", ({ x, y }) => x + y)
8889
9180
  * )
8890
9181
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9182
+ * ```
8891
9183
  *
8892
9184
  * @category Do notation
8893
9185
  * @since 2.0.0
@@ -8908,6 +9200,7 @@ export declare const Do: Effect<{}>;
8908
9200
  * @see {@link let_ let}
8909
9201
  *
8910
9202
  * @example
9203
+ * ```ts
8911
9204
  * import { Effect, pipe } from "effect"
8912
9205
  *
8913
9206
  * const result = pipe(
@@ -8917,6 +9210,7 @@ export declare const Do: Effect<{}>;
8917
9210
  * Effect.let("sum", ({ x, y }) => x + y)
8918
9211
  * )
8919
9212
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9213
+ * ```
8920
9214
  *
8921
9215
  * @category Do notation
8922
9216
  * @since 2.0.0
@@ -8937,6 +9231,7 @@ export declare const bind: {
8937
9231
  * @see {@link let_ let}
8938
9232
  *
8939
9233
  * @example
9234
+ * ```ts
8940
9235
  * import { Effect, pipe } from "effect"
8941
9236
  *
8942
9237
  * const result = pipe(
@@ -8946,6 +9241,7 @@ export declare const bind: {
8946
9241
  * Effect.let("sum", ({ x, y }) => x + y)
8947
9242
  * )
8948
9243
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9244
+ * ```
8949
9245
  *
8950
9246
  * @category Do notation
8951
9247
  * @since 2.0.0
@@ -8968,6 +9264,7 @@ export declare const bind: {
8968
9264
  * @see {@link let_ let}
8969
9265
  *
8970
9266
  * @example
9267
+ * ```ts
8971
9268
  * import { Effect, pipe } from "effect"
8972
9269
  *
8973
9270
  * const result = pipe(
@@ -8977,6 +9274,7 @@ export declare const bind: {
8977
9274
  * Effect.let("sum", ({ x, y }) => x + y)
8978
9275
  * )
8979
9276
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9277
+ * ```
8980
9278
  *
8981
9279
  * @category Do notation
8982
9280
  * @since 2.0.0
@@ -8991,6 +9289,7 @@ export declare const bind: {
8991
9289
  * results in a Do notation pipeline.
8992
9290
  *
8993
9291
  * @example
9292
+ * ```ts
8994
9293
  * import { Effect, Either, pipe } from "effect"
8995
9294
  *
8996
9295
  * const result = pipe(
@@ -9002,6 +9301,7 @@ export declare const bind: {
9002
9301
  * }), { concurrency: 2, mode: "either" })
9003
9302
  * )
9004
9303
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, a: Either.right(2), b: Either.left("oops") })
9304
+ * ```
9005
9305
  *
9006
9306
  * @category Do notation
9007
9307
  * @since 3.7.0
@@ -9013,6 +9313,7 @@ export declare const bindAll: {
9013
9313
  * results in a Do notation pipeline.
9014
9314
  *
9015
9315
  * @example
9316
+ * ```ts
9016
9317
  * import { Effect, Either, pipe } from "effect"
9017
9318
  *
9018
9319
  * const result = pipe(
@@ -9024,6 +9325,7 @@ export declare const bindAll: {
9024
9325
  * }), { concurrency: 2, mode: "either" })
9025
9326
  * )
9026
9327
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, a: Either.right(2), b: Either.left("oops") })
9328
+ * ```
9027
9329
  *
9028
9330
  * @category Do notation
9029
9331
  * @since 3.7.0
@@ -9042,6 +9344,7 @@ export declare const bindAll: {
9042
9344
  * results in a Do notation pipeline.
9043
9345
  *
9044
9346
  * @example
9347
+ * ```ts
9045
9348
  * import { Effect, Either, pipe } from "effect"
9046
9349
  *
9047
9350
  * const result = pipe(
@@ -9053,6 +9356,7 @@ export declare const bindAll: {
9053
9356
  * }), { concurrency: 2, mode: "either" })
9054
9357
  * )
9055
9358
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, a: Either.right(2), b: Either.left("oops") })
9359
+ * ```
9056
9360
  *
9057
9361
  * @category Do notation
9058
9362
  * @since 3.7.0
@@ -9086,6 +9390,7 @@ export declare const bindAll: {
9086
9390
  * @see {@link let_ let}
9087
9391
  *
9088
9392
  * @example
9393
+ * ```ts
9089
9394
  * import { Effect, pipe } from "effect"
9090
9395
  *
9091
9396
  * const result = pipe(
@@ -9095,6 +9400,7 @@ export declare const bindAll: {
9095
9400
  * Effect.let("sum", ({ x, y }) => x + y)
9096
9401
  * )
9097
9402
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9403
+ * ```
9098
9404
  *
9099
9405
  * @category Do notation
9100
9406
  * @since 2.0.0
@@ -9115,6 +9421,7 @@ export declare const bindTo: {
9115
9421
  * @see {@link let_ let}
9116
9422
  *
9117
9423
  * @example
9424
+ * ```ts
9118
9425
  * import { Effect, pipe } from "effect"
9119
9426
  *
9120
9427
  * const result = pipe(
@@ -9124,6 +9431,7 @@ export declare const bindTo: {
9124
9431
  * Effect.let("sum", ({ x, y }) => x + y)
9125
9432
  * )
9126
9433
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9434
+ * ```
9127
9435
  *
9128
9436
  * @category Do notation
9129
9437
  * @since 2.0.0
@@ -9146,6 +9454,7 @@ export declare const bindTo: {
9146
9454
  * @see {@link let_ let}
9147
9455
  *
9148
9456
  * @example
9457
+ * ```ts
9149
9458
  * import { Effect, pipe } from "effect"
9150
9459
  *
9151
9460
  * const result = pipe(
@@ -9155,6 +9464,7 @@ export declare const bindTo: {
9155
9464
  * Effect.let("sum", ({ x, y }) => x + y)
9156
9465
  * )
9157
9466
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9467
+ * ```
9158
9468
  *
9159
9469
  * @category Do notation
9160
9470
  * @since 2.0.0
@@ -9187,6 +9497,7 @@ export {
9187
9497
  * @see {@link bindTo}
9188
9498
  *
9189
9499
  * @example
9500
+ * ```ts
9190
9501
  * import { Effect, pipe } from "effect"
9191
9502
  *
9192
9503
  * const result = pipe(
@@ -9197,6 +9508,7 @@ export {
9197
9508
  * )
9198
9509
  * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })
9199
9510
  *
9511
+ * ```
9200
9512
  * @category Do notation
9201
9513
  * @since 2.0.0
9202
9514
  */
@@ -9219,6 +9531,7 @@ let_ as let };
9219
9531
  * @see {@link exit} for a version that uses `Exit` instead.
9220
9532
  *
9221
9533
  * @example
9534
+ * ```ts
9222
9535
  * // Title: Using Effect.option to Handle Errors
9223
9536
  * import { Effect } from "effect"
9224
9537
  *
@@ -9251,6 +9564,7 @@ let_ as let };
9251
9564
  * // _tag: 'Failure',
9252
9565
  * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Boom!' }
9253
9566
  * // }
9567
+ * ```
9254
9568
  *
9255
9569
  * @since 2.0.0
9256
9570
  * @category Outcome Encapsulation
@@ -9275,6 +9589,7 @@ export declare const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option.O
9275
9589
  * @see {@link exit} for a version that uses `Exit` instead.
9276
9590
  *
9277
9591
  * @example
9592
+ * ```ts
9278
9593
  * import { Effect, Either, Random } from "effect"
9279
9594
  *
9280
9595
  * class HttpError {
@@ -9310,6 +9625,7 @@ export declare const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option.O
9310
9625
  * onRight: (value) => value // Do nothing in case of success
9311
9626
  * })
9312
9627
  * })
9628
+ * ```
9313
9629
  *
9314
9630
  * @since 2.0.0
9315
9631
  * @category Outcome Encapsulation
@@ -9332,6 +9648,7 @@ export declare const either: <A, E, R>(self: Effect<A, E, R>) => Effect<Either.E
9332
9648
  * @see {@link either} for a version that uses `Either` instead.
9333
9649
  *
9334
9650
  * @example
9651
+ * ```ts
9335
9652
  * import { Effect, Cause, Console, Exit } from "effect"
9336
9653
  *
9337
9654
  * // Simulating a runtime error
@@ -9363,6 +9680,7 @@ export declare const either: <A, E, R>(self: Effect<A, E, R>) => Effect<Either.E
9363
9680
  * // _tag: "Success",
9364
9681
  * // value: undefined
9365
9682
  * // }
9683
+ * ```
9366
9684
  *
9367
9685
  * @since 2.0.0
9368
9686
  * @category Outcome Encapsulation
@@ -9379,6 +9697,7 @@ export declare const exit: <A, E, R>(self: Effect<A, E, R>) => Effect<Exit.Exit<
9379
9697
  * failure. Additionally, if the effect is interrupted, the `Deferred` will also be interrupted.
9380
9698
  *
9381
9699
  * @example
9700
+ * ```ts
9382
9701
  * import { Deferred, Effect } from "effect"
9383
9702
  *
9384
9703
  * // Define an effect that succeeds
@@ -9402,6 +9721,7 @@ export declare const exit: <A, E, R>(self: Effect<A, E, R>) => Effect<Exit.Exit<
9402
9721
  * // Output:
9403
9722
  * // 42
9404
9723
  * // true
9724
+ * ```
9405
9725
  *
9406
9726
  * @since 2.0.0
9407
9727
  * @category Synchronization Utilities
@@ -9418,6 +9738,7 @@ export declare const intoDeferred: {
9418
9738
  * failure. Additionally, if the effect is interrupted, the `Deferred` will also be interrupted.
9419
9739
  *
9420
9740
  * @example
9741
+ * ```ts
9421
9742
  * import { Deferred, Effect } from "effect"
9422
9743
  *
9423
9744
  * // Define an effect that succeeds
@@ -9441,6 +9762,7 @@ export declare const intoDeferred: {
9441
9762
  * // Output:
9442
9763
  * // 42
9443
9764
  * // true
9765
+ * ```
9444
9766
  *
9445
9767
  * @since 2.0.0
9446
9768
  * @category Synchronization Utilities
@@ -9457,6 +9779,7 @@ export declare const intoDeferred: {
9457
9779
  * failure. Additionally, if the effect is interrupted, the `Deferred` will also be interrupted.
9458
9780
  *
9459
9781
  * @example
9782
+ * ```ts
9460
9783
  * import { Deferred, Effect } from "effect"
9461
9784
  *
9462
9785
  * // Define an effect that succeeds
@@ -9480,6 +9803,7 @@ export declare const intoDeferred: {
9480
9803
  * // Output:
9481
9804
  * // 42
9482
9805
  * // true
9806
+ * ```
9483
9807
  *
9484
9808
  * @since 2.0.0
9485
9809
  * @category Synchronization Utilities
@@ -9505,6 +9829,7 @@ export {
9505
9829
  * is executed. If it is `false`, the `onFalse` effect is executed instead.
9506
9830
  *
9507
9831
  * @example
9832
+ * ```ts
9508
9833
  * // Title: Simulating a Coin Flip
9509
9834
  * import { Effect, Random, Console } from "effect"
9510
9835
  *
@@ -9515,6 +9840,7 @@ export {
9515
9840
  *
9516
9841
  * Effect.runFork(flipTheCoin)
9517
9842
  *
9843
+ * ```
9518
9844
  * @since 2.0.0
9519
9845
  * @category Conditional Operators
9520
9846
  */
@@ -9653,6 +9979,7 @@ export declare const filterOrElse: {
9653
9979
  * Let's explore this concept through an example:
9654
9980
  *
9655
9981
  * @example
9982
+ * ```ts
9656
9983
  * import { Effect, pipe } from "effect"
9657
9984
  *
9658
9985
  * // Define a user interface
@@ -9673,6 +10000,7 @@ export declare const filterOrElse: {
9673
10000
  * // 'user' now has the type `User` (not `User | null`)
9674
10001
  * Effect.andThen((user) => user.name)
9675
10002
  * )
10003
+ * ```
9676
10004
  *
9677
10005
  * @since 2.0.0
9678
10006
  * @category Filtering
@@ -9689,6 +10017,7 @@ export declare const filterOrFail: {
9689
10017
  * Let's explore this concept through an example:
9690
10018
  *
9691
10019
  * @example
10020
+ * ```ts
9692
10021
  * import { Effect, pipe } from "effect"
9693
10022
  *
9694
10023
  * // Define a user interface
@@ -9709,6 +10038,7 @@ export declare const filterOrFail: {
9709
10038
  * // 'user' now has the type `User` (not `User | null`)
9710
10039
  * Effect.andThen((user) => user.name)
9711
10040
  * )
10041
+ * ```
9712
10042
  *
9713
10043
  * @since 2.0.0
9714
10044
  * @category Filtering
@@ -9725,6 +10055,7 @@ export declare const filterOrFail: {
9725
10055
  * Let's explore this concept through an example:
9726
10056
  *
9727
10057
  * @example
10058
+ * ```ts
9728
10059
  * import { Effect, pipe } from "effect"
9729
10060
  *
9730
10061
  * // Define a user interface
@@ -9745,6 +10076,7 @@ export declare const filterOrFail: {
9745
10076
  * // 'user' now has the type `User` (not `User | null`)
9746
10077
  * Effect.andThen((user) => user.name)
9747
10078
  * )
10079
+ * ```
9748
10080
  *
9749
10081
  * @since 2.0.0
9750
10082
  * @category Filtering
@@ -9761,6 +10093,7 @@ export declare const filterOrFail: {
9761
10093
  * Let's explore this concept through an example:
9762
10094
  *
9763
10095
  * @example
10096
+ * ```ts
9764
10097
  * import { Effect, pipe } from "effect"
9765
10098
  *
9766
10099
  * // Define a user interface
@@ -9781,6 +10114,7 @@ export declare const filterOrFail: {
9781
10114
  * // 'user' now has the type `User` (not `User | null`)
9782
10115
  * Effect.andThen((user) => user.name)
9783
10116
  * )
10117
+ * ```
9784
10118
  *
9785
10119
  * @since 2.0.0
9786
10120
  * @category Filtering
@@ -9797,6 +10131,7 @@ export declare const filterOrFail: {
9797
10131
  * Let's explore this concept through an example:
9798
10132
  *
9799
10133
  * @example
10134
+ * ```ts
9800
10135
  * import { Effect, pipe } from "effect"
9801
10136
  *
9802
10137
  * // Define a user interface
@@ -9817,6 +10152,7 @@ export declare const filterOrFail: {
9817
10152
  * // 'user' now has the type `User` (not `User | null`)
9818
10153
  * Effect.andThen((user) => user.name)
9819
10154
  * )
10155
+ * ```
9820
10156
  *
9821
10157
  * @since 2.0.0
9822
10158
  * @category Filtering
@@ -9833,6 +10169,7 @@ export declare const filterOrFail: {
9833
10169
  * Let's explore this concept through an example:
9834
10170
  *
9835
10171
  * @example
10172
+ * ```ts
9836
10173
  * import { Effect, pipe } from "effect"
9837
10174
  *
9838
10175
  * // Define a user interface
@@ -9853,6 +10190,7 @@ export declare const filterOrFail: {
9853
10190
  * // 'user' now has the type `User` (not `User | null`)
9854
10191
  * Effect.andThen((user) => user.name)
9855
10192
  * )
10193
+ * ```
9856
10194
  *
9857
10195
  * @since 2.0.0
9858
10196
  * @category Filtering
@@ -9869,6 +10207,7 @@ export declare const filterOrFail: {
9869
10207
  * Let's explore this concept through an example:
9870
10208
  *
9871
10209
  * @example
10210
+ * ```ts
9872
10211
  * import { Effect, pipe } from "effect"
9873
10212
  *
9874
10213
  * // Define a user interface
@@ -9889,6 +10228,7 @@ export declare const filterOrFail: {
9889
10228
  * // 'user' now has the type `User` (not `User | null`)
9890
10229
  * Effect.andThen((user) => user.name)
9891
10230
  * )
10231
+ * ```
9892
10232
  *
9893
10233
  * @since 2.0.0
9894
10234
  * @category Filtering
@@ -9905,6 +10245,7 @@ export declare const filterOrFail: {
9905
10245
  * Let's explore this concept through an example:
9906
10246
  *
9907
10247
  * @example
10248
+ * ```ts
9908
10249
  * import { Effect, pipe } from "effect"
9909
10250
  *
9910
10251
  * // Define a user interface
@@ -9925,6 +10266,7 @@ export declare const filterOrFail: {
9925
10266
  * // 'user' now has the type `User` (not `User | null`)
9926
10267
  * Effect.andThen((user) => user.name)
9927
10268
  * )
10269
+ * ```
9928
10270
  *
9929
10271
  * @since 2.0.0
9930
10272
  * @category Filtering
@@ -9941,6 +10283,7 @@ export declare const filterOrFail: {
9941
10283
  * Let's explore this concept through an example:
9942
10284
  *
9943
10285
  * @example
10286
+ * ```ts
9944
10287
  * import { Effect, pipe } from "effect"
9945
10288
  *
9946
10289
  * // Define a user interface
@@ -9961,6 +10304,7 @@ export declare const filterOrFail: {
9961
10304
  * // 'user' now has the type `User` (not `User | null`)
9962
10305
  * Effect.andThen((user) => user.name)
9963
10306
  * )
10307
+ * ```
9964
10308
  *
9965
10309
  * @since 2.0.0
9966
10310
  * @category Filtering
@@ -10051,6 +10395,7 @@ export declare const unlessEffect: {
10051
10395
  * @see {@link unless} for a version that executes the effect when the condition is `false`.
10052
10396
  *
10053
10397
  * @example
10398
+ * ```ts
10054
10399
  * // Title: Conditional Effect Execution
10055
10400
  * import { Effect, Option } from "effect"
10056
10401
  *
@@ -10076,6 +10421,7 @@ export declare const unlessEffect: {
10076
10421
  * // _id: "Option",
10077
10422
  * // _tag: "None"
10078
10423
  * // }
10424
+ * ```
10079
10425
  *
10080
10426
  * @since 2.0.0
10081
10427
  * @category Conditional Operators
@@ -10097,6 +10443,7 @@ export declare const when: {
10097
10443
  * @see {@link unless} for a version that executes the effect when the condition is `false`.
10098
10444
  *
10099
10445
  * @example
10446
+ * ```ts
10100
10447
  * // Title: Conditional Effect Execution
10101
10448
  * import { Effect, Option } from "effect"
10102
10449
  *
@@ -10122,6 +10469,7 @@ export declare const when: {
10122
10469
  * // _id: "Option",
10123
10470
  * // _tag: "None"
10124
10471
  * // }
10472
+ * ```
10125
10473
  *
10126
10474
  * @since 2.0.0
10127
10475
  * @category Conditional Operators
@@ -10143,6 +10491,7 @@ export declare const when: {
10143
10491
  * @see {@link unless} for a version that executes the effect when the condition is `false`.
10144
10492
  *
10145
10493
  * @example
10494
+ * ```ts
10146
10495
  * // Title: Conditional Effect Execution
10147
10496
  * import { Effect, Option } from "effect"
10148
10497
  *
@@ -10168,6 +10517,7 @@ export declare const when: {
10168
10517
  * // _id: "Option",
10169
10518
  * // _tag: "None"
10170
10519
  * // }
10520
+ * ```
10171
10521
  *
10172
10522
  * @since 2.0.0
10173
10523
  * @category Conditional Operators
@@ -10192,6 +10542,7 @@ export declare const when: {
10192
10542
  * @see {@link unlessEffect} for a version that executes the effect when the condition is `false`.
10193
10543
  *
10194
10544
  * @example
10545
+ * ```ts
10195
10546
  * // Title: Using an Effect as a Condition
10196
10547
  * import { Effect, Random } from "effect"
10197
10548
  *
@@ -10202,6 +10553,7 @@ export declare const when: {
10202
10553
  * console.log(Effect.runSync(randomIntOption))
10203
10554
  * // Example Output:
10204
10555
  * // { _id: 'Option', _tag: 'Some', value: 8609104974198840 }
10556
+ * ```
10205
10557
  *
10206
10558
  * @since 2.0.0
10207
10559
  * @category Conditional Operators
@@ -10225,6 +10577,7 @@ export declare const whenEffect: {
10225
10577
  * @see {@link unlessEffect} for a version that executes the effect when the condition is `false`.
10226
10578
  *
10227
10579
  * @example
10580
+ * ```ts
10228
10581
  * // Title: Using an Effect as a Condition
10229
10582
  * import { Effect, Random } from "effect"
10230
10583
  *
@@ -10235,6 +10588,7 @@ export declare const whenEffect: {
10235
10588
  * console.log(Effect.runSync(randomIntOption))
10236
10589
  * // Example Output:
10237
10590
  * // { _id: 'Option', _tag: 'Some', value: 8609104974198840 }
10591
+ * ```
10238
10592
  *
10239
10593
  * @since 2.0.0
10240
10594
  * @category Conditional Operators
@@ -10258,6 +10612,7 @@ export declare const whenEffect: {
10258
10612
  * @see {@link unlessEffect} for a version that executes the effect when the condition is `false`.
10259
10613
  *
10260
10614
  * @example
10615
+ * ```ts
10261
10616
  * // Title: Using an Effect as a Condition
10262
10617
  * import { Effect, Random } from "effect"
10263
10618
  *
@@ -10268,6 +10623,7 @@ export declare const whenEffect: {
10268
10623
  * console.log(Effect.runSync(randomIntOption))
10269
10624
  * // Example Output:
10270
10625
  * // { _id: 'Option', _tag: 'Some', value: 8609104974198840 }
10626
+ * ```
10271
10627
  *
10272
10628
  * @since 2.0.0
10273
10629
  * @category Conditional Operators
@@ -10351,6 +10707,7 @@ export declare const whenRef: {
10351
10707
  * changing the original one.
10352
10708
  *
10353
10709
  * @example
10710
+ * ```ts
10354
10711
  * import { pipe, Effect } from "effect"
10355
10712
  *
10356
10713
  * // Function to apply a discount safely to a transaction amount
@@ -10373,6 +10730,7 @@ export declare const whenRef: {
10373
10730
  *
10374
10731
  * Effect.runPromise(finalAmount).then(console.log)
10375
10732
  * // Output: 95
10733
+ * ```
10376
10734
  *
10377
10735
  * @since 2.0.0
10378
10736
  * @category sequencing
@@ -10408,6 +10766,7 @@ export declare const flatMap: {
10408
10766
  * changing the original one.
10409
10767
  *
10410
10768
  * @example
10769
+ * ```ts
10411
10770
  * import { pipe, Effect } from "effect"
10412
10771
  *
10413
10772
  * // Function to apply a discount safely to a transaction amount
@@ -10430,6 +10789,7 @@ export declare const flatMap: {
10430
10789
  *
10431
10790
  * Effect.runPromise(finalAmount).then(console.log)
10432
10791
  * // Output: 95
10792
+ * ```
10433
10793
  *
10434
10794
  * @since 2.0.0
10435
10795
  * @category sequencing
@@ -10465,6 +10825,7 @@ export declare const flatMap: {
10465
10825
  * changing the original one.
10466
10826
  *
10467
10827
  * @example
10828
+ * ```ts
10468
10829
  * import { pipe, Effect } from "effect"
10469
10830
  *
10470
10831
  * // Function to apply a discount safely to a transaction amount
@@ -10487,6 +10848,7 @@ export declare const flatMap: {
10487
10848
  *
10488
10849
  * Effect.runPromise(finalAmount).then(console.log)
10489
10850
  * // Output: 95
10851
+ * ```
10490
10852
  *
10491
10853
  * @since 2.0.0
10492
10854
  * @category sequencing
@@ -10527,6 +10889,7 @@ export declare const flatMap: {
10527
10889
  * treating them as effects.
10528
10890
  *
10529
10891
  * @example
10892
+ * ```ts
10530
10893
  * // Title: Applying a Discount Based on Fetched Amount
10531
10894
  * import { pipe, Effect } from "effect"
10532
10895
  *
@@ -10561,6 +10924,7 @@ export declare const flatMap: {
10561
10924
  *
10562
10925
  * Effect.runPromise(result2).then(console.log)
10563
10926
  * // Output: 190
10927
+ * ```
10564
10928
  *
10565
10929
  * @since 2.0.0
10566
10930
  * @category sequencing
@@ -10600,6 +10964,7 @@ export declare const andThen: {
10600
10964
  * treating them as effects.
10601
10965
  *
10602
10966
  * @example
10967
+ * ```ts
10603
10968
  * // Title: Applying a Discount Based on Fetched Amount
10604
10969
  * import { pipe, Effect } from "effect"
10605
10970
  *
@@ -10634,6 +10999,7 @@ export declare const andThen: {
10634
10999
  *
10635
11000
  * Effect.runPromise(result2).then(console.log)
10636
11001
  * // Output: 190
11002
+ * ```
10637
11003
  *
10638
11004
  * @since 2.0.0
10639
11005
  * @category sequencing
@@ -10673,6 +11039,7 @@ export declare const andThen: {
10673
11039
  * treating them as effects.
10674
11040
  *
10675
11041
  * @example
11042
+ * ```ts
10676
11043
  * // Title: Applying a Discount Based on Fetched Amount
10677
11044
  * import { pipe, Effect } from "effect"
10678
11045
  *
@@ -10707,6 +11074,7 @@ export declare const andThen: {
10707
11074
  *
10708
11075
  * Effect.runPromise(result2).then(console.log)
10709
11076
  * // Output: 190
11077
+ * ```
10710
11078
  *
10711
11079
  * @since 2.0.0
10712
11080
  * @category sequencing
@@ -10746,6 +11114,7 @@ export declare const andThen: {
10746
11114
  * treating them as effects.
10747
11115
  *
10748
11116
  * @example
11117
+ * ```ts
10749
11118
  * // Title: Applying a Discount Based on Fetched Amount
10750
11119
  * import { pipe, Effect } from "effect"
10751
11120
  *
@@ -10780,6 +11149,7 @@ export declare const andThen: {
10780
11149
  *
10781
11150
  * Effect.runPromise(result2).then(console.log)
10782
11151
  * // Output: 190
11152
+ * ```
10783
11153
  *
10784
11154
  * @since 2.0.0
10785
11155
  * @category sequencing
@@ -10819,6 +11189,7 @@ export declare const andThen: {
10819
11189
  * treating them as effects.
10820
11190
  *
10821
11191
  * @example
11192
+ * ```ts
10822
11193
  * // Title: Applying a Discount Based on Fetched Amount
10823
11194
  * import { pipe, Effect } from "effect"
10824
11195
  *
@@ -10853,6 +11224,7 @@ export declare const andThen: {
10853
11224
  *
10854
11225
  * Effect.runPromise(result2).then(console.log)
10855
11226
  * // Output: 190
11227
+ * ```
10856
11228
  *
10857
11229
  * @since 2.0.0
10858
11230
  * @category sequencing
@@ -11030,6 +11402,7 @@ export declare const summarized: {
11030
11402
  * will fail too.
11031
11403
  *
11032
11404
  * @example
11405
+ * ```ts
11033
11406
  * // Title: Logging a step in a pipeline
11034
11407
  * import { Console, Effect, pipe } from "effect"
11035
11408
  *
@@ -11057,6 +11430,7 @@ export declare const summarized: {
11057
11430
  * // Output:
11058
11431
  * // Apply a discount to: 100
11059
11432
  * // 95
11433
+ * ```
11060
11434
  *
11061
11435
  * @since 2.0.0
11062
11436
  * @category sequencing
@@ -11080,6 +11454,7 @@ export declare const tap: {
11080
11454
  * will fail too.
11081
11455
  *
11082
11456
  * @example
11457
+ * ```ts
11083
11458
  * // Title: Logging a step in a pipeline
11084
11459
  * import { Console, Effect, pipe } from "effect"
11085
11460
  *
@@ -11107,6 +11482,7 @@ export declare const tap: {
11107
11482
  * // Output:
11108
11483
  * // Apply a discount to: 100
11109
11484
  * // 95
11485
+ * ```
11110
11486
  *
11111
11487
  * @since 2.0.0
11112
11488
  * @category sequencing
@@ -11130,6 +11506,7 @@ export declare const tap: {
11130
11506
  * will fail too.
11131
11507
  *
11132
11508
  * @example
11509
+ * ```ts
11133
11510
  * // Title: Logging a step in a pipeline
11134
11511
  * import { Console, Effect, pipe } from "effect"
11135
11512
  *
@@ -11157,6 +11534,7 @@ export declare const tap: {
11157
11534
  * // Output:
11158
11535
  * // Apply a discount to: 100
11159
11536
  * // 95
11537
+ * ```
11160
11538
  *
11161
11539
  * @since 2.0.0
11162
11540
  * @category sequencing
@@ -11182,6 +11560,7 @@ export declare const tap: {
11182
11560
  * will fail too.
11183
11561
  *
11184
11562
  * @example
11563
+ * ```ts
11185
11564
  * // Title: Logging a step in a pipeline
11186
11565
  * import { Console, Effect, pipe } from "effect"
11187
11566
  *
@@ -11209,6 +11588,7 @@ export declare const tap: {
11209
11588
  * // Output:
11210
11589
  * // Apply a discount to: 100
11211
11590
  * // 95
11591
+ * ```
11212
11592
  *
11213
11593
  * @since 2.0.0
11214
11594
  * @category sequencing
@@ -11232,6 +11612,7 @@ export declare const tap: {
11232
11612
  * will fail too.
11233
11613
  *
11234
11614
  * @example
11615
+ * ```ts
11235
11616
  * // Title: Logging a step in a pipeline
11236
11617
  * import { Console, Effect, pipe } from "effect"
11237
11618
  *
@@ -11259,6 +11640,7 @@ export declare const tap: {
11259
11640
  * // Output:
11260
11641
  * // Apply a discount to: 100
11261
11642
  * // 95
11643
+ * ```
11262
11644
  *
11263
11645
  * @since 2.0.0
11264
11646
  * @category sequencing
@@ -11284,6 +11666,7 @@ export declare const tap: {
11284
11666
  * will fail too.
11285
11667
  *
11286
11668
  * @example
11669
+ * ```ts
11287
11670
  * // Title: Logging a step in a pipeline
11288
11671
  * import { Console, Effect, pipe } from "effect"
11289
11672
  *
@@ -11311,6 +11694,7 @@ export declare const tap: {
11311
11694
  * // Output:
11312
11695
  * // Apply a discount to: 100
11313
11696
  * // 95
11697
+ * ```
11314
11698
  *
11315
11699
  * @since 2.0.0
11316
11700
  * @category sequencing
@@ -11334,6 +11718,7 @@ export declare const tap: {
11334
11718
  * will fail too.
11335
11719
  *
11336
11720
  * @example
11721
+ * ```ts
11337
11722
  * // Title: Logging a step in a pipeline
11338
11723
  * import { Console, Effect, pipe } from "effect"
11339
11724
  *
@@ -11361,6 +11746,7 @@ export declare const tap: {
11361
11746
  * // Output:
11362
11747
  * // Apply a discount to: 100
11363
11748
  * // 95
11749
+ * ```
11364
11750
  *
11365
11751
  * @since 2.0.0
11366
11752
  * @category sequencing
@@ -11386,6 +11772,7 @@ export declare const tap: {
11386
11772
  * will fail too.
11387
11773
  *
11388
11774
  * @example
11775
+ * ```ts
11389
11776
  * // Title: Logging a step in a pipeline
11390
11777
  * import { Console, Effect, pipe } from "effect"
11391
11778
  *
@@ -11413,6 +11800,7 @@ export declare const tap: {
11413
11800
  * // Output:
11414
11801
  * // Apply a discount to: 100
11415
11802
  * // 95
11803
+ * ```
11416
11804
  *
11417
11805
  * @since 2.0.0
11418
11806
  * @category sequencing
@@ -11436,6 +11824,7 @@ export declare const tap: {
11436
11824
  * will fail too.
11437
11825
  *
11438
11826
  * @example
11827
+ * ```ts
11439
11828
  * // Title: Logging a step in a pipeline
11440
11829
  * import { Console, Effect, pipe } from "effect"
11441
11830
  *
@@ -11463,6 +11852,7 @@ export declare const tap: {
11463
11852
  * // Output:
11464
11853
  * // Apply a discount to: 100
11465
11854
  * // 95
11855
+ * ```
11466
11856
  *
11467
11857
  * @since 2.0.0
11468
11858
  * @category sequencing
@@ -11483,6 +11873,7 @@ export declare const tap: {
11483
11873
  * altering the result.
11484
11874
  *
11485
11875
  * @example
11876
+ * ```ts
11486
11877
  * import { Effect, Random, Console } from "effect"
11487
11878
  *
11488
11879
  * // Simulate a task that might fail
@@ -11502,6 +11893,7 @@ export declare const tap: {
11502
11893
  * Effect.runFork(tapping)
11503
11894
  * // Example Output:
11504
11895
  * // failure: random number is negative
11896
+ * ```
11505
11897
  *
11506
11898
  * @since 2.0.0
11507
11899
  * @category sequencing
@@ -11519,6 +11911,7 @@ export declare const tapBoth: {
11519
11911
  * altering the result.
11520
11912
  *
11521
11913
  * @example
11914
+ * ```ts
11522
11915
  * import { Effect, Random, Console } from "effect"
11523
11916
  *
11524
11917
  * // Simulate a task that might fail
@@ -11538,6 +11931,7 @@ export declare const tapBoth: {
11538
11931
  * Effect.runFork(tapping)
11539
11932
  * // Example Output:
11540
11933
  * // failure: random number is negative
11934
+ * ```
11541
11935
  *
11542
11936
  * @since 2.0.0
11543
11937
  * @category sequencing
@@ -11558,6 +11952,7 @@ export declare const tapBoth: {
11558
11952
  * altering the result.
11559
11953
  *
11560
11954
  * @example
11955
+ * ```ts
11561
11956
  * import { Effect, Random, Console } from "effect"
11562
11957
  *
11563
11958
  * // Simulate a task that might fail
@@ -11577,6 +11972,7 @@ export declare const tapBoth: {
11577
11972
  * Effect.runFork(tapping)
11578
11973
  * // Example Output:
11579
11974
  * // failure: random number is negative
11975
+ * ```
11580
11976
  *
11581
11977
  * @since 2.0.0
11582
11978
  * @category sequencing
@@ -11597,6 +11993,7 @@ export declare const tapBoth: {
11597
11993
  * severe errors.
11598
11994
  *
11599
11995
  * @example
11996
+ * ```ts
11600
11997
  * import { Effect, Console } from "effect"
11601
11998
  *
11602
11999
  * // Simulate a task that fails with a recoverable error
@@ -11624,6 +12021,7 @@ export declare const tapBoth: {
11624
12021
  * // Output:
11625
12022
  * // defect: RuntimeException: Something went wrong
11626
12023
  * // ... stack trace ...
12024
+ * ```
11627
12025
  *
11628
12026
  * @since 2.0.0
11629
12027
  * @category sequencing
@@ -11640,6 +12038,7 @@ export declare const tapDefect: {
11640
12038
  * severe errors.
11641
12039
  *
11642
12040
  * @example
12041
+ * ```ts
11643
12042
  * import { Effect, Console } from "effect"
11644
12043
  *
11645
12044
  * // Simulate a task that fails with a recoverable error
@@ -11667,6 +12066,7 @@ export declare const tapDefect: {
11667
12066
  * // Output:
11668
12067
  * // defect: RuntimeException: Something went wrong
11669
12068
  * // ... stack trace ...
12069
+ * ```
11670
12070
  *
11671
12071
  * @since 2.0.0
11672
12072
  * @category sequencing
@@ -11683,6 +12083,7 @@ export declare const tapDefect: {
11683
12083
  * severe errors.
11684
12084
  *
11685
12085
  * @example
12086
+ * ```ts
11686
12087
  * import { Effect, Console } from "effect"
11687
12088
  *
11688
12089
  * // Simulate a task that fails with a recoverable error
@@ -11710,6 +12111,7 @@ export declare const tapDefect: {
11710
12111
  * // Output:
11711
12112
  * // defect: RuntimeException: Something went wrong
11712
12113
  * // ... stack trace ...
12114
+ * ```
11713
12115
  *
11714
12116
  * @since 2.0.0
11715
12117
  * @category sequencing
@@ -11726,6 +12128,7 @@ export declare const tapDefect: {
11726
12128
  * while the operation you provide can inspect or act on it.
11727
12129
  *
11728
12130
  * @example
12131
+ * ```ts
11729
12132
  * import { Effect, Console } from "effect"
11730
12133
  *
11731
12134
  * // Simulate a task that fails with an error
@@ -11739,6 +12142,7 @@ export declare const tapDefect: {
11739
12142
  * Effect.runFork(tapping)
11740
12143
  * // Output:
11741
12144
  * // expected error: NetworkError
12145
+ * ```
11742
12146
  *
11743
12147
  * @since 2.0.0
11744
12148
  * @category sequencing
@@ -11754,6 +12158,7 @@ export declare const tapError: {
11754
12158
  * while the operation you provide can inspect or act on it.
11755
12159
  *
11756
12160
  * @example
12161
+ * ```ts
11757
12162
  * import { Effect, Console } from "effect"
11758
12163
  *
11759
12164
  * // Simulate a task that fails with an error
@@ -11767,6 +12172,7 @@ export declare const tapError: {
11767
12172
  * Effect.runFork(tapping)
11768
12173
  * // Output:
11769
12174
  * // expected error: NetworkError
12175
+ * ```
11770
12176
  *
11771
12177
  * @since 2.0.0
11772
12178
  * @category sequencing
@@ -11782,6 +12188,7 @@ export declare const tapError: {
11782
12188
  * while the operation you provide can inspect or act on it.
11783
12189
  *
11784
12190
  * @example
12191
+ * ```ts
11785
12192
  * import { Effect, Console } from "effect"
11786
12193
  *
11787
12194
  * // Simulate a task that fails with an error
@@ -11795,6 +12202,7 @@ export declare const tapError: {
11795
12202
  * Effect.runFork(tapping)
11796
12203
  * // Output:
11797
12204
  * // expected error: NetworkError
12205
+ * ```
11798
12206
  *
11799
12207
  * @since 2.0.0
11800
12208
  * @category sequencing
@@ -11811,6 +12219,7 @@ export declare const tapError: {
11811
12219
  * without modifying the error or the overall result of the effect.
11812
12220
  *
11813
12221
  * @example
12222
+ * ```ts
11814
12223
  * import { Effect, Console } from "effect"
11815
12224
  *
11816
12225
  * class NetworkError {
@@ -11835,6 +12244,7 @@ export declare const tapError: {
11835
12244
  * Effect.runFork(tapping)
11836
12245
  * // Output:
11837
12246
  * // expected error: 504
12247
+ * ```
11838
12248
  *
11839
12249
  * @since 2.0.0
11840
12250
  * @category sequencing
@@ -11850,6 +12260,7 @@ export declare const tapErrorTag: {
11850
12260
  * without modifying the error or the overall result of the effect.
11851
12261
  *
11852
12262
  * @example
12263
+ * ```ts
11853
12264
  * import { Effect, Console } from "effect"
11854
12265
  *
11855
12266
  * class NetworkError {
@@ -11874,6 +12285,7 @@ export declare const tapErrorTag: {
11874
12285
  * Effect.runFork(tapping)
11875
12286
  * // Output:
11876
12287
  * // expected error: 504
12288
+ * ```
11877
12289
  *
11878
12290
  * @since 2.0.0
11879
12291
  * @category sequencing
@@ -11893,6 +12305,7 @@ export declare const tapErrorTag: {
11893
12305
  * without modifying the error or the overall result of the effect.
11894
12306
  *
11895
12307
  * @example
12308
+ * ```ts
11896
12309
  * import { Effect, Console } from "effect"
11897
12310
  *
11898
12311
  * class NetworkError {
@@ -11917,6 +12330,7 @@ export declare const tapErrorTag: {
11917
12330
  * Effect.runFork(tapping)
11918
12331
  * // Output:
11919
12332
  * // expected error: 504
12333
+ * ```
11920
12334
  *
11921
12335
  * @since 2.0.0
11922
12336
  * @category sequencing
@@ -11937,6 +12351,7 @@ export declare const tapErrorTag: {
11937
12351
  * altering the error or the overall result of the effect.
11938
12352
  *
11939
12353
  * @example
12354
+ * ```ts
11940
12355
  * import { Effect, Console } from "effect"
11941
12356
  *
11942
12357
  * // Create a task that fails with a NetworkError
@@ -11963,6 +12378,7 @@ export declare const tapErrorTag: {
11963
12378
  * // Output:
11964
12379
  * // error cause: RuntimeException: Something went wrong
11965
12380
  * // ... stack trace ...
12381
+ * ```
11966
12382
  *
11967
12383
  * @since 2.0.0
11968
12384
  * @category sequencing
@@ -11978,6 +12394,7 @@ export declare const tapErrorCause: {
11978
12394
  * altering the error or the overall result of the effect.
11979
12395
  *
11980
12396
  * @example
12397
+ * ```ts
11981
12398
  * import { Effect, Console } from "effect"
11982
12399
  *
11983
12400
  * // Create a task that fails with a NetworkError
@@ -12004,6 +12421,7 @@ export declare const tapErrorCause: {
12004
12421
  * // Output:
12005
12422
  * // error cause: RuntimeException: Something went wrong
12006
12423
  * // ... stack trace ...
12424
+ * ```
12007
12425
  *
12008
12426
  * @since 2.0.0
12009
12427
  * @category sequencing
@@ -12019,6 +12437,7 @@ export declare const tapErrorCause: {
12019
12437
  * altering the error or the overall result of the effect.
12020
12438
  *
12021
12439
  * @example
12440
+ * ```ts
12022
12441
  * import { Effect, Console } from "effect"
12023
12442
  *
12024
12443
  * // Create a task that fails with a NetworkError
@@ -12045,6 +12464,7 @@ export declare const tapErrorCause: {
12045
12464
  * // Output:
12046
12465
  * // error cause: RuntimeException: Something went wrong
12047
12466
  * // ... stack trace ...
12467
+ * ```
12048
12468
  *
12049
12469
  * @since 2.0.0
12050
12470
  * @category sequencing
@@ -12077,6 +12497,7 @@ export declare const forever: <A, E, R>(self: Effect<A, E, R>) => Effect<never,
12077
12497
  * ```
12078
12498
  *
12079
12499
  * @example
12500
+ * ```ts
12080
12501
  * // Title: Effectful Iteration
12081
12502
  * import { Effect } from "effect"
12082
12503
  *
@@ -12093,6 +12514,7 @@ export declare const forever: <A, E, R>(self: Effect<A, E, R>) => Effect<never,
12093
12514
  *
12094
12515
  * Effect.runPromise(result).then(console.log)
12095
12516
  * // Output: 6
12517
+ * ```
12096
12518
  *
12097
12519
  * @since 2.0.0
12098
12520
  * @category Looping
@@ -12117,6 +12539,7 @@ export declare const iterate: {
12117
12539
  * ```
12118
12540
  *
12119
12541
  * @example
12542
+ * ```ts
12120
12543
  * // Title: Effectful Iteration
12121
12544
  * import { Effect } from "effect"
12122
12545
  *
@@ -12133,6 +12556,7 @@ export declare const iterate: {
12133
12556
  *
12134
12557
  * Effect.runPromise(result).then(console.log)
12135
12558
  * // Output: 6
12559
+ * ```
12136
12560
  *
12137
12561
  * @since 2.0.0
12138
12562
  * @category Looping
@@ -12160,6 +12584,7 @@ export declare const iterate: {
12160
12584
  * ```
12161
12585
  *
12162
12586
  * @example
12587
+ * ```ts
12163
12588
  * // Title: Effectful Iteration
12164
12589
  * import { Effect } from "effect"
12165
12590
  *
@@ -12176,6 +12601,7 @@ export declare const iterate: {
12176
12601
  *
12177
12602
  * Effect.runPromise(result).then(console.log)
12178
12603
  * // Output: 6
12604
+ * ```
12179
12605
  *
12180
12606
  * @since 2.0.0
12181
12607
  * @category Looping
@@ -12212,6 +12638,7 @@ export declare const iterate: {
12212
12638
  * discarded, and the final result will be `void`.
12213
12639
  *
12214
12640
  * @example
12641
+ * ```ts
12215
12642
  * // Title: Looping with Collected Results
12216
12643
  * import { Effect } from "effect"
12217
12644
  *
@@ -12231,6 +12658,7 @@ export declare const iterate: {
12231
12658
  *
12232
12659
  * Effect.runPromise(result).then(console.log)
12233
12660
  * // Output: [1, 2, 3, 4, 5]
12661
+ * ```
12234
12662
  *
12235
12663
  * @example
12236
12664
  * // Title: Loop with Discarded Results
@@ -12291,6 +12719,7 @@ export declare const loop: {
12291
12719
  * discarded, and the final result will be `void`.
12292
12720
  *
12293
12721
  * @example
12722
+ * ```ts
12294
12723
  * // Title: Looping with Collected Results
12295
12724
  * import { Effect } from "effect"
12296
12725
  *
@@ -12310,6 +12739,7 @@ export declare const loop: {
12310
12739
  *
12311
12740
  * Effect.runPromise(result).then(console.log)
12312
12741
  * // Output: [1, 2, 3, 4, 5]
12742
+ * ```
12313
12743
  *
12314
12744
  * @example
12315
12745
  * // Title: Loop with Discarded Results
@@ -12375,6 +12805,7 @@ export declare const loop: {
12375
12805
  * discarded, and the final result will be `void`.
12376
12806
  *
12377
12807
  * @example
12808
+ * ```ts
12378
12809
  * // Title: Looping with Collected Results
12379
12810
  * import { Effect } from "effect"
12380
12811
  *
@@ -12394,6 +12825,7 @@ export declare const loop: {
12394
12825
  *
12395
12826
  * Effect.runPromise(result).then(console.log)
12396
12827
  * // Output: [1, 2, 3, 4, 5]
12828
+ * ```
12397
12829
  *
12398
12830
  * @example
12399
12831
  * // Title: Loop with Discarded Results
@@ -12459,6 +12891,7 @@ export declare const loop: {
12459
12891
  * discarded, and the final result will be `void`.
12460
12892
  *
12461
12893
  * @example
12894
+ * ```ts
12462
12895
  * // Title: Looping with Collected Results
12463
12896
  * import { Effect } from "effect"
12464
12897
  *
@@ -12478,6 +12911,7 @@ export declare const loop: {
12478
12911
  *
12479
12912
  * Effect.runPromise(result).then(console.log)
12480
12913
  * // Output: [1, 2, 3, 4, 5]
12914
+ * ```
12481
12915
  *
12482
12916
  * @example
12483
12917
  * // Title: Loop with Discarded Results
@@ -12543,6 +12977,7 @@ export declare const loop: {
12543
12977
  * discarded, and the final result will be `void`.
12544
12978
  *
12545
12979
  * @example
12980
+ * ```ts
12546
12981
  * // Title: Looping with Collected Results
12547
12982
  * import { Effect } from "effect"
12548
12983
  *
@@ -12562,6 +12997,7 @@ export declare const loop: {
12562
12997
  *
12563
12998
  * Effect.runPromise(result).then(console.log)
12564
12999
  * // Output: [1, 2, 3, 4, 5]
13000
+ * ```
12565
13001
  *
12566
13002
  * @example
12567
13003
  * // Title: Loop with Discarded Results
@@ -12644,6 +13080,7 @@ export declare namespace Repeat {
12644
13080
  * an additional time.
12645
13081
  *
12646
13082
  * @example
13083
+ * ```ts
12647
13084
  * // Success Example
12648
13085
  * import { Effect, Schedule, Console } from "effect"
12649
13086
  *
@@ -12652,6 +13089,7 @@ export declare namespace Repeat {
12652
13089
  * const program = Effect.repeat(action, policy)
12653
13090
  *
12654
13091
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13092
+ * ```
12655
13093
  *
12656
13094
  * @example
12657
13095
  * // Failure Example
@@ -12688,6 +13126,7 @@ export declare const repeat: {
12688
13126
  * an additional time.
12689
13127
  *
12690
13128
  * @example
13129
+ * ```ts
12691
13130
  * // Success Example
12692
13131
  * import { Effect, Schedule, Console } from "effect"
12693
13132
  *
@@ -12696,6 +13135,7 @@ export declare const repeat: {
12696
13135
  * const program = Effect.repeat(action, policy)
12697
13136
  *
12698
13137
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13138
+ * ```
12699
13139
  *
12700
13140
  * @example
12701
13141
  * // Failure Example
@@ -12732,6 +13172,7 @@ export declare const repeat: {
12732
13172
  * an additional time.
12733
13173
  *
12734
13174
  * @example
13175
+ * ```ts
12735
13176
  * // Success Example
12736
13177
  * import { Effect, Schedule, Console } from "effect"
12737
13178
  *
@@ -12740,6 +13181,7 @@ export declare const repeat: {
12740
13181
  * const program = Effect.repeat(action, policy)
12741
13182
  *
12742
13183
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13184
+ * ```
12743
13185
  *
12744
13186
  * @example
12745
13187
  * // Failure Example
@@ -12776,6 +13218,7 @@ export declare const repeat: {
12776
13218
  * an additional time.
12777
13219
  *
12778
13220
  * @example
13221
+ * ```ts
12779
13222
  * // Success Example
12780
13223
  * import { Effect, Schedule, Console } from "effect"
12781
13224
  *
@@ -12784,6 +13227,7 @@ export declare const repeat: {
12784
13227
  * const program = Effect.repeat(action, policy)
12785
13228
  *
12786
13229
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13230
+ * ```
12787
13231
  *
12788
13232
  * @example
12789
13233
  * // Failure Example
@@ -12820,6 +13264,7 @@ export declare const repeat: {
12820
13264
  * an additional time.
12821
13265
  *
12822
13266
  * @example
13267
+ * ```ts
12823
13268
  * // Success Example
12824
13269
  * import { Effect, Schedule, Console } from "effect"
12825
13270
  *
@@ -12828,6 +13273,7 @@ export declare const repeat: {
12828
13273
  * const program = Effect.repeat(action, policy)
12829
13274
  *
12830
13275
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13276
+ * ```
12831
13277
  *
12832
13278
  * @example
12833
13279
  * // Failure Example
@@ -12864,12 +13310,14 @@ export declare const repeat: {
12864
13310
  * initially and then repeats it one additional time if it succeeds.
12865
13311
  *
12866
13312
  * @example
13313
+ * ```ts
12867
13314
  * import { Effect, Console } from "effect"
12868
13315
  *
12869
13316
  * const action = Console.log("success")
12870
13317
  * const program = Effect.repeatN(action, 2)
12871
13318
  *
12872
13319
  * Effect.runPromise(program)
13320
+ * ```
12873
13321
  *
12874
13322
  * @since 2.0.0
12875
13323
  * @category repetition / recursion
@@ -12882,12 +13330,14 @@ export declare const repeatN: {
12882
13330
  * initially and then repeats it one additional time if it succeeds.
12883
13331
  *
12884
13332
  * @example
13333
+ * ```ts
12885
13334
  * import { Effect, Console } from "effect"
12886
13335
  *
12887
13336
  * const action = Console.log("success")
12888
13337
  * const program = Effect.repeatN(action, 2)
12889
13338
  *
12890
13339
  * Effect.runPromise(program)
13340
+ * ```
12891
13341
  *
12892
13342
  * @since 2.0.0
12893
13343
  * @category repetition / recursion
@@ -12900,12 +13350,14 @@ export declare const repeatN: {
12900
13350
  * initially and then repeats it one additional time if it succeeds.
12901
13351
  *
12902
13352
  * @example
13353
+ * ```ts
12903
13354
  * import { Effect, Console } from "effect"
12904
13355
  *
12905
13356
  * const action = Console.log("success")
12906
13357
  * const program = Effect.repeatN(action, 2)
12907
13358
  *
12908
13359
  * Effect.runPromise(program)
13360
+ * ```
12909
13361
  *
12910
13362
  * @since 2.0.0
12911
13363
  * @category repetition / recursion
@@ -12921,6 +13373,7 @@ export declare const repeatN: {
12921
13373
  * initially and then repeats it an additional time if it succeeds.
12922
13374
  *
12923
13375
  * @example
13376
+ * ```ts
12924
13377
  * import { Effect, Schedule } from "effect"
12925
13378
  *
12926
13379
  * let count = 0
@@ -12950,6 +13403,7 @@ export declare const repeatN: {
12950
13403
  * )
12951
13404
  *
12952
13405
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13406
+ * ```
12953
13407
  *
12954
13408
  * @since 2.0.0
12955
13409
  * @category repetition / recursion
@@ -12964,6 +13418,7 @@ export declare const repeatOrElse: {
12964
13418
  * initially and then repeats it an additional time if it succeeds.
12965
13419
  *
12966
13420
  * @example
13421
+ * ```ts
12967
13422
  * import { Effect, Schedule } from "effect"
12968
13423
  *
12969
13424
  * let count = 0
@@ -12993,6 +13448,7 @@ export declare const repeatOrElse: {
12993
13448
  * )
12994
13449
  *
12995
13450
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13451
+ * ```
12996
13452
  *
12997
13453
  * @since 2.0.0
12998
13454
  * @category repetition / recursion
@@ -13007,6 +13463,7 @@ export declare const repeatOrElse: {
13007
13463
  * initially and then repeats it an additional time if it succeeds.
13008
13464
  *
13009
13465
  * @example
13466
+ * ```ts
13010
13467
  * import { Effect, Schedule } from "effect"
13011
13468
  *
13012
13469
  * let count = 0
@@ -13036,6 +13493,7 @@ export declare const repeatOrElse: {
13036
13493
  * )
13037
13494
  *
13038
13495
  * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13496
+ * ```
13039
13497
  *
13040
13498
  * @since 2.0.0
13041
13499
  * @category repetition / recursion
@@ -13262,6 +13720,7 @@ export declare const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boole
13262
13720
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
13263
13721
  *
13264
13722
  * @example
13723
+ * ```ts
13265
13724
  * import { Effect } from "effect"
13266
13725
  *
13267
13726
  * const success: Effect.Effect<number, Error> = Effect.succeed(42)
@@ -13287,6 +13746,7 @@ export declare const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boole
13287
13746
  * // Run and log the result of the failed effect
13288
13747
  * Effect.runPromise(program2).then(console.log)
13289
13748
  * // Output: "failure: Uh oh!"
13749
+ * ```
13290
13750
  *
13291
13751
  * @since 2.0.0
13292
13752
  * @category getters & folding
@@ -13305,6 +13765,7 @@ export declare const match: {
13305
13765
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
13306
13766
  *
13307
13767
  * @example
13768
+ * ```ts
13308
13769
  * import { Effect } from "effect"
13309
13770
  *
13310
13771
  * const success: Effect.Effect<number, Error> = Effect.succeed(42)
@@ -13330,6 +13791,7 @@ export declare const match: {
13330
13791
  * // Run and log the result of the failed effect
13331
13792
  * Effect.runPromise(program2).then(console.log)
13332
13793
  * // Output: "failure: Uh oh!"
13794
+ * ```
13333
13795
  *
13334
13796
  * @since 2.0.0
13335
13797
  * @category getters & folding
@@ -13351,6 +13813,7 @@ export declare const match: {
13351
13813
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
13352
13814
  *
13353
13815
  * @example
13816
+ * ```ts
13354
13817
  * import { Effect } from "effect"
13355
13818
  *
13356
13819
  * const success: Effect.Effect<number, Error> = Effect.succeed(42)
@@ -13376,6 +13839,7 @@ export declare const match: {
13376
13839
  * // Run and log the result of the failed effect
13377
13840
  * Effect.runPromise(program2).then(console.log)
13378
13841
  * // Output: "failure: Uh oh!"
13842
+ * ```
13379
13843
  *
13380
13844
  * @since 2.0.0
13381
13845
  * @category getters & folding
@@ -13454,6 +13918,7 @@ export declare const matchCause: {
13454
13918
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
13455
13919
  *
13456
13920
  * @example
13921
+ * ```ts
13457
13922
  * import { Effect, Console } from "effect"
13458
13923
  *
13459
13924
  * const task: Effect.Effect<number, Error> = Effect.die("Uh oh!")
@@ -13481,6 +13946,7 @@ export declare const matchCause: {
13481
13946
  *
13482
13947
  * Effect.runSync(program)
13483
13948
  * // Output: "Die: Uh oh!"
13949
+ * ```
13484
13950
  *
13485
13951
  * @since 2.0.0
13486
13952
  * @category getters & folding
@@ -13500,6 +13966,7 @@ export declare const matchCauseEffect: {
13500
13966
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
13501
13967
  *
13502
13968
  * @example
13969
+ * ```ts
13503
13970
  * import { Effect, Console } from "effect"
13504
13971
  *
13505
13972
  * const task: Effect.Effect<number, Error> = Effect.die("Uh oh!")
@@ -13527,6 +13994,7 @@ export declare const matchCauseEffect: {
13527
13994
  *
13528
13995
  * Effect.runSync(program)
13529
13996
  * // Output: "Die: Uh oh!"
13997
+ * ```
13530
13998
  *
13531
13999
  * @since 2.0.0
13532
14000
  * @category getters & folding
@@ -13549,6 +14017,7 @@ export declare const matchCauseEffect: {
13549
14017
  * @see {@link matchEffect} if you don't need to handle the cause of the failure.
13550
14018
  *
13551
14019
  * @example
14020
+ * ```ts
13552
14021
  * import { Effect, Console } from "effect"
13553
14022
  *
13554
14023
  * const task: Effect.Effect<number, Error> = Effect.die("Uh oh!")
@@ -13576,6 +14045,7 @@ export declare const matchCauseEffect: {
13576
14045
  *
13577
14046
  * Effect.runSync(program)
13578
14047
  * // Output: "Die: Uh oh!"
14048
+ * ```
13579
14049
  *
13580
14050
  * @since 2.0.0
13581
14051
  * @category getters & folding
@@ -13647,6 +14117,7 @@ export declare const matchEffect: {
13647
14117
  * To adjust the log level, use the `Logger.withMinimumLogLevel` function.
13648
14118
  *
13649
14119
  * @example
14120
+ * ```ts
13650
14121
  * import { Cause, Effect } from "effect"
13651
14122
  *
13652
14123
  * const program = Effect.log(
@@ -13660,6 +14131,7 @@ export declare const matchEffect: {
13660
14131
  * // Output:
13661
14132
  * // timestamp=... level=INFO fiber=#0 message=message1 message=message2 cause="Error: Oh no!
13662
14133
  * // Error: Oh uh!"
14134
+ * ```
13663
14135
  *
13664
14136
  * @since 2.0.0
13665
14137
  * @category Logging
@@ -13687,12 +14159,14 @@ export declare const logTrace: (...message: ReadonlyArray<any>) => Effect<void,
13687
14159
  * `Logger.withMinimumLogLevel` and set the log level to `LogLevel.Debug`.
13688
14160
  *
13689
14161
  * @example
14162
+ * ```ts
13690
14163
  * import { Effect, Logger, LogLevel } from "effect"
13691
14164
  *
13692
14165
  * const program = Effect.logDebug("message1").pipe(Logger.withMinimumLogLevel(LogLevel.Debug))
13693
14166
  *
13694
14167
  * // Effect.runFork(program)
13695
14168
  * // timestamp=... level=DEBUG fiber=#0 message=message1
14169
+ * ```
13696
14170
  *
13697
14171
  * @since 2.0.0
13698
14172
  * @category Logging
@@ -13732,6 +14206,7 @@ export declare const logFatal: (...message: ReadonlyArray<any>) => Effect<void,
13732
14206
  * time-sensitive processes.
13733
14207
  *
13734
14208
  * @example
14209
+ * ```ts
13735
14210
  * import { Effect } from "effect"
13736
14211
  *
13737
14212
  * const program = Effect.gen(function*() {
@@ -13741,6 +14216,7 @@ export declare const logFatal: (...message: ReadonlyArray<any>) => Effect<void,
13741
14216
  *
13742
14217
  * // Effect.runFork(program)
13743
14218
  * // timestamp=... level=INFO fiber=#0 message="The job is finished!" myspan=1011ms
14219
+ * ```
13744
14220
  *
13745
14221
  * @since 2.0.0
13746
14222
  * @category Logging
@@ -13752,6 +14228,7 @@ export declare const withLogSpan: {
13752
14228
  * time-sensitive processes.
13753
14229
  *
13754
14230
  * @example
14231
+ * ```ts
13755
14232
  * import { Effect } from "effect"
13756
14233
  *
13757
14234
  * const program = Effect.gen(function*() {
@@ -13761,6 +14238,7 @@ export declare const withLogSpan: {
13761
14238
  *
13762
14239
  * // Effect.runFork(program)
13763
14240
  * // timestamp=... level=INFO fiber=#0 message="The job is finished!" myspan=1011ms
14241
+ * ```
13764
14242
  *
13765
14243
  * @since 2.0.0
13766
14244
  * @category Logging
@@ -13772,6 +14250,7 @@ export declare const withLogSpan: {
13772
14250
  * time-sensitive processes.
13773
14251
  *
13774
14252
  * @example
14253
+ * ```ts
13775
14254
  * import { Effect } from "effect"
13776
14255
  *
13777
14256
  * const program = Effect.gen(function*() {
@@ -13781,6 +14260,7 @@ export declare const withLogSpan: {
13781
14260
  *
13782
14261
  * // Effect.runFork(program)
13783
14262
  * // timestamp=... level=INFO fiber=#0 message="The job is finished!" myspan=1011ms
14263
+ * ```
13784
14264
  *
13785
14265
  * @since 2.0.0
13786
14266
  * @category Logging
@@ -13793,6 +14273,7 @@ export declare const withLogSpan: {
13793
14273
  * to log messages, making them more informative and easier to trace.
13794
14274
  *
13795
14275
  * @example
14276
+ * ```ts
13796
14277
  * import { Effect } from "effect"
13797
14278
  *
13798
14279
  * const program = Effect.gen(function*() {
@@ -13803,6 +14284,7 @@ export declare const withLogSpan: {
13803
14284
  * // Effect.runFork(program)
13804
14285
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13805
14286
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
14287
+ * ```
13806
14288
  *
13807
14289
  * @since 2.0.0
13808
14290
  * @category Logging
@@ -13814,6 +14296,7 @@ export declare const annotateLogs: {
13814
14296
  * to log messages, making them more informative and easier to trace.
13815
14297
  *
13816
14298
  * @example
14299
+ * ```ts
13817
14300
  * import { Effect } from "effect"
13818
14301
  *
13819
14302
  * const program = Effect.gen(function*() {
@@ -13824,6 +14307,7 @@ export declare const annotateLogs: {
13824
14307
  * // Effect.runFork(program)
13825
14308
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13826
14309
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
14310
+ * ```
13827
14311
  *
13828
14312
  * @since 2.0.0
13829
14313
  * @category Logging
@@ -13835,6 +14319,7 @@ export declare const annotateLogs: {
13835
14319
  * to log messages, making them more informative and easier to trace.
13836
14320
  *
13837
14321
  * @example
14322
+ * ```ts
13838
14323
  * import { Effect } from "effect"
13839
14324
  *
13840
14325
  * const program = Effect.gen(function*() {
@@ -13845,6 +14330,7 @@ export declare const annotateLogs: {
13845
14330
  * // Effect.runFork(program)
13846
14331
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13847
14332
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
14333
+ * ```
13848
14334
  *
13849
14335
  * @since 2.0.0
13850
14336
  * @category Logging
@@ -13856,6 +14342,7 @@ export declare const annotateLogs: {
13856
14342
  * to log messages, making them more informative and easier to trace.
13857
14343
  *
13858
14344
  * @example
14345
+ * ```ts
13859
14346
  * import { Effect } from "effect"
13860
14347
  *
13861
14348
  * const program = Effect.gen(function*() {
@@ -13866,6 +14353,7 @@ export declare const annotateLogs: {
13866
14353
  * // Effect.runFork(program)
13867
14354
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13868
14355
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
14356
+ * ```
13869
14357
  *
13870
14358
  * @since 2.0.0
13871
14359
  * @category Logging
@@ -13877,6 +14365,7 @@ export declare const annotateLogs: {
13877
14365
  * to log messages, making them more informative and easier to trace.
13878
14366
  *
13879
14367
  * @example
14368
+ * ```ts
13880
14369
  * import { Effect } from "effect"
13881
14370
  *
13882
14371
  * const program = Effect.gen(function*() {
@@ -13887,6 +14376,7 @@ export declare const annotateLogs: {
13887
14376
  * // Effect.runFork(program)
13888
14377
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13889
14378
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
14379
+ * ```
13890
14380
  *
13891
14381
  * @since 2.0.0
13892
14382
  * @category Logging
@@ -13900,6 +14390,7 @@ export declare const annotateLogs: {
13900
14390
  * defined `Scope`, making it easier to manage context-specific logging.
13901
14391
  *
13902
14392
  * @example
14393
+ * ```ts
13903
14394
  * import { Effect } from "effect"
13904
14395
  *
13905
14396
  * const program = Effect.gen(function*() {
@@ -13914,6 +14405,7 @@ export declare const annotateLogs: {
13914
14405
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13915
14406
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
13916
14407
  * // timestamp=... level=INFO fiber=#0 message="no annotations again"
14408
+ * ```
13917
14409
  *
13918
14410
  * @since 3.1.0
13919
14411
  * @category Logging
@@ -13926,6 +14418,7 @@ export declare const annotateLogsScoped: {
13926
14418
  * defined `Scope`, making it easier to manage context-specific logging.
13927
14419
  *
13928
14420
  * @example
14421
+ * ```ts
13929
14422
  * import { Effect } from "effect"
13930
14423
  *
13931
14424
  * const program = Effect.gen(function*() {
@@ -13940,6 +14433,7 @@ export declare const annotateLogsScoped: {
13940
14433
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13941
14434
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
13942
14435
  * // timestamp=... level=INFO fiber=#0 message="no annotations again"
14436
+ * ```
13943
14437
  *
13944
14438
  * @since 3.1.0
13945
14439
  * @category Logging
@@ -13952,6 +14446,7 @@ export declare const annotateLogsScoped: {
13952
14446
  * defined `Scope`, making it easier to manage context-specific logging.
13953
14447
  *
13954
14448
  * @example
14449
+ * ```ts
13955
14450
  * import { Effect } from "effect"
13956
14451
  *
13957
14452
  * const program = Effect.gen(function*() {
@@ -13966,6 +14461,7 @@ export declare const annotateLogsScoped: {
13966
14461
  * // timestamp=... level=INFO fiber=#0 message=message1 key=value
13967
14462
  * // timestamp=... level=INFO fiber=#0 message=message2 key=value
13968
14463
  * // timestamp=... level=INFO fiber=#0 message="no annotations again"
14464
+ * ```
13969
14465
  *
13970
14466
  * @since 3.1.0
13971
14467
  * @category Logging
@@ -14017,6 +14513,7 @@ export declare const withUnhandledErrorLogLevel: {
14017
14513
  * @see {@link orDieWith} if you need to customize the error.
14018
14514
  *
14019
14515
  * @example
14516
+ * ```ts
14020
14517
  * // Title: Propagating an Error as a Defect
14021
14518
  * import { Effect } from "effect"
14022
14519
  *
@@ -14033,6 +14530,7 @@ export declare const withUnhandledErrorLogLevel: {
14033
14530
  * // Output:
14034
14531
  * // (FiberFailure) Error: Cannot divide by zero
14035
14532
  * // ...stack trace...
14533
+ * ```
14036
14534
  *
14037
14535
  * @since 2.0.0
14038
14536
  * @category Converting Failures to Defects
@@ -14056,6 +14554,7 @@ export declare const orDie: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never,
14056
14554
  * @see {@link orDie} if you don't need to customize the error.
14057
14555
  *
14058
14556
  * @example
14557
+ * ```ts
14059
14558
  * // Title: Customizing Defect
14060
14559
  * import { Effect } from "effect"
14061
14560
  *
@@ -14075,6 +14574,7 @@ export declare const orDie: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never,
14075
14574
  * // Output:
14076
14575
  * // (FiberFailure) Error: defect: Cannot divide by zero
14077
14576
  * // ...stack trace...
14577
+ * ```
14078
14578
  *
14079
14579
  * @since 2.0.0
14080
14580
  * @category Converting Failures to Defects
@@ -14098,6 +14598,7 @@ export declare const orDieWith: {
14098
14598
  * @see {@link orDie} if you don't need to customize the error.
14099
14599
  *
14100
14600
  * @example
14601
+ * ```ts
14101
14602
  * // Title: Customizing Defect
14102
14603
  * import { Effect } from "effect"
14103
14604
  *
@@ -14117,6 +14618,7 @@ export declare const orDieWith: {
14117
14618
  * // Output:
14118
14619
  * // (FiberFailure) Error: defect: Cannot divide by zero
14119
14620
  * // ...stack trace...
14621
+ * ```
14120
14622
  *
14121
14623
  * @since 2.0.0
14122
14624
  * @category Converting Failures to Defects
@@ -14140,6 +14642,7 @@ export declare const orDieWith: {
14140
14642
  * @see {@link orDie} if you don't need to customize the error.
14141
14643
  *
14142
14644
  * @example
14645
+ * ```ts
14143
14646
  * // Title: Customizing Defect
14144
14647
  * import { Effect } from "effect"
14145
14648
  *
@@ -14159,6 +14662,7 @@ export declare const orDieWith: {
14159
14662
  * // Output:
14160
14663
  * // (FiberFailure) Error: defect: Cannot divide by zero
14161
14664
  * // ...stack trace...
14665
+ * ```
14162
14666
  *
14163
14667
  * @since 2.0.0
14164
14668
  * @category Converting Failures to Defects
@@ -14176,6 +14680,7 @@ export declare const orDieWith: {
14176
14680
  * @see {@link catchAll} if you need to access the error in the fallback effect.
14177
14681
  *
14178
14682
  * @example
14683
+ * ```ts
14179
14684
  * import { Effect } from "effect"
14180
14685
  *
14181
14686
  * const success = Effect.succeed("success")
@@ -14191,6 +14696,7 @@ export declare const orDieWith: {
14191
14696
  * const program2 = Effect.orElse(failure, () => fallback)
14192
14697
  * console.log(Effect.runSync(program2))
14193
14698
  * // Output: "fallback"
14699
+ * ```
14194
14700
  *
14195
14701
  * @since 2.0.0
14196
14702
  * @category Fallback
@@ -14207,6 +14713,7 @@ export declare const orElse: {
14207
14713
  * @see {@link catchAll} if you need to access the error in the fallback effect.
14208
14714
  *
14209
14715
  * @example
14716
+ * ```ts
14210
14717
  * import { Effect } from "effect"
14211
14718
  *
14212
14719
  * const success = Effect.succeed("success")
@@ -14222,6 +14729,7 @@ export declare const orElse: {
14222
14729
  * const program2 = Effect.orElse(failure, () => fallback)
14223
14730
  * console.log(Effect.runSync(program2))
14224
14731
  * // Output: "fallback"
14732
+ * ```
14225
14733
  *
14226
14734
  * @since 2.0.0
14227
14735
  * @category Fallback
@@ -14238,6 +14746,7 @@ export declare const orElse: {
14238
14746
  * @see {@link catchAll} if you need to access the error in the fallback effect.
14239
14747
  *
14240
14748
  * @example
14749
+ * ```ts
14241
14750
  * import { Effect } from "effect"
14242
14751
  *
14243
14752
  * const success = Effect.succeed("success")
@@ -14253,6 +14762,7 @@ export declare const orElse: {
14253
14762
  * const program2 = Effect.orElse(failure, () => fallback)
14254
14763
  * console.log(Effect.runSync(program2))
14255
14764
  * // Output: "fallback"
14765
+ * ```
14256
14766
  *
14257
14767
  * @since 2.0.0
14258
14768
  * @category Fallback
@@ -14272,6 +14782,7 @@ export declare const orElse: {
14272
14782
  * @see {@link mapError} if you need to access the error to transform it.
14273
14783
  *
14274
14784
  * @example
14785
+ * ```ts
14275
14786
  * import { Effect } from "effect"
14276
14787
  *
14277
14788
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14293,6 +14804,7 @@ export declare const orElse: {
14293
14804
  * // _tag: 'Failure',
14294
14805
  * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'invalid age' }
14295
14806
  * // }
14807
+ * ```
14296
14808
  *
14297
14809
  * @since 2.0.0
14298
14810
  * @category Fallback
@@ -14311,6 +14823,7 @@ export declare const orElseFail: {
14311
14823
  * @see {@link mapError} if you need to access the error to transform it.
14312
14824
  *
14313
14825
  * @example
14826
+ * ```ts
14314
14827
  * import { Effect } from "effect"
14315
14828
  *
14316
14829
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14332,6 +14845,7 @@ export declare const orElseFail: {
14332
14845
  * // _tag: 'Failure',
14333
14846
  * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'invalid age' }
14334
14847
  * // }
14848
+ * ```
14335
14849
  *
14336
14850
  * @since 2.0.0
14337
14851
  * @category Fallback
@@ -14350,6 +14864,7 @@ export declare const orElseFail: {
14350
14864
  * @see {@link mapError} if you need to access the error to transform it.
14351
14865
  *
14352
14866
  * @example
14867
+ * ```ts
14353
14868
  * import { Effect } from "effect"
14354
14869
  *
14355
14870
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14371,6 +14886,7 @@ export declare const orElseFail: {
14371
14886
  * // _tag: 'Failure',
14372
14887
  * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'invalid age' }
14373
14888
  * // }
14889
+ * ```
14374
14890
  *
14375
14891
  * @since 2.0.0
14376
14892
  * @category Fallback
@@ -14395,6 +14911,7 @@ export declare const orElseFail: {
14395
14911
  * already succeeds, it will remain unchanged.
14396
14912
  *
14397
14913
  * @example
14914
+ * ```ts
14398
14915
  * import { Effect } from "effect"
14399
14916
  *
14400
14917
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14412,6 +14929,7 @@ export declare const orElseFail: {
14412
14929
  * console.log(Effect.runSyncExit(program))
14413
14930
  * // Output:
14414
14931
  * // { _id: 'Exit', _tag: 'Success', value: 18 }
14932
+ * ```
14415
14933
  *
14416
14934
  * @since 2.0.0
14417
14935
  * @category Fallback
@@ -14435,6 +14953,7 @@ export declare const orElseSucceed: {
14435
14953
  * already succeeds, it will remain unchanged.
14436
14954
  *
14437
14955
  * @example
14956
+ * ```ts
14438
14957
  * import { Effect } from "effect"
14439
14958
  *
14440
14959
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14452,6 +14971,7 @@ export declare const orElseSucceed: {
14452
14971
  * console.log(Effect.runSyncExit(program))
14453
14972
  * // Output:
14454
14973
  * // { _id: 'Exit', _tag: 'Success', value: 18 }
14974
+ * ```
14455
14975
  *
14456
14976
  * @since 2.0.0
14457
14977
  * @category Fallback
@@ -14475,6 +14995,7 @@ export declare const orElseSucceed: {
14475
14995
  * already succeeds, it will remain unchanged.
14476
14996
  *
14477
14997
  * @example
14998
+ * ```ts
14478
14999
  * import { Effect } from "effect"
14479
15000
  *
14480
15001
  * const validate = (age: number): Effect.Effect<number, string> => {
@@ -14492,6 +15013,7 @@ export declare const orElseSucceed: {
14492
15013
  * console.log(Effect.runSyncExit(program))
14493
15014
  * // Output:
14494
15015
  * // { _id: 'Exit', _tag: 'Success', value: 18 }
15016
+ * ```
14495
15017
  *
14496
15018
  * @since 2.0.0
14497
15019
  * @category Fallback
@@ -14516,6 +15038,7 @@ export declare const orElseSucceed: {
14516
15038
  * error.
14517
15039
  *
14518
15040
  * @example
15041
+ * ```ts
14519
15042
  * import { Effect, Console } from "effect"
14520
15043
  *
14521
15044
  * interface Config {
@@ -14562,6 +15085,7 @@ export declare const orElseSucceed: {
14562
15085
  * // Unavailable config for node2
14563
15086
  * // Config for node3 found
14564
15087
  * // { host: 'node3.example.com', port: 8080, apiKey: '12345-abcde' }
15088
+ * ```
14565
15089
  *
14566
15090
  * @since 2.0.0
14567
15091
  * @category Fallback
@@ -14836,6 +15360,7 @@ export declare const unsafeMakeLatch: (open?: boolean | undefined) => Latch;
14836
15360
  * @category latch
14837
15361
  * @since 3.8.0
14838
15362
  * @example
15363
+ * ```ts
14839
15364
  * import { Effect } from "effect"
14840
15365
  *
14841
15366
  * Effect.gen(function*() {
@@ -14852,6 +15377,7 @@ export declare const unsafeMakeLatch: (open?: boolean | undefined) => Latch;
14852
15377
  * yield* latch.open
14853
15378
  * yield* fiber.await
14854
15379
  * })
15380
+ * ```
14855
15381
  */
14856
15382
  export declare const makeLatch: (open?: boolean | undefined) => Effect<Latch, never, never>;
14857
15383
  /**
@@ -14868,6 +15394,7 @@ export declare const makeLatch: (open?: boolean | undefined) => Effect<Latch, ne
14868
15394
  * `runFork` is a good default choice.
14869
15395
  *
14870
15396
  * @example
15397
+ * ```ts
14871
15398
  * // Title: Running an Effect in the Background
14872
15399
  * import { Effect, Console, Schedule, Fiber } from "effect"
14873
15400
  *
@@ -14885,6 +15412,7 @@ export declare const makeLatch: (open?: boolean | undefined) => Effect<Latch, ne
14885
15412
  * setTimeout(() => {
14886
15413
  * Effect.runFork(Fiber.interrupt(fiber))
14887
15414
  * }, 500)
15415
+ * ```
14888
15416
  *
14889
15417
  * @since 2.0.0
14890
15418
  * @category Running Effects
@@ -14910,11 +15438,13 @@ export declare const runCallback: <A, E>(effect: Effect<A, E>, options?: Runtime
14910
15438
  * @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
14911
15439
  *
14912
15440
  * @example
15441
+ * ```ts
14913
15442
  * // Title: Running a Successful Effect as a Promise
14914
15443
  * import { Effect } from "effect"
14915
15444
  *
14916
15445
  * Effect.runPromise(Effect.succeed(1)).then(console.log)
14917
15446
  * // Output: 1
15447
+ * ```
14918
15448
  *
14919
15449
  * @example
14920
15450
  * //Example: Handling a Failing Effect as a Rejected Promise
@@ -14947,6 +15477,7 @@ export declare const runPromise: <A, E>(effect: Effect<A, E, never>, options?: {
14947
15477
  * a `Cause` type.
14948
15478
  *
14949
15479
  * @example
15480
+ * ```ts
14950
15481
  * // Title: Handling Results as Exit
14951
15482
  * import { Effect } from "effect"
14952
15483
  *
@@ -14971,6 +15502,7 @@ export declare const runPromise: <A, E>(effect: Effect<A, E, never>, options?: {
14971
15502
  * // failure: "my error"
14972
15503
  * // }
14973
15504
  * // }
15505
+ * ```
14974
15506
  *
14975
15507
  * @since 2.0.0
14976
15508
  * @category Running Effects
@@ -14994,6 +15526,7 @@ export declare const runPromiseExit: <A, E>(effect: Effect<A, E, never>, options
14994
15526
  * throwing an error.
14995
15527
  *
14996
15528
  * @example
15529
+ * ```ts
14997
15530
  * // Title: Synchronous Logging
14998
15531
  * import { Effect } from "effect"
14999
15532
  *
@@ -15007,6 +15540,7 @@ export declare const runPromiseExit: <A, E>(effect: Effect<A, E, never>, options
15007
15540
  *
15008
15541
  * console.log(result)
15009
15542
  * // Output: 1
15543
+ * ```
15010
15544
  *
15011
15545
  * @example
15012
15546
  * // Title: Incorrect Usage with Failing or Async Effects
@@ -15055,6 +15589,7 @@ export declare const runSync: <A, E>(effect: Effect<A, E>) => A;
15055
15589
  * resolved synchronously.
15056
15590
  *
15057
15591
  * @example
15592
+ * ```ts
15058
15593
  * // Title: Handling Results as Exit
15059
15594
  * import { Effect } from "effect"
15060
15595
  *
@@ -15077,6 +15612,7 @@ export declare const runSync: <A, E>(effect: Effect<A, E>) => A;
15077
15612
  * // failure: "my error"
15078
15613
  * // }
15079
15614
  * // }
15615
+ * ```
15080
15616
  *
15081
15617
  * @example
15082
15618
  * // Title: Asynchronous Operation Resulting in Die
@@ -15117,6 +15653,7 @@ export declare const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E
15117
15653
  * @see {@link zip} for a version that stops at the first error.
15118
15654
  *
15119
15655
  * @example
15656
+ * ```ts
15120
15657
  * import { Effect, Console } from "effect"
15121
15658
  *
15122
15659
  * const task1 = Console.log("task1").pipe(Effect.as(1))
@@ -15144,6 +15681,7 @@ export declare const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E
15144
15681
  * // right: { _id: 'Cause', _tag: 'Fail', failure: 'Oh no!' }
15145
15682
  * // }
15146
15683
  * // }
15684
+ * ```
15147
15685
  *
15148
15686
  * @since 2.0.0
15149
15687
  * @category Error Accumulation
@@ -15164,6 +15702,7 @@ export declare const validate: {
15164
15702
  * @see {@link zip} for a version that stops at the first error.
15165
15703
  *
15166
15704
  * @example
15705
+ * ```ts
15167
15706
  * import { Effect, Console } from "effect"
15168
15707
  *
15169
15708
  * const task1 = Console.log("task1").pipe(Effect.as(1))
@@ -15191,6 +15730,7 @@ export declare const validate: {
15191
15730
  * // right: { _id: 'Cause', _tag: 'Fail', failure: 'Oh no!' }
15192
15731
  * // }
15193
15732
  * // }
15733
+ * ```
15194
15734
  *
15195
15735
  * @since 2.0.0
15196
15736
  * @category Error Accumulation
@@ -15215,6 +15755,7 @@ export declare const validate: {
15215
15755
  * @see {@link zip} for a version that stops at the first error.
15216
15756
  *
15217
15757
  * @example
15758
+ * ```ts
15218
15759
  * import { Effect, Console } from "effect"
15219
15760
  *
15220
15761
  * const task1 = Console.log("task1").pipe(Effect.as(1))
@@ -15242,6 +15783,7 @@ export declare const validate: {
15242
15783
  * // right: { _id: 'Cause', _tag: 'Fail', failure: 'Oh no!' }
15243
15784
  * // }
15244
15785
  * // }
15786
+ * ```
15245
15787
  *
15246
15788
  * @since 2.0.0
15247
15789
  * @category Error Accumulation
@@ -15300,6 +15842,7 @@ export declare const validateWith: {
15300
15842
  * @see {@link validate} for a version that accumulates errors.
15301
15843
  *
15302
15844
  * @example
15845
+ * ```ts
15303
15846
  * // Title: Combining Two Effects Sequentially
15304
15847
  * import { Effect } from "effect"
15305
15848
  *
@@ -15323,6 +15866,7 @@ export declare const validateWith: {
15323
15866
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15324
15867
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15325
15868
  * // [ 1, 'hello' ]
15869
+ * ```
15326
15870
  *
15327
15871
  * @example
15328
15872
  * // Title: Combining Two Effects Concurrently
@@ -15365,6 +15909,7 @@ export declare const zip: {
15365
15909
  * @see {@link validate} for a version that accumulates errors.
15366
15910
  *
15367
15911
  * @example
15912
+ * ```ts
15368
15913
  * // Title: Combining Two Effects Sequentially
15369
15914
  * import { Effect } from "effect"
15370
15915
  *
@@ -15388,6 +15933,7 @@ export declare const zip: {
15388
15933
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15389
15934
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15390
15935
  * // [ 1, 'hello' ]
15936
+ * ```
15391
15937
  *
15392
15938
  * @example
15393
15939
  * // Title: Combining Two Effects Concurrently
@@ -15434,6 +15980,7 @@ export declare const zip: {
15434
15980
  * @see {@link validate} for a version that accumulates errors.
15435
15981
  *
15436
15982
  * @example
15983
+ * ```ts
15437
15984
  * // Title: Combining Two Effects Sequentially
15438
15985
  * import { Effect } from "effect"
15439
15986
  *
@@ -15457,6 +16004,7 @@ export declare const zip: {
15457
16004
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15458
16005
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15459
16006
  * // [ 1, 'hello' ]
16007
+ * ```
15460
16008
  *
15461
16009
  * @example
15462
16010
  * // Title: Combining Two Effects Concurrently
@@ -15507,6 +16055,7 @@ export declare const zip: {
15507
16055
  * @see {@link zipRight} for a version that returns the result of the second effect.
15508
16056
  *
15509
16057
  * @example
16058
+ * ```ts
15510
16059
  * import { Effect } from "effect"
15511
16060
  *
15512
16061
  * const task1 = Effect.succeed(1).pipe(
@@ -15525,6 +16074,7 @@ export declare const zip: {
15525
16074
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15526
16075
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15527
16076
  * // 1
16077
+ * ```
15528
16078
  *
15529
16079
  * @since 2.0.0
15530
16080
  * @category Zipping
@@ -15548,6 +16098,7 @@ export declare const zipLeft: {
15548
16098
  * @see {@link zipRight} for a version that returns the result of the second effect.
15549
16099
  *
15550
16100
  * @example
16101
+ * ```ts
15551
16102
  * import { Effect } from "effect"
15552
16103
  *
15553
16104
  * const task1 = Effect.succeed(1).pipe(
@@ -15566,6 +16117,7 @@ export declare const zipLeft: {
15566
16117
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15567
16118
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15568
16119
  * // 1
16120
+ * ```
15569
16121
  *
15570
16122
  * @since 2.0.0
15571
16123
  * @category Zipping
@@ -15593,6 +16145,7 @@ export declare const zipLeft: {
15593
16145
  * @see {@link zipRight} for a version that returns the result of the second effect.
15594
16146
  *
15595
16147
  * @example
16148
+ * ```ts
15596
16149
  * import { Effect } from "effect"
15597
16150
  *
15598
16151
  * const task1 = Effect.succeed(1).pipe(
@@ -15611,6 +16164,7 @@ export declare const zipLeft: {
15611
16164
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15612
16165
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15613
16166
  * // 1
16167
+ * ```
15614
16168
  *
15615
16169
  * @since 2.0.0
15616
16170
  * @category Zipping
@@ -15639,6 +16193,7 @@ export declare const zipLeft: {
15639
16193
  * @see {@link zipLeft} for a version that returns the result of the first effect.
15640
16194
  *
15641
16195
  * @example
16196
+ * ```ts
15642
16197
  * import { Effect } from "effect"
15643
16198
  *
15644
16199
  * const task1 = Effect.succeed(1).pipe(
@@ -15657,6 +16212,7 @@ export declare const zipLeft: {
15657
16212
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15658
16213
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15659
16214
  * // hello
16215
+ * ```
15660
16216
  *
15661
16217
  * @since 2.0.0
15662
16218
  * @category Zipping
@@ -15680,6 +16236,7 @@ export declare const zipRight: {
15680
16236
  * @see {@link zipLeft} for a version that returns the result of the first effect.
15681
16237
  *
15682
16238
  * @example
16239
+ * ```ts
15683
16240
  * import { Effect } from "effect"
15684
16241
  *
15685
16242
  * const task1 = Effect.succeed(1).pipe(
@@ -15698,6 +16255,7 @@ export declare const zipRight: {
15698
16255
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15699
16256
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15700
16257
  * // hello
16258
+ * ```
15701
16259
  *
15702
16260
  * @since 2.0.0
15703
16261
  * @category Zipping
@@ -15725,6 +16283,7 @@ export declare const zipRight: {
15725
16283
  * @see {@link zipLeft} for a version that returns the result of the first effect.
15726
16284
  *
15727
16285
  * @example
16286
+ * ```ts
15728
16287
  * import { Effect } from "effect"
15729
16288
  *
15730
16289
  * const task1 = Effect.succeed(1).pipe(
@@ -15743,6 +16302,7 @@ export declare const zipRight: {
15743
16302
  * // timestamp=... level=INFO fiber=#0 message="task1 done"
15744
16303
  * // timestamp=... level=INFO fiber=#0 message="task2 done"
15745
16304
  * // hello
16305
+ * ```
15746
16306
  *
15747
16307
  * @since 2.0.0
15748
16308
  * @category Zipping
@@ -15769,6 +16329,7 @@ export declare const zipRight: {
15769
16329
  * use the `{ concurrent: true }` option.
15770
16330
  *
15771
16331
  * @example
16332
+ * ```ts
15772
16333
  * // Title: Combining Effects with a Custom Function
15773
16334
  * import { Effect } from "effect"
15774
16335
  *
@@ -15793,6 +16354,7 @@ export declare const zipRight: {
15793
16354
  * // timestamp=... level=INFO fiber=#3 message="task1 done"
15794
16355
  * // timestamp=... level=INFO fiber=#2 message="task2 done"
15795
16356
  * // 6
16357
+ * ```
15796
16358
  *
15797
16359
  * @since 2.0.0
15798
16360
  * @category Zipping
@@ -15814,6 +16376,7 @@ export declare const zipWith: {
15814
16376
  * use the `{ concurrent: true }` option.
15815
16377
  *
15816
16378
  * @example
16379
+ * ```ts
15817
16380
  * // Title: Combining Effects with a Custom Function
15818
16381
  * import { Effect } from "effect"
15819
16382
  *
@@ -15838,6 +16401,7 @@ export declare const zipWith: {
15838
16401
  * // timestamp=... level=INFO fiber=#3 message="task1 done"
15839
16402
  * // timestamp=... level=INFO fiber=#2 message="task2 done"
15840
16403
  * // 6
16404
+ * ```
15841
16405
  *
15842
16406
  * @since 2.0.0
15843
16407
  * @category Zipping
@@ -15863,6 +16427,7 @@ export declare const zipWith: {
15863
16427
  * use the `{ concurrent: true }` option.
15864
16428
  *
15865
16429
  * @example
16430
+ * ```ts
15866
16431
  * // Title: Combining Effects with a Custom Function
15867
16432
  * import { Effect } from "effect"
15868
16433
  *
@@ -15887,6 +16452,7 @@ export declare const zipWith: {
15887
16452
  * // timestamp=... level=INFO fiber=#3 message="task1 done"
15888
16453
  * // timestamp=... level=INFO fiber=#2 message="task2 done"
15889
16454
  * // 6
16455
+ * ```
15890
16456
  *
15891
16457
  * @since 2.0.0
15892
16458
  * @category Zipping
@@ -16038,6 +16604,7 @@ export declare const withTracerScoped: (value: Tracer.Tracer) => Effect<void, ne
16038
16604
  * @since 2.0.0
16039
16605
  * @category Tracing
16040
16606
  * @example
16607
+ * ```ts
16041
16608
  * import { Effect } from "effect"
16042
16609
  *
16043
16610
  * Effect.succeed(42).pipe(
@@ -16045,6 +16612,7 @@ export declare const withTracerScoped: (value: Tracer.Tracer) => Effect<void, ne
16045
16612
  * // the span will not be registered with the tracer
16046
16613
  * Effect.withTracerEnabled(false)
16047
16614
  * )
16615
+ * ```
16048
16616
  */
16049
16617
  export declare const withTracerEnabled: {
16050
16618
  /**
@@ -16053,6 +16621,7 @@ export declare const withTracerEnabled: {
16053
16621
  * @since 2.0.0
16054
16622
  * @category Tracing
16055
16623
  * @example
16624
+ * ```ts
16056
16625
  * import { Effect } from "effect"
16057
16626
  *
16058
16627
  * Effect.succeed(42).pipe(
@@ -16060,6 +16629,7 @@ export declare const withTracerEnabled: {
16060
16629
  * // the span will not be registered with the tracer
16061
16630
  * Effect.withTracerEnabled(false)
16062
16631
  * )
16632
+ * ```
16063
16633
  */
16064
16634
  (enabled: boolean): <A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, R>;
16065
16635
  /**
@@ -16068,6 +16638,7 @@ export declare const withTracerEnabled: {
16068
16638
  * @since 2.0.0
16069
16639
  * @category Tracing
16070
16640
  * @example
16641
+ * ```ts
16071
16642
  * import { Effect } from "effect"
16072
16643
  *
16073
16644
  * Effect.succeed(42).pipe(
@@ -16075,6 +16646,7 @@ export declare const withTracerEnabled: {
16075
16646
  * // the span will not be registered with the tracer
16076
16647
  * Effect.withTracerEnabled(false)
16077
16648
  * )
16649
+ * ```
16078
16650
  */
16079
16651
  <A, E, R>(effect: Effect<A, E, R>, enabled: boolean): Effect<A, E, R>;
16080
16652
  };
@@ -16289,6 +16861,7 @@ export interface FunctionWithSpanOptions {
16289
16861
  * @since 3.2.0
16290
16862
  * @category Tracing
16291
16863
  * @example
16864
+ * ```ts
16292
16865
  * import { Effect } from "effect"
16293
16866
  *
16294
16867
  * const getTodo = Effect.functionWithSpan({
@@ -16298,6 +16871,7 @@ export interface FunctionWithSpanOptions {
16298
16871
  * attributes: { id }
16299
16872
  * })
16300
16873
  * })
16874
+ * ```
16301
16875
  */
16302
16876
  export declare const functionWithSpan: <Args extends Array<any>, Ret extends Effect<any, any, any>>(options: {
16303
16877
  readonly body: (...args: Args) => Ret;
@@ -16366,6 +16940,7 @@ export declare const withParentSpan: {
16366
16940
  * value.
16367
16941
  *
16368
16942
  * @example
16943
+ * ```ts
16369
16944
  * import { Effect } from "effect"
16370
16945
  *
16371
16946
  * // ┌─── Effect<number, NoSuchElementException, never>
@@ -16391,6 +16966,7 @@ export declare const withParentSpan: {
16391
16966
  * // failure: { _tag: 'NoSuchElementException' }
16392
16967
  * // }
16393
16968
  * // }
16969
+ * ```
16394
16970
  *
16395
16971
  * @since 2.0.0
16396
16972
  * @category Optional Wrapping
@@ -16408,6 +16984,7 @@ export declare const fromNullable: <A>(value: A) => Effect<NonNullable<A>, Cause
16408
16984
  * unchanged.
16409
16985
  *
16410
16986
  * @example
16987
+ * ```ts
16411
16988
  * import { Effect } from "effect"
16412
16989
  *
16413
16990
  * // ┌─── Effect<number, NoSuchElementException, never>
@@ -16431,6 +17008,7 @@ export declare const fromNullable: <A>(value: A) => Effect<NonNullable<A>, Cause
16431
17008
  *
16432
17009
  * Effect.runPromise(option2).then(console.log)
16433
17010
  * // Output: { _tag: 'None' }
17011
+ * ```
16434
17012
  *
16435
17013
  * @since 2.0.0
16436
17014
  * @category Optional Wrapping
@@ -16472,6 +17050,7 @@ export declare namespace Tag {
16472
17050
  }
16473
17051
  /**
16474
17052
  * @example
17053
+ * ```ts
16475
17054
  * import { Effect, Layer } from "effect"
16476
17055
  *
16477
17056
  * class MapTag extends Effect.Tag("MapTag")<MapTag, Map<string, string>>() {
@@ -16480,6 +17059,7 @@ export declare namespace Tag {
16480
17059
  * Effect.sync(() => new Map())
16481
17060
  * )
16482
17061
  * }
17062
+ * ```
16483
17063
  *
16484
17064
  * @since 2.0.0
16485
17065
  * @category Context
@@ -16489,6 +17069,7 @@ export declare const Tag: <const Id extends string>(id: Id) => <Self, Type exten
16489
17069
  };
16490
17070
  /**
16491
17071
  * @example
17072
+ * ```ts
16492
17073
  * import { Effect } from 'effect';
16493
17074
  *
16494
17075
  * class Prefix extends Effect.Service<Prefix>()("Prefix", {
@@ -16508,6 +17089,7 @@ export declare const Tag: <const Id extends string>(id: Id) => <Self, Type exten
16508
17089
  * }),
16509
17090
  * dependencies: [Prefix.Default]
16510
17091
  * }) {}
17092
+ * ```
16511
17093
  *
16512
17094
  * @since 3.9.0
16513
17095
  * @category Context
@@ -16663,4 +17245,79 @@ export declare namespace Service {
16663
17245
  readonly accessors: true;
16664
17246
  } ? true : false;
16665
17247
  }
17248
+ /**
17249
+ * @since 3.11.0
17250
+ * @category models
17251
+ */
17252
+ export declare namespace fn {
17253
+ /**
17254
+ * @since 3.11.0
17255
+ * @category models
17256
+ */
17257
+ type FnEffect<AEff, Eff extends YieldWrap<Effect<any, any, any>>> = Effect<AEff, [
17258
+ Eff
17259
+ ] extends [never] ? never : [Eff] extends [YieldWrap<Effect<infer _A, infer E, infer _R>>] ? E : never, [
17260
+ Eff
17261
+ ] extends [never] ? never : [Eff] extends [YieldWrap<Effect<infer _A, infer _E, infer R>>] ? R : never>;
17262
+ /**
17263
+ * @since 3.11.0
17264
+ * @category models
17265
+ */
17266
+ type Gen = {
17267
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>>(body: (...args: Args) => Generator<Eff, AEff, never>): (...args: Args) => fn.FnEffect<AEff, Eff>;
17268
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A): (...args: Args) => A;
17269
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B): (...args: Args) => B;
17270
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C): (...args: Args) => C;
17271
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D): (...args: Args) => D;
17272
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D, E extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D, e: (_: D) => E): (...args: Args) => E;
17273
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D, E, F extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D, e: (_: D) => E, f: (_: E) => F): (...args: Args) => F;
17274
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D, E, F, G extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D, e: (_: D) => E, f: (_: E) => F, g: (_: F) => G): (...args: Args) => G;
17275
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D, E, F, G, H extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D, e: (_: D) => E, f: (_: E) => F, g: (_: F) => G, h: (_: G) => H): (...args: Args) => H;
17276
+ <Eff extends YieldWrap<Effect<any, any, any>>, AEff, Args extends Array<any>, A, B, C, D, E, F, G, H, I extends Effect<any, any, any>>(body: (...args: Args) => Generator<Eff, AEff, never>, a: (_: fn.FnEffect<AEff, Eff>) => A, b: (_: A) => B, c: (_: B) => C, d: (_: C) => D, e: (_: D) => E, f: (_: E) => F, g: (_: F) => G, h: (_: G) => H, i: (_: H) => I): (...args: Args) => I;
17277
+ };
17278
+ /**
17279
+ * @since 3.11.0
17280
+ * @category models
17281
+ */
17282
+ type NonGen = {
17283
+ <Eff extends Effect<any, any, any>, Args extends Array<any>>(body: (...args: Args) => Eff): (...args: Args) => Eff;
17284
+ <Eff extends Effect<any, any, any>, A, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => Eff): (...args: Args) => Eff;
17285
+ <Eff extends Effect<any, any, any>, A, B, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => Eff): (...args: Args) => Eff;
17286
+ <Eff extends Effect<any, any, any>, A, B, C, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => Eff): (...args: Args) => Eff;
17287
+ <Eff extends Effect<any, any, any>, A, B, C, D, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => Eff): (...args: Args) => Eff;
17288
+ <Eff extends Effect<any, any, any>, A, B, C, D, E, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => E, e: (_: E) => Eff): (...args: Args) => Eff;
17289
+ <Eff extends Effect<any, any, any>, A, B, C, D, E, F, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => E, e: (_: E) => F, f: (_: E) => Eff): (...args: Args) => Eff;
17290
+ <Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => E, e: (_: E) => F, f: (_: E) => G, g: (_: G) => Eff): (...args: Args) => Eff;
17291
+ <Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, H, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => E, e: (_: E) => F, f: (_: E) => G, g: (_: G) => H, h: (_: H) => Eff): (...args: Args) => Eff;
17292
+ <Eff extends Effect<any, any, any>, A, B, C, D, E, F, G, H, I, Args extends Array<any>>(body: (...args: Args) => A, a: (_: A) => B, b: (_: B) => C, c: (_: C) => D, d: (_: D) => E, e: (_: E) => F, f: (_: E) => G, g: (_: G) => H, h: (_: H) => I, i: (_: H) => Eff): (...args: Args) => Eff;
17293
+ };
17294
+ }
17295
+ /**
17296
+ * Creates a function that returns an Effect which is automatically traced with a span pointing to the call site.
17297
+ *
17298
+ * The function can be created both using a generator function that can yield effects or using a normal function.
17299
+ *
17300
+ * @since 3.11.0
17301
+ * @category function
17302
+ *
17303
+ * @example
17304
+ * import { Effect } from "effect"
17305
+ *
17306
+ * const logExample = Effect.fn("logExample")(
17307
+ * function*<N extends number>(n: N) {
17308
+ * yield* Effect.annotateCurrentSpan("n", n)
17309
+ * yield* Effect.logInfo(`got: ${n}`)
17310
+ * yield* Effect.fail(new Error())
17311
+ * },
17312
+ * Effect.delay("1 second")
17313
+ * )
17314
+ *
17315
+ * Effect.runFork(
17316
+ * // this location is printed on the stack trace of the following `Effect.logError`
17317
+ * logExample(100).pipe(
17318
+ * Effect.catchAllCause(Effect.logError)
17319
+ * )
17320
+ * )
17321
+ */
17322
+ export declare const fn: (name: string, options?: Tracer.SpanOptions) => fn.Gen & fn.NonGen;
16666
17323
  //# sourceMappingURL=Effect.d.ts.map