effect 3.1.0 → 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 (278) 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/Equal.js +26 -4
  22. package/dist/cjs/Equal.js.map +1 -1
  23. package/dist/cjs/FiberHandle.js.map +1 -1
  24. package/dist/cjs/FiberMap.js.map +1 -1
  25. package/dist/cjs/FiberSet.js.map +1 -1
  26. package/dist/cjs/Function.js +2 -2
  27. package/dist/cjs/Function.js.map +1 -1
  28. package/dist/cjs/Hash.js +29 -12
  29. package/dist/cjs/Hash.js.map +1 -1
  30. package/dist/cjs/Iterable.js +10 -13
  31. package/dist/cjs/Iterable.js.map +1 -1
  32. package/dist/cjs/List.js +2 -2
  33. package/dist/cjs/Metric.js +5 -7
  34. package/dist/cjs/Metric.js.map +1 -1
  35. package/dist/cjs/Number.js +20 -21
  36. package/dist/cjs/Number.js.map +1 -1
  37. package/dist/cjs/Option.js +223 -164
  38. package/dist/cjs/Option.js.map +1 -1
  39. package/dist/cjs/Order.js +1 -2
  40. package/dist/cjs/Order.js.map +1 -1
  41. package/dist/cjs/Ordering.js +2 -2
  42. package/dist/cjs/Predicate.js +9 -12
  43. package/dist/cjs/Predicate.js.map +1 -1
  44. package/dist/cjs/Readable.js.map +1 -1
  45. package/dist/cjs/Record.js +35 -47
  46. package/dist/cjs/Record.js.map +1 -1
  47. package/dist/cjs/RegExp.js +1 -1
  48. package/dist/cjs/Request.js +2 -2
  49. package/dist/cjs/Request.js.map +1 -1
  50. package/dist/cjs/Stream.js +82 -4
  51. package/dist/cjs/Stream.js.map +1 -1
  52. package/dist/cjs/String.js +81 -111
  53. package/dist/cjs/String.js.map +1 -1
  54. package/dist/cjs/Struct.js +13 -19
  55. package/dist/cjs/Struct.js.map +1 -1
  56. package/dist/cjs/Subscribable.js.map +1 -1
  57. package/dist/cjs/Symbol.js +3 -3
  58. package/dist/cjs/TestAnnotation.js.map +1 -1
  59. package/dist/cjs/TestAnnotationMap.js.map +1 -1
  60. package/dist/cjs/TestAnnotations.js.map +1 -1
  61. package/dist/cjs/TestClock.js.map +1 -1
  62. package/dist/cjs/TestLive.js.map +1 -1
  63. package/dist/cjs/TestSized.js.map +1 -1
  64. package/dist/cjs/Trie.js +28 -44
  65. package/dist/cjs/Trie.js.map +1 -1
  66. package/dist/cjs/Utils.js +35 -1
  67. package/dist/cjs/Utils.js.map +1 -1
  68. package/dist/cjs/internal/core-effect.js +4 -11
  69. package/dist/cjs/internal/core-effect.js.map +1 -1
  70. package/dist/cjs/internal/core.js +16 -4
  71. package/dist/cjs/internal/core.js.map +1 -1
  72. package/dist/cjs/internal/doNotation.js +23 -0
  73. package/dist/cjs/internal/doNotation.js.map +1 -0
  74. package/dist/cjs/internal/groupBy.js.map +1 -1
  75. package/dist/cjs/internal/stream.js +3 -7
  76. package/dist/cjs/internal/stream.js.map +1 -1
  77. package/dist/cjs/internal/version.js +1 -1
  78. package/dist/dts/Array.d.ts +10 -13
  79. package/dist/dts/Array.d.ts.map +1 -1
  80. package/dist/dts/BigDecimal.d.ts +14 -17
  81. package/dist/dts/BigDecimal.d.ts.map +1 -1
  82. package/dist/dts/BigInt.d.ts +41 -46
  83. package/dist/dts/BigInt.d.ts.map +1 -1
  84. package/dist/dts/Boolean.d.ts +13 -13
  85. package/dist/dts/Brand.d.ts +3 -3
  86. package/dist/dts/Chunk.d.ts +3 -3
  87. package/dist/dts/Context.d.ts +15 -20
  88. package/dist/dts/Context.d.ts.map +1 -1
  89. package/dist/dts/Cron.d.ts +3 -6
  90. package/dist/dts/Cron.d.ts.map +1 -1
  91. package/dist/dts/Data.d.ts +10 -16
  92. package/dist/dts/Data.d.ts.map +1 -1
  93. package/dist/dts/Duration.d.ts +1 -1
  94. package/dist/dts/Effect.d.ts +120 -26
  95. package/dist/dts/Effect.d.ts.map +1 -1
  96. package/dist/dts/Either.d.ts +155 -64
  97. package/dist/dts/Either.d.ts.map +1 -1
  98. package/dist/dts/Equal.d.ts.map +1 -1
  99. package/dist/dts/FiberHandle.d.ts.map +1 -1
  100. package/dist/dts/FiberMap.d.ts.map +1 -1
  101. package/dist/dts/FiberSet.d.ts.map +1 -1
  102. package/dist/dts/Function.d.ts +4 -2
  103. package/dist/dts/Function.d.ts.map +1 -1
  104. package/dist/dts/Hash.d.ts.map +1 -1
  105. package/dist/dts/HashMap.d.ts +2 -2
  106. package/dist/dts/Iterable.d.ts +10 -13
  107. package/dist/dts/Iterable.d.ts.map +1 -1
  108. package/dist/dts/List.d.ts +2 -2
  109. package/dist/dts/Metric.d.ts +5 -7
  110. package/dist/dts/Metric.d.ts.map +1 -1
  111. package/dist/dts/Number.d.ts +20 -21
  112. package/dist/dts/Number.d.ts.map +1 -1
  113. package/dist/dts/Option.d.ts +245 -155
  114. package/dist/dts/Option.d.ts.map +1 -1
  115. package/dist/dts/Order.d.ts +1 -2
  116. package/dist/dts/Order.d.ts.map +1 -1
  117. package/dist/dts/Ordering.d.ts +2 -2
  118. package/dist/dts/Predicate.d.ts +9 -12
  119. package/dist/dts/Predicate.d.ts.map +1 -1
  120. package/dist/dts/Readable.d.ts.map +1 -1
  121. package/dist/dts/Record.d.ts +35 -47
  122. package/dist/dts/Record.d.ts.map +1 -1
  123. package/dist/dts/RegExp.d.ts +1 -1
  124. package/dist/dts/Request.d.ts +2 -2
  125. package/dist/dts/Request.d.ts.map +1 -1
  126. package/dist/dts/Stream.d.ts +136 -31
  127. package/dist/dts/Stream.d.ts.map +1 -1
  128. package/dist/dts/String.d.ts +81 -111
  129. package/dist/dts/String.d.ts.map +1 -1
  130. package/dist/dts/Struct.d.ts +13 -19
  131. package/dist/dts/Struct.d.ts.map +1 -1
  132. package/dist/dts/Subscribable.d.ts.map +1 -1
  133. package/dist/dts/Symbol.d.ts +3 -3
  134. package/dist/dts/TestAnnotation.d.ts.map +1 -1
  135. package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
  136. package/dist/dts/TestAnnotations.d.ts.map +1 -1
  137. package/dist/dts/TestClock.d.ts +1 -5
  138. package/dist/dts/TestClock.d.ts.map +1 -1
  139. package/dist/dts/TestLive.d.ts.map +1 -1
  140. package/dist/dts/TestSized.d.ts.map +1 -1
  141. package/dist/dts/Trie.d.ts +28 -44
  142. package/dist/dts/Trie.d.ts.map +1 -1
  143. package/dist/dts/Types.d.ts +10 -10
  144. package/dist/dts/Utils.d.ts +19 -0
  145. package/dist/dts/Utils.d.ts.map +1 -1
  146. package/dist/dts/internal/core.d.ts.map +1 -1
  147. package/dist/dts/internal/doNotation.d.ts +2 -0
  148. package/dist/dts/internal/doNotation.d.ts.map +1 -0
  149. package/dist/dts/internal/stream.d.ts.map +1 -1
  150. package/dist/esm/Array.js +10 -13
  151. package/dist/esm/Array.js.map +1 -1
  152. package/dist/esm/BigDecimal.js +14 -17
  153. package/dist/esm/BigDecimal.js.map +1 -1
  154. package/dist/esm/BigInt.js +41 -46
  155. package/dist/esm/BigInt.js.map +1 -1
  156. package/dist/esm/Boolean.js +13 -13
  157. package/dist/esm/Brand.js +2 -2
  158. package/dist/esm/Chunk.js +3 -3
  159. package/dist/esm/Context.js +15 -20
  160. package/dist/esm/Context.js.map +1 -1
  161. package/dist/esm/Cron.js +3 -6
  162. package/dist/esm/Cron.js.map +1 -1
  163. package/dist/esm/Data.js +9 -15
  164. package/dist/esm/Data.js.map +1 -1
  165. package/dist/esm/Duration.js +1 -1
  166. package/dist/esm/Effect.js +101 -11
  167. package/dist/esm/Effect.js.map +1 -1
  168. package/dist/esm/Either.js +141 -61
  169. package/dist/esm/Either.js.map +1 -1
  170. package/dist/esm/Equal.js +26 -4
  171. package/dist/esm/Equal.js.map +1 -1
  172. package/dist/esm/FiberHandle.js.map +1 -1
  173. package/dist/esm/FiberMap.js.map +1 -1
  174. package/dist/esm/FiberSet.js.map +1 -1
  175. package/dist/esm/Function.js +2 -2
  176. package/dist/esm/Function.js.map +1 -1
  177. package/dist/esm/Hash.js +30 -13
  178. package/dist/esm/Hash.js.map +1 -1
  179. package/dist/esm/Iterable.js +10 -13
  180. package/dist/esm/Iterable.js.map +1 -1
  181. package/dist/esm/List.js +2 -2
  182. package/dist/esm/Metric.js +5 -7
  183. package/dist/esm/Metric.js.map +1 -1
  184. package/dist/esm/Number.js +20 -21
  185. package/dist/esm/Number.js.map +1 -1
  186. package/dist/esm/Option.js +249 -164
  187. package/dist/esm/Option.js.map +1 -1
  188. package/dist/esm/Order.js +1 -2
  189. package/dist/esm/Order.js.map +1 -1
  190. package/dist/esm/Ordering.js +2 -2
  191. package/dist/esm/Predicate.js +9 -12
  192. package/dist/esm/Predicate.js.map +1 -1
  193. package/dist/esm/Readable.js.map +1 -1
  194. package/dist/esm/Record.js +35 -47
  195. package/dist/esm/Record.js.map +1 -1
  196. package/dist/esm/RegExp.js +1 -1
  197. package/dist/esm/Request.js +2 -2
  198. package/dist/esm/Request.js.map +1 -1
  199. package/dist/esm/Stream.js +107 -6
  200. package/dist/esm/Stream.js.map +1 -1
  201. package/dist/esm/String.js +81 -111
  202. package/dist/esm/String.js.map +1 -1
  203. package/dist/esm/Struct.js +13 -19
  204. package/dist/esm/Struct.js.map +1 -1
  205. package/dist/esm/Subscribable.js.map +1 -1
  206. package/dist/esm/Symbol.js +3 -3
  207. package/dist/esm/TestAnnotation.js.map +1 -1
  208. package/dist/esm/TestAnnotationMap.js.map +1 -1
  209. package/dist/esm/TestAnnotations.js.map +1 -1
  210. package/dist/esm/TestClock.js.map +1 -1
  211. package/dist/esm/TestLive.js.map +1 -1
  212. package/dist/esm/TestSized.js.map +1 -1
  213. package/dist/esm/Trie.js +28 -44
  214. package/dist/esm/Trie.js.map +1 -1
  215. package/dist/esm/Utils.js +33 -0
  216. package/dist/esm/Utils.js.map +1 -1
  217. package/dist/esm/internal/core-effect.js +4 -11
  218. package/dist/esm/internal/core-effect.js.map +1 -1
  219. package/dist/esm/internal/core.js +16 -4
  220. package/dist/esm/internal/core.js.map +1 -1
  221. package/dist/esm/internal/doNotation.js +14 -0
  222. package/dist/esm/internal/doNotation.js.map +1 -0
  223. package/dist/esm/internal/groupBy.js.map +1 -1
  224. package/dist/esm/internal/stream.js +3 -7
  225. package/dist/esm/internal/stream.js.map +1 -1
  226. package/dist/esm/internal/version.js +1 -1
  227. package/package.json +1 -1
  228. package/src/Array.ts +10 -13
  229. package/src/BigDecimal.ts +14 -17
  230. package/src/BigInt.ts +41 -46
  231. package/src/Boolean.ts +13 -13
  232. package/src/Brand.ts +3 -3
  233. package/src/Chunk.ts +3 -3
  234. package/src/Context.ts +15 -20
  235. package/src/Cron.ts +3 -6
  236. package/src/Data.ts +10 -16
  237. package/src/Duration.ts +1 -1
  238. package/src/Effect.ts +122 -32
  239. package/src/Either.ts +161 -94
  240. package/src/Equal.ts +30 -9
  241. package/src/FiberHandle.ts +1 -1
  242. package/src/FiberMap.ts +1 -1
  243. package/src/FiberSet.ts +1 -1
  244. package/src/Function.ts +4 -2
  245. package/src/Hash.ts +30 -13
  246. package/src/HashMap.ts +2 -2
  247. package/src/Iterable.ts +10 -13
  248. package/src/List.ts +2 -2
  249. package/src/Metric.ts +5 -7
  250. package/src/Number.ts +20 -21
  251. package/src/Option.ts +250 -172
  252. package/src/Order.ts +1 -2
  253. package/src/Ordering.ts +2 -2
  254. package/src/Predicate.ts +9 -12
  255. package/src/Readable.ts +1 -1
  256. package/src/Record.ts +35 -47
  257. package/src/RegExp.ts +1 -1
  258. package/src/Request.ts +3 -3
  259. package/src/Stream.ts +137 -36
  260. package/src/String.ts +81 -111
  261. package/src/Struct.ts +13 -19
  262. package/src/Subscribable.ts +1 -1
  263. package/src/Symbol.ts +3 -3
  264. package/src/TestAnnotation.ts +1 -1
  265. package/src/TestAnnotationMap.ts +1 -1
  266. package/src/TestAnnotations.ts +1 -1
  267. package/src/TestClock.ts +1 -5
  268. package/src/TestLive.ts +1 -1
  269. package/src/TestSized.ts +1 -1
  270. package/src/Trie.ts +28 -44
  271. package/src/Types.ts +10 -10
  272. package/src/Utils.ts +40 -2
  273. package/src/internal/core-effect.ts +29 -45
  274. package/src/internal/core.ts +20 -4
  275. package/src/internal/doNotation.ts +77 -0
  276. package/src/internal/groupBy.ts +16 -16
  277. package/src/internal/stream.ts +34 -58
  278. package/src/internal/version.ts +1 -1
package/src/String.ts CHANGED
@@ -23,10 +23,10 @@ import * as predicate from "./Predicate.js"
23
23
  * @param input - The value to test.
24
24
  *
25
25
  * @example
26
- * import { isString } from 'effect/String'
26
+ * import { String } from "effect"
27
27
  *
28
- * assert.deepStrictEqual(isString("a"), true)
29
- * assert.deepStrictEqual(isString(1), false)
28
+ * assert.deepStrictEqual(String.isString("a"), true)
29
+ * assert.deepStrictEqual(String.isString(1), false)
30
30
  *
31
31
  * @category guards
32
32
  * @since 2.0.0
@@ -71,10 +71,9 @@ export const concat: {
71
71
 
72
72
  /**
73
73
  * @example
74
- * import * as S from 'effect/String'
75
- * import { pipe } from 'effect/Function'
74
+ * import { pipe, String } from "effect"
76
75
  *
77
- * assert.deepStrictEqual(pipe('a', S.toUpperCase), 'A')
76
+ * assert.deepStrictEqual(pipe('a', String.toUpperCase), 'A')
78
77
  *
79
78
  * @since 2.0.0
80
79
  */
@@ -82,10 +81,9 @@ export const toUpperCase = <S extends string>(self: S): Uppercase<S> => self.toU
82
81
 
83
82
  /**
84
83
  * @example
85
- * import * as S from 'effect/String'
86
- * import { pipe } from 'effect/Function'
84
+ * import { pipe, String } from "effect"
87
85
  *
88
- * assert.deepStrictEqual(pipe('A', S.toLowerCase), 'a')
86
+ * assert.deepStrictEqual(pipe('A', String.toLowerCase), 'a')
89
87
  *
90
88
  * @since 2.0.0
91
89
  */
@@ -93,10 +91,9 @@ export const toLowerCase = <T extends string>(self: T): Lowercase<T> => self.toL
93
91
 
94
92
  /**
95
93
  * @example
96
- * import * as S from 'effect/String'
97
- * import { pipe } from 'effect/Function'
94
+ * import { pipe, String } from "effect"
98
95
  *
99
- * assert.deepStrictEqual(pipe('abc', S.capitalize), 'Abc')
96
+ * assert.deepStrictEqual(pipe('abc', String.capitalize), 'Abc')
100
97
  *
101
98
  * @since 2.0.0
102
99
  */
@@ -108,10 +105,9 @@ export const capitalize = <T extends string>(self: T): Capitalize<T> => {
108
105
 
109
106
  /**
110
107
  * @example
111
- * import * as S from 'effect/String'
112
- * import { pipe } from 'effect/Function'
108
+ * import { pipe, String } from "effect"
113
109
  *
114
- * assert.deepStrictEqual(pipe('ABC', S.uncapitalize), 'aBC')
110
+ * assert.deepStrictEqual(pipe('ABC', String.uncapitalize), 'aBC')
115
111
  *
116
112
  * @since 2.0.0
117
113
  */
@@ -123,10 +119,9 @@ export const uncapitalize = <T extends string>(self: T): Uncapitalize<T> => {
123
119
 
124
120
  /**
125
121
  * @example
126
- * import * as S from 'effect/String'
127
- * import { pipe } from 'effect/Function'
122
+ * import { pipe, String } from "effect"
128
123
  *
129
- * assert.deepStrictEqual(pipe('abc', S.replace('b', 'd')), 'adc')
124
+ * assert.deepStrictEqual(pipe('abc', String.replace('b', 'd')), 'adc')
130
125
  *
131
126
  * @since 2.0.0
132
127
  */
@@ -140,9 +135,9 @@ export type Trim<A extends string> = TrimEnd<TrimStart<A>>
140
135
 
141
136
  /**
142
137
  * @example
143
- * import * as S from 'effect/String'
138
+ * import { String } from "effect"
144
139
  *
145
- * assert.deepStrictEqual(S.trim(' a '), 'a')
140
+ * assert.deepStrictEqual(String.trim(' a '), 'a')
146
141
  *
147
142
  * @since 2.0.0
148
143
  */
@@ -159,9 +154,9 @@ export type TrimStart<A extends string> = A extends ` ${infer B}` ? TrimStart<B>
159
154
 
160
155
  /**
161
156
  * @example
162
- * import * as S from 'effect/String'
157
+ * import { String } from "effect"
163
158
  *
164
- * assert.deepStrictEqual(S.trimStart(' a '), 'a ')
159
+ * assert.deepStrictEqual(String.trimStart(' a '), 'a ')
165
160
  *
166
161
  * @since 2.0.0
167
162
  */
@@ -178,9 +173,9 @@ export type TrimEnd<A extends string> = A extends `${infer B} ` ? TrimEnd<B>
178
173
 
179
174
  /**
180
175
  * @example
181
- * import * as S from 'effect/String'
176
+ * import { String } from "effect"
182
177
  *
183
- * assert.deepStrictEqual(S.trimEnd(' a '), ' a')
178
+ * assert.deepStrictEqual(String.trimEnd(' a '), ' a')
184
179
  *
185
180
  * @since 2.0.0
186
181
  */
@@ -188,10 +183,9 @@ export const trimEnd = <A extends string>(self: A): TrimEnd<A> => self.trimEnd()
188
183
 
189
184
  /**
190
185
  * @example
191
- * import * as S from 'effect/String'
192
- * import { pipe } from 'effect/Function'
186
+ * import { pipe, String } from "effect"
193
187
  *
194
- * assert.deepStrictEqual(pipe('abcd', S.slice(1, 3)), 'bc')
188
+ * assert.deepStrictEqual(pipe('abcd', String.slice(1, 3)), 'bc')
195
189
  *
196
190
  * @since 2.0.0
197
191
  */
@@ -201,10 +195,10 @@ export const slice = (start?: number, end?: number) => (self: string): string =>
201
195
  * Test whether a `string` is empty.
202
196
  *
203
197
  * @example
204
- * import * as S from 'effect/String'
198
+ * import { String } from "effect"
205
199
  *
206
- * assert.deepStrictEqual(S.isEmpty(''), true)
207
- * assert.deepStrictEqual(S.isEmpty('a'), false)
200
+ * assert.deepStrictEqual(String.isEmpty(''), true)
201
+ * assert.deepStrictEqual(String.isEmpty('a'), false)
208
202
  *
209
203
  * @since 2.0.0
210
204
  */
@@ -221,9 +215,9 @@ export const isNonEmpty = (self: string): boolean => self.length > 0
221
215
  * Calculate the number of characters in a `string`.
222
216
  *
223
217
  * @example
224
- * import * as S from 'effect/String'
218
+ * import { String } from "effect"
225
219
  *
226
- * assert.deepStrictEqual(S.length('abc'), 3)
220
+ * assert.deepStrictEqual(String.length('abc'), 3)
227
221
  *
228
222
  * @since 2.0.0
229
223
  */
@@ -231,11 +225,10 @@ export const length = (self: string): number => self.length
231
225
 
232
226
  /**
233
227
  * @example
234
- * import * as S from 'effect/String'
235
- * import { pipe } from 'effect/Function'
228
+ * import { pipe, String } from "effect"
236
229
  *
237
- * assert.deepStrictEqual(pipe('abc', S.split('')), ['a', 'b', 'c'])
238
- * assert.deepStrictEqual(pipe('', S.split('')), [''])
230
+ * assert.deepStrictEqual(pipe('abc', String.split('')), ['a', 'b', 'c'])
231
+ * assert.deepStrictEqual(pipe('', String.split('')), [''])
239
232
  *
240
233
  * @since 2.0.0
241
234
  */
@@ -270,12 +263,10 @@ export const endsWith = (searchString: string, position?: number) => (self: stri
270
263
 
271
264
  /**
272
265
  * @example
273
- * import * as S from 'effect/String'
274
- * import * as Option from 'effect/Option'
275
- * import { pipe } from 'effect/Function'
266
+ * import { pipe, String, Option } from "effect"
276
267
  *
277
- * assert.deepStrictEqual(pipe("abc", S.charCodeAt(1)), Option.some(98))
278
- * assert.deepStrictEqual(pipe("abc", S.charCodeAt(4)), Option.none())
268
+ * assert.deepStrictEqual(pipe("abc", String.charCodeAt(1)), Option.some(98))
269
+ * assert.deepStrictEqual(pipe("abc", String.charCodeAt(4)), Option.none())
279
270
  *
280
271
  * @since 2.0.0
281
272
  */
@@ -290,11 +281,10 @@ export const charCodeAt: {
290
281
 
291
282
  /**
292
283
  * @example
293
- * import * as S from 'effect/String'
294
- * import { pipe } from 'effect/Function'
284
+ * import { pipe, String, Option } from "effect"
295
285
  *
296
- * assert.deepStrictEqual(pipe("abcd", S.substring(1)), "bcd")
297
- * assert.deepStrictEqual(pipe("abcd", S.substring(1, 3)), "bc")
286
+ * assert.deepStrictEqual(pipe("abcd", String.substring(1)), "bcd")
287
+ * assert.deepStrictEqual(pipe("abcd", String.substring(1, 3)), "bc")
298
288
  *
299
289
  * @since 2.0.0
300
290
  */
@@ -302,12 +292,10 @@ export const substring = (start: number, end?: number) => (self: string): string
302
292
 
303
293
  /**
304
294
  * @example
305
- * import * as S from 'effect/String'
306
- * import * as Option from 'effect/Option'
307
- * import { pipe } from 'effect/Function'
295
+ * import { pipe, String, Option } from "effect"
308
296
  *
309
- * assert.deepStrictEqual(pipe("abc", S.at(1)), Option.some("b"))
310
- * assert.deepStrictEqual(pipe("abc", S.at(4)), Option.none())
297
+ * assert.deepStrictEqual(pipe("abc", String.at(1)), Option.some("b"))
298
+ * assert.deepStrictEqual(pipe("abc", String.at(4)), Option.none())
311
299
  *
312
300
  * @since 2.0.0
313
301
  */
@@ -318,12 +306,10 @@ export const at: {
318
306
 
319
307
  /**
320
308
  * @example
321
- * import * as S from 'effect/String'
322
- * import * as Option from 'effect/Option'
323
- * import { pipe } from 'effect/Function'
309
+ * import { pipe, String, Option } from "effect"
324
310
  *
325
- * assert.deepStrictEqual(pipe("abc", S.charAt(1)), Option.some("b"))
326
- * assert.deepStrictEqual(pipe("abc", S.charAt(4)), Option.none())
311
+ * assert.deepStrictEqual(pipe("abc", String.charAt(1)), Option.some("b"))
312
+ * assert.deepStrictEqual(pipe("abc", String.charAt(4)), Option.none())
327
313
  *
328
314
  * @since 2.0.0
329
315
  */
@@ -337,11 +323,9 @@ export const charAt: {
337
323
 
338
324
  /**
339
325
  * @example
340
- * import * as S from 'effect/String'
341
- * import * as Option from 'effect/Option'
342
- * import { pipe } from 'effect/Function'
326
+ * import { pipe, String, Option } from "effect"
343
327
  *
344
- * assert.deepStrictEqual(pipe("abc", S.codePointAt(1)), Option.some(98))
328
+ * assert.deepStrictEqual(pipe("abc", String.codePointAt(1)), Option.some(98))
345
329
  *
346
330
  * @since 2.0.0
347
331
  */
@@ -352,11 +336,9 @@ export const codePointAt: {
352
336
 
353
337
  /**
354
338
  * @example
355
- * import * as S from 'effect/String'
356
- * import * as Option from 'effect/Option'
357
- * import { pipe } from 'effect/Function'
339
+ * import { pipe, String, Option } from "effect"
358
340
  *
359
- * assert.deepStrictEqual(pipe("abbbc", S.indexOf("b")), Option.some(1))
341
+ * assert.deepStrictEqual(pipe("abbbc", String.indexOf("b")), Option.some(1))
360
342
  *
361
343
  * @since 2.0.0
362
344
  */
@@ -365,12 +347,10 @@ export const indexOf = (searchString: string) => (self: string): Option.Option<n
365
347
 
366
348
  /**
367
349
  * @example
368
- * import * as S from 'effect/String'
369
- * import * as Option from 'effect/Option'
370
- * import { pipe } from 'effect/Function'
350
+ * import { pipe, String, Option } from "effect"
371
351
  *
372
- * assert.deepStrictEqual(pipe("abbbc", S.lastIndexOf("b")), Option.some(3))
373
- * assert.deepStrictEqual(pipe("abbbc", S.lastIndexOf("d")), Option.none())
352
+ * assert.deepStrictEqual(pipe("abbbc", String.lastIndexOf("b")), Option.some(3))
353
+ * assert.deepStrictEqual(pipe("abbbc", String.lastIndexOf("d")), Option.none())
374
354
  *
375
355
  * @since 2.0.0
376
356
  */
@@ -379,12 +359,11 @@ export const lastIndexOf = (searchString: string) => (self: string): Option.Opti
379
359
 
380
360
  /**
381
361
  * @example
382
- * import * as S from 'effect/String'
383
- * import { pipe } from 'effect/Function'
362
+ * import { pipe, String } from "effect"
384
363
  *
385
- * assert.deepStrictEqual(pipe("a", S.localeCompare("b")), -1)
386
- * assert.deepStrictEqual(pipe("b", S.localeCompare("a")), 1)
387
- * assert.deepStrictEqual(pipe("a", S.localeCompare("a")), 0)
364
+ * assert.deepStrictEqual(pipe("a", String.localeCompare("b")), -1)
365
+ * assert.deepStrictEqual(pipe("b", String.localeCompare("a")), 1)
366
+ * assert.deepStrictEqual(pipe("a", String.localeCompare("a")), 0)
388
367
  *
389
368
  * @since 2.0.0
390
369
  */
@@ -409,15 +388,14 @@ export const matchAll = (regexp: RegExp) => (self: string): IterableIterator<Reg
409
388
 
410
389
  /**
411
390
  * @example
412
- * import * as S from 'effect/String'
413
- * import { pipe } from 'effect/Function'
391
+ * import { pipe, String } from "effect"
414
392
  *
415
393
  * const str = "\u1E9B\u0323";
416
- * assert.deepStrictEqual(pipe(str, S.normalize()), "\u1E9B\u0323")
417
- * assert.deepStrictEqual(pipe(str, S.normalize("NFC")), "\u1E9B\u0323")
418
- * assert.deepStrictEqual(pipe(str, S.normalize("NFD")), "\u017F\u0323\u0307")
419
- * assert.deepStrictEqual(pipe(str, S.normalize("NFKC")), "\u1E69")
420
- * assert.deepStrictEqual(pipe(str, S.normalize("NFKD")), "\u0073\u0323\u0307")
394
+ * assert.deepStrictEqual(pipe(str, String.normalize()), "\u1E9B\u0323")
395
+ * assert.deepStrictEqual(pipe(str, String.normalize("NFC")), "\u1E9B\u0323")
396
+ * assert.deepStrictEqual(pipe(str, String.normalize("NFD")), "\u017F\u0323\u0307")
397
+ * assert.deepStrictEqual(pipe(str, String.normalize("NFKC")), "\u1E69")
398
+ * assert.deepStrictEqual(pipe(str, String.normalize("NFKD")), "\u0073\u0323\u0307")
421
399
  *
422
400
  * @since 2.0.0
423
401
  */
@@ -425,11 +403,10 @@ export const normalize = (form?: "NFC" | "NFD" | "NFKC" | "NFKD") => (self: stri
425
403
 
426
404
  /**
427
405
  * @example
428
- * import * as S from 'effect/String'
429
- * import { pipe } from 'effect/Function'
406
+ * import { pipe, String } from "effect"
430
407
  *
431
- * assert.deepStrictEqual(pipe("a", S.padEnd(5)), "a ")
432
- * assert.deepStrictEqual(pipe("a", S.padEnd(5, "_")), "a____")
408
+ * assert.deepStrictEqual(pipe("a", String.padEnd(5)), "a ")
409
+ * assert.deepStrictEqual(pipe("a", String.padEnd(5, "_")), "a____")
433
410
  *
434
411
  * @since 2.0.0
435
412
  */
@@ -438,11 +415,10 @@ export const padEnd = (maxLength: number, fillString?: string) => (self: string)
438
415
 
439
416
  /**
440
417
  * @example
441
- * import * as S from 'effect/String'
442
- * import { pipe } from 'effect/Function'
418
+ * import { pipe, String } from "effect"
443
419
  *
444
- * assert.deepStrictEqual(pipe("a", S.padStart(5)), " a")
445
- * assert.deepStrictEqual(pipe("a", S.padStart(5, "_")), "____a")
420
+ * assert.deepStrictEqual(pipe("a", String.padStart(5)), " a")
421
+ * assert.deepStrictEqual(pipe("a", String.padStart(5, "_")), "____a")
446
422
  *
447
423
  * @since 2.0.0
448
424
  */
@@ -451,10 +427,9 @@ export const padStart = (maxLength: number, fillString?: string) => (self: strin
451
427
 
452
428
  /**
453
429
  * @example
454
- * import * as S from 'effect/String'
455
- * import { pipe } from 'effect/Function'
430
+ * import { pipe, String } from "effect"
456
431
  *
457
- * assert.deepStrictEqual(pipe("a", S.repeat(5)), "aaaaa")
432
+ * assert.deepStrictEqual(pipe("a", String.repeat(5)), "aaaaa")
458
433
  *
459
434
  * @since 2.0.0
460
435
  */
@@ -462,11 +437,10 @@ export const repeat = (count: number) => (self: string): string => self.repeat(c
462
437
 
463
438
  /**
464
439
  * @example
465
- * import * as S from 'effect/String'
466
- * import { pipe } from 'effect/Function'
440
+ * import { pipe, String } from "effect"
467
441
  *
468
- * assert.deepStrictEqual(pipe("ababb", S.replaceAll("b", "c")), "acacc")
469
- * assert.deepStrictEqual(pipe("ababb", S.replaceAll(/ba/g, "cc")), "accbb")
442
+ * assert.deepStrictEqual(pipe("ababb", String.replaceAll("b", "c")), "acacc")
443
+ * assert.deepStrictEqual(pipe("ababb", String.replaceAll(/ba/g, "cc")), "accbb")
470
444
  *
471
445
  * @since 2.0.0
472
446
  */
@@ -475,13 +449,11 @@ export const replaceAll = (searchValue: string | RegExp, replaceValue: string) =
475
449
 
476
450
  /**
477
451
  * @example
478
- * import * as S from 'effect/String'
479
- * import * as Option from 'effect/Option'
480
- * import { pipe } from 'effect/Function'
452
+ * import { pipe, String, Option } from "effect"
481
453
  *
482
- * assert.deepStrictEqual(pipe("ababb", S.search("b")), Option.some(1))
483
- * assert.deepStrictEqual(pipe("ababb", S.search(/abb/)), Option.some(2))
484
- * assert.deepStrictEqual(pipe("ababb", S.search("d")), Option.none())
454
+ * assert.deepStrictEqual(pipe("ababb", String.search("b")), Option.some(1))
455
+ * assert.deepStrictEqual(pipe("ababb", String.search(/abb/)), Option.some(2))
456
+ * assert.deepStrictEqual(pipe("ababb", String.search("d")), Option.none())
485
457
  *
486
458
  * @since 2.0.0
487
459
  */
@@ -496,11 +468,10 @@ export const search: {
496
468
 
497
469
  /**
498
470
  * @example
499
- * import * as S from 'effect/String'
500
- * import { pipe } from 'effect/Function'
471
+ * import { pipe, String } from "effect"
501
472
  *
502
473
  * const str = "\u0130"
503
- * assert.deepStrictEqual(pipe(str, S.toLocaleLowerCase("tr")), "i")
474
+ * assert.deepStrictEqual(pipe(str, String.toLocaleLowerCase("tr")), "i")
504
475
  *
505
476
  * @since 2.0.0
506
477
  */
@@ -509,11 +480,10 @@ export const toLocaleLowerCase = (locale?: string | Array<string>) => (self: str
509
480
 
510
481
  /**
511
482
  * @example
512
- * import * as S from 'effect/String'
513
- * import { pipe } from 'effect/Function'
483
+ * import { pipe, String } from "effect"
514
484
  *
515
485
  * const str = "i\u0307"
516
- * assert.deepStrictEqual(pipe(str, S.toLocaleUpperCase("lt-LT")), "I")
486
+ * assert.deepStrictEqual(pipe(str, String.toLocaleUpperCase("lt-LT")), "I")
517
487
  *
518
488
  * @since 2.0.0
519
489
  */
@@ -531,9 +501,9 @@ export const toLocaleUpperCase = (locale?: string | Array<string>) => (self: str
531
501
  * If `n` is a float, it will be rounded down to the nearest integer.
532
502
  *
533
503
  * @example
534
- * import * as S from 'effect/String'
504
+ * import { String } from "effect"
535
505
  *
536
- * assert.deepStrictEqual(S.takeLeft("Hello World", 5), "Hello")
506
+ * assert.deepStrictEqual(String.takeLeft("Hello World", 5), "Hello")
537
507
  *
538
508
  * @since 2.0.0
539
509
  */
@@ -553,9 +523,9 @@ export const takeLeft: {
553
523
  * If `n` is a float, it will be rounded down to the nearest integer.
554
524
  *
555
525
  * @example
556
- * import * as S from 'effect/String'
526
+ * import { String } from "effect"
557
527
  *
558
- * assert.deepStrictEqual(S.takeRight("Hello World", 5), "World")
528
+ * assert.deepStrictEqual(String.takeRight("Hello World", 5), "World")
559
529
  *
560
530
  * @since 2.0.0
561
531
  */
package/src/Struct.ts CHANGED
@@ -14,11 +14,10 @@ import type { MatchRecord, Simplify } from "./Types.js"
14
14
  * Create a new object by picking properties of an existing object.
15
15
  *
16
16
  * @example
17
- * import { pick } from "effect/Struct"
18
- * import { pipe } from "effect/Function"
17
+ * import { pipe, Struct } from "effect"
19
18
  *
20
- * assert.deepStrictEqual(pipe({ a: "a", b: 1, c: true }, pick("a", "b")), { a: "a", b: 1 })
21
- * assert.deepStrictEqual(pick({ a: "a", b: 1, c: true }, "a", "b"), { a: "a", b: 1 })
19
+ * assert.deepStrictEqual(pipe({ a: "a", b: 1, c: true }, Struct.pick("a", "b")), { a: "a", b: 1 })
20
+ * assert.deepStrictEqual(Struct.pick({ a: "a", b: 1, c: true }, "a", "b"), { a: "a", b: 1 })
22
21
  *
23
22
  * @since 2.0.0
24
23
  */
@@ -49,11 +48,10 @@ export const pick: {
49
48
  * Create a new object by omitting properties of an existing object.
50
49
  *
51
50
  * @example
52
- * import { omit } from "effect/Struct"
53
- * import { pipe } from "effect/Function"
51
+ * import { pipe, Struct } from "effect"
54
52
  *
55
- * assert.deepStrictEqual(pipe({ a: "a", b: 1, c: true }, omit("c")), { a: "a", b: 1 })
56
- * assert.deepStrictEqual(omit({ a: "a", b: 1, c: true }, "c"), { a: "a", b: 1 })
53
+ * assert.deepStrictEqual(pipe({ a: "a", b: 1, c: true }, Struct.omit("c")), { a: "a", b: 1 })
54
+ * assert.deepStrictEqual(Struct.omit({ a: "a", b: 1, c: true }, "c"), { a: "a", b: 1 })
57
55
  *
58
56
  * @since 2.0.0
59
57
  */
@@ -83,13 +81,11 @@ export const omit: {
83
81
  * Alias of {@link Equivalence.struct}.
84
82
  *
85
83
  * @example
86
- * import { getEquivalence } from "effect/Struct"
87
- * import * as S from "effect/String"
88
- * import * as N from "effect/Number"
84
+ * import { Struct, String, Number } from "effect"
89
85
  *
90
- * const PersonEquivalence = getEquivalence({
91
- * name: S.Equivalence,
92
- * age: N.Equivalence
86
+ * const PersonEquivalence = Struct.getEquivalence({
87
+ * name: String.Equivalence,
88
+ * age: Number.Equivalence
93
89
  * })
94
90
  *
95
91
  * assert.deepStrictEqual(
@@ -136,13 +132,12 @@ type Transformed<O, T extends PartialTransform<O>> =
136
132
  * If no transformation function is provided for a key, it will return the origional value for that key.
137
133
  *
138
134
  * @example
139
- * import { evolve } from 'effect/Struct'
140
- * import { pipe } from 'effect/Function'
135
+ * import { pipe, Struct } from "effect"
141
136
  *
142
137
  * assert.deepStrictEqual(
143
138
  * pipe(
144
139
  * { a: 'a', b: 1, c: 3 },
145
- * evolve({
140
+ * Struct.evolve({
146
141
  * a: (a) => a.length,
147
142
  * b: (b) => b * 2
148
143
  * })
@@ -178,8 +173,7 @@ export const evolve: {
178
173
  * Retrieves the value associated with the specified key from a struct.
179
174
  *
180
175
  * @example
181
- * import * as Struct from "effect/Struct"
182
- * import { pipe } from "effect/Function"
176
+ * import { pipe, Struct } from "effect"
183
177
  *
184
178
  * const value = pipe({ a: 1, b: 2 }, Struct.get("a"))
185
179
  *
@@ -13,7 +13,7 @@ import type { NoInfer } from "./Types.js"
13
13
  * @since 2.0.0
14
14
  * @category type ids
15
15
  */
16
- export const TypeId = Symbol.for("effect/Subscribable")
16
+ export const TypeId: unique symbol = Symbol.for("effect/Subscribable")
17
17
 
18
18
  /**
19
19
  * @since 2.0.0
package/src/Symbol.ts CHANGED
@@ -11,10 +11,10 @@ import * as predicate from "./Predicate.js"
11
11
  * @param input - The value to test.
12
12
  *
13
13
  * @example
14
- * import { isSymbol } from "effect/Predicate"
14
+ * import { Predicate } from "effect"
15
15
  *
16
- * assert.deepStrictEqual(isSymbol(Symbol.for("a")), true)
17
- * assert.deepStrictEqual(isSymbol("a"), false)
16
+ * assert.deepStrictEqual(Predicate.isSymbol(Symbol.for("a")), true)
17
+ * assert.deepStrictEqual(Predicate.isSymbol("a"), false)
18
18
  *
19
19
  * @category guards
20
20
  * @since 2.0.0
@@ -20,7 +20,7 @@ const TestAnnotationSymbolKey = "effect/TestAnnotation"
20
20
  /**
21
21
  * @since 2.0.0
22
22
  */
23
- export const TestAnnotationTypeId = Symbol.for(TestAnnotationSymbolKey)
23
+ export const TestAnnotationTypeId: unique symbol = Symbol.for(TestAnnotationSymbolKey)
24
24
 
25
25
  /**
26
26
  * @since 2.0.0
@@ -9,7 +9,7 @@ import type * as TestAnnotation from "./TestAnnotation.js"
9
9
  /**
10
10
  * @since 2.0.0
11
11
  */
12
- export const TestAnnotationMapTypeId = Symbol.for("effect/TestAnnotationMap")
12
+ export const TestAnnotationMapTypeId: unique symbol = Symbol.for("effect/TestAnnotationMap")
13
13
 
14
14
  /**
15
15
  * @since 2.0.0
@@ -20,7 +20,7 @@ import * as TestAnnotationMap from "./TestAnnotationMap.js"
20
20
  /**
21
21
  * @since 2.0.0
22
22
  */
23
- export const TestAnnotationsTypeId = Symbol.for("effect/TestAnnotations")
23
+ export const TestAnnotationsTypeId: unique symbol = Symbol.for("effect/TestAnnotations")
24
24
 
25
25
  /**
26
26
  * @since 2.0.0
package/src/TestClock.ts CHANGED
@@ -47,11 +47,7 @@ import * as Live from "./TestLive.js"
47
47
  * For example, here is how we can test `Effect.timeout` using `TestClock`:
48
48
  *
49
49
  * ```ts
50
- * import * as Duration from "effect/Duration"
51
- * import * as Effect from "effect/Effect"
52
- * import * as Fiber from "effect/Fiber"
53
- * import * as TestClock from "effect/TestClock"
54
- * import * as Option from "effect/Option"
50
+ * import { Duration, Effect, Fiber, TestClock, Option } from "effect"
55
51
  *
56
52
  * Effect.gen(function*() {
57
53
  * const fiber = yield* pipe(
package/src/TestLive.ts CHANGED
@@ -10,7 +10,7 @@ import * as defaultServices from "./internal/defaultServices.js"
10
10
  /**
11
11
  * @since 2.0.0
12
12
  */
13
- export const TestLiveTypeId = Symbol.for("effect/TestLive")
13
+ export const TestLiveTypeId: unique symbol = Symbol.for("effect/TestLive")
14
14
 
15
15
  /**
16
16
  * @since 2.0.0
package/src/TestSized.ts CHANGED
@@ -9,7 +9,7 @@ import * as core from "./internal/core.js"
9
9
  /**
10
10
  * @since 2.0.0
11
11
  */
12
- export const TestSizedTypeId = Symbol.for("effect/TestSized")
12
+ export const TestSizedTypeId: unique symbol = Symbol.for("effect/TestSized")
13
13
 
14
14
  /**
15
15
  * @since 2.0.0