effect 3.1.1 → 3.1.2

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 (257) hide show
  1. package/dist/cjs/Array.js +10 -13
  2. package/dist/cjs/Array.js.map +1 -1
  3. package/dist/cjs/BigDecimal.js +14 -17
  4. package/dist/cjs/BigDecimal.js.map +1 -1
  5. package/dist/cjs/BigInt.js +41 -46
  6. package/dist/cjs/BigInt.js.map +1 -1
  7. package/dist/cjs/Boolean.js +13 -13
  8. package/dist/cjs/Brand.js +2 -2
  9. package/dist/cjs/Chunk.js +3 -3
  10. package/dist/cjs/Context.js +15 -20
  11. package/dist/cjs/Context.js.map +1 -1
  12. package/dist/cjs/Cron.js +3 -6
  13. package/dist/cjs/Cron.js.map +1 -1
  14. package/dist/cjs/Data.js +8 -13
  15. package/dist/cjs/Data.js.map +1 -1
  16. package/dist/cjs/Duration.js +1 -1
  17. package/dist/cjs/Effect.js +77 -9
  18. package/dist/cjs/Effect.js.map +1 -1
  19. package/dist/cjs/Either.js +117 -59
  20. package/dist/cjs/Either.js.map +1 -1
  21. package/dist/cjs/FiberHandle.js.map +1 -1
  22. package/dist/cjs/FiberMap.js.map +1 -1
  23. package/dist/cjs/FiberSet.js.map +1 -1
  24. package/dist/cjs/Function.js +2 -2
  25. package/dist/cjs/Function.js.map +1 -1
  26. package/dist/cjs/Iterable.js +10 -13
  27. package/dist/cjs/Iterable.js.map +1 -1
  28. package/dist/cjs/List.js +2 -2
  29. package/dist/cjs/Metric.js +5 -7
  30. package/dist/cjs/Metric.js.map +1 -1
  31. package/dist/cjs/Number.js +20 -21
  32. package/dist/cjs/Number.js.map +1 -1
  33. package/dist/cjs/Option.js +223 -164
  34. package/dist/cjs/Option.js.map +1 -1
  35. package/dist/cjs/Order.js +1 -2
  36. package/dist/cjs/Order.js.map +1 -1
  37. package/dist/cjs/Ordering.js +2 -2
  38. package/dist/cjs/Predicate.js +9 -12
  39. package/dist/cjs/Predicate.js.map +1 -1
  40. package/dist/cjs/Readable.js.map +1 -1
  41. package/dist/cjs/Record.js +35 -47
  42. package/dist/cjs/Record.js.map +1 -1
  43. package/dist/cjs/RegExp.js +1 -1
  44. package/dist/cjs/Request.js +2 -2
  45. package/dist/cjs/Request.js.map +1 -1
  46. package/dist/cjs/Stream.js +82 -4
  47. package/dist/cjs/Stream.js.map +1 -1
  48. package/dist/cjs/String.js +81 -111
  49. package/dist/cjs/String.js.map +1 -1
  50. package/dist/cjs/Struct.js +13 -19
  51. package/dist/cjs/Struct.js.map +1 -1
  52. package/dist/cjs/Subscribable.js.map +1 -1
  53. package/dist/cjs/Symbol.js +3 -3
  54. package/dist/cjs/TestAnnotation.js.map +1 -1
  55. package/dist/cjs/TestAnnotationMap.js.map +1 -1
  56. package/dist/cjs/TestAnnotations.js.map +1 -1
  57. package/dist/cjs/TestClock.js.map +1 -1
  58. package/dist/cjs/TestLive.js.map +1 -1
  59. package/dist/cjs/TestSized.js.map +1 -1
  60. package/dist/cjs/Trie.js +28 -44
  61. package/dist/cjs/Trie.js.map +1 -1
  62. package/dist/cjs/Utils.js.map +1 -1
  63. package/dist/cjs/internal/core-effect.js +4 -11
  64. package/dist/cjs/internal/core-effect.js.map +1 -1
  65. package/dist/cjs/internal/doNotation.js +23 -0
  66. package/dist/cjs/internal/doNotation.js.map +1 -0
  67. package/dist/cjs/internal/groupBy.js.map +1 -1
  68. package/dist/cjs/internal/stream.js +3 -7
  69. package/dist/cjs/internal/stream.js.map +1 -1
  70. package/dist/cjs/internal/version.js +1 -1
  71. package/dist/dts/Array.d.ts +10 -13
  72. package/dist/dts/Array.d.ts.map +1 -1
  73. package/dist/dts/BigDecimal.d.ts +14 -17
  74. package/dist/dts/BigDecimal.d.ts.map +1 -1
  75. package/dist/dts/BigInt.d.ts +41 -46
  76. package/dist/dts/BigInt.d.ts.map +1 -1
  77. package/dist/dts/Boolean.d.ts +13 -13
  78. package/dist/dts/Brand.d.ts +3 -3
  79. package/dist/dts/Chunk.d.ts +3 -3
  80. package/dist/dts/Context.d.ts +15 -20
  81. package/dist/dts/Context.d.ts.map +1 -1
  82. package/dist/dts/Cron.d.ts +3 -6
  83. package/dist/dts/Cron.d.ts.map +1 -1
  84. package/dist/dts/Data.d.ts +10 -16
  85. package/dist/dts/Data.d.ts.map +1 -1
  86. package/dist/dts/Duration.d.ts +1 -1
  87. package/dist/dts/Effect.d.ts +120 -26
  88. package/dist/dts/Effect.d.ts.map +1 -1
  89. package/dist/dts/Either.d.ts +155 -64
  90. package/dist/dts/Either.d.ts.map +1 -1
  91. package/dist/dts/FiberHandle.d.ts.map +1 -1
  92. package/dist/dts/FiberMap.d.ts.map +1 -1
  93. package/dist/dts/FiberSet.d.ts.map +1 -1
  94. package/dist/dts/Function.d.ts +4 -2
  95. package/dist/dts/Function.d.ts.map +1 -1
  96. package/dist/dts/HashMap.d.ts +2 -2
  97. package/dist/dts/Iterable.d.ts +10 -13
  98. package/dist/dts/Iterable.d.ts.map +1 -1
  99. package/dist/dts/List.d.ts +2 -2
  100. package/dist/dts/Metric.d.ts +5 -7
  101. package/dist/dts/Metric.d.ts.map +1 -1
  102. package/dist/dts/Number.d.ts +20 -21
  103. package/dist/dts/Number.d.ts.map +1 -1
  104. package/dist/dts/Option.d.ts +245 -155
  105. package/dist/dts/Option.d.ts.map +1 -1
  106. package/dist/dts/Order.d.ts +1 -2
  107. package/dist/dts/Order.d.ts.map +1 -1
  108. package/dist/dts/Ordering.d.ts +2 -2
  109. package/dist/dts/Predicate.d.ts +9 -12
  110. package/dist/dts/Predicate.d.ts.map +1 -1
  111. package/dist/dts/Readable.d.ts.map +1 -1
  112. package/dist/dts/Record.d.ts +35 -47
  113. package/dist/dts/Record.d.ts.map +1 -1
  114. package/dist/dts/RegExp.d.ts +1 -1
  115. package/dist/dts/Request.d.ts +2 -2
  116. package/dist/dts/Request.d.ts.map +1 -1
  117. package/dist/dts/Stream.d.ts +136 -31
  118. package/dist/dts/Stream.d.ts.map +1 -1
  119. package/dist/dts/String.d.ts +81 -111
  120. package/dist/dts/String.d.ts.map +1 -1
  121. package/dist/dts/Struct.d.ts +13 -19
  122. package/dist/dts/Struct.d.ts.map +1 -1
  123. package/dist/dts/Subscribable.d.ts.map +1 -1
  124. package/dist/dts/Symbol.d.ts +3 -3
  125. package/dist/dts/TestAnnotation.d.ts.map +1 -1
  126. package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
  127. package/dist/dts/TestAnnotations.d.ts.map +1 -1
  128. package/dist/dts/TestClock.d.ts +1 -5
  129. package/dist/dts/TestClock.d.ts.map +1 -1
  130. package/dist/dts/TestLive.d.ts.map +1 -1
  131. package/dist/dts/TestSized.d.ts.map +1 -1
  132. package/dist/dts/Trie.d.ts +28 -44
  133. package/dist/dts/Trie.d.ts.map +1 -1
  134. package/dist/dts/Types.d.ts +10 -10
  135. package/dist/dts/Utils.d.ts.map +1 -1
  136. package/dist/dts/internal/doNotation.d.ts +2 -0
  137. package/dist/dts/internal/doNotation.d.ts.map +1 -0
  138. package/dist/dts/internal/stream.d.ts.map +1 -1
  139. package/dist/esm/Array.js +10 -13
  140. package/dist/esm/Array.js.map +1 -1
  141. package/dist/esm/BigDecimal.js +14 -17
  142. package/dist/esm/BigDecimal.js.map +1 -1
  143. package/dist/esm/BigInt.js +41 -46
  144. package/dist/esm/BigInt.js.map +1 -1
  145. package/dist/esm/Boolean.js +13 -13
  146. package/dist/esm/Brand.js +2 -2
  147. package/dist/esm/Chunk.js +3 -3
  148. package/dist/esm/Context.js +15 -20
  149. package/dist/esm/Context.js.map +1 -1
  150. package/dist/esm/Cron.js +3 -6
  151. package/dist/esm/Cron.js.map +1 -1
  152. package/dist/esm/Data.js +9 -15
  153. package/dist/esm/Data.js.map +1 -1
  154. package/dist/esm/Duration.js +1 -1
  155. package/dist/esm/Effect.js +101 -11
  156. package/dist/esm/Effect.js.map +1 -1
  157. package/dist/esm/Either.js +141 -61
  158. package/dist/esm/Either.js.map +1 -1
  159. package/dist/esm/FiberHandle.js.map +1 -1
  160. package/dist/esm/FiberMap.js.map +1 -1
  161. package/dist/esm/FiberSet.js.map +1 -1
  162. package/dist/esm/Function.js +2 -2
  163. package/dist/esm/Function.js.map +1 -1
  164. package/dist/esm/Iterable.js +10 -13
  165. package/dist/esm/Iterable.js.map +1 -1
  166. package/dist/esm/List.js +2 -2
  167. package/dist/esm/Metric.js +5 -7
  168. package/dist/esm/Metric.js.map +1 -1
  169. package/dist/esm/Number.js +20 -21
  170. package/dist/esm/Number.js.map +1 -1
  171. package/dist/esm/Option.js +249 -164
  172. package/dist/esm/Option.js.map +1 -1
  173. package/dist/esm/Order.js +1 -2
  174. package/dist/esm/Order.js.map +1 -1
  175. package/dist/esm/Ordering.js +2 -2
  176. package/dist/esm/Predicate.js +9 -12
  177. package/dist/esm/Predicate.js.map +1 -1
  178. package/dist/esm/Readable.js.map +1 -1
  179. package/dist/esm/Record.js +35 -47
  180. package/dist/esm/Record.js.map +1 -1
  181. package/dist/esm/RegExp.js +1 -1
  182. package/dist/esm/Request.js +2 -2
  183. package/dist/esm/Request.js.map +1 -1
  184. package/dist/esm/Stream.js +107 -6
  185. package/dist/esm/Stream.js.map +1 -1
  186. package/dist/esm/String.js +81 -111
  187. package/dist/esm/String.js.map +1 -1
  188. package/dist/esm/Struct.js +13 -19
  189. package/dist/esm/Struct.js.map +1 -1
  190. package/dist/esm/Subscribable.js.map +1 -1
  191. package/dist/esm/Symbol.js +3 -3
  192. package/dist/esm/TestAnnotation.js.map +1 -1
  193. package/dist/esm/TestAnnotationMap.js.map +1 -1
  194. package/dist/esm/TestAnnotations.js.map +1 -1
  195. package/dist/esm/TestClock.js.map +1 -1
  196. package/dist/esm/TestLive.js.map +1 -1
  197. package/dist/esm/TestSized.js.map +1 -1
  198. package/dist/esm/Trie.js +28 -44
  199. package/dist/esm/Trie.js.map +1 -1
  200. package/dist/esm/Utils.js.map +1 -1
  201. package/dist/esm/internal/core-effect.js +4 -11
  202. package/dist/esm/internal/core-effect.js.map +1 -1
  203. package/dist/esm/internal/doNotation.js +14 -0
  204. package/dist/esm/internal/doNotation.js.map +1 -0
  205. package/dist/esm/internal/groupBy.js.map +1 -1
  206. package/dist/esm/internal/stream.js +3 -7
  207. package/dist/esm/internal/stream.js.map +1 -1
  208. package/dist/esm/internal/version.js +1 -1
  209. package/package.json +1 -1
  210. package/src/Array.ts +10 -13
  211. package/src/BigDecimal.ts +14 -17
  212. package/src/BigInt.ts +41 -46
  213. package/src/Boolean.ts +13 -13
  214. package/src/Brand.ts +3 -3
  215. package/src/Chunk.ts +3 -3
  216. package/src/Context.ts +15 -20
  217. package/src/Cron.ts +3 -6
  218. package/src/Data.ts +10 -16
  219. package/src/Duration.ts +1 -1
  220. package/src/Effect.ts +122 -32
  221. package/src/Either.ts +161 -94
  222. package/src/FiberHandle.ts +1 -1
  223. package/src/FiberMap.ts +1 -1
  224. package/src/FiberSet.ts +1 -1
  225. package/src/Function.ts +4 -2
  226. package/src/HashMap.ts +2 -2
  227. package/src/Iterable.ts +10 -13
  228. package/src/List.ts +2 -2
  229. package/src/Metric.ts +5 -7
  230. package/src/Number.ts +20 -21
  231. package/src/Option.ts +250 -172
  232. package/src/Order.ts +1 -2
  233. package/src/Ordering.ts +2 -2
  234. package/src/Predicate.ts +9 -12
  235. package/src/Readable.ts +1 -1
  236. package/src/Record.ts +35 -47
  237. package/src/RegExp.ts +1 -1
  238. package/src/Request.ts +3 -3
  239. package/src/Stream.ts +137 -36
  240. package/src/String.ts +81 -111
  241. package/src/Struct.ts +13 -19
  242. package/src/Subscribable.ts +1 -1
  243. package/src/Symbol.ts +3 -3
  244. package/src/TestAnnotation.ts +1 -1
  245. package/src/TestAnnotationMap.ts +1 -1
  246. package/src/TestAnnotations.ts +1 -1
  247. package/src/TestClock.ts +1 -5
  248. package/src/TestLive.ts +1 -1
  249. package/src/TestSized.ts +1 -1
  250. package/src/Trie.ts +28 -44
  251. package/src/Types.ts +10 -10
  252. package/src/Utils.ts +2 -2
  253. package/src/internal/core-effect.ts +29 -45
  254. package/src/internal/doNotation.ts +77 -0
  255. package/src/internal/groupBy.ts +16 -16
  256. package/src/internal/stream.ts +34 -58
  257. package/src/internal/version.ts +1 -1
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.1.1";
1
+ let moduleVersion = "3.1.2";
2
2
  export const getCurrentVersion = () => moduleVersion;
3
3
  export const setCurrentVersion = version => {
4
4
  moduleVersion = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "The missing standard library for TypeScript, for writing production-grade software.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/Array.ts CHANGED
@@ -66,7 +66,7 @@ export const allocate = <A = never>(n: number): Array<A | undefined> => new Arra
66
66
  * **Note**. `n` is normalized to an integer >= 1.
67
67
  *
68
68
  * @example
69
- * import { makeBy } from 'effect/Array'
69
+ * import { makeBy } from "effect/Array"
70
70
  *
71
71
  * assert.deepStrictEqual(makeBy(5, n => n * 2), [0, 2, 4, 6, 8])
72
72
  *
@@ -86,7 +86,7 @@ export const makeBy = <A>(n: number, f: (i: number) => A): NonEmptyArray<A> => {
86
86
  * Return a `NonEmptyArray` containing a range of integers, including both endpoints.
87
87
  *
88
88
  * @example
89
- * import { range } from 'effect/Array'
89
+ * import { range } from "effect/Array"
90
90
  *
91
91
  * assert.deepStrictEqual(range(1, 3), [1, 2, 3])
92
92
  *
@@ -102,7 +102,7 @@ export const range = (start: number, end: number): NonEmptyArray<number> =>
102
102
  * **Note**. `n` is normalized to an integer >= 1.
103
103
  *
104
104
  * @example
105
- * import { replicate } from 'effect/Array'
105
+ * import { replicate } from "effect/Array"
106
106
  *
107
107
  * assert.deepStrictEqual(replicate("a", 3), ["a", "a", "a"])
108
108
  *
@@ -242,7 +242,7 @@ export const prepend: {
242
242
  * If either array is non-empty, the result is also a non-empty array.
243
243
  *
244
244
  * @example
245
- * import * as Array from "effect/Array"
245
+ * import { Array } from "effect"
246
246
  *
247
247
  * assert.deepStrictEqual(
248
248
  * Array.prependAll([1, 2], ["a", "b"]),
@@ -1656,11 +1656,10 @@ export const partitionMap: {
1656
1656
  * Retrieves the `Some` values from an `Iterable` of `Option`s, collecting them into an array.
1657
1657
  *
1658
1658
  * @example
1659
- * import { getSomes } from "effect/Array"
1660
- * import { some, none } from "effect/Option"
1659
+ * import { Array, Option } from "effect"
1661
1660
  *
1662
1661
  * assert.deepStrictEqual(
1663
- * getSomes([some(1), none(), some(2)]),
1662
+ * Array.getSomes([Option.some(1), Option.none(), Option.some(2)]),
1664
1663
  * [1, 2]
1665
1664
  * )
1666
1665
  *
@@ -1673,11 +1672,10 @@ export const getSomes: <A>(self: Iterable<Option<A>>) => Array<A> = filterMap(id
1673
1672
  * Retrieves the `Left` values from an `Iterable` of `Either`s, collecting them into an array.
1674
1673
  *
1675
1674
  * @example
1676
- * import { getLefts } from "effect/Array"
1677
- * import { right, left } from "effect/Either"
1675
+ * import { Array, Either } from "effect"
1678
1676
  *
1679
1677
  * assert.deepStrictEqual(
1680
- * getLefts([right(1), left("err"), right(2)]),
1678
+ * Array.getLefts([Either.right(1), Either.left("err"), Either.right(2)]),
1681
1679
  * ["err"]
1682
1680
  * )
1683
1681
  *
@@ -1699,11 +1697,10 @@ export const getLefts = <R, L>(self: Iterable<Either<R, L>>): Array<L> => {
1699
1697
  * Retrieves the `Right` values from an `Iterable` of `Either`s, collecting them into an array.
1700
1698
  *
1701
1699
  * @example
1702
- * import { getRights } from "effect/Array"
1703
- * import { right, left } from "effect/Either"
1700
+ * import { Array, Either } from "effect"
1704
1701
  *
1705
1702
  * assert.deepStrictEqual(
1706
- * getRights([right(1), left("err"), right(2)]),
1703
+ * Array.getRights([Either.right(1), Either.left("err"), Either.right(2)]),
1707
1704
  * [1, 2]
1708
1705
  * )
1709
1706
  *
package/src/BigDecimal.ts CHANGED
@@ -374,12 +374,11 @@ export const roundTerminal = (n: bigint): bigint => {
374
374
  * @param that - The divisor operand.
375
375
  *
376
376
  * @example
377
- * import { divide, unsafeFromString } from "effect/BigDecimal"
378
- * import { some, none } from "effect/Option"
377
+ * import { BigDecimal, Option } from "effect"
379
378
  *
380
- * assert.deepStrictEqual(divide(unsafeFromString("6"), unsafeFromString("3")), some(unsafeFromString("2")))
381
- * assert.deepStrictEqual(divide(unsafeFromString("6"), unsafeFromString("4")), some(unsafeFromString("1.5")))
382
- * assert.deepStrictEqual(divide(unsafeFromString("6"), unsafeFromString("0")), none())
379
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("3")), Option.some(BigDecimal.unsafeFromString("2")))
380
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("4")), Option.some(BigDecimal.unsafeFromString("1.5")))
381
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("0")), Option.none())
383
382
  *
384
383
  * @since 2.0.0
385
384
  * @category math
@@ -556,7 +555,7 @@ export const greaterThanOrEqualTo: {
556
555
  * @param maximum - The `maximum` value to check.
557
556
  *
558
557
  * @example
559
- * import * as BigDecimal from "effect/BigDecimal"
558
+ * import { BigDecimal } from "effect"
560
559
  *
561
560
  * const between = BigDecimal.between({
562
561
  * minimum: BigDecimal.unsafeFromString("1"),
@@ -593,7 +592,7 @@ export const between: {
593
592
  * @param maximum - The upper end of the range.
594
593
  *
595
594
  * @example
596
- * import * as BigDecimal from "effect/BigDecimal"
595
+ * import { BigDecimal } from "effect"
597
596
  *
598
597
  * const clamp = BigDecimal.clamp({
599
598
  * minimum: BigDecimal.unsafeFromString("1"),
@@ -715,12 +714,11 @@ export const negate = (n: BigDecimal): BigDecimal => make(-n.value, n.scale)
715
714
  * @param divisor - The divisor.
716
715
  *
717
716
  * @example
718
- * import { remainder, unsafeFromString } from "effect/BigDecimal"
719
- * import { some } from "effect/Option"
717
+ * import { BigDecimal, Option } from "effect"
720
718
  *
721
- * assert.deepStrictEqual(remainder(unsafeFromString("2"), unsafeFromString("2")), some(unsafeFromString("0")))
722
- * assert.deepStrictEqual(remainder(unsafeFromString("3"), unsafeFromString("2")), some(unsafeFromString("1")))
723
- * assert.deepStrictEqual(remainder(unsafeFromString("-4"), unsafeFromString("2")), some(unsafeFromString("0")))
719
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("2"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("0")))
720
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("3"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("1")))
721
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("-4"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("0")))
724
722
  *
725
723
  * @since 2.0.0
726
724
  * @category math
@@ -832,12 +830,11 @@ export const fromNumber = (n: number): BigDecimal => {
832
830
  * @param s - The `string` to parse.
833
831
  *
834
832
  * @example
835
- * import { fromString, make } from "effect/BigDecimal"
836
- * import { some, none } from "effect/Option"
833
+ * import { BigDecimal, Option } from "effect"
837
834
  *
838
- * assert.deepStrictEqual(fromString("123"), some(make(123n, 0)))
839
- * assert.deepStrictEqual(fromString("123.456"), some(make(123456n, 3)))
840
- * assert.deepStrictEqual(fromString("123.abc"), none())
835
+ * assert.deepStrictEqual(BigDecimal.fromString("123"), Option.some(BigDecimal.make(123n, 0)))
836
+ * assert.deepStrictEqual(BigDecimal.fromString("123.456"), Option.some(BigDecimal.make(123456n, 3)))
837
+ * assert.deepStrictEqual(BigDecimal.fromString("123.abc"), Option.none())
841
838
  *
842
839
  * @since 2.0.0
843
840
  * @category constructors
package/src/BigInt.ts CHANGED
@@ -40,7 +40,7 @@ export const isBigInt: (u: unknown) => u is bigint = predicate.isBigInt
40
40
  * @param that - The second operand.
41
41
  *
42
42
  * @example
43
- * import { sum } from 'effect/BigInt'
43
+ * import { sum } from "effect/BigInt"
44
44
  *
45
45
  * assert.deepStrictEqual(sum(2n, 3n), 5n)
46
46
  *
@@ -59,7 +59,7 @@ export const sum: {
59
59
  * @param that - The second operand.
60
60
  *
61
61
  * @example
62
- * import { multiply } from 'effect/BigInt'
62
+ * import { multiply } from "effect/BigInt"
63
63
  *
64
64
  * assert.deepStrictEqual(multiply(2n, 3n), 6n)
65
65
  *
@@ -78,7 +78,7 @@ export const multiply: {
78
78
  * @param that - The second operand.
79
79
  *
80
80
  * @example
81
- * import { subtract } from 'effect/BigInt'
81
+ * import { subtract } from "effect/BigInt"
82
82
  *
83
83
  * assert.deepStrictEqual(subtract(2n, 3n), -1n)
84
84
  *
@@ -102,11 +102,10 @@ export const subtract: {
102
102
  * @param that - The divisor operand.
103
103
  *
104
104
  * @example
105
- * import { divide } from 'effect/BigInt'
106
- * import { some, none } from 'effect/Option'
105
+ * import { BigInt, Option } from "effect"
107
106
  *
108
- * assert.deepStrictEqual(divide(6n, 3n), some(2n))
109
- * assert.deepStrictEqual(divide(6n, 0n), none())
107
+ * assert.deepStrictEqual(BigInt.divide(6n, 3n), Option.some(2n))
108
+ * assert.deepStrictEqual(BigInt.divide(6n, 0n), Option.none())
110
109
  *
111
110
  * @category math
112
111
  * @since 2.0.0
@@ -131,7 +130,7 @@ export const divide: {
131
130
  * @param that - The divisor operand.
132
131
  *
133
132
  * @example
134
- * import { unsafeDivide } from 'effect/BigInt'
133
+ * import { unsafeDivide } from "effect/BigInt"
135
134
  *
136
135
  * assert.deepStrictEqual(unsafeDivide(6n, 3n), 2n)
137
136
  * assert.deepStrictEqual(unsafeDivide(6n, 4n), 1n)
@@ -150,7 +149,7 @@ export const unsafeDivide: {
150
149
  * @param n - A `bigint` to be incremented.
151
150
  *
152
151
  * @example
153
- * import { increment } from 'effect/BigInt'
152
+ * import { increment } from "effect/BigInt"
154
153
  *
155
154
  * assert.deepStrictEqual(increment(2n), 3n)
156
155
  *
@@ -165,7 +164,7 @@ export const increment = (n: bigint): bigint => n + bigint1
165
164
  * @param n - A `bigint` to be decremented.
166
165
  *
167
166
  * @example
168
- * import { decrement } from 'effect/BigInt'
167
+ * import { decrement } from "effect/BigInt"
169
168
  *
170
169
  * assert.deepStrictEqual(decrement(3n), 2n)
171
170
  *
@@ -193,7 +192,7 @@ export const Order: order.Order<bigint> = order.bigint
193
192
  * @param that - The second argument.
194
193
  *
195
194
  * @example
196
- * import { lessThan } from 'effect/BigInt'
195
+ * import { lessThan } from "effect/BigInt"
197
196
  *
198
197
  * assert.deepStrictEqual(lessThan(2n, 3n), true)
199
198
  * assert.deepStrictEqual(lessThan(3n, 3n), false)
@@ -214,7 +213,7 @@ export const lessThan: {
214
213
  * @param that - The second `bigint` to compare with.
215
214
  *
216
215
  * @example
217
- * import { lessThanOrEqualTo } from 'effect/BigInt'
216
+ * import { lessThanOrEqualTo } from "effect/BigInt"
218
217
  *
219
218
  * assert.deepStrictEqual(lessThanOrEqualTo(2n, 3n), true)
220
219
  * assert.deepStrictEqual(lessThanOrEqualTo(3n, 3n), true)
@@ -235,7 +234,7 @@ export const lessThanOrEqualTo: {
235
234
  * @param that - The second argument.
236
235
  *
237
236
  * @example
238
- * import { greaterThan } from 'effect/BigInt'
237
+ * import { greaterThan } from "effect/BigInt"
239
238
  *
240
239
  * assert.deepStrictEqual(greaterThan(2n, 3n), false)
241
240
  * assert.deepStrictEqual(greaterThan(3n, 3n), false)
@@ -256,7 +255,7 @@ export const greaterThan: {
256
255
  * @param that - The second `bigint` to compare with.
257
256
  *
258
257
  * @example
259
- * import { greaterThanOrEqualTo } from 'effect/BigInt'
258
+ * import { greaterThanOrEqualTo } from "effect/BigInt"
260
259
  *
261
260
  * assert.deepStrictEqual(greaterThanOrEqualTo(2n, 3n), false)
262
261
  * assert.deepStrictEqual(greaterThanOrEqualTo(3n, 3n), true)
@@ -278,7 +277,7 @@ export const greaterThanOrEqualTo: {
278
277
  * @param maximum - The `maximum` value to check.
279
278
  *
280
279
  * @example
281
- * import * as BigInt from 'effect/BigInt'
280
+ * import { BigInt } from "effect"
282
281
  *
283
282
  * const between = BigInt.between({ minimum: 0n, maximum: 5n })
284
283
  *
@@ -312,7 +311,7 @@ export const between: {
312
311
  * @param maximum - The upper end of the range.
313
312
  *
314
313
  * @example
315
- * import * as BigInt from 'effect/BigInt'
314
+ * import { BigInt } from "effect"
316
315
  *
317
316
  * const clamp = BigInt.clamp({ minimum: 1n, maximum: 5n })
318
317
  *
@@ -340,7 +339,7 @@ export const clamp: {
340
339
  * @param that - The second `bigint`.
341
340
  *
342
341
  * @example
343
- * import { min } from 'effect/BigInt'
342
+ * import { min } from "effect/BigInt"
344
343
  *
345
344
  * assert.deepStrictEqual(min(2n, 3n), 2n)
346
345
  *
@@ -358,7 +357,7 @@ export const min: {
358
357
  * @param that - The second `bigint`.
359
358
  *
360
359
  * @example
361
- * import { max } from 'effect/BigInt'
360
+ * import { max } from "effect/BigInt"
362
361
  *
363
362
  * assert.deepStrictEqual(max(2n, 3n), 3n)
364
363
  *
@@ -375,7 +374,7 @@ export const max: {
375
374
  * @param n - The `bigint` to determine the sign of.
376
375
  *
377
376
  * @example
378
- * import { sign } from 'effect/BigInt'
377
+ * import { sign } from "effect/BigInt"
379
378
  *
380
379
  * assert.deepStrictEqual(sign(-5n), -1)
381
380
  * assert.deepStrictEqual(sign(0n), 0)
@@ -392,7 +391,7 @@ export const sign = (n: bigint): Ordering => Order(n, bigint0)
392
391
  * @param n - The `bigint` to determine the absolute value of.
393
392
  *
394
393
  * @example
395
- * import { abs } from 'effect/BigInt'
394
+ * import { abs } from "effect/BigInt"
396
395
  *
397
396
  * assert.deepStrictEqual(abs(-5n), 5n)
398
397
  * assert.deepStrictEqual(abs(0n), 0n)
@@ -410,7 +409,7 @@ export const abs = (n: bigint): bigint => (n < bigint0 ? -n : n)
410
409
  * @param b - The second `bigint`.
411
410
  *
412
411
  * @example
413
- * import { gcd } from 'effect/BigInt'
412
+ * import { gcd } from "effect/BigInt"
414
413
  *
415
414
  * assert.deepStrictEqual(gcd(2n, 3n), 1n)
416
415
  * assert.deepStrictEqual(gcd(2n, 4n), 2n)
@@ -438,7 +437,7 @@ export const gcd: {
438
437
  * @param b - The second `bigint`.
439
438
  *
440
439
  * @example
441
- * import { lcm } from 'effect/BigInt'
440
+ * import { lcm } from "effect/BigInt"
442
441
  *
443
442
  * assert.deepStrictEqual(lcm(2n, 3n), 6n)
444
443
  * assert.deepStrictEqual(lcm(2n, 4n), 4n)
@@ -458,7 +457,7 @@ export const lcm: {
458
457
  * @param n - The `bigint` to determine the square root of.
459
458
  *
460
459
  * @example
461
- * import { unsafeSqrt } from 'effect/BigInt'
460
+ * import { unsafeSqrt } from "effect/BigInt"
462
461
  *
463
462
  * assert.deepStrictEqual(unsafeSqrt(4n), 2n)
464
463
  * assert.deepStrictEqual(unsafeSqrt(9n), 3n)
@@ -487,13 +486,12 @@ export const unsafeSqrt = (n: bigint): bigint => {
487
486
  * @param n - The `bigint` to determine the square root of.
488
487
  *
489
488
  * @example
490
- * import { sqrt } from 'effect/BigInt'
491
- * import * as Option from 'effect/Option'
489
+ * import { BigInt, Option } from "effect"
492
490
  *
493
- * assert.deepStrictEqual(sqrt(4n), Option.some(2n))
494
- * assert.deepStrictEqual(sqrt(9n), Option.some(3n))
495
- * assert.deepStrictEqual(sqrt(16n), Option.some(4n))
496
- * assert.deepStrictEqual(sqrt(-1n), Option.none())
491
+ * assert.deepStrictEqual(BigInt.sqrt(4n), Option.some(2n))
492
+ * assert.deepStrictEqual(BigInt.sqrt(9n), Option.some(3n))
493
+ * assert.deepStrictEqual(BigInt.sqrt(16n), Option.some(4n))
494
+ * assert.deepStrictEqual(BigInt.sqrt(-1n), Option.none())
497
495
  *
498
496
  * @category math
499
497
  * @since 2.0.0
@@ -507,7 +505,7 @@ export const sqrt = (n: bigint): Option.Option<bigint> =>
507
505
  * @param collection - The collection of `bigint`s to sum.
508
506
  *
509
507
  * @example
510
- * import { sumAll } from 'effect/BigInt'
508
+ * import { sumAll } from "effect/BigInt"
511
509
  *
512
510
  * assert.deepStrictEqual(sumAll([2n, 3n, 4n]), 9n)
513
511
  *
@@ -528,7 +526,7 @@ export const sumAll = (collection: Iterable<bigint>): bigint => {
528
526
  * @param collection - The collection of `bigint`s to multiply.
529
527
  *
530
528
  * @example
531
- * import { multiplyAll } from 'effect/BigInt'
529
+ * import { multiplyAll } from "effect/BigInt"
532
530
  *
533
531
  * assert.deepStrictEqual(multiplyAll([2n, 3n, 4n]), 24n)
534
532
  *
@@ -556,12 +554,11 @@ export const multiplyAll = (collection: Iterable<bigint>): bigint => {
556
554
  * @param b - The `bigint` to be converted to a `number`.
557
555
  *
558
556
  * @example
559
- * import { toNumber } from "effect/BigInt"
560
- * import { Option } from "effect"
557
+ * import { BigInt as BI, Option } from "effect"
561
558
  *
562
- * assert.deepStrictEqual(toNumber(BigInt(42)), Option.some(42))
563
- * assert.deepStrictEqual(toNumber(BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1)), Option.none())
564
- * assert.deepStrictEqual(toNumber(BigInt(Number.MIN_SAFE_INTEGER) - BigInt(1)), Option.none())
559
+ * assert.deepStrictEqual(BI.toNumber(BigInt(42)), Option.some(42))
560
+ * assert.deepStrictEqual(BI.toNumber(BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1)), Option.none())
561
+ * assert.deepStrictEqual(BI.toNumber(BigInt(Number.MIN_SAFE_INTEGER) - BigInt(1)), Option.none())
565
562
  *
566
563
  * @category conversions
567
564
  * @since 2.0.0
@@ -582,12 +579,11 @@ export const toNumber = (b: bigint): Option.Option<number> => {
582
579
  * @param s - The string to be converted to a `bigint`.
583
580
  *
584
581
  * @example
585
- * import { fromString } from "effect/BigInt"
586
- * import { Option } from "effect"
582
+ * import { BigInt as BI, Option } from "effect"
587
583
  *
588
- * assert.deepStrictEqual(fromString("42"), Option.some(BigInt(42)))
589
- * assert.deepStrictEqual(fromString(" "), Option.none())
590
- * assert.deepStrictEqual(fromString("a"), Option.none())
584
+ * assert.deepStrictEqual(BI.fromString("42"), Option.some(BigInt(42)))
585
+ * assert.deepStrictEqual(BI.fromString(" "), Option.none())
586
+ * assert.deepStrictEqual(BI.fromString("a"), Option.none())
591
587
  *
592
588
  * @category conversions
593
589
  * @since 2.4.12
@@ -612,12 +608,11 @@ export const fromString = (s: string): Option.Option<bigint> => {
612
608
  * @param n - The number to be converted to a `bigint`.
613
609
  *
614
610
  * @example
615
- * import { fromNumber } from "effect/BigInt"
616
- * import { Option } from "effect"
611
+ * import { BigInt as BI, Option } from "effect"
617
612
  *
618
- * assert.deepStrictEqual(fromNumber(42), Option.some(BigInt(42)))
619
- * assert.deepStrictEqual(fromNumber(Number.MAX_SAFE_INTEGER + 1), Option.none())
620
- * assert.deepStrictEqual(fromNumber(Number.MIN_SAFE_INTEGER - 1), Option.none())
613
+ * assert.deepStrictEqual(BI.fromNumber(42), Option.some(BigInt(42)))
614
+ * assert.deepStrictEqual(BI.fromNumber(Number.MAX_SAFE_INTEGER + 1), Option.none())
615
+ * assert.deepStrictEqual(BI.fromNumber(Number.MIN_SAFE_INTEGER - 1), Option.none())
621
616
  *
622
617
  * @category conversions
623
618
  * @since 2.4.12
package/src/Boolean.ts CHANGED
@@ -17,7 +17,7 @@ import * as predicate from "./Predicate.js"
17
17
  * @param input - The value to test.
18
18
  *
19
19
  * @example
20
- * import { isBoolean } from 'effect/Boolean'
20
+ * import { isBoolean } from "effect/Boolean"
21
21
  *
22
22
  * assert.deepStrictEqual(isBoolean(true), true)
23
23
  * assert.deepStrictEqual(isBoolean("true"), false)
@@ -36,9 +36,9 @@ export const isBoolean: (input: unknown) => input is boolean = predicate.isBoole
36
36
  * @param onTrue - a lazy evaluation function that will be executed when the `value` is `true`.
37
37
  *
38
38
  * @example
39
- * import * as B from "effect/Boolean"
39
+ * import { Boolean } from "effect"
40
40
  *
41
- * assert.deepStrictEqual(B.match(true, { onFalse: () => "It's false!", onTrue: () => "It's true!" }), "It's true!")
41
+ * assert.deepStrictEqual(Boolean.match(true, { onFalse: () => "It's false!", onTrue: () => "It's true!" }), "It's true!")
42
42
  *
43
43
  * @category pattern matching
44
44
  * @since 2.0.0
@@ -73,7 +73,7 @@ export const Order: order.Order<boolean> = order.boolean
73
73
  * Negates the given boolean: `!self`
74
74
  *
75
75
  * @example
76
- * import { not } from 'effect/Boolean'
76
+ * import { not } from "effect/Boolean"
77
77
  *
78
78
  * assert.deepStrictEqual(not(true), false)
79
79
  * assert.deepStrictEqual(not(false), true)
@@ -87,7 +87,7 @@ export const not = (self: boolean): boolean => !self
87
87
  * Combines two boolean using AND: `self && that`.
88
88
  *
89
89
  * @example
90
- * import { and } from 'effect/Boolean'
90
+ * import { and } from "effect/Boolean"
91
91
  *
92
92
  * assert.deepStrictEqual(and(true, true), true)
93
93
  * assert.deepStrictEqual(and(true, false), false)
@@ -106,7 +106,7 @@ export const and: {
106
106
  * Combines two boolean using NAND: `!(self && that)`.
107
107
  *
108
108
  * @example
109
- * import { nand } from 'effect/Boolean'
109
+ * import { nand } from "effect/Boolean"
110
110
  *
111
111
  * assert.deepStrictEqual(nand(true, true), false)
112
112
  * assert.deepStrictEqual(nand(true, false), true)
@@ -125,7 +125,7 @@ export const nand: {
125
125
  * Combines two boolean using OR: `self || that`.
126
126
  *
127
127
  * @example
128
- * import { or } from 'effect/Boolean'
128
+ * import { or } from "effect/Boolean"
129
129
  *
130
130
  * assert.deepStrictEqual(or(true, true), true)
131
131
  * assert.deepStrictEqual(or(true, false), true)
@@ -144,7 +144,7 @@ export const or: {
144
144
  * Combines two booleans using NOR: `!(self || that)`.
145
145
  *
146
146
  * @example
147
- * import { nor } from 'effect/Boolean'
147
+ * import { nor } from "effect/Boolean"
148
148
  *
149
149
  * assert.deepStrictEqual(nor(true, true), false)
150
150
  * assert.deepStrictEqual(nor(true, false), false)
@@ -163,7 +163,7 @@ export const nor: {
163
163
  * Combines two booleans using XOR: `(!self && that) || (self && !that)`.
164
164
  *
165
165
  * @example
166
- * import { xor } from 'effect/Boolean'
166
+ * import { xor } from "effect/Boolean"
167
167
  *
168
168
  * assert.deepStrictEqual(xor(true, true), false)
169
169
  * assert.deepStrictEqual(xor(true, false), true)
@@ -182,7 +182,7 @@ export const xor: {
182
182
  * Combines two booleans using EQV (aka XNOR): `!xor(self, that)`.
183
183
  *
184
184
  * @example
185
- * import { eqv } from 'effect/Boolean'
185
+ * import { eqv } from "effect/Boolean"
186
186
  *
187
187
  * assert.deepStrictEqual(eqv(true, true), true)
188
188
  * assert.deepStrictEqual(eqv(true, false), false)
@@ -201,7 +201,7 @@ export const eqv: {
201
201
  * Combines two booleans using an implication: `(!self || that)`.
202
202
  *
203
203
  * @example
204
- * import { implies } from 'effect/Boolean'
204
+ * import { implies } from "effect/Boolean"
205
205
  *
206
206
  * assert.deepStrictEqual(implies(true, true), true)
207
207
  * assert.deepStrictEqual(implies(true, false), false)
@@ -222,7 +222,7 @@ export const implies: {
222
222
  * @param collection - An iterable collection of booleans.
223
223
  *
224
224
  * @example
225
- * import { every } from 'effect/Boolean'
225
+ * import { every } from "effect/Boolean"
226
226
  *
227
227
  * assert.deepStrictEqual(every([true, true, true]), true)
228
228
  * assert.deepStrictEqual(every([true, false, true]), false)
@@ -244,7 +244,7 @@ export const every = (collection: Iterable<boolean>): boolean => {
244
244
  * @param collection - An iterable collection of booleans.
245
245
  *
246
246
  * @example
247
- * import { some } from 'effect/Boolean'
247
+ * import { some } from "effect/Boolean"
248
248
  *
249
249
  * assert.deepStrictEqual(some([true, false, true]), true)
250
250
  * assert.deepStrictEqual(some([false, false, false]), false)
package/src/Brand.ts CHANGED
@@ -196,7 +196,7 @@ export const errors: (...errors: Array<Brand.BrandErrors>) => Brand.BrandErrors
196
196
  * @param onFailure - Takes the unbranded value that did not pass the `refinement` predicate and returns a `BrandErrors`.
197
197
  *
198
198
  * @example
199
- * import * as Brand from "effect/Brand"
199
+ * import { Brand } from "effect"
200
200
  *
201
201
  * type Int = number & Brand.Brand<"Int">
202
202
  *
@@ -247,7 +247,7 @@ export function refined<A extends Brand<any>>(
247
247
  * If you also want to perform some validation, see {@link refined}.
248
248
  *
249
249
  * @example
250
- * import * as Brand from "effect/Brand"
250
+ * import { Brand } from "effect"
251
251
  *
252
252
  * type UserId = number & Brand.Brand<"UserId">
253
253
  *
@@ -275,7 +275,7 @@ export const nominal = <A extends Brand<any>>(): Brand.Constructor<
275
275
  * This API is useful when you want to validate that the input data passes multiple brand validators.
276
276
  *
277
277
  * @example
278
- * import * as Brand from "effect/Brand"
278
+ * import { Brand } from "effect"
279
279
  *
280
280
  * type Int = number & Brand.Brand<"Int">
281
281
  * const Int = Brand.refined<Int>(
package/src/Chunk.ts CHANGED
@@ -551,7 +551,7 @@ export const dropWhile: {
551
551
  * If either chunk is non-empty, the result is also a non-empty chunk.
552
552
  *
553
553
  * @example
554
- * import * as Chunk from "effect/Chunk"
554
+ * import { Chunk } from "effect"
555
555
  *
556
556
  * assert.deepStrictEqual(
557
557
  * Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray),
@@ -575,7 +575,7 @@ export const prependAll: {
575
575
  * If either chunk is non-empty, the result is also a non-empty chunk.
576
576
  *
577
577
  * @example
578
- * import * as Chunk from "effect/Chunk"
578
+ * import { Chunk } from "effect"
579
579
  *
580
580
  * assert.deepStrictEqual(
581
581
  * Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray),
@@ -866,7 +866,7 @@ export declare namespace Chunk {
866
866
  * If the input chunk is non-empty, the resulting chunk will also be non-empty.
867
867
  *
868
868
  * @example
869
- * import * as Chunk from "effect/Chunk"
869
+ * import { Chunk } from "effect"
870
870
  *
871
871
  * assert.deepStrictEqual(
872
872
  * Chunk.map(Chunk.make(1, 2), (n) => n + 1),