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/Either.ts CHANGED
@@ -142,6 +142,7 @@ export const left: <L>(left: L) => Either<never, L> = either.left
142
142
  *
143
143
  * @example
144
144
  * ```ts
145
+ * import * as assert from "node:assert"
145
146
  * import { Either } from "effect"
146
147
  *
147
148
  * assert.deepStrictEqual(Either.fromNullable(1, () => 'fallback'), Either.right(1))
@@ -158,6 +159,7 @@ export const fromNullable: {
158
159
  *
159
160
  * @example
160
161
  * ```ts
162
+ * import * as assert from "node:assert"
161
163
  * import { Either } from "effect"
162
164
  *
163
165
  * assert.deepStrictEqual(Either.fromNullable(1, () => 'fallback'), Either.right(1))
@@ -174,6 +176,7 @@ export const fromNullable: {
174
176
  *
175
177
  * @example
176
178
  * ```ts
179
+ * import * as assert from "node:assert"
177
180
  * import { Either } from "effect"
178
181
  *
179
182
  * assert.deepStrictEqual(Either.fromNullable(1, () => 'fallback'), Either.right(1))
@@ -193,6 +196,7 @@ export const fromNullable: {
193
196
  /**
194
197
  * @example
195
198
  * ```ts
199
+ * import * as assert from "node:assert"
196
200
  * import { Either, Option } from "effect"
197
201
  *
198
202
  * assert.deepStrictEqual(Either.fromOption(Option.some(1), () => 'error'), Either.right(1))
@@ -206,6 +210,7 @@ export const fromOption: {
206
210
  /**
207
211
  * @example
208
212
  * ```ts
213
+ * import * as assert from "node:assert"
209
214
  * import { Either, Option } from "effect"
210
215
  *
211
216
  * assert.deepStrictEqual(Either.fromOption(Option.some(1), () => 'error'), Either.right(1))
@@ -219,6 +224,7 @@ export const fromOption: {
219
224
  /**
220
225
  * @example
221
226
  * ```ts
227
+ * import * as assert from "node:assert"
222
228
  * import { Either, Option } from "effect"
223
229
  *
224
230
  * assert.deepStrictEqual(Either.fromOption(Option.some(1), () => 'error'), Either.right(1))
@@ -274,10 +280,9 @@ export {
274
280
  /**
275
281
  * Tests if a value is a `Either`.
276
282
  *
277
- * @param input - The value to test.
278
- *
279
283
  * @example
280
284
  * ```ts
285
+ * import * as assert from "node:assert"
281
286
  * import { Either } from "effect"
282
287
  *
283
288
  * assert.deepStrictEqual(Either.isEither(Either.right(1)), true)
@@ -293,10 +298,9 @@ export const isEither: (input: unknown) => input is Either<unknown, unknown> = e
293
298
  /**
294
299
  * Determine if a `Either` is a `Left`.
295
300
  *
296
- * @param self - The `Either` to check.
297
- *
298
301
  * @example
299
302
  * ```ts
303
+ * import * as assert from "node:assert"
300
304
  * import { Either } from "effect"
301
305
  *
302
306
  * assert.deepStrictEqual(Either.isLeft(Either.right(1)), false)
@@ -311,10 +315,9 @@ export const isLeft: <R, L>(self: Either<R, L>) => self is Left<L, R> = either.i
311
315
  /**
312
316
  * Determine if a `Either` is a `Right`.
313
317
  *
314
- * @param self - The `Either` to check.
315
- *
316
318
  * @example
317
319
  * ```ts
320
+ * import * as assert from "node:assert"
318
321
  * import { Either } from "effect"
319
322
  *
320
323
  * assert.deepStrictEqual(Either.isRight(Either.right(1)), true)
@@ -331,6 +334,7 @@ export const isRight: <R, L>(self: Either<R, L>) => self is Right<L, R> = either
331
334
  *
332
335
  * @example
333
336
  * ```ts
337
+ * import * as assert from "node:assert"
334
338
  * import { Either, Option } from "effect"
335
339
  *
336
340
  * assert.deepStrictEqual(Either.getRight(Either.right('ok')), Option.some('ok'))
@@ -347,6 +351,7 @@ export const getRight: <R, L>(self: Either<R, L>) => Option<R> = either.getRight
347
351
  *
348
352
  * @example
349
353
  * ```ts
354
+ * import * as assert from "node:assert"
350
355
  * import { Either, Option } from "effect"
351
356
  *
352
357
  * assert.deepStrictEqual(Either.getLeft(Either.right('ok')), Option.none())
@@ -409,9 +414,6 @@ export const mapBoth: {
409
414
  /**
410
415
  * Maps the `Left` side of an `Either` value to a new `Either` value.
411
416
  *
412
- * @param self - The input `Either` value to map.
413
- * @param f - A transformation function to apply to the `Left` value of the input `Either`.
414
- *
415
417
  * @category mapping
416
418
  * @since 2.0.0
417
419
  */
@@ -419,9 +421,6 @@ export const mapLeft: {
419
421
  /**
420
422
  * Maps the `Left` side of an `Either` value to a new `Either` value.
421
423
  *
422
- * @param self - The input `Either` value to map.
423
- * @param f - A transformation function to apply to the `Left` value of the input `Either`.
424
- *
425
424
  * @category mapping
426
425
  * @since 2.0.0
427
426
  */
@@ -429,9 +428,6 @@ export const mapLeft: {
429
428
  /**
430
429
  * Maps the `Left` side of an `Either` value to a new `Either` value.
431
430
  *
432
- * @param self - The input `Either` value to map.
433
- * @param f - A transformation function to apply to the `Left` value of the input `Either`.
434
- *
435
431
  * @category mapping
436
432
  * @since 2.0.0
437
433
  */
@@ -445,9 +441,6 @@ export const mapLeft: {
445
441
  /**
446
442
  * Maps the `Right` side of an `Either` value to a new `Either` value.
447
443
  *
448
- * @param self - An `Either` to map
449
- * @param f - The function to map over the value of the `Either`
450
- *
451
444
  * @category mapping
452
445
  * @since 2.0.0
453
446
  */
@@ -455,9 +448,6 @@ export const map: {
455
448
  /**
456
449
  * Maps the `Right` side of an `Either` value to a new `Either` value.
457
450
  *
458
- * @param self - An `Either` to map
459
- * @param f - The function to map over the value of the `Either`
460
- *
461
451
  * @category mapping
462
452
  * @since 2.0.0
463
453
  */
@@ -465,9 +455,6 @@ export const map: {
465
455
  /**
466
456
  * Maps the `Right` side of an `Either` value to a new `Either` value.
467
457
  *
468
- * @param self - An `Either` to map
469
- * @param f - The function to map over the value of the `Either`
470
- *
471
458
  * @category mapping
472
459
  * @since 2.0.0
473
460
  */
@@ -484,6 +471,7 @@ export const map: {
484
471
  *
485
472
  * @example
486
473
  * ```ts
474
+ * import * as assert from "node:assert"
487
475
  * import { pipe, Either } from "effect"
488
476
  *
489
477
  * const onLeft = (strings: ReadonlyArray<string>): string => `strings: ${strings.join(', ')}`
@@ -507,6 +495,7 @@ export const match: {
507
495
  *
508
496
  * @example
509
497
  * ```ts
498
+ * import * as assert from "node:assert"
510
499
  * import { pipe, Either } from "effect"
511
500
  *
512
501
  * const onLeft = (strings: ReadonlyArray<string>): string => `strings: ${strings.join(', ')}`
@@ -535,6 +524,7 @@ export const match: {
535
524
  *
536
525
  * @example
537
526
  * ```ts
527
+ * import * as assert from "node:assert"
538
528
  * import { pipe, Either } from "effect"
539
529
  *
540
530
  * const onLeft = (strings: ReadonlyArray<string>): string => `strings: ${strings.join(', ')}`
@@ -570,10 +560,9 @@ export const match: {
570
560
  * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
571
561
  * or `Left` of the result of the provided function if the predicate returns false
572
562
  *
573
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
574
- *
575
563
  * @example
576
564
  * ```ts
565
+ * import * as assert from "node:assert"
577
566
  * import { pipe, Either } from "effect"
578
567
  *
579
568
  * const isPositive = (n: number): boolean => n > 0
@@ -602,10 +591,9 @@ export const liftPredicate: {
602
591
  * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
603
592
  * or `Left` of the result of the provided function if the predicate returns false
604
593
  *
605
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
606
- *
607
594
  * @example
608
595
  * ```ts
596
+ * import * as assert from "node:assert"
609
597
  * import { pipe, Either } from "effect"
610
598
  *
611
599
  * const isPositive = (n: number): boolean => n > 0
@@ -634,10 +622,9 @@ export const liftPredicate: {
634
622
  * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
635
623
  * or `Left` of the result of the provided function if the predicate returns false
636
624
  *
637
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
638
- *
639
625
  * @example
640
626
  * ```ts
627
+ * import * as assert from "node:assert"
641
628
  * import { pipe, Either } from "effect"
642
629
  *
643
630
  * const isPositive = (n: number): boolean => n > 0
@@ -666,10 +653,9 @@ export const liftPredicate: {
666
653
  * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
667
654
  * or `Left` of the result of the provided function if the predicate returns false
668
655
  *
669
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
670
- *
671
656
  * @example
672
657
  * ```ts
658
+ * import * as assert from "node:assert"
673
659
  * import { pipe, Either } from "effect"
674
660
  *
675
661
  * const isPositive = (n: number): boolean => n > 0
@@ -698,10 +684,9 @@ export const liftPredicate: {
698
684
  * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
699
685
  * or `Left` of the result of the provided function if the predicate returns false
700
686
  *
701
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
702
- *
703
687
  * @example
704
688
  * ```ts
689
+ * import * as assert from "node:assert"
705
690
  * import { pipe, Either } from "effect"
706
691
  *
707
692
  * const isPositive = (n: number): boolean => n > 0
@@ -742,6 +727,7 @@ export const liftPredicate: {
742
727
  *
743
728
  * @example
744
729
  * ```ts
730
+ * import * as assert from "node:assert"
745
731
  * import { pipe, Either } from "effect"
746
732
  *
747
733
  * const isPositive = (n: number): boolean => n > 0
@@ -772,6 +758,7 @@ export const filterOrLeft: {
772
758
  *
773
759
  * @example
774
760
  * ```ts
761
+ * import * as assert from "node:assert"
775
762
  * import { pipe, Either } from "effect"
776
763
  *
777
764
  * const isPositive = (n: number): boolean => n > 0
@@ -805,6 +792,7 @@ export const filterOrLeft: {
805
792
  *
806
793
  * @example
807
794
  * ```ts
795
+ * import * as assert from "node:assert"
808
796
  * import { pipe, Either } from "effect"
809
797
  *
810
798
  * const isPositive = (n: number): boolean => n > 0
@@ -835,6 +823,7 @@ export const filterOrLeft: {
835
823
  *
836
824
  * @example
837
825
  * ```ts
826
+ * import * as assert from "node:assert"
838
827
  * import { pipe, Either } from "effect"
839
828
  *
840
829
  * const isPositive = (n: number): boolean => n > 0
@@ -869,6 +858,7 @@ export const filterOrLeft: {
869
858
  *
870
859
  * @example
871
860
  * ```ts
861
+ * import * as assert from "node:assert"
872
862
  * import { pipe, Either } from "effect"
873
863
  *
874
864
  * const isPositive = (n: number): boolean => n > 0
@@ -913,6 +903,7 @@ export const merge: <R, L>(self: Either<R, L>) => L | R = match({
913
903
  *
914
904
  * @example
915
905
  * ```ts
906
+ * import * as assert from "node:assert"
916
907
  * import { Either } from "effect"
917
908
  *
918
909
  * assert.deepStrictEqual(Either.getOrElse(Either.right(1), (error) => error + "!"), 1)
@@ -928,6 +919,7 @@ export const getOrElse: {
928
919
  *
929
920
  * @example
930
921
  * ```ts
922
+ * import * as assert from "node:assert"
931
923
  * import { Either } from "effect"
932
924
  *
933
925
  * assert.deepStrictEqual(Either.getOrElse(Either.right(1), (error) => error + "!"), 1)
@@ -943,6 +935,7 @@ export const getOrElse: {
943
935
  *
944
936
  * @example
945
937
  * ```ts
938
+ * import * as assert from "node:assert"
946
939
  * import { Either } from "effect"
947
940
  *
948
941
  * assert.deepStrictEqual(Either.getOrElse(Either.right(1), (error) => error + "!"), 1)
@@ -961,6 +954,7 @@ export const getOrElse: {
961
954
  /**
962
955
  * @example
963
956
  * ```ts
957
+ * import * as assert from "node:assert"
964
958
  * import { Either } from "effect"
965
959
  *
966
960
  * assert.deepStrictEqual(Either.getOrNull(Either.right(1)), 1)
@@ -975,6 +969,7 @@ export const getOrNull: <R, L>(self: Either<R, L>) => R | null = getOrElse(const
975
969
  /**
976
970
  * @example
977
971
  * ```ts
972
+ * import * as assert from "node:assert"
978
973
  * import { Either } from "effect"
979
974
  *
980
975
  * assert.deepStrictEqual(Either.getOrUndefined(Either.right(1)), 1)
@@ -991,11 +986,9 @@ export const getOrUndefined: <R, L>(self: Either<R, L>) => R | undefined = getOr
991
986
  *
992
987
  * If a default error is sufficient for your use case and you don't need to configure the thrown error, see {@link getOrThrow}.
993
988
  *
994
- * @param self - The `Either` to extract the value from.
995
- * @param onLeft - A function that will be called if the `Either` is `Left`. It returns the error to be thrown.
996
- *
997
989
  * @example
998
990
  * ```ts
991
+ * import * as assert from "node:assert"
999
992
  * import { Either } from "effect"
1000
993
  *
1001
994
  * assert.deepStrictEqual(
@@ -1014,11 +1007,9 @@ export const getOrThrowWith: {
1014
1007
  *
1015
1008
  * If a default error is sufficient for your use case and you don't need to configure the thrown error, see {@link getOrThrow}.
1016
1009
  *
1017
- * @param self - The `Either` to extract the value from.
1018
- * @param onLeft - A function that will be called if the `Either` is `Left`. It returns the error to be thrown.
1019
- *
1020
1010
  * @example
1021
1011
  * ```ts
1012
+ * import * as assert from "node:assert"
1022
1013
  * import { Either } from "effect"
1023
1014
  *
1024
1015
  * assert.deepStrictEqual(
@@ -1037,11 +1028,9 @@ export const getOrThrowWith: {
1037
1028
  *
1038
1029
  * If a default error is sufficient for your use case and you don't need to configure the thrown error, see {@link getOrThrow}.
1039
1030
  *
1040
- * @param self - The `Either` to extract the value from.
1041
- * @param onLeft - A function that will be called if the `Either` is `Left`. It returns the error to be thrown.
1042
- *
1043
1031
  * @example
1044
1032
  * ```ts
1033
+ * import * as assert from "node:assert"
1045
1034
  * import { Either } from "effect"
1046
1035
  *
1047
1036
  * assert.deepStrictEqual(
@@ -1068,17 +1057,17 @@ export const getOrThrowWith: {
1068
1057
  *
1069
1058
  * The thrown error is a default error. To configure the error thrown, see {@link getOrThrowWith}.
1070
1059
  *
1071
- * @param self - The `Either` to extract the value from.
1072
- * @throws `Error("getOrThrow called on a Left")`
1073
- *
1074
1060
  * @example
1075
1061
  * ```ts
1062
+ * import * as assert from "node:assert"
1076
1063
  * import { Either } from "effect"
1077
1064
  *
1078
1065
  * assert.deepStrictEqual(Either.getOrThrow(Either.right(1)), 1)
1079
1066
  * assert.throws(() => Either.getOrThrow(Either.left("error")))
1080
1067
  * ```
1081
1068
  *
1069
+ * @throws `Error("getOrThrow called on a Left")`
1070
+ *
1082
1071
  * @category getters
1083
1072
  * @since 2.0.0
1084
1073
  */
@@ -1089,9 +1078,6 @@ export const getOrThrow: <R, L>(self: Either<R, L>) => R = getOrThrowWith(() =>
1089
1078
  /**
1090
1079
  * Returns `self` if it is a `Right` or `that` otherwise.
1091
1080
  *
1092
- * @param self - The input `Either` value to check and potentially return.
1093
- * @param that - A function that takes the error value from `self` (if it's a `Left`) and returns a new `Either` value.
1094
- *
1095
1081
  * @category error handling
1096
1082
  * @since 2.0.0
1097
1083
  */
@@ -1099,9 +1085,6 @@ export const orElse: {
1099
1085
  /**
1100
1086
  * Returns `self` if it is a `Right` or `that` otherwise.
1101
1087
  *
1102
- * @param self - The input `Either` value to check and potentially return.
1103
- * @param that - A function that takes the error value from `self` (if it's a `Left`) and returns a new `Either` value.
1104
- *
1105
1088
  * @category error handling
1106
1089
  * @since 2.0.0
1107
1090
  */
@@ -1109,9 +1092,6 @@ export const orElse: {
1109
1092
  /**
1110
1093
  * Returns `self` if it is a `Right` or `that` otherwise.
1111
1094
  *
1112
- * @param self - The input `Either` value to check and potentially return.
1113
- * @param that - A function that takes the error value from `self` (if it's a `Left`) and returns a new `Either` value.
1114
- *
1115
1095
  * @category error handling
1116
1096
  * @since 2.0.0
1117
1097
  */
@@ -1264,10 +1244,9 @@ export const ap: {
1264
1244
  * - If a struct is supplied, then the returned `Either` will contain a struct with the same keys.
1265
1245
  * - If an iterable is supplied, then the returned `Either` will contain an array.
1266
1246
  *
1267
- * @param fields - the struct of `Either`s to be sequenced.
1268
- *
1269
1247
  * @example
1270
1248
  * ```ts
1249
+ * import * as assert from "node:assert"
1271
1250
  * import { Either } from "effect"
1272
1251
  *
1273
1252
  * assert.deepStrictEqual(Either.all([Either.right(1), Either.right(2)]), Either.right([1, 2]))
@@ -1294,7 +1273,7 @@ export const all: <const I extends Iterable<Either<any, any>> | Record<string, E
1294
1273
  ): Either<any, any> => {
1295
1274
  if (Symbol.iterator in input) {
1296
1275
  const out: Array<Either<any, any>> = []
1297
- for (const e of (input as Iterable<Either<any, any>>)) {
1276
+ for (const e of input) {
1298
1277
  if (isLeft(e)) {
1299
1278
  return e
1300
1279
  }
@@ -1365,6 +1344,7 @@ export const gen: Gen.Gen<EitherTypeLambda, Gen.Adapter<EitherTypeLambda>> = (..
1365
1344
  *
1366
1345
  * @example
1367
1346
  * ```ts
1347
+ * import * as assert from "node:assert"
1368
1348
  * import { Either, pipe } from "effect"
1369
1349
  *
1370
1350
  * const result = pipe(
@@ -1397,6 +1377,7 @@ export const Do: Either<{}> = right({})
1397
1377
  *
1398
1378
  * @example
1399
1379
  * ```ts
1380
+ * import * as assert from "node:assert"
1400
1381
  * import { Either, pipe } from "effect"
1401
1382
  *
1402
1383
  * const result = pipe(
@@ -1428,6 +1409,7 @@ export const bind: {
1428
1409
  *
1429
1410
  * @example
1430
1411
  * ```ts
1412
+ * import * as assert from "node:assert"
1431
1413
  * import { Either, pipe } from "effect"
1432
1414
  *
1433
1415
  * const result = pipe(
@@ -1459,6 +1441,7 @@ export const bind: {
1459
1441
  *
1460
1442
  * @example
1461
1443
  * ```ts
1444
+ * import * as assert from "node:assert"
1462
1445
  * import { Either, pipe } from "effect"
1463
1446
  *
1464
1447
  * const result = pipe(
@@ -1496,6 +1479,7 @@ export const bind: {
1496
1479
  *
1497
1480
  * @example
1498
1481
  * ```ts
1482
+ * import * as assert from "node:assert"
1499
1483
  * import { Either, pipe } from "effect"
1500
1484
  *
1501
1485
  * const result = pipe(
@@ -1527,6 +1511,7 @@ export const bindTo: {
1527
1511
  *
1528
1512
  * @example
1529
1513
  * ```ts
1514
+ * import * as assert from "node:assert"
1530
1515
  * import { Either, pipe } from "effect"
1531
1516
  *
1532
1517
  * const result = pipe(
@@ -1558,6 +1543,7 @@ export const bindTo: {
1558
1543
  *
1559
1544
  * @example
1560
1545
  * ```ts
1546
+ * import * as assert from "node:assert"
1561
1547
  * import { Either, pipe } from "effect"
1562
1548
  *
1563
1549
  * const result = pipe(
@@ -1604,6 +1590,7 @@ export {
1604
1590
  *
1605
1591
  * @example
1606
1592
  * ```ts
1593
+ * import * as assert from "node:assert"
1607
1594
  * import { Either, pipe } from "effect"
1608
1595
  *
1609
1596
  * const result = pipe(
package/src/Encoding.ts CHANGED
@@ -187,7 +187,7 @@ export interface EncodeException {
187
187
  export const EncodeException: (input: string, message?: string) => EncodeException = Common.EncodeException
188
188
 
189
189
  /**
190
- * Returns `true` if the specified value is an `Exception`, `false` otherwise.
190
+ * Returns `true` if the specified value is an `EncodeException`, `false` otherwise.
191
191
  *
192
192
  * @since 3.12.0
193
193
  * @category refinements
@@ -201,7 +201,7 @@ export const productMany = <A>(
201
201
  /**
202
202
  * Similar to `Promise.all` but operates on `Equivalence`s.
203
203
  *
204
- * ```
204
+ * ```ts skip-type-checking
205
205
  * [Equivalence<A>, Equivalence<B>, ...] -> Equivalence<[A, B, ...]>
206
206
  * ```
207
207
  *