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.
- package/dist/cjs/Array.js +10 -13
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/BigDecimal.js +14 -17
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/BigInt.js +41 -46
- package/dist/cjs/BigInt.js.map +1 -1
- package/dist/cjs/Boolean.js +13 -13
- package/dist/cjs/Brand.js +2 -2
- package/dist/cjs/Chunk.js +3 -3
- package/dist/cjs/Context.js +15 -20
- package/dist/cjs/Context.js.map +1 -1
- package/dist/cjs/Cron.js +3 -6
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/Data.js +8 -13
- package/dist/cjs/Data.js.map +1 -1
- package/dist/cjs/Duration.js +1 -1
- package/dist/cjs/Effect.js +77 -9
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +117 -59
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/FiberHandle.js.map +1 -1
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/Function.js +2 -2
- package/dist/cjs/Function.js.map +1 -1
- package/dist/cjs/Iterable.js +10 -13
- package/dist/cjs/Iterable.js.map +1 -1
- package/dist/cjs/List.js +2 -2
- package/dist/cjs/Metric.js +5 -7
- package/dist/cjs/Metric.js.map +1 -1
- package/dist/cjs/Number.js +20 -21
- package/dist/cjs/Number.js.map +1 -1
- package/dist/cjs/Option.js +223 -164
- package/dist/cjs/Option.js.map +1 -1
- package/dist/cjs/Order.js +1 -2
- package/dist/cjs/Order.js.map +1 -1
- package/dist/cjs/Ordering.js +2 -2
- package/dist/cjs/Predicate.js +9 -12
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/Readable.js.map +1 -1
- package/dist/cjs/Record.js +35 -47
- package/dist/cjs/Record.js.map +1 -1
- package/dist/cjs/RegExp.js +1 -1
- package/dist/cjs/Request.js +2 -2
- package/dist/cjs/Request.js.map +1 -1
- package/dist/cjs/Stream.js +82 -4
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/String.js +81 -111
- package/dist/cjs/String.js.map +1 -1
- package/dist/cjs/Struct.js +13 -19
- package/dist/cjs/Struct.js.map +1 -1
- package/dist/cjs/Subscribable.js.map +1 -1
- package/dist/cjs/Symbol.js +3 -3
- package/dist/cjs/TestAnnotation.js.map +1 -1
- package/dist/cjs/TestAnnotationMap.js.map +1 -1
- package/dist/cjs/TestAnnotations.js.map +1 -1
- package/dist/cjs/TestClock.js.map +1 -1
- package/dist/cjs/TestLive.js.map +1 -1
- package/dist/cjs/TestSized.js.map +1 -1
- package/dist/cjs/Trie.js +28 -44
- package/dist/cjs/Trie.js.map +1 -1
- package/dist/cjs/Utils.js.map +1 -1
- package/dist/cjs/internal/core-effect.js +4 -11
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/doNotation.js +23 -0
- package/dist/cjs/internal/doNotation.js.map +1 -0
- package/dist/cjs/internal/groupBy.js.map +1 -1
- package/dist/cjs/internal/stream.js +3 -7
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Array.d.ts +10 -13
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/BigDecimal.d.ts +14 -17
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/BigInt.d.ts +41 -46
- package/dist/dts/BigInt.d.ts.map +1 -1
- package/dist/dts/Boolean.d.ts +13 -13
- package/dist/dts/Brand.d.ts +3 -3
- package/dist/dts/Chunk.d.ts +3 -3
- package/dist/dts/Context.d.ts +15 -20
- package/dist/dts/Context.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts +3 -6
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Data.d.ts +10 -16
- package/dist/dts/Data.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts +1 -1
- package/dist/dts/Effect.d.ts +120 -26
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +155 -64
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/FiberHandle.d.ts.map +1 -1
- package/dist/dts/FiberMap.d.ts.map +1 -1
- package/dist/dts/FiberSet.d.ts.map +1 -1
- package/dist/dts/Function.d.ts +4 -2
- package/dist/dts/Function.d.ts.map +1 -1
- package/dist/dts/HashMap.d.ts +2 -2
- package/dist/dts/Iterable.d.ts +10 -13
- package/dist/dts/Iterable.d.ts.map +1 -1
- package/dist/dts/List.d.ts +2 -2
- package/dist/dts/Metric.d.ts +5 -7
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/Number.d.ts +20 -21
- package/dist/dts/Number.d.ts.map +1 -1
- package/dist/dts/Option.d.ts +245 -155
- package/dist/dts/Option.d.ts.map +1 -1
- package/dist/dts/Order.d.ts +1 -2
- package/dist/dts/Order.d.ts.map +1 -1
- package/dist/dts/Ordering.d.ts +2 -2
- package/dist/dts/Predicate.d.ts +9 -12
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Readable.d.ts.map +1 -1
- package/dist/dts/Record.d.ts +35 -47
- package/dist/dts/Record.d.ts.map +1 -1
- package/dist/dts/RegExp.d.ts +1 -1
- package/dist/dts/Request.d.ts +2 -2
- package/dist/dts/Request.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +136 -31
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/String.d.ts +81 -111
- package/dist/dts/String.d.ts.map +1 -1
- package/dist/dts/Struct.d.ts +13 -19
- package/dist/dts/Struct.d.ts.map +1 -1
- package/dist/dts/Subscribable.d.ts.map +1 -1
- package/dist/dts/Symbol.d.ts +3 -3
- package/dist/dts/TestAnnotation.d.ts.map +1 -1
- package/dist/dts/TestAnnotationMap.d.ts.map +1 -1
- package/dist/dts/TestAnnotations.d.ts.map +1 -1
- package/dist/dts/TestClock.d.ts +1 -5
- package/dist/dts/TestClock.d.ts.map +1 -1
- package/dist/dts/TestLive.d.ts.map +1 -1
- package/dist/dts/TestSized.d.ts.map +1 -1
- package/dist/dts/Trie.d.ts +28 -44
- package/dist/dts/Trie.d.ts.map +1 -1
- package/dist/dts/Types.d.ts +10 -10
- package/dist/dts/Utils.d.ts.map +1 -1
- package/dist/dts/internal/doNotation.d.ts +2 -0
- package/dist/dts/internal/doNotation.d.ts.map +1 -0
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/Array.js +10 -13
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/BigDecimal.js +14 -17
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/BigInt.js +41 -46
- package/dist/esm/BigInt.js.map +1 -1
- package/dist/esm/Boolean.js +13 -13
- package/dist/esm/Brand.js +2 -2
- package/dist/esm/Chunk.js +3 -3
- package/dist/esm/Context.js +15 -20
- package/dist/esm/Context.js.map +1 -1
- package/dist/esm/Cron.js +3 -6
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/Data.js +9 -15
- package/dist/esm/Data.js.map +1 -1
- package/dist/esm/Duration.js +1 -1
- package/dist/esm/Effect.js +101 -11
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +141 -61
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/FiberHandle.js.map +1 -1
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/Function.js +2 -2
- package/dist/esm/Function.js.map +1 -1
- package/dist/esm/Iterable.js +10 -13
- package/dist/esm/Iterable.js.map +1 -1
- package/dist/esm/List.js +2 -2
- package/dist/esm/Metric.js +5 -7
- package/dist/esm/Metric.js.map +1 -1
- package/dist/esm/Number.js +20 -21
- package/dist/esm/Number.js.map +1 -1
- package/dist/esm/Option.js +249 -164
- package/dist/esm/Option.js.map +1 -1
- package/dist/esm/Order.js +1 -2
- package/dist/esm/Order.js.map +1 -1
- package/dist/esm/Ordering.js +2 -2
- package/dist/esm/Predicate.js +9 -12
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/Readable.js.map +1 -1
- package/dist/esm/Record.js +35 -47
- package/dist/esm/Record.js.map +1 -1
- package/dist/esm/RegExp.js +1 -1
- package/dist/esm/Request.js +2 -2
- package/dist/esm/Request.js.map +1 -1
- package/dist/esm/Stream.js +107 -6
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/String.js +81 -111
- package/dist/esm/String.js.map +1 -1
- package/dist/esm/Struct.js +13 -19
- package/dist/esm/Struct.js.map +1 -1
- package/dist/esm/Subscribable.js.map +1 -1
- package/dist/esm/Symbol.js +3 -3
- package/dist/esm/TestAnnotation.js.map +1 -1
- package/dist/esm/TestAnnotationMap.js.map +1 -1
- package/dist/esm/TestAnnotations.js.map +1 -1
- package/dist/esm/TestClock.js.map +1 -1
- package/dist/esm/TestLive.js.map +1 -1
- package/dist/esm/TestSized.js.map +1 -1
- package/dist/esm/Trie.js +28 -44
- package/dist/esm/Trie.js.map +1 -1
- package/dist/esm/Utils.js.map +1 -1
- package/dist/esm/internal/core-effect.js +4 -11
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/doNotation.js +14 -0
- package/dist/esm/internal/doNotation.js.map +1 -0
- package/dist/esm/internal/groupBy.js.map +1 -1
- package/dist/esm/internal/stream.js +3 -7
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Array.ts +10 -13
- package/src/BigDecimal.ts +14 -17
- package/src/BigInt.ts +41 -46
- package/src/Boolean.ts +13 -13
- package/src/Brand.ts +3 -3
- package/src/Chunk.ts +3 -3
- package/src/Context.ts +15 -20
- package/src/Cron.ts +3 -6
- package/src/Data.ts +10 -16
- package/src/Duration.ts +1 -1
- package/src/Effect.ts +122 -32
- package/src/Either.ts +161 -94
- package/src/FiberHandle.ts +1 -1
- package/src/FiberMap.ts +1 -1
- package/src/FiberSet.ts +1 -1
- package/src/Function.ts +4 -2
- package/src/HashMap.ts +2 -2
- package/src/Iterable.ts +10 -13
- package/src/List.ts +2 -2
- package/src/Metric.ts +5 -7
- package/src/Number.ts +20 -21
- package/src/Option.ts +250 -172
- package/src/Order.ts +1 -2
- package/src/Ordering.ts +2 -2
- package/src/Predicate.ts +9 -12
- package/src/Readable.ts +1 -1
- package/src/Record.ts +35 -47
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +3 -3
- package/src/Stream.ts +137 -36
- package/src/String.ts +81 -111
- package/src/Struct.ts +13 -19
- package/src/Subscribable.ts +1 -1
- package/src/Symbol.ts +3 -3
- package/src/TestAnnotation.ts +1 -1
- package/src/TestAnnotationMap.ts +1 -1
- package/src/TestAnnotations.ts +1 -1
- package/src/TestClock.ts +1 -5
- package/src/TestLive.ts +1 -1
- package/src/TestSized.ts +1 -1
- package/src/Trie.ts +28 -44
- package/src/Types.ts +10 -10
- package/src/Utils.ts +2 -2
- package/src/internal/core-effect.ts +29 -45
- package/src/internal/doNotation.ts +77 -0
- package/src/internal/groupBy.ts +16 -16
- package/src/internal/stream.ts +34 -58
- package/src/internal/version.ts +1 -1
package/src/Trie.ts
CHANGED
|
@@ -44,8 +44,7 @@ export interface Trie<in out Value> extends Iterable<[string, Value]>, Equal, Pi
|
|
|
44
44
|
* Creates an empty `Trie`.
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
|
-
* import
|
|
48
|
-
* import * as Equal from "effect/Equal"
|
|
47
|
+
* import { Trie, Equal } from "effect"
|
|
49
48
|
*
|
|
50
49
|
* const trie = Trie.empty<string>()
|
|
51
50
|
*
|
|
@@ -61,8 +60,7 @@ export const empty: <V = never>() => Trie<V> = TR.empty
|
|
|
61
60
|
* Creates a new `Trie` from an iterable collection of key/value pairs (e.g. `Array<[string, V]>`).
|
|
62
61
|
*
|
|
63
62
|
* @example
|
|
64
|
-
* import
|
|
65
|
-
* import * as Equal from "effect/Equal"
|
|
63
|
+
* import { Trie, Equal } from "effect"
|
|
66
64
|
*
|
|
67
65
|
* const iterable: Array<readonly [string, number]> = [["call", 0], ["me", 1], ["mind", 2], ["mid", 3]]
|
|
68
66
|
* const trie = Trie.fromIterable(iterable)
|
|
@@ -80,8 +78,7 @@ export const fromIterable: <V>(entries: Iterable<readonly [string, V]>) => Trie<
|
|
|
80
78
|
* Constructs a new `Trie` from the specified entries (`[string, V]`).
|
|
81
79
|
*
|
|
82
80
|
* @example
|
|
83
|
-
* import
|
|
84
|
-
* import * as Equal from "effect/Equal"
|
|
81
|
+
* import { Trie, Equal } from "effect"
|
|
85
82
|
*
|
|
86
83
|
* const trie = Trie.make(["ca", 0], ["me", 1])
|
|
87
84
|
*
|
|
@@ -99,7 +96,7 @@ export const make: <Entries extends Array<readonly [string, any]>>(
|
|
|
99
96
|
* Insert a new entry in the `Trie`.
|
|
100
97
|
*
|
|
101
98
|
* @example
|
|
102
|
-
* import
|
|
99
|
+
* import { Trie } from "effect"
|
|
103
100
|
*
|
|
104
101
|
* const trie1 = Trie.empty<number>().pipe(
|
|
105
102
|
* Trie.insert("call", 0)
|
|
@@ -127,7 +124,7 @@ export const insert: {
|
|
|
127
124
|
* The keys are returned in alphabetical order, regardless of insertion order.
|
|
128
125
|
*
|
|
129
126
|
* @example
|
|
130
|
-
* import
|
|
127
|
+
* import { Trie } from "effect"
|
|
131
128
|
*
|
|
132
129
|
* const trie = Trie.empty<number>().pipe(
|
|
133
130
|
* Trie.insert("cab", 0),
|
|
@@ -149,7 +146,7 @@ export const keys: <V>(self: Trie<V>) => IterableIterator<string> = TR.keys
|
|
|
149
146
|
* Values are ordered based on their key in alphabetical order, regardless of insertion order.
|
|
150
147
|
*
|
|
151
148
|
* @example
|
|
152
|
-
* import
|
|
149
|
+
* import { Trie } from "effect"
|
|
153
150
|
*
|
|
154
151
|
* const trie = Trie.empty<number>().pipe(
|
|
155
152
|
* Trie.insert("call", 0),
|
|
@@ -171,7 +168,7 @@ export const values: <V>(self: Trie<V>) => IterableIterator<V> = TR.values
|
|
|
171
168
|
* The entries are returned by keys in alphabetical order, regardless of insertion order.
|
|
172
169
|
*
|
|
173
170
|
* @example
|
|
174
|
-
* import
|
|
171
|
+
* import { Trie } from "effect"
|
|
175
172
|
*
|
|
176
173
|
* const trie = Trie.empty<number>().pipe(
|
|
177
174
|
* Trie.insert("call", 0),
|
|
@@ -192,7 +189,7 @@ export const entries: <V>(self: Trie<V>) => IterableIterator<[string, V]> = TR.e
|
|
|
192
189
|
* Equivalent to `Array.from(Trie.entries(trie))`.
|
|
193
190
|
*
|
|
194
191
|
* @example
|
|
195
|
-
* import
|
|
192
|
+
* import { Trie } from "effect"
|
|
196
193
|
*
|
|
197
194
|
* const trie = Trie.empty<number>().pipe(
|
|
198
195
|
* Trie.insert("call", 0),
|
|
@@ -212,7 +209,7 @@ export const toEntries = <V>(self: Trie<V>): Array<[string, V]> => Array.from(en
|
|
|
212
209
|
* that have `prefix` as prefix (`prefix` included if it exists).
|
|
213
210
|
*
|
|
214
211
|
* @example
|
|
215
|
-
* import
|
|
212
|
+
* import { Trie } from "effect"
|
|
216
213
|
*
|
|
217
214
|
* const trie = Trie.empty<number>().pipe(
|
|
218
215
|
* Trie.insert("she", 0),
|
|
@@ -237,7 +234,7 @@ export const keysWithPrefix: {
|
|
|
237
234
|
* that have `prefix` as prefix (`prefix` included if it exists).
|
|
238
235
|
*
|
|
239
236
|
* @example
|
|
240
|
-
* import
|
|
237
|
+
* import { Trie } from "effect"
|
|
241
238
|
*
|
|
242
239
|
* const trie = Trie.empty<number>().pipe(
|
|
243
240
|
* Trie.insert("she", 0),
|
|
@@ -264,7 +261,7 @@ export const valuesWithPrefix: {
|
|
|
264
261
|
* that have `prefix` as prefix (`prefix` included if it exists).
|
|
265
262
|
*
|
|
266
263
|
* @example
|
|
267
|
-
* import
|
|
264
|
+
* import { Trie } from "effect"
|
|
268
265
|
*
|
|
269
266
|
* const trie = Trie.empty<number>().pipe(
|
|
270
267
|
* Trie.insert("she", 0),
|
|
@@ -289,7 +286,7 @@ export const entriesWithPrefix: {
|
|
|
289
286
|
* that have `prefix` as prefix (`prefix` included if it exists).
|
|
290
287
|
*
|
|
291
288
|
* @example
|
|
292
|
-
* import
|
|
289
|
+
* import { Trie } from "effect"
|
|
293
290
|
*
|
|
294
291
|
* const trie = Trie.empty<number>().pipe(
|
|
295
292
|
* Trie.insert("shells", 0),
|
|
@@ -314,8 +311,7 @@ export const toEntriesWithPrefix: {
|
|
|
314
311
|
* that is a prefix of that `key` if it exists, `None` otherwise.
|
|
315
312
|
*
|
|
316
313
|
* @example
|
|
317
|
-
* import
|
|
318
|
-
* import * as Option from "effect/Option"
|
|
314
|
+
* import { Trie, Option } from "effect"
|
|
319
315
|
*
|
|
320
316
|
* const trie = Trie.empty<number>().pipe(
|
|
321
317
|
* Trie.insert("shells", 0),
|
|
@@ -340,7 +336,7 @@ export const longestPrefixOf: {
|
|
|
340
336
|
* Returns the size of the `Trie` (number of entries in the `Trie`).
|
|
341
337
|
*
|
|
342
338
|
* @example
|
|
343
|
-
* import
|
|
339
|
+
* import { Trie } from "effect"
|
|
344
340
|
*
|
|
345
341
|
* const trie = Trie.empty<number>().pipe(
|
|
346
342
|
* Trie.insert("a", 0),
|
|
@@ -358,8 +354,7 @@ export const size: <V>(self: Trie<V>) => number = TR.size
|
|
|
358
354
|
* Safely lookup the value for the specified key in the `Trie`.
|
|
359
355
|
*
|
|
360
356
|
* @example
|
|
361
|
-
* import
|
|
362
|
-
* import * as Option from "effect/Option"
|
|
357
|
+
* import { Trie, Option } from "effect"
|
|
363
358
|
*
|
|
364
359
|
* const trie = Trie.empty<number>().pipe(
|
|
365
360
|
* Trie.insert("call", 0),
|
|
@@ -389,7 +384,7 @@ export const get: {
|
|
|
389
384
|
* Check if the given key exists in the `Trie`.
|
|
390
385
|
*
|
|
391
386
|
* @example
|
|
392
|
-
* import
|
|
387
|
+
* import { Trie } from "effect"
|
|
393
388
|
*
|
|
394
389
|
* const trie = Trie.empty<number>().pipe(
|
|
395
390
|
* Trie.insert("call", 0),
|
|
@@ -419,7 +414,7 @@ export const has: {
|
|
|
419
414
|
* Checks if the `Trie` contains any entries.
|
|
420
415
|
*
|
|
421
416
|
* @example
|
|
422
|
-
* import
|
|
417
|
+
* import { Trie } from "effect"
|
|
423
418
|
*
|
|
424
419
|
* const trie = Trie.empty<number>()
|
|
425
420
|
* const trie1 = trie.pipe(Trie.insert("ma", 0))
|
|
@@ -439,7 +434,7 @@ export const isEmpty: <V>(self: Trie<V>) => boolean = TR.isEmpty
|
|
|
439
434
|
* get a value from the `Trie`.
|
|
440
435
|
*
|
|
441
436
|
* @example
|
|
442
|
-
* import
|
|
437
|
+
* import { Trie } from "effect"
|
|
443
438
|
*
|
|
444
439
|
* const trie = Trie.empty<number>().pipe(
|
|
445
440
|
* Trie.insert("call", 0),
|
|
@@ -460,8 +455,7 @@ export const unsafeGet: {
|
|
|
460
455
|
* Remove the entry for the specified key in the `Trie`.
|
|
461
456
|
*
|
|
462
457
|
* @example
|
|
463
|
-
* import
|
|
464
|
-
* import * as Option from "effect/Option"
|
|
458
|
+
* import { Trie, Option } from "effect"
|
|
465
459
|
*
|
|
466
460
|
* const trie = Trie.empty<number>().pipe(
|
|
467
461
|
* Trie.insert("call", 0),
|
|
@@ -489,7 +483,7 @@ export const remove: {
|
|
|
489
483
|
* Reduce a state over the entries of the `Trie`.
|
|
490
484
|
*
|
|
491
485
|
* @example
|
|
492
|
-
* import
|
|
486
|
+
* import { Trie } from "effect"
|
|
493
487
|
*
|
|
494
488
|
* const trie = Trie.empty<number>().pipe(
|
|
495
489
|
* Trie.insert("shells", 0),
|
|
@@ -528,8 +522,7 @@ export const reduce: {
|
|
|
528
522
|
* Maps over the entries of the `Trie` using the specified function.
|
|
529
523
|
*
|
|
530
524
|
* @example
|
|
531
|
-
* import
|
|
532
|
-
* import * as Equal from "effect/Equal"
|
|
525
|
+
* import { Trie, Equal } from "effect"
|
|
533
526
|
*
|
|
534
527
|
* const trie = Trie.empty<number>().pipe(
|
|
535
528
|
* Trie.insert("shells", 0),
|
|
@@ -564,8 +557,7 @@ export const map: {
|
|
|
564
557
|
* Filters entries out of a `Trie` using the specified predicate.
|
|
565
558
|
*
|
|
566
559
|
* @example
|
|
567
|
-
* import
|
|
568
|
-
* import * as Equal from "effect/Equal"
|
|
560
|
+
* import { Trie, Equal } from "effect"
|
|
569
561
|
*
|
|
570
562
|
* const trie = Trie.empty<number>().pipe(
|
|
571
563
|
* Trie.insert("shells", 0),
|
|
@@ -600,9 +592,7 @@ export const filter: {
|
|
|
600
592
|
* and filters out `None` values.
|
|
601
593
|
*
|
|
602
594
|
* @example
|
|
603
|
-
* import
|
|
604
|
-
* import * as Equal from "effect/Equal"
|
|
605
|
-
* import * as Option from "effect/Option"
|
|
595
|
+
* import { Trie, Equal, Option } from "effect"
|
|
606
596
|
*
|
|
607
597
|
* const trie = Trie.empty<number>().pipe(
|
|
608
598
|
* Trie.insert("shells", 0),
|
|
@@ -637,9 +627,7 @@ export const filterMap: {
|
|
|
637
627
|
* Filters out `None` values from a `Trie` of `Options`s.
|
|
638
628
|
*
|
|
639
629
|
* @example
|
|
640
|
-
* import
|
|
641
|
-
* import * as Equal from "effect/Equal"
|
|
642
|
-
* import * as Option from "effect/Option"
|
|
630
|
+
* import { Trie, Equal, Option } from "effect"
|
|
643
631
|
*
|
|
644
632
|
* const trie = Trie.empty<Option.Option<number>>().pipe(
|
|
645
633
|
* Trie.insert("shells", Option.some(0)),
|
|
@@ -663,7 +651,7 @@ export const compact: <A>(self: Trie<Option<A>>) => Trie<A> = TR.compact
|
|
|
663
651
|
* Applies the specified function to the entries of the `Trie`.
|
|
664
652
|
*
|
|
665
653
|
* @example
|
|
666
|
-
* import
|
|
654
|
+
* import { Trie } from "effect"
|
|
667
655
|
*
|
|
668
656
|
* let value = 0
|
|
669
657
|
*
|
|
@@ -690,9 +678,7 @@ export const forEach: {
|
|
|
690
678
|
* Updates the value of the specified key within the `Trie` if it exists.
|
|
691
679
|
*
|
|
692
680
|
* @example
|
|
693
|
-
* import
|
|
694
|
-
* import * as Equal from "effect/Equal"
|
|
695
|
-
* import * as Option from "effect/Option"
|
|
681
|
+
* import { Trie, Equal, Option } from "effect"
|
|
696
682
|
*
|
|
697
683
|
* const trie = Trie.empty<number>().pipe(
|
|
698
684
|
* Trie.insert("shells", 0),
|
|
@@ -716,8 +702,7 @@ export const modify: {
|
|
|
716
702
|
* Removes all entries in the `Trie` which have the specified keys.
|
|
717
703
|
*
|
|
718
704
|
* @example
|
|
719
|
-
* import
|
|
720
|
-
* import * as Equal from "effect/Equal"
|
|
705
|
+
* import { Trie, Equal } from "effect"
|
|
721
706
|
*
|
|
722
707
|
* const trie = Trie.empty<number>().pipe(
|
|
723
708
|
* Trie.insert("shells", 0),
|
|
@@ -742,8 +727,7 @@ export const removeMany: {
|
|
|
742
727
|
* Insert multiple entries in the `Trie` at once.
|
|
743
728
|
*
|
|
744
729
|
* @example
|
|
745
|
-
* import
|
|
746
|
-
* import * as Equal from "effect/Equal"
|
|
730
|
+
* import { Trie, Equal } from "effect"
|
|
747
731
|
*
|
|
748
732
|
* const trie = Trie.empty<number>().pipe(
|
|
749
733
|
* Trie.insert("shells", 0),
|
package/src/Types.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Returns the tags in a type.
|
|
9
9
|
* @example
|
|
10
|
-
* import
|
|
10
|
+
* import type { Types } from "effect"
|
|
11
11
|
*
|
|
12
12
|
* type Res = Types.Tags<string | { _tag: "a" } | { _tag: "b" } > // "a" | "b"
|
|
13
13
|
*
|
|
@@ -19,7 +19,7 @@ export type Tags<E> = E extends { _tag: string } ? E["_tag"] : never
|
|
|
19
19
|
/**
|
|
20
20
|
* Excludes the tagged object from the type.
|
|
21
21
|
* @example
|
|
22
|
-
* import
|
|
22
|
+
* import type { Types } from "effect"
|
|
23
23
|
*
|
|
24
24
|
* type Res = Types.ExcludeTag<string | { _tag: "a" } | { _tag: "b" }, "a"> // string | { _tag: "b" }
|
|
25
25
|
*
|
|
@@ -32,7 +32,7 @@ export type ExcludeTag<E, K extends Tags<E>> = Exclude<E, { _tag: K }>
|
|
|
32
32
|
* Extracts the type of the given tag.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
|
-
* import
|
|
35
|
+
* import type { Types } from "effect"
|
|
36
36
|
*
|
|
37
37
|
* type Res = Types.ExtractTag<{ _tag: "a", a: number } | { _tag: "b", b: number }, "b"> // { _tag: "b", b: number }
|
|
38
38
|
*
|
|
@@ -54,7 +54,7 @@ export type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ext
|
|
|
54
54
|
* Simplifies the type signature of a type.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
|
-
* import
|
|
57
|
+
* import type { Types } from "effect"
|
|
58
58
|
*
|
|
59
59
|
* type Res = Types.Simplify<{ a: number } & { b: number }> // { a: number; b: number; }
|
|
60
60
|
*
|
|
@@ -69,7 +69,7 @@ export type Simplify<A> = {
|
|
|
69
69
|
* Determines if two types are equal.
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
|
-
* import
|
|
72
|
+
* import type { Types } from "effect"
|
|
73
73
|
*
|
|
74
74
|
* type Res1 = Types.Equals<{ a: number }, { a: number }> // true
|
|
75
75
|
* type Res2 = Types.Equals<{ a: number }, { b: number }> // false
|
|
@@ -86,7 +86,7 @@ export type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <
|
|
|
86
86
|
* Determines if a record contains any of the given keys.
|
|
87
87
|
*
|
|
88
88
|
* @example
|
|
89
|
-
* import
|
|
89
|
+
* import type { Types } from "effect"
|
|
90
90
|
*
|
|
91
91
|
* type Res1 = Types.Has<{ a: number }, "a" | "b"> // true
|
|
92
92
|
* type Res2 = Types.Has<{ c: number }, "a" | "b"> // false
|
|
@@ -102,7 +102,7 @@ export type Has<A, Key extends string> = (Key extends infer K ? K extends keyof
|
|
|
102
102
|
* Merges two object where the keys of the left object take precedence in the case of a conflict.
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
|
-
* import
|
|
105
|
+
* import type { Types } from "effect"
|
|
106
106
|
* type MergeLeft = Types.MergeLeft<{ a: number, b: number; }, { a: string }> // { a: number; b: number; }
|
|
107
107
|
*
|
|
108
108
|
* @since 2.0.0
|
|
@@ -118,7 +118,7 @@ export type MergeLeft<K, H> = Simplify<
|
|
|
118
118
|
* Merges two object where the keys of the right object take precedence in the case of a conflict.
|
|
119
119
|
*
|
|
120
120
|
* @example
|
|
121
|
-
* import
|
|
121
|
+
* import type { Types } from "effect"
|
|
122
122
|
* type MergeRight = Types.MergeRight<{ a: number, b: number; }, { a: string }> // { a: string; b: number; }
|
|
123
123
|
*
|
|
124
124
|
* @since 2.0.0
|
|
@@ -153,7 +153,7 @@ export type Concurrency = number | "unbounded" | "inherit"
|
|
|
153
153
|
* Make all properties in `T` mutable. Supports arrays, tuples, and records as well.
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
|
-
* import type
|
|
156
|
+
* import type { Types } from "effect"
|
|
157
157
|
*
|
|
158
158
|
* type MutableStruct = Types.Mutable<{ readonly a: string; readonly b: number }> // { a: string; b: number; }
|
|
159
159
|
*
|
|
@@ -174,7 +174,7 @@ export type Mutable<T> = {
|
|
|
174
174
|
* Like `Types.Mutable`, but works recursively.
|
|
175
175
|
*
|
|
176
176
|
* @example
|
|
177
|
-
* import type
|
|
177
|
+
* import type { Types } from "effect"
|
|
178
178
|
*
|
|
179
179
|
* type DeepMutableStruct = Types.DeepMutable<{
|
|
180
180
|
* readonly a: string;
|
package/src/Utils.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type * as Types from "./Types.js"
|
|
|
25
25
|
* @category symbols
|
|
26
26
|
* @since 2.0.0
|
|
27
27
|
*/
|
|
28
|
-
export const GenKindTypeId = Symbol.for("effect/Gen/GenKind")
|
|
28
|
+
export const GenKindTypeId: unique symbol = Symbol.for("effect/Gen/GenKind")
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* @category symbols
|
|
@@ -717,7 +717,7 @@ function add64(
|
|
|
717
717
|
/**
|
|
718
718
|
* @since 3.0.6
|
|
719
719
|
*/
|
|
720
|
-
export const YieldWrapTypeId = Symbol.for("effect/Utils/YieldWrap")
|
|
720
|
+
export const YieldWrapTypeId: unique symbol = Symbol.for("effect/Utils/YieldWrap")
|
|
721
721
|
|
|
722
722
|
/**
|
|
723
723
|
* @since 3.0.6
|
|
@@ -25,12 +25,13 @@ import type * as Random from "../Random.js"
|
|
|
25
25
|
import * as Ref from "../Ref.js"
|
|
26
26
|
import type * as runtimeFlagsPatch from "../RuntimeFlagsPatch.js"
|
|
27
27
|
import * as Tracer from "../Tracer.js"
|
|
28
|
-
import type {
|
|
28
|
+
import type { NoInfer } from "../Types.js"
|
|
29
29
|
import { yieldWrapGet } from "../Utils.js"
|
|
30
30
|
import * as internalCause from "./cause.js"
|
|
31
31
|
import { clockTag } from "./clock.js"
|
|
32
32
|
import * as core from "./core.js"
|
|
33
33
|
import * as defaultServices from "./defaultServices.js"
|
|
34
|
+
import * as doNotation from "./doNotation.js"
|
|
34
35
|
import * as fiberRefsPatch from "./fiberRefs/patch.js"
|
|
35
36
|
import type { FiberRuntime } from "./fiberRuntime.js"
|
|
36
37
|
import * as metricLabel from "./metric/label.js"
|
|
@@ -369,56 +370,39 @@ export const Do: Effect.Effect<{}> = core.succeed({})
|
|
|
369
370
|
|
|
370
371
|
/* @internal */
|
|
371
372
|
export const bind: {
|
|
372
|
-
<N extends string,
|
|
373
|
-
|
|
374
|
-
f: (
|
|
375
|
-
): <
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
f: (_: K) => Effect.Effect<A, E2, R2>
|
|
385
|
-
): Effect.Effect<MergeRecord<K, { [k in N]: A }>, E2 | E, R2 | R> =>
|
|
386
|
-
core.flatMap(self, (k) =>
|
|
387
|
-
core.map(
|
|
388
|
-
f(k),
|
|
389
|
-
(a): MergeRecord<K, { [k in N]: A }> => ({ ...k, [tag]: a } as any)
|
|
390
|
-
)))
|
|
373
|
+
<N extends string, A extends object, B, E2, R2>(
|
|
374
|
+
name: Exclude<N, keyof A>,
|
|
375
|
+
f: (a: A) => Effect.Effect<B, E2, R2>
|
|
376
|
+
): <E1, R1>(
|
|
377
|
+
self: Effect.Effect<A, E1, R1>
|
|
378
|
+
) => Effect.Effect<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }, E2 | E1, R2 | R1>
|
|
379
|
+
<A extends object, N extends string, E1, R1, B, E2, R2>(
|
|
380
|
+
self: Effect.Effect<A, E1, R1>,
|
|
381
|
+
name: Exclude<N, keyof A>,
|
|
382
|
+
f: (a: A) => Effect.Effect<B, E2, R2>
|
|
383
|
+
): Effect.Effect<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }, E1 | E2, R1 | R2>
|
|
384
|
+
} = doNotation.bind<Effect.EffectTypeLambda>(core.map, core.flatMap)
|
|
391
385
|
|
|
392
386
|
/* @internal */
|
|
393
387
|
export const bindTo: {
|
|
394
|
-
<N extends string>(
|
|
395
|
-
<A, E, R, N extends string>(self: Effect.Effect<A, E, R>,
|
|
396
|
-
} =
|
|
397
|
-
2,
|
|
398
|
-
<A, E, R, N extends string>(self: Effect.Effect<A, E, R>, tag: N): Effect.Effect<Record<N, A>, E, R> =>
|
|
399
|
-
core.map(self, (a) => ({ [tag]: a } as Record<N, A>))
|
|
400
|
-
)
|
|
388
|
+
<N extends string>(name: N): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<{ [K in N]: A }, E, R>
|
|
389
|
+
<A, E, R, N extends string>(self: Effect.Effect<A, E, R>, name: N): Effect.Effect<{ [K in N]: A }, E, R>
|
|
390
|
+
} = doNotation.bindTo<Effect.EffectTypeLambda>(core.map)
|
|
401
391
|
|
|
402
392
|
/* @internal */
|
|
403
393
|
export const let_: {
|
|
404
|
-
<N extends string,
|
|
405
|
-
|
|
406
|
-
f: (
|
|
407
|
-
): <E, R>(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
f: (_: K) => A
|
|
417
|
-
): Effect.Effect<MergeRecord<K, { [k in N]: A }>, E, R> =>
|
|
418
|
-
core.map(
|
|
419
|
-
self,
|
|
420
|
-
(k): MergeRecord<K, { [k in N]: A }> => ({ ...k, [tag]: f(k) } as any)
|
|
421
|
-
))
|
|
394
|
+
<N extends string, A extends object, B>(
|
|
395
|
+
name: Exclude<N, keyof A>,
|
|
396
|
+
f: (a: A) => B
|
|
397
|
+
): <E, R>(
|
|
398
|
+
self: Effect.Effect<A, E, R>
|
|
399
|
+
) => Effect.Effect<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }, E, R>
|
|
400
|
+
<A extends object, N extends string, E, R, B>(
|
|
401
|
+
self: Effect.Effect<A, E, R>,
|
|
402
|
+
name: Exclude<N, keyof A>,
|
|
403
|
+
f: (a: A) => B
|
|
404
|
+
): Effect.Effect<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }, E, R>
|
|
405
|
+
} = doNotation.let_<Effect.EffectTypeLambda>(core.map)
|
|
422
406
|
|
|
423
407
|
/* @internal */
|
|
424
408
|
export const dropUntil: {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { dual } from "../Function.js"
|
|
2
|
+
import type { Kind, TypeLambda } from "../HKT.js"
|
|
3
|
+
|
|
4
|
+
type Map<F extends TypeLambda> = {
|
|
5
|
+
<A, B>(f: (a: A) => B): <R, O, E>(self: Kind<F, R, O, E, A>) => Kind<F, R, O, E, B>
|
|
6
|
+
<R, O, E, A, B>(self: Kind<F, R, O, E, A>, f: (a: A) => B): Kind<F, R, O, E, B>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type FlatMap<F extends TypeLambda> = {
|
|
10
|
+
<A, R2, O2, E2, B>(
|
|
11
|
+
f: (a: A) => Kind<F, R2, O2, E2, B>
|
|
12
|
+
): <R1, O1, E1>(self: Kind<F, R1, O1, E1, A>) => Kind<F, R1 & R2, O1 | O2, E1 | E2, B>
|
|
13
|
+
<R1, O1, E1, A, R2, O2, E2, B>(
|
|
14
|
+
self: Kind<F, R1, O1, E1, A>,
|
|
15
|
+
f: (a: A) => Kind<F, R2, O2, E2, B>
|
|
16
|
+
): Kind<F, R1 & R2, O1 | O2, E1 | E2, B>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const let_ = <F extends TypeLambda>(
|
|
21
|
+
map: Map<F>
|
|
22
|
+
): {
|
|
23
|
+
<N extends string, A extends object, B>(
|
|
24
|
+
name: Exclude<N, keyof A>,
|
|
25
|
+
f: (a: A) => B
|
|
26
|
+
): <R, O, E>(
|
|
27
|
+
self: Kind<F, R, O, E, A>
|
|
28
|
+
) => Kind<F, R, O, E, { [K in keyof A | N]: K extends keyof A ? A[K] : B }>
|
|
29
|
+
<R, O, E, A extends object, N extends string, B>(
|
|
30
|
+
self: Kind<F, R, O, E, A>,
|
|
31
|
+
name: Exclude<N, keyof A>,
|
|
32
|
+
f: (a: A) => B
|
|
33
|
+
): Kind<F, R, O, E, { [K in keyof A | N]: K extends keyof A ? A[K] : B }>
|
|
34
|
+
} =>
|
|
35
|
+
dual(3, <R, O, E, A extends object, N extends string, B>(
|
|
36
|
+
self: Kind<F, R, O, E, A>,
|
|
37
|
+
name: Exclude<N, keyof A>,
|
|
38
|
+
f: (a: A) => B
|
|
39
|
+
): Kind<F, R, O, E, { [K in keyof A | N]: K extends keyof A ? A[K] : B }> =>
|
|
40
|
+
map(self, (a) => Object.assign({}, a, { [name]: f(a) }) as any))
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const bindTo = <F extends TypeLambda>(map: Map<F>): {
|
|
44
|
+
<N extends string>(
|
|
45
|
+
name: N
|
|
46
|
+
): <R, O, E, A>(self: Kind<F, R, O, E, A>) => Kind<F, R, O, E, { [K in N]: A }>
|
|
47
|
+
<R, O, E, A, N extends string>(
|
|
48
|
+
self: Kind<F, R, O, E, A>,
|
|
49
|
+
name: N
|
|
50
|
+
): Kind<F, R, O, E, { [K in N]: A }>
|
|
51
|
+
} =>
|
|
52
|
+
dual(2, <R, O, E, A, N extends string>(
|
|
53
|
+
self: Kind<F, R, O, E, A>,
|
|
54
|
+
name: N
|
|
55
|
+
): Kind<F, R, O, E, { [K in N]: A }> => map(self, (a) => ({ [name]: a } as { [K in N]: A })))
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const bind = <F extends TypeLambda>(map: Map<F>, flatMap: FlatMap<F>): {
|
|
59
|
+
<N extends string, A extends object, R2, O2, E2, B>(
|
|
60
|
+
name: Exclude<N, keyof A>,
|
|
61
|
+
f: (a: A) => Kind<F, R2, O2, E2, B>
|
|
62
|
+
): <R1, O1, E1>(
|
|
63
|
+
self: Kind<F, R1, O1, E1, A>
|
|
64
|
+
) => Kind<F, R1 & R2, O1 | O2, E1 | E2, { [K in keyof A | N]: K extends keyof A ? A[K] : B }>
|
|
65
|
+
<R1, O1, E1, A extends object, N extends string, R2, O2, E2, B>(
|
|
66
|
+
self: Kind<F, R1, O1, E1, A>,
|
|
67
|
+
name: Exclude<N, keyof A>,
|
|
68
|
+
f: (a: A) => Kind<F, R2, O2, E2, B>
|
|
69
|
+
): Kind<F, R1 & R2, O1 | O2, E1 | E2, { [K in keyof A | N]: K extends keyof A ? A[K] : B }>
|
|
70
|
+
} =>
|
|
71
|
+
dual(3, <R1, O1, E1, A, N extends string, R2, O2, E2, B>(
|
|
72
|
+
self: Kind<F, R1, O1, E1, A>,
|
|
73
|
+
name: Exclude<N, keyof A>,
|
|
74
|
+
f: (a: A) => Kind<F, R2, O2, E2, B>
|
|
75
|
+
): Kind<F, R1 & R2, O1 | O2, E1 | E2, { [K in keyof A | N]: K extends keyof A ? A[K] : B }> =>
|
|
76
|
+
flatMap(self, (a) =>
|
|
77
|
+
map(f(a), (b) => Object.assign({}, a, { [name]: b }) as { [K in keyof A | N]: K extends keyof A ? A[K] : B })))
|
package/src/internal/groupBy.ts
CHANGED
|
@@ -13,7 +13,7 @@ import * as Queue from "../Queue.js"
|
|
|
13
13
|
import * as Ref from "../Ref.js"
|
|
14
14
|
import type * as Stream from "../Stream.js"
|
|
15
15
|
import type * as Take from "../Take.js"
|
|
16
|
-
import type {
|
|
16
|
+
import type { NoInfer } from "../Types.js"
|
|
17
17
|
import * as channel from "./channel.js"
|
|
18
18
|
import * as channelExecutor from "./channel/channelExecutor.js"
|
|
19
19
|
import * as core from "./core-stream.js"
|
|
@@ -274,35 +274,35 @@ export const mapEffectOptions = dual<
|
|
|
274
274
|
|
|
275
275
|
/** @internal */
|
|
276
276
|
export const bindEffect = dual<
|
|
277
|
-
<N extends string,
|
|
278
|
-
tag: Exclude<N, keyof
|
|
279
|
-
f: (_:
|
|
277
|
+
<N extends string, A, B, E2, R2>(
|
|
278
|
+
tag: Exclude<N, keyof A>,
|
|
279
|
+
f: (_: A) => Effect.Effect<B, E2, R2>,
|
|
280
280
|
options?: {
|
|
281
281
|
readonly concurrency?: number | "unbounded" | undefined
|
|
282
282
|
readonly bufferSize?: number | undefined
|
|
283
283
|
}
|
|
284
|
-
) => <E, R>(self: Stream.Stream<
|
|
285
|
-
|
|
284
|
+
) => <E, R>(self: Stream.Stream<A, E, R>) => Stream.Stream<
|
|
285
|
+
{ [K in keyof A | N]: K extends keyof A ? A[K] : B },
|
|
286
286
|
E | E2,
|
|
287
287
|
R | R2
|
|
288
288
|
>,
|
|
289
|
-
<
|
|
290
|
-
self: Stream.Stream<
|
|
291
|
-
tag: Exclude<N, keyof
|
|
292
|
-
f: (_:
|
|
289
|
+
<A, E, R, N extends string, B, E2, R2>(
|
|
290
|
+
self: Stream.Stream<A, E, R>,
|
|
291
|
+
tag: Exclude<N, keyof A>,
|
|
292
|
+
f: (_: A) => Effect.Effect<B, E2, R2>,
|
|
293
293
|
options?: {
|
|
294
294
|
readonly concurrency?: number | "unbounded" | undefined
|
|
295
295
|
readonly unordered?: boolean | undefined
|
|
296
296
|
}
|
|
297
297
|
) => Stream.Stream<
|
|
298
|
-
|
|
298
|
+
{ [K in keyof A | N]: K extends keyof A ? A[K] : B },
|
|
299
299
|
E | E2,
|
|
300
300
|
R | R2
|
|
301
301
|
>
|
|
302
|
-
>((args) => typeof args[0] !== "string", <
|
|
303
|
-
self: Stream.Stream<
|
|
304
|
-
tag: Exclude<N, keyof
|
|
305
|
-
f: (_:
|
|
302
|
+
>((args) => typeof args[0] !== "string", <A, E, R, N extends string, B, E2, R2>(
|
|
303
|
+
self: Stream.Stream<A, E, R>,
|
|
304
|
+
tag: Exclude<N, keyof A>,
|
|
305
|
+
f: (_: A) => Effect.Effect<B, E2, R2>,
|
|
306
306
|
options?: {
|
|
307
307
|
readonly concurrency?: number | "unbounded" | undefined
|
|
308
308
|
readonly unordered?: boolean | undefined
|
|
@@ -311,7 +311,7 @@ export const bindEffect = dual<
|
|
|
311
311
|
mapEffectOptions(self, (k) =>
|
|
312
312
|
Effect.map(
|
|
313
313
|
f(k),
|
|
314
|
-
(a)
|
|
314
|
+
(a) => ({ ...k, [tag]: a } as { [K in keyof A | N]: K extends keyof A ? A[K] : B })
|
|
315
315
|
), options))
|
|
316
316
|
|
|
317
317
|
const mapDequeue = <A, B>(dequeue: Queue.Dequeue<A>, f: (a: A) => B): Queue.Dequeue<B> => new MapDequeue(dequeue, f)
|