effect 3.13.8 → 3.13.9

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 (333) hide show
  1. package/dist/cjs/Array.js +460 -431
  2. package/dist/cjs/Array.js.map +1 -1
  3. package/dist/cjs/BigDecimal.js +31 -89
  4. package/dist/cjs/BigDecimal.js.map +1 -1
  5. package/dist/cjs/BigInt.js +27 -71
  6. package/dist/cjs/BigInt.js.map +1 -1
  7. package/dist/cjs/Boolean.js +12 -10
  8. package/dist/cjs/Boolean.js.map +1 -1
  9. package/dist/cjs/Brand.js +2 -0
  10. package/dist/cjs/Brand.js.map +1 -1
  11. package/dist/cjs/Channel.js +0 -2
  12. package/dist/cjs/Channel.js.map +1 -1
  13. package/dist/cjs/Chunk.js +4 -0
  14. package/dist/cjs/Chunk.js.map +1 -1
  15. package/dist/cjs/Config.js +0 -5
  16. package/dist/cjs/Config.js.map +1 -1
  17. package/dist/cjs/Context.js +14 -24
  18. package/dist/cjs/Context.js.map +1 -1
  19. package/dist/cjs/Cron.js +11 -25
  20. package/dist/cjs/Cron.js.map +1 -1
  21. package/dist/cjs/Data.js +6 -0
  22. package/dist/cjs/Data.js.map +1 -1
  23. package/dist/cjs/DateTime.js +2 -0
  24. package/dist/cjs/DateTime.js.map +1 -1
  25. package/dist/cjs/Duration.js +2 -2
  26. package/dist/cjs/Effect.js +122 -53
  27. package/dist/cjs/Effect.js.map +1 -1
  28. package/dist/cjs/Either.js +21 -25
  29. package/dist/cjs/Either.js.map +1 -1
  30. package/dist/cjs/Encoding.js +1 -1
  31. package/dist/cjs/Equivalence.js +1 -1
  32. package/dist/cjs/Function.js +21 -24
  33. package/dist/cjs/Function.js.map +1 -1
  34. package/dist/cjs/HashMap.js +0 -3
  35. package/dist/cjs/HashMap.js.map +1 -1
  36. package/dist/cjs/Iterable.js +9 -2
  37. package/dist/cjs/Iterable.js.map +1 -1
  38. package/dist/cjs/List.js +2 -0
  39. package/dist/cjs/List.js.map +1 -1
  40. package/dist/cjs/Logger.js +0 -2
  41. package/dist/cjs/Logger.js.map +1 -1
  42. package/dist/cjs/Mailbox.js +1 -0
  43. package/dist/cjs/Mailbox.js.map +1 -1
  44. package/dist/cjs/ManagedRuntime.js +0 -2
  45. package/dist/cjs/ManagedRuntime.js.map +1 -1
  46. package/dist/cjs/Metric.js +6 -12
  47. package/dist/cjs/Metric.js.map +1 -1
  48. package/dist/cjs/Number.js +22 -61
  49. package/dist/cjs/Number.js.map +1 -1
  50. package/dist/cjs/Option.js +5 -0
  51. package/dist/cjs/Option.js.map +1 -1
  52. package/dist/cjs/Order.js +1 -0
  53. package/dist/cjs/Order.js.map +1 -1
  54. package/dist/cjs/Ordering.js +2 -7
  55. package/dist/cjs/Ordering.js.map +1 -1
  56. package/dist/cjs/Pool.js +1 -1
  57. package/dist/cjs/Predicate.js +36 -77
  58. package/dist/cjs/Predicate.js.map +1 -1
  59. package/dist/cjs/Random.js +1 -2
  60. package/dist/cjs/Random.js.map +1 -1
  61. package/dist/cjs/RcMap.js +5 -2
  62. package/dist/cjs/RcMap.js.map +1 -1
  63. package/dist/cjs/Record.js +28 -107
  64. package/dist/cjs/Record.js.map +1 -1
  65. package/dist/cjs/Redacted.js +3 -0
  66. package/dist/cjs/Redacted.js.map +1 -1
  67. package/dist/cjs/RegExp.js +2 -2
  68. package/dist/cjs/RegExp.js.map +1 -1
  69. package/dist/cjs/STM.js +3 -5
  70. package/dist/cjs/STM.js.map +1 -1
  71. package/dist/cjs/Schedule.js +2 -2
  72. package/dist/cjs/Schema.js +14 -13
  73. package/dist/cjs/Schema.js.map +1 -1
  74. package/dist/cjs/SchemaAST.js +0 -2
  75. package/dist/cjs/SchemaAST.js.map +1 -1
  76. package/dist/cjs/Sink.js +14 -10
  77. package/dist/cjs/Sink.js.map +1 -1
  78. package/dist/cjs/Stream.js +24 -25
  79. package/dist/cjs/Stream.js.map +1 -1
  80. package/dist/cjs/String.js +31 -2
  81. package/dist/cjs/String.js.map +1 -1
  82. package/dist/cjs/Struct.js +6 -0
  83. package/dist/cjs/Struct.js.map +1 -1
  84. package/dist/cjs/Symbol.js +1 -2
  85. package/dist/cjs/Symbol.js.map +1 -1
  86. package/dist/cjs/TestClock.js.map +1 -1
  87. package/dist/cjs/Trie.js +28 -0
  88. package/dist/cjs/Trie.js.map +1 -1
  89. package/dist/cjs/Tuple.js +9 -24
  90. package/dist/cjs/Tuple.js.map +1 -1
  91. package/dist/cjs/internal/matcher.js +1 -1
  92. package/dist/cjs/internal/matcher.js.map +1 -1
  93. package/dist/cjs/internal/version.js +1 -1
  94. package/dist/dts/Array.d.ts +1235 -1188
  95. package/dist/dts/Array.d.ts.map +1 -1
  96. package/dist/dts/BigDecimal.d.ts +61 -189
  97. package/dist/dts/BigDecimal.d.ts.map +1 -1
  98. package/dist/dts/BigInt.d.ts +57 -165
  99. package/dist/dts/BigInt.d.ts.map +1 -1
  100. package/dist/dts/Boolean.d.ts +28 -18
  101. package/dist/dts/Boolean.d.ts.map +1 -1
  102. package/dist/dts/Brand.d.ts +3 -3
  103. package/dist/dts/Brand.d.ts.map +1 -1
  104. package/dist/dts/Channel.d.ts +0 -6
  105. package/dist/dts/Channel.d.ts.map +1 -1
  106. package/dist/dts/Chunk.d.ts +15 -0
  107. package/dist/dts/Chunk.d.ts.map +1 -1
  108. package/dist/dts/Config.d.ts +0 -5
  109. package/dist/dts/Config.d.ts.map +1 -1
  110. package/dist/dts/Context.d.ts +26 -54
  111. package/dist/dts/Context.d.ts.map +1 -1
  112. package/dist/dts/Cron.d.ts +9 -23
  113. package/dist/dts/Cron.d.ts.map +1 -1
  114. package/dist/dts/Data.d.ts +8 -0
  115. package/dist/dts/Data.d.ts.map +1 -1
  116. package/dist/dts/DateTime.d.ts +6 -0
  117. package/dist/dts/DateTime.d.ts.map +1 -1
  118. package/dist/dts/Duration.d.ts +2 -2
  119. package/dist/dts/Effect.d.ts +153 -71
  120. package/dist/dts/Effect.d.ts.map +1 -1
  121. package/dist/dts/Either.d.ts +44 -57
  122. package/dist/dts/Either.d.ts.map +1 -1
  123. package/dist/dts/Encoding.d.ts +1 -1
  124. package/dist/dts/Equivalence.d.ts +1 -1
  125. package/dist/dts/Function.d.ts +55 -59
  126. package/dist/dts/Function.d.ts.map +1 -1
  127. package/dist/dts/HashMap.d.ts +0 -9
  128. package/dist/dts/HashMap.d.ts.map +1 -1
  129. package/dist/dts/Iterable.d.ts +13 -2
  130. package/dist/dts/Iterable.d.ts.map +1 -1
  131. package/dist/dts/List.d.ts +10 -0
  132. package/dist/dts/List.d.ts.map +1 -1
  133. package/dist/dts/Logger.d.ts +0 -6
  134. package/dist/dts/Logger.d.ts.map +1 -1
  135. package/dist/dts/Mailbox.d.ts +1 -0
  136. package/dist/dts/Mailbox.d.ts.map +1 -1
  137. package/dist/dts/ManagedRuntime.d.ts +0 -2
  138. package/dist/dts/ManagedRuntime.d.ts.map +1 -1
  139. package/dist/dts/Metric.d.ts +14 -20
  140. package/dist/dts/Metric.d.ts.map +1 -1
  141. package/dist/dts/Micro.d.ts +1 -1
  142. package/dist/dts/Number.d.ts +52 -155
  143. package/dist/dts/Number.d.ts.map +1 -1
  144. package/dist/dts/Option.d.ts +12 -0
  145. package/dist/dts/Option.d.ts.map +1 -1
  146. package/dist/dts/Order.d.ts +1 -0
  147. package/dist/dts/Order.d.ts.map +1 -1
  148. package/dist/dts/Ordering.d.ts +4 -17
  149. package/dist/dts/Ordering.d.ts.map +1 -1
  150. package/dist/dts/Pool.d.ts +1 -1
  151. package/dist/dts/Predicate.d.ts +56 -133
  152. package/dist/dts/Predicate.d.ts.map +1 -1
  153. package/dist/dts/Random.d.ts +1 -2
  154. package/dist/dts/Random.d.ts.map +1 -1
  155. package/dist/dts/RcMap.d.ts +15 -6
  156. package/dist/dts/RcMap.d.ts.map +1 -1
  157. package/dist/dts/Record.d.ts +68 -279
  158. package/dist/dts/Record.d.ts.map +1 -1
  159. package/dist/dts/Redacted.d.ts +3 -0
  160. package/dist/dts/Redacted.d.ts.map +1 -1
  161. package/dist/dts/RegExp.d.ts +2 -2
  162. package/dist/dts/RegExp.d.ts.map +1 -1
  163. package/dist/dts/STM.d.ts +5 -7
  164. package/dist/dts/STM.d.ts.map +1 -1
  165. package/dist/dts/Schedule.d.ts +7 -7
  166. package/dist/dts/Schema.d.ts +31 -25
  167. package/dist/dts/Schema.d.ts.map +1 -1
  168. package/dist/dts/SchemaAST.d.ts +0 -2
  169. package/dist/dts/SchemaAST.d.ts.map +1 -1
  170. package/dist/dts/Sink.d.ts +14 -10
  171. package/dist/dts/Sink.d.ts.map +1 -1
  172. package/dist/dts/Stream.d.ts +58 -62
  173. package/dist/dts/Stream.d.ts.map +1 -1
  174. package/dist/dts/String.d.ts +47 -2
  175. package/dist/dts/String.d.ts.map +1 -1
  176. package/dist/dts/Struct.d.ts +12 -0
  177. package/dist/dts/Struct.d.ts.map +1 -1
  178. package/dist/dts/Symbol.d.ts +1 -2
  179. package/dist/dts/Symbol.d.ts.map +1 -1
  180. package/dist/dts/TestClock.d.ts +2 -1
  181. package/dist/dts/TestClock.d.ts.map +1 -1
  182. package/dist/dts/Trie.d.ts +66 -0
  183. package/dist/dts/Trie.d.ts.map +1 -1
  184. package/dist/dts/Tuple.d.ts +21 -62
  185. package/dist/dts/Tuple.d.ts.map +1 -1
  186. package/dist/dts/Utils.d.ts +8 -8
  187. package/dist/esm/Array.js +474 -442
  188. package/dist/esm/Array.js.map +1 -1
  189. package/dist/esm/BigDecimal.js +31 -89
  190. package/dist/esm/BigDecimal.js.map +1 -1
  191. package/dist/esm/BigInt.js +27 -71
  192. package/dist/esm/BigInt.js.map +1 -1
  193. package/dist/esm/Boolean.js +12 -10
  194. package/dist/esm/Boolean.js.map +1 -1
  195. package/dist/esm/Brand.js +2 -0
  196. package/dist/esm/Brand.js.map +1 -1
  197. package/dist/esm/Channel.js +0 -2
  198. package/dist/esm/Channel.js.map +1 -1
  199. package/dist/esm/Chunk.js +4 -0
  200. package/dist/esm/Chunk.js.map +1 -1
  201. package/dist/esm/Config.js +0 -5
  202. package/dist/esm/Config.js.map +1 -1
  203. package/dist/esm/Context.js +14 -24
  204. package/dist/esm/Context.js.map +1 -1
  205. package/dist/esm/Cron.js +11 -25
  206. package/dist/esm/Cron.js.map +1 -1
  207. package/dist/esm/Data.js +7 -0
  208. package/dist/esm/Data.js.map +1 -1
  209. package/dist/esm/DateTime.js +2 -0
  210. package/dist/esm/DateTime.js.map +1 -1
  211. package/dist/esm/Duration.js +2 -2
  212. package/dist/esm/Effect.js +123 -53
  213. package/dist/esm/Effect.js.map +1 -1
  214. package/dist/esm/Either.js +22 -25
  215. package/dist/esm/Either.js.map +1 -1
  216. package/dist/esm/Encoding.js +1 -1
  217. package/dist/esm/Equivalence.js +1 -1
  218. package/dist/esm/Function.js +21 -24
  219. package/dist/esm/Function.js.map +1 -1
  220. package/dist/esm/HashMap.js +0 -3
  221. package/dist/esm/HashMap.js.map +1 -1
  222. package/dist/esm/Iterable.js +9 -2
  223. package/dist/esm/Iterable.js.map +1 -1
  224. package/dist/esm/List.js +2 -0
  225. package/dist/esm/List.js.map +1 -1
  226. package/dist/esm/Logger.js +0 -2
  227. package/dist/esm/Logger.js.map +1 -1
  228. package/dist/esm/Mailbox.js +1 -0
  229. package/dist/esm/Mailbox.js.map +1 -1
  230. package/dist/esm/ManagedRuntime.js +0 -2
  231. package/dist/esm/ManagedRuntime.js.map +1 -1
  232. package/dist/esm/Metric.js +6 -12
  233. package/dist/esm/Metric.js.map +1 -1
  234. package/dist/esm/Micro.js +1 -1
  235. package/dist/esm/Number.js +22 -61
  236. package/dist/esm/Number.js.map +1 -1
  237. package/dist/esm/Option.js +6 -0
  238. package/dist/esm/Option.js.map +1 -1
  239. package/dist/esm/Order.js +1 -0
  240. package/dist/esm/Order.js.map +1 -1
  241. package/dist/esm/Ordering.js +2 -7
  242. package/dist/esm/Ordering.js.map +1 -1
  243. package/dist/esm/Pool.js +1 -1
  244. package/dist/esm/Predicate.js +36 -77
  245. package/dist/esm/Predicate.js.map +1 -1
  246. package/dist/esm/Random.js +1 -2
  247. package/dist/esm/Random.js.map +1 -1
  248. package/dist/esm/RcMap.js +5 -2
  249. package/dist/esm/RcMap.js.map +1 -1
  250. package/dist/esm/Record.js +28 -107
  251. package/dist/esm/Record.js.map +1 -1
  252. package/dist/esm/Redacted.js +3 -0
  253. package/dist/esm/Redacted.js.map +1 -1
  254. package/dist/esm/RegExp.js +2 -2
  255. package/dist/esm/RegExp.js.map +1 -1
  256. package/dist/esm/STM.js +3 -5
  257. package/dist/esm/STM.js.map +1 -1
  258. package/dist/esm/Schedule.js +2 -2
  259. package/dist/esm/Schema.js +14 -13
  260. package/dist/esm/Schema.js.map +1 -1
  261. package/dist/esm/SchemaAST.js +0 -2
  262. package/dist/esm/SchemaAST.js.map +1 -1
  263. package/dist/esm/Sink.js +14 -10
  264. package/dist/esm/Sink.js.map +1 -1
  265. package/dist/esm/Stream.js +25 -25
  266. package/dist/esm/Stream.js.map +1 -1
  267. package/dist/esm/String.js +31 -2
  268. package/dist/esm/String.js.map +1 -1
  269. package/dist/esm/Struct.js +6 -0
  270. package/dist/esm/Struct.js.map +1 -1
  271. package/dist/esm/Symbol.js +1 -2
  272. package/dist/esm/Symbol.js.map +1 -1
  273. package/dist/esm/TestClock.js.map +1 -1
  274. package/dist/esm/Trie.js +28 -0
  275. package/dist/esm/Trie.js.map +1 -1
  276. package/dist/esm/Tuple.js +11 -30
  277. package/dist/esm/Tuple.js.map +1 -1
  278. package/dist/esm/internal/matcher.js +1 -1
  279. package/dist/esm/internal/matcher.js.map +1 -1
  280. package/dist/esm/internal/version.js +1 -1
  281. package/package.json +1 -1
  282. package/src/Array.ts +1235 -1188
  283. package/src/BigDecimal.ts +61 -189
  284. package/src/BigInt.ts +57 -165
  285. package/src/Boolean.ts +28 -18
  286. package/src/Brand.ts +3 -3
  287. package/src/Channel.ts +0 -6
  288. package/src/Chunk.ts +16 -0
  289. package/src/Config.ts +0 -5
  290. package/src/Context.ts +26 -54
  291. package/src/Cron.ts +11 -25
  292. package/src/Data.ts +8 -0
  293. package/src/DateTime.ts +6 -0
  294. package/src/Duration.ts +2 -2
  295. package/src/Effect.ts +153 -71
  296. package/src/Either.ts +45 -58
  297. package/src/Encoding.ts +1 -1
  298. package/src/Equivalence.ts +1 -1
  299. package/src/Function.ts +55 -59
  300. package/src/HashMap.ts +0 -9
  301. package/src/Iterable.ts +13 -2
  302. package/src/List.ts +12 -0
  303. package/src/Logger.ts +0 -6
  304. package/src/Mailbox.ts +1 -0
  305. package/src/ManagedRuntime.ts +0 -2
  306. package/src/Metric.ts +14 -20
  307. package/src/Micro.ts +1 -1
  308. package/src/Number.ts +52 -155
  309. package/src/Option.ts +12 -0
  310. package/src/Order.ts +1 -0
  311. package/src/Ordering.ts +4 -17
  312. package/src/Pool.ts +1 -1
  313. package/src/Predicate.ts +56 -133
  314. package/src/Random.ts +1 -2
  315. package/src/RcMap.ts +15 -6
  316. package/src/Record.ts +68 -279
  317. package/src/Redacted.ts +3 -0
  318. package/src/RegExp.ts +2 -2
  319. package/src/STM.ts +5 -7
  320. package/src/Schedule.ts +7 -7
  321. package/src/Schema.ts +31 -25
  322. package/src/SchemaAST.ts +0 -2
  323. package/src/Sink.ts +14 -10
  324. package/src/Stream.ts +56 -61
  325. package/src/String.ts +47 -2
  326. package/src/Struct.ts +12 -0
  327. package/src/Symbol.ts +1 -2
  328. package/src/TestClock.ts +2 -1
  329. package/src/Trie.ts +66 -0
  330. package/src/Tuple.ts +21 -62
  331. package/src/Utils.ts +8 -8
  332. package/src/internal/matcher.ts +1 -1
  333. package/src/internal/version.ts +1 -1
package/src/Function.ts CHANGED
@@ -14,10 +14,9 @@ export interface FunctionTypeLambda extends TypeLambda {
14
14
  /**
15
15
  * Tests if a value is a `function`.
16
16
  *
17
- * @param input - The value to test.
18
- *
19
17
  * @example
20
18
  * ```ts
19
+ * import * as assert from "node:assert"
21
20
  * import { isFunction } from "effect/Predicate"
22
21
  *
23
22
  * assert.deepStrictEqual(isFunction(isFunction), true)
@@ -42,13 +41,13 @@ export const isFunction = (input: unknown): input is Function => typeof input ==
42
41
  * takes an optional argument, you can use a predicate to determine if the
43
42
  * function is being used in a data-first or data-last style.
44
43
  *
45
- * @param arity - Either the arity of the uncurried function or a predicate
46
- * which determines if the function is being used in a data-first
47
- * or data-last style.
48
- * @param body - The definition of the uncurried function.
44
+ * You can pass either the arity of the uncurried function or a predicate
45
+ * which determines if the function is being used in a data-first or
46
+ * data-last style.
49
47
  *
50
48
  * @example
51
49
  * ```ts
50
+ * import * as assert from "node:assert"
52
51
  * import { dual, pipe } from "effect/Function"
53
52
  *
54
53
  * // Exampe using arity to determine data-first or data-last style
@@ -86,13 +85,13 @@ export const dual: {
86
85
  * takes an optional argument, you can use a predicate to determine if the
87
86
  * function is being used in a data-first or data-last style.
88
87
  *
89
- * @param arity - Either the arity of the uncurried function or a predicate
90
- * which determines if the function is being used in a data-first
91
- * or data-last style.
92
- * @param body - The definition of the uncurried function.
88
+ * You can pass either the arity of the uncurried function or a predicate
89
+ * which determines if the function is being used in a data-first or
90
+ * data-last style.
93
91
  *
94
92
  * @example
95
93
  * ```ts
94
+ * import * as assert from "node:assert"
96
95
  * import { dual, pipe } from "effect/Function"
97
96
  *
98
97
  * // Exampe using arity to determine data-first or data-last style
@@ -130,13 +129,13 @@ export const dual: {
130
129
  * takes an optional argument, you can use a predicate to determine if the
131
130
  * function is being used in a data-first or data-last style.
132
131
  *
133
- * @param arity - Either the arity of the uncurried function or a predicate
134
- * which determines if the function is being used in a data-first
135
- * or data-last style.
136
- * @param body - The definition of the uncurried function.
132
+ * You can pass either the arity of the uncurried function or a predicate
133
+ * which determines if the function is being used in a data-first or
134
+ * data-last style.
137
135
  *
138
136
  * @example
139
137
  * ```ts
138
+ * import * as assert from "node:assert"
140
139
  * import { dual, pipe } from "effect/Function"
141
140
  *
142
141
  * // Exampe using arity to determine data-first or data-last style
@@ -233,11 +232,9 @@ export const dual: {
233
232
  /**
234
233
  * Apply a function to a given value.
235
234
  *
236
- * @param a - The value that the function will be applied to.
237
- * @param self - The function to be applied to a value.
238
- *
239
235
  * @example
240
236
  * ```ts
237
+ * import * as assert from "node:assert"
241
238
  * import { pipe, apply } from "effect/Function"
242
239
  * import { length } from "effect/String"
243
240
  *
@@ -253,6 +250,7 @@ export const apply = <A>(a: A) => <B>(self: (a: A) => B): B => self(a)
253
250
  *
254
251
  * @example
255
252
  * ```ts
253
+ * import * as assert from "node:assert"
256
254
  * import { LazyArg, constant } from "effect/Function"
257
255
  *
258
256
  * const constNull: LazyArg<null> = constant(null)
@@ -267,6 +265,7 @@ export interface LazyArg<A> {
267
265
  /**
268
266
  * @example
269
267
  * ```ts
268
+ * import * as assert from "node:assert"
270
269
  * import { FunctionN } from "effect/Function"
271
270
  *
272
271
  * const sum: FunctionN<[number, number], number> = (a, b) => a + b
@@ -281,10 +280,9 @@ export interface FunctionN<A extends ReadonlyArray<unknown>, B> {
281
280
  /**
282
281
  * The identity function, i.e. A function that returns its input argument.
283
282
  *
284
- * @param a - The input argument.
285
- *
286
283
  * @example
287
284
  * ```ts
285
+ * import * as assert from "node:assert"
288
286
  * import { identity } from "effect/Function"
289
287
  *
290
288
  * assert.deepStrictEqual(identity(5), 5)
@@ -300,6 +298,7 @@ export const identity = <A>(a: A): A => a
300
298
  *
301
299
  * @example
302
300
  * ```ts
301
+ * import * as assert from "node:assert"
303
302
  * import { satisfies } from "effect/Function"
304
303
  *
305
304
  * const test1 = satisfies<number>()(5 as const)
@@ -318,10 +317,9 @@ export const satisfies = <A>() => <B extends A>(b: B) => b
318
317
  /**
319
318
  * Casts the result to the specified type.
320
319
  *
321
- * @param a - The value to be casted to the target type.
322
- *
323
320
  * @example
324
321
  * ```ts
322
+ * import * as assert from "node:assert"
325
323
  * import { unsafeCoerce, identity } from "effect/Function"
326
324
  *
327
325
  * assert.deepStrictEqual(unsafeCoerce, identity)
@@ -337,10 +335,9 @@ export const unsafeCoerce: <A, B>(a: A) => B = identity as any
337
335
  * This is useful when you want to pass a value to a higher-order function (a function that takes another function as its argument)
338
336
  * and want that inner function to always use the same value, no matter how many times it is called.
339
337
  *
340
- * @param value - The constant value to be returned.
341
- *
342
338
  * @example
343
339
  * ```ts
340
+ * import * as assert from "node:assert"
344
341
  * import { constant } from "effect/Function"
345
342
  *
346
343
  * const constNull = constant(null)
@@ -358,6 +355,7 @@ export const constant = <A>(value: A): LazyArg<A> => () => value
358
355
  *
359
356
  * @example
360
357
  * ```ts
358
+ * import * as assert from "node:assert"
361
359
  * import { constTrue } from "effect/Function"
362
360
  *
363
361
  * assert.deepStrictEqual(constTrue(), true)
@@ -372,6 +370,7 @@ export const constTrue: LazyArg<boolean> = constant(true)
372
370
  *
373
371
  * @example
374
372
  * ```ts
373
+ * import * as assert from "node:assert"
375
374
  * import { constFalse } from "effect/Function"
376
375
  *
377
376
  * assert.deepStrictEqual(constFalse(), false)
@@ -386,6 +385,7 @@ export const constFalse: LazyArg<boolean> = constant(false)
386
385
  *
387
386
  * @example
388
387
  * ```ts
388
+ * import * as assert from "node:assert"
389
389
  * import { constNull } from "effect/Function"
390
390
  *
391
391
  * assert.deepStrictEqual(constNull(), null)
@@ -400,6 +400,7 @@ export const constNull: LazyArg<null> = constant(null)
400
400
  *
401
401
  * @example
402
402
  * ```ts
403
+ * import * as assert from "node:assert"
403
404
  * import { constUndefined } from "effect/Function"
404
405
  *
405
406
  * assert.deepStrictEqual(constUndefined(), undefined)
@@ -414,6 +415,7 @@ export const constUndefined: LazyArg<undefined> = constant(undefined)
414
415
  *
415
416
  * @example
416
417
  * ```ts
418
+ * import * as assert from "node:assert"
417
419
  * import { constVoid } from "effect/Function"
418
420
  *
419
421
  * assert.deepStrictEqual(constVoid(), undefined)
@@ -426,10 +428,9 @@ export const constVoid: LazyArg<void> = constUndefined
426
428
  /**
427
429
  * Reverses the order of arguments for a curried function.
428
430
  *
429
- * @param f - A curried function that takes multiple arguments.
430
- *
431
431
  * @example
432
432
  * ```ts
433
+ * import * as assert from "node:assert"
433
434
  * import { flip } from "effect/Function"
434
435
  *
435
436
  * const f = (a: number) => (b: string) => a - b.length
@@ -449,11 +450,9 @@ export const flip = <A extends Array<unknown>, B extends Array<unknown>, C>(
449
450
  * Composes two functions, `ab` and `bc` into a single function that takes in an argument `a` of type `A` and returns a result of type `C`.
450
451
  * The result is obtained by first applying the `ab` function to `a` and then applying the `bc` function to the result of `ab`.
451
452
  *
452
- * @param ab - A function that maps from `A` to `B`.
453
- * @param bc - A function that maps from `B` to `C`.
454
- *
455
453
  * @example
456
454
  * ```ts
455
+ * import * as assert from "node:assert"
457
456
  * import { compose } from "effect/Function"
458
457
  *
459
458
  * const increment = (n: number) => n + 1;
@@ -469,11 +468,9 @@ export const compose: {
469
468
  * Composes two functions, `ab` and `bc` into a single function that takes in an argument `a` of type `A` and returns a result of type `C`.
470
469
  * The result is obtained by first applying the `ab` function to `a` and then applying the `bc` function to the result of `ab`.
471
470
  *
472
- * @param ab - A function that maps from `A` to `B`.
473
- * @param bc - A function that maps from `B` to `C`.
474
- *
475
471
  * @example
476
472
  * ```ts
473
+ * import * as assert from "node:assert"
477
474
  * import { compose } from "effect/Function"
478
475
  *
479
476
  * const increment = (n: number) => n + 1;
@@ -489,11 +486,9 @@ export const compose: {
489
486
  * Composes two functions, `ab` and `bc` into a single function that takes in an argument `a` of type `A` and returns a result of type `C`.
490
487
  * The result is obtained by first applying the `ab` function to `a` and then applying the `bc` function to the result of `ab`.
491
488
  *
492
- * @param ab - A function that maps from `A` to `B`.
493
- * @param bc - A function that maps from `B` to `C`.
494
- *
495
489
  * @example
496
490
  * ```ts
491
+ * import * as assert from "node:assert"
497
492
  * import { compose } from "effect/Function"
498
493
  *
499
494
  * const increment = (n: number) => n + 1;
@@ -520,10 +515,11 @@ export const absurd = <A>(_: never): A => {
520
515
  }
521
516
 
522
517
  /**
523
- * Creates a tupled version of this function: instead of `n` arguments, it accepts a single tuple argument.
518
+ * Creates a version of this function: instead of `n` arguments, it accepts a single tuple argument.
524
519
  *
525
520
  * @example
526
521
  * ```ts
522
+ * import * as assert from "node:assert"
527
523
  * import { tupled } from "effect/Function"
528
524
  *
529
525
  * const sumTupled = tupled((x: number, y: number): number => x + y)
@@ -540,6 +536,7 @@ export const tupled = <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => B):
540
536
  *
541
537
  * @example
542
538
  * ```ts
539
+ * import * as assert from "node:assert"
543
540
  * import { untupled } from "effect/Function"
544
541
  *
545
542
  * const getFirst = untupled(<A, B>(tuple: [A, B]): A => tuple[0])
@@ -554,23 +551,6 @@ export const untupled = <A extends ReadonlyArray<unknown>, B>(f: (a: A) => B): (
554
551
  /**
555
552
  * Pipes the value of an expression into a pipeline of functions.
556
553
  *
557
- * **When to Use**
558
- *
559
- * This is useful in combination with data-last functions as a simulation of
560
- * methods:
561
- *
562
- * ```ts
563
- * as.map(f).filter(g)
564
- * ```
565
- *
566
- * becomes:
567
- *
568
- * ```ts
569
- * import { pipe, Array } from "effect"
570
- *
571
- * pipe(as, Array.map(f), Array.filter(g))
572
- * ```
573
- *
574
554
  * **Details**
575
555
  *
576
556
  * The `pipe` function is a utility that allows us to compose functions in a
@@ -578,7 +558,7 @@ export const untupled = <A extends ReadonlyArray<unknown>, B>(f: (a: A) => B): (
578
558
  * passes it as the input to the next function in the pipeline. This enables us
579
559
  * to build complex transformations by chaining multiple functions together.
580
560
  *
581
- * ```ts
561
+ * ```ts skip-type-checking
582
562
  * import { pipe } from "effect"
583
563
  *
584
564
  * const result = pipe(input, func1, func2, ..., funcN)
@@ -591,7 +571,7 @@ export const untupled = <A extends ReadonlyArray<unknown>, B>(f: (a: A) => B): (
591
571
  *
592
572
  * Here's an illustration of how `pipe` works:
593
573
  *
594
- * ```text
574
+ * ```
595
575
  * ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌────────┐
596
576
  * │ input │───►│ func1 │───►│ func2 │───►│ ... │───►│ funcN │───►│ result │
597
577
  * └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ └────────┘
@@ -600,9 +580,26 @@ export const untupled = <A extends ReadonlyArray<unknown>, B>(f: (a: A) => B): (
600
580
  * It's important to note that functions passed to `pipe` must have a **single
601
581
  * argument** because they are only called with a single argument.
602
582
  *
603
- * @example
583
+ * **When to Use**
584
+ *
585
+ * This is useful in combination with data-last functions as a simulation of
586
+ * methods:
587
+ *
588
+ * ```ts skip-type-checking
589
+ * as.map(f).filter(g)
590
+ * ```
591
+ *
592
+ * becomes:
593
+ *
594
+ * ```ts skip-type-checking
595
+ * import { pipe, Array } from "effect"
596
+ *
597
+ * pipe(as, Array.map(f), Array.filter(g))
598
+ * ```
599
+ *
600
+ * **Example** (Chaining Arithmetic Operations)
601
+ *
604
602
  * ```ts
605
- * // Example: Chaining Arithmetic Operations
606
603
  * import { pipe } from "effect"
607
604
  *
608
605
  * // Define simple arithmetic operations
@@ -1114,6 +1111,7 @@ export function pipe(
1114
1111
  *
1115
1112
  * @example
1116
1113
  * ```ts
1114
+ * import * as assert from "node:assert"
1117
1115
  * import { flow } from "effect/Function"
1118
1116
  *
1119
1117
  * const len = (s: string): number => s.length
@@ -1304,11 +1302,9 @@ export const hole: <T>() => T = unsafeCoerce(absurd)
1304
1302
  *
1305
1303
  * This function is useful for discarding the first argument passed to it and returning the second argument.
1306
1304
  *
1307
- * @param _ - The first argument to be discarded.
1308
- * @param b - The second argument to be returned.
1309
- *
1310
1305
  * @example
1311
1306
  * ```ts
1307
+ * import * as assert from "node:assert"
1312
1308
  * import { SK } from "effect/Function";
1313
1309
  *
1314
1310
  * assert.deepStrictEqual(SK(0, "hello"), "hello")
package/src/HashMap.ts CHANGED
@@ -754,9 +754,6 @@ export const findFirst: {
754
754
  /**
755
755
  * Checks if any entry in a hashmap meets a specific condition.
756
756
  *
757
- * @param self - The hashmap to check.
758
- * @param predicate - The condition to test entries (value, key).
759
- *
760
757
  * @since 3.13.0
761
758
  * @category elements
762
759
  */
@@ -764,9 +761,6 @@ export const some: {
764
761
  /**
765
762
  * Checks if any entry in a hashmap meets a specific condition.
766
763
  *
767
- * @param self - The hashmap to check.
768
- * @param predicate - The condition to test entries (value, key).
769
- *
770
764
  * @since 3.13.0
771
765
  * @category elements
772
766
  */
@@ -774,9 +768,6 @@ export const some: {
774
768
  /**
775
769
  * Checks if any entry in a hashmap meets a specific condition.
776
770
  *
777
- * @param self - The hashmap to check.
778
- * @param predicate - The condition to test entries (value, key).
779
- *
780
771
  * @since 3.13.0
781
772
  * @category elements
782
773
  */
package/src/Iterable.ts CHANGED
@@ -25,6 +25,7 @@ import type { NoInfer } from "./Types.js"
25
25
  *
26
26
  * @example
27
27
  * ```ts
28
+ * import * as assert from "node:assert"
28
29
  * import { makeBy } from "effect/Iterable"
29
30
  *
30
31
  * assert.deepStrictEqual(Array.from(makeBy(n => n * 2, { length: 5 })), [0, 2, 4, 6, 8])
@@ -59,6 +60,7 @@ export const makeBy = <A>(f: (i: number) => A, options?: {
59
60
  *
60
61
  * @example
61
62
  * ```ts
63
+ * import * as assert from "node:assert"
62
64
  * import { range } from "effect/Iterable"
63
65
  *
64
66
  * assert.deepStrictEqual(Array.from(range(1, 3)), [1, 2, 3])
@@ -83,6 +85,7 @@ export const range = (start: number, end?: number): Iterable<number> => {
83
85
  *
84
86
  * @example
85
87
  * ```ts
88
+ * import * as assert from "node:assert"
86
89
  * import { replicate } from "effect/Iterable"
87
90
  *
88
91
  * assert.deepStrictEqual(Array.from(replicate("a", 3)), ["a", "a", "a"])
@@ -99,6 +102,7 @@ export const replicate: {
99
102
  *
100
103
  * @example
101
104
  * ```ts
105
+ * import * as assert from "node:assert"
102
106
  * import { replicate } from "effect/Iterable"
103
107
  *
104
108
  * assert.deepStrictEqual(Array.from(replicate("a", 3)), ["a", "a", "a"])
@@ -115,6 +119,7 @@ export const replicate: {
115
119
  *
116
120
  * @example
117
121
  * ```ts
122
+ * import * as assert from "node:assert"
118
123
  * import { replicate } from "effect/Iterable"
119
124
  *
120
125
  * assert.deepStrictEqual(Array.from(replicate("a", 3)), ["a", "a", "a"])
@@ -129,10 +134,9 @@ export const replicate: {
129
134
  /**
130
135
  * Takes a record and returns an Iterable of tuples containing its keys and values.
131
136
  *
132
- * @param self - The record to transform.
133
- *
134
137
  * @example
135
138
  * ```ts
139
+ * import * as assert from "node:assert"
136
140
  * import { fromRecord } from "effect/Iterable"
137
141
  *
138
142
  * const x = { a: 1, b: 2, c: 3 }
@@ -180,6 +184,7 @@ export const prepend: {
180
184
  *
181
185
  * @example
182
186
  * ```ts
187
+ * import * as assert from "node:assert"
183
188
  * import { Iterable } from "effect"
184
189
  *
185
190
  * assert.deepStrictEqual(
@@ -197,6 +202,7 @@ export const prependAll: {
197
202
  *
198
203
  * @example
199
204
  * ```ts
205
+ * import * as assert from "node:assert"
200
206
  * import { Iterable } from "effect"
201
207
  *
202
208
  * assert.deepStrictEqual(
@@ -214,6 +220,7 @@ export const prependAll: {
214
220
  *
215
221
  * @example
216
222
  * ```ts
223
+ * import * as assert from "node:assert"
217
224
  * import { Iterable } from "effect"
218
225
  *
219
226
  * assert.deepStrictEqual(
@@ -346,6 +353,7 @@ export const scan: {
346
353
  *
347
354
  * @example
348
355
  * ```ts
356
+ * import * as assert from "node:assert"
349
357
  * import { isEmpty } from "effect/Iterable"
350
358
  *
351
359
  * assert.deepStrictEqual(isEmpty([]), true);
@@ -1197,6 +1205,7 @@ export const filterMapWhile: {
1197
1205
  *
1198
1206
  * @example
1199
1207
  * ```ts
1208
+ * import * as assert from "node:assert"
1200
1209
  * import { Iterable, Option } from "effect"
1201
1210
  *
1202
1211
  * assert.deepStrictEqual(
@@ -1215,6 +1224,7 @@ export const getSomes: <A>(self: Iterable<Option<A>>) => Iterable<A> = filterMap
1215
1224
  *
1216
1225
  * @example
1217
1226
  * ```ts
1227
+ * import * as assert from "node:assert"
1218
1228
  * import { Iterable, Either } from "effect"
1219
1229
  *
1220
1230
  * assert.deepStrictEqual(
@@ -1233,6 +1243,7 @@ export const getLefts = <R, L>(self: Iterable<Either<R, L>>): Iterable<L> => fil
1233
1243
  *
1234
1244
  * @example
1235
1245
  * ```ts
1246
+ * import * as assert from "node:assert"
1236
1247
  * import { Iterable, Either } from "effect"
1237
1248
  *
1238
1249
  * assert.deepStrictEqual(
package/src/List.ts CHANGED
@@ -350,6 +350,7 @@ export const append: {
350
350
  *
351
351
  * @example
352
352
  * ```ts
353
+ * import * as assert from "node:assert"
353
354
  * import { List } from "effect"
354
355
  *
355
356
  * assert.deepStrictEqual(
@@ -368,6 +369,7 @@ export const appendAll: {
368
369
  *
369
370
  * @example
370
371
  * ```ts
372
+ * import * as assert from "node:assert"
371
373
  * import { List } from "effect"
372
374
  *
373
375
  * assert.deepStrictEqual(
@@ -386,6 +388,7 @@ export const appendAll: {
386
388
  *
387
389
  * @example
388
390
  * ```ts
391
+ * import * as assert from "node:assert"
389
392
  * import { List } from "effect"
390
393
  *
391
394
  * assert.deepStrictEqual(
@@ -404,6 +407,7 @@ export const appendAll: {
404
407
  *
405
408
  * @example
406
409
  * ```ts
410
+ * import * as assert from "node:assert"
407
411
  * import { List } from "effect"
408
412
  *
409
413
  * assert.deepStrictEqual(
@@ -422,6 +426,7 @@ export const appendAll: {
422
426
  *
423
427
  * @example
424
428
  * ```ts
429
+ * import * as assert from "node:assert"
425
430
  * import { List } from "effect"
426
431
  *
427
432
  * assert.deepStrictEqual(
@@ -471,6 +476,7 @@ A | B>(element, self))
471
476
  *
472
477
  * @example
473
478
  * ```ts
479
+ * import * as assert from "node:assert"
474
480
  * import { List } from "effect"
475
481
  *
476
482
  * assert.deepStrictEqual(
@@ -489,6 +495,7 @@ export const prependAll: {
489
495
  *
490
496
  * @example
491
497
  * ```ts
498
+ * import * as assert from "node:assert"
492
499
  * import { List } from "effect"
493
500
  *
494
501
  * assert.deepStrictEqual(
@@ -507,6 +514,7 @@ export const prependAll: {
507
514
  *
508
515
  * @example
509
516
  * ```ts
517
+ * import * as assert from "node:assert"
510
518
  * import { List } from "effect"
511
519
  *
512
520
  * assert.deepStrictEqual(
@@ -525,6 +533,7 @@ export const prependAll: {
525
533
  *
526
534
  * @example
527
535
  * ```ts
536
+ * import * as assert from "node:assert"
528
537
  * import { List } from "effect"
529
538
  *
530
539
  * assert.deepStrictEqual(
@@ -543,6 +552,7 @@ export const prependAll: {
543
552
  *
544
553
  * @example
545
554
  * ```ts
555
+ * import * as assert from "node:assert"
546
556
  * import { List } from "effect"
547
557
  *
548
558
  * assert.deepStrictEqual(
@@ -567,6 +577,7 @@ export const prependAll: {
567
577
  *
568
578
  * @example
569
579
  * ```ts
580
+ * import * as assert from "node:assert"
570
581
  * import { List } from "effect"
571
582
  *
572
583
  * assert.deepStrictEqual(
@@ -588,6 +599,7 @@ export const prependAll: {
588
599
  *
589
600
  * @example
590
601
  * ```ts
602
+ * import * as assert from "node:assert"
591
603
  * import { List } from "effect"
592
604
  *
593
605
  * assert.deepStrictEqual(
package/src/Logger.ts CHANGED
@@ -215,8 +215,6 @@ export const map: {
215
215
  * Creates a batched logger that groups log messages together and processes them
216
216
  * in intervals.
217
217
  *
218
- * @param window - The time window in which to batch log messages.
219
- *
220
218
  * @example
221
219
  * ```ts
222
220
  * import { Console, Effect, Logger } from "effect"
@@ -250,8 +248,6 @@ export const batched: {
250
248
  * Creates a batched logger that groups log messages together and processes them
251
249
  * in intervals.
252
250
  *
253
- * @param window - The time window in which to batch log messages.
254
- *
255
251
  * @example
256
252
  * ```ts
257
253
  * import { Console, Effect, Logger } from "effect"
@@ -288,8 +284,6 @@ export const batched: {
288
284
  * Creates a batched logger that groups log messages together and processes them
289
285
  * in intervals.
290
286
  *
291
- * @param window - The time window in which to batch log messages.
292
- *
293
287
  * @example
294
288
  * ```ts
295
289
  * import { Console, Effect, Logger } from "effect"
package/src/Mailbox.ts CHANGED
@@ -179,6 +179,7 @@ export interface ReadonlyMailbox<out A, out E = never>
179
179
  * @category constructors
180
180
  * @example
181
181
  * ```ts
182
+ * import * as assert from "node:assert"
182
183
  * import { Effect, Mailbox } from "effect"
183
184
  *
184
185
  * Effect.gen(function*() {
@@ -25,8 +25,6 @@ export type TypeId = typeof TypeId
25
25
  /**
26
26
  * Checks if the provided argument is a `ManagedRuntime`.
27
27
  *
28
- * @param input - The value to be checked if it is a `ManagedRuntime`.
29
-
30
28
  * @since 3.9.0
31
29
  * @category guards
32
30
  */