effect 3.8.5 → 3.9.0
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 +24 -3
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/BigDecimal.js +3 -0
- package/dist/cjs/BigDecimal.js.map +1 -1
- package/dist/cjs/Chunk.js +3 -0
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Context.js.map +1 -1
- package/dist/cjs/Cron.js +3 -0
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/DateTime.js +6 -0
- package/dist/cjs/DateTime.js.map +1 -1
- package/dist/cjs/Duration.js +3 -0
- package/dist/cjs/Duration.js.map +1 -1
- package/dist/cjs/Effect.js +122 -35
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/FiberHandle.js +3 -0
- package/dist/cjs/FiberHandle.js.map +1 -1
- package/dist/cjs/FiberMap.js +3 -0
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberSet.js +3 -0
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/Inspectable.js +15 -1
- package/dist/cjs/Inspectable.js.map +1 -1
- package/dist/cjs/Layer.js.map +1 -1
- package/dist/cjs/List.js +6 -0
- package/dist/cjs/List.js.map +1 -1
- package/dist/cjs/ManagedRuntime.js +16 -1
- package/dist/cjs/ManagedRuntime.js.map +1 -1
- package/dist/cjs/Micro.js +6 -0
- package/dist/cjs/Micro.js.map +1 -1
- package/dist/cjs/MutableHashMap.js +3 -0
- package/dist/cjs/MutableHashMap.js.map +1 -1
- package/dist/cjs/MutableHashSet.js +3 -0
- package/dist/cjs/MutableHashSet.js.map +1 -1
- package/dist/cjs/MutableList.js +3 -0
- package/dist/cjs/MutableList.js.map +1 -1
- package/dist/cjs/MutableQueue.js +3 -0
- package/dist/cjs/MutableQueue.js.map +1 -1
- package/dist/cjs/MutableRef.js +3 -0
- package/dist/cjs/MutableRef.js.map +1 -1
- package/dist/cjs/Pool.js.map +1 -1
- package/dist/cjs/Predicate.js +18 -2
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/RegExp.js +20 -1
- package/dist/cjs/RegExp.js.map +1 -1
- package/dist/cjs/Resource.js.map +1 -1
- package/dist/cjs/ScopedRef.js.map +1 -1
- package/dist/cjs/SortedMap.js +3 -0
- package/dist/cjs/SortedMap.js.map +1 -1
- package/dist/cjs/SortedSet.js +3 -0
- package/dist/cjs/SortedSet.js.map +1 -1
- package/dist/cjs/Tuple.js +21 -2
- package/dist/cjs/Tuple.js.map +1 -1
- package/dist/cjs/Unify.js.map +1 -1
- package/dist/cjs/internal/cause.js +3 -0
- package/dist/cjs/internal/cause.js.map +1 -1
- package/dist/cjs/internal/context.js +6 -1
- package/dist/cjs/internal/context.js.map +1 -1
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/core.js +12 -0
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +5 -1
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/fiberId.js +9 -0
- package/dist/cjs/internal/fiberId.js.map +1 -1
- package/dist/cjs/internal/hashMap.js +3 -0
- package/dist/cjs/internal/hashMap.js.map +1 -1
- package/dist/cjs/internal/hashSet.js +3 -0
- package/dist/cjs/internal/hashSet.js.map +1 -1
- package/dist/cjs/internal/layer.js +33 -19
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/mailbox.js +3 -0
- package/dist/cjs/internal/mailbox.js.map +1 -1
- package/dist/cjs/internal/managedRuntime/circular.js +10 -0
- package/dist/cjs/internal/managedRuntime/circular.js.map +1 -0
- package/dist/cjs/internal/managedRuntime.js +23 -9
- package/dist/cjs/internal/managedRuntime.js.map +1 -1
- package/dist/cjs/internal/option.js +3 -0
- package/dist/cjs/internal/option.js.map +1 -1
- package/dist/cjs/internal/pool.js +6 -1
- package/dist/cjs/internal/pool.js.map +1 -1
- package/dist/cjs/internal/redBlackTree.js +3 -0
- package/dist/cjs/internal/redBlackTree.js.map +1 -1
- package/dist/cjs/internal/resource.js +15 -5
- package/dist/cjs/internal/resource.js.map +1 -1
- package/dist/cjs/internal/runtime.js +3 -0
- package/dist/cjs/internal/runtime.js.map +1 -1
- package/dist/cjs/internal/scopedRef.js +11 -8
- package/dist/cjs/internal/scopedRef.js.map +1 -1
- package/dist/cjs/internal/stm/core.js +1 -2
- package/dist/cjs/internal/stm/core.js.map +1 -1
- package/dist/cjs/internal/trie.js +3 -0
- package/dist/cjs/internal/trie.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Array.d.ts +51 -2
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/BigDecimal.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +2 -3
- package/dist/dts/Context.d.ts.map +1 -1
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Deferred.d.ts +1 -1
- package/dist/dts/Deferred.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +233 -10
- package/dist/dts/Effect.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/HashMap.d.ts +15 -0
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/Inspectable.d.ts +15 -0
- package/dist/dts/Inspectable.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +46 -5
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/List.d.ts.map +1 -1
- package/dist/dts/ManagedRuntime.d.ts +41 -2
- package/dist/dts/ManagedRuntime.d.ts.map +1 -1
- package/dist/dts/Micro.d.ts.map +1 -1
- package/dist/dts/MutableHashMap.d.ts.map +1 -1
- package/dist/dts/MutableHashSet.d.ts.map +1 -1
- package/dist/dts/MutableList.d.ts.map +1 -1
- package/dist/dts/MutableQueue.d.ts.map +1 -1
- package/dist/dts/MutableRef.d.ts.map +1 -1
- package/dist/dts/Pool.d.ts +21 -1
- package/dist/dts/Pool.d.ts.map +1 -1
- package/dist/dts/Predicate.d.ts +15 -0
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Queue.d.ts +2 -2
- package/dist/dts/Queue.d.ts.map +1 -1
- package/dist/dts/RegExp.d.ts +12 -2
- package/dist/dts/RegExp.d.ts.map +1 -1
- package/dist/dts/Resource.d.ts +21 -1
- package/dist/dts/Resource.d.ts.map +1 -1
- package/dist/dts/ScopedRef.d.ts +21 -1
- package/dist/dts/ScopedRef.d.ts.map +1 -1
- package/dist/dts/SortedMap.d.ts.map +1 -1
- package/dist/dts/SortedSet.d.ts.map +1 -1
- package/dist/dts/Tuple.d.ts +59 -0
- package/dist/dts/Tuple.d.ts.map +1 -1
- package/dist/dts/Types.d.ts +39 -0
- package/dist/dts/Types.d.ts.map +1 -1
- package/dist/dts/Unify.d.ts +8 -13
- package/dist/dts/Unify.d.ts.map +1 -1
- package/dist/dts/internal/core.d.ts.map +1 -1
- package/dist/dts/internal/hashMap.d.ts.map +1 -1
- package/dist/dts/internal/layer.d.ts.map +1 -1
- package/dist/dts/internal/managedRuntime/circular.d.ts +2 -0
- package/dist/dts/internal/managedRuntime/circular.d.ts.map +1 -0
- package/dist/esm/Array.js +21 -0
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/BigDecimal.js +4 -1
- package/dist/esm/BigDecimal.js.map +1 -1
- package/dist/esm/Chunk.js +4 -1
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Context.js.map +1 -1
- package/dist/esm/Cron.js +4 -1
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/DateTime.js +6 -0
- package/dist/esm/DateTime.js.map +1 -1
- package/dist/esm/Duration.js +4 -1
- package/dist/esm/Duration.js.map +1 -1
- package/dist/esm/Effect.js +116 -30
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/FiberHandle.js +3 -0
- package/dist/esm/FiberHandle.js.map +1 -1
- package/dist/esm/FiberMap.js +3 -0
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberSet.js +3 -0
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/Inspectable.js +14 -0
- package/dist/esm/Inspectable.js.map +1 -1
- package/dist/esm/Layer.js.map +1 -1
- package/dist/esm/List.js +7 -1
- package/dist/esm/List.js.map +1 -1
- package/dist/esm/ManagedRuntime.js +15 -0
- package/dist/esm/ManagedRuntime.js.map +1 -1
- package/dist/esm/Micro.js +7 -1
- package/dist/esm/Micro.js.map +1 -1
- package/dist/esm/MutableHashMap.js +4 -1
- package/dist/esm/MutableHashMap.js.map +1 -1
- package/dist/esm/MutableHashSet.js +4 -1
- package/dist/esm/MutableHashSet.js.map +1 -1
- package/dist/esm/MutableList.js +4 -1
- package/dist/esm/MutableList.js.map +1 -1
- package/dist/esm/MutableQueue.js +4 -1
- package/dist/esm/MutableQueue.js.map +1 -1
- package/dist/esm/MutableRef.js +4 -1
- package/dist/esm/MutableRef.js.map +1 -1
- package/dist/esm/Pool.js.map +1 -1
- package/dist/esm/Predicate.js +15 -0
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/RegExp.js +16 -0
- package/dist/esm/RegExp.js.map +1 -1
- package/dist/esm/Resource.js.map +1 -1
- package/dist/esm/ScopedRef.js.map +1 -1
- package/dist/esm/SortedMap.js +4 -1
- package/dist/esm/SortedMap.js.map +1 -1
- package/dist/esm/SortedSet.js +4 -1
- package/dist/esm/SortedSet.js.map +1 -1
- package/dist/esm/Tuple.js +19 -0
- package/dist/esm/Tuple.js.map +1 -1
- package/dist/esm/Unify.js.map +1 -1
- package/dist/esm/internal/cause.js +4 -1
- package/dist/esm/internal/cause.js.map +1 -1
- package/dist/esm/internal/context.js +7 -2
- package/dist/esm/internal/context.js.map +1 -1
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/core.js +13 -1
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +5 -1
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/fiberId.js +10 -1
- package/dist/esm/internal/fiberId.js.map +1 -1
- package/dist/esm/internal/hashMap.js +4 -1
- package/dist/esm/internal/hashMap.js.map +1 -1
- package/dist/esm/internal/hashSet.js +4 -1
- package/dist/esm/internal/hashSet.js.map +1 -1
- package/dist/esm/internal/layer.js +32 -18
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/mailbox.js +3 -0
- package/dist/esm/internal/mailbox.js.map +1 -1
- package/dist/esm/internal/managedRuntime/circular.js +4 -0
- package/dist/esm/internal/managedRuntime/circular.js.map +1 -0
- package/dist/esm/internal/managedRuntime.js +21 -8
- package/dist/esm/internal/managedRuntime.js.map +1 -1
- package/dist/esm/internal/option.js +4 -1
- package/dist/esm/internal/option.js.map +1 -1
- package/dist/esm/internal/pool.js +6 -1
- package/dist/esm/internal/pool.js.map +1 -1
- package/dist/esm/internal/redBlackTree.js +4 -1
- package/dist/esm/internal/redBlackTree.js.map +1 -1
- package/dist/esm/internal/resource.js +15 -5
- package/dist/esm/internal/resource.js.map +1 -1
- package/dist/esm/internal/runtime.js +3 -0
- package/dist/esm/internal/runtime.js.map +1 -1
- package/dist/esm/internal/scopedRef.js +11 -8
- package/dist/esm/internal/scopedRef.js.map +1 -1
- package/dist/esm/internal/stm/core.js +1 -2
- package/dist/esm/internal/stm/core.js.map +1 -1
- package/dist/esm/internal/trie.js +4 -1
- package/dist/esm/internal/trie.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Array.ts +68 -4
- package/src/BigDecimal.ts +4 -1
- package/src/Chunk.ts +4 -1
- package/src/Context.ts +2 -3
- package/src/Cron.ts +4 -1
- package/src/DateTime.ts +6 -0
- package/src/Deferred.ts +1 -1
- package/src/Duration.ts +4 -1
- package/src/Effect.ts +435 -56
- package/src/FiberHandle.ts +3 -0
- package/src/FiberMap.ts +3 -0
- package/src/FiberSet.ts +3 -0
- package/src/HashMap.ts +16 -0
- package/src/Inspectable.ts +22 -0
- package/src/Layer.ts +49 -8
- package/src/List.ts +7 -1
- package/src/ManagedRuntime.ts +46 -2
- package/src/Micro.ts +7 -1
- package/src/MutableHashMap.ts +4 -1
- package/src/MutableHashSet.ts +4 -1
- package/src/MutableList.ts +4 -1
- package/src/MutableQueue.ts +4 -1
- package/src/MutableRef.ts +4 -1
- package/src/Pool.ts +26 -1
- package/src/Predicate.ts +16 -0
- package/src/Queue.ts +2 -2
- package/src/RegExp.ts +17 -0
- package/src/Resource.ts +22 -1
- package/src/ScopedRef.ts +22 -1
- package/src/SortedMap.ts +4 -1
- package/src/SortedSet.ts +4 -1
- package/src/Tuple.ts +66 -0
- package/src/Types.ts +41 -0
- package/src/Unify.ts +9 -14
- package/src/internal/cause.ts +4 -1
- package/src/internal/context.ts +7 -2
- package/src/internal/core-effect.ts +7 -7
- package/src/internal/core.ts +13 -1
- package/src/internal/effect/circular.ts +8 -2
- package/src/internal/fiberId.ts +10 -1
- package/src/internal/hashMap.ts +4 -1
- package/src/internal/hashSet.ts +4 -1
- package/src/internal/layer.ts +105 -38
- package/src/internal/mailbox.ts +3 -0
- package/src/internal/managedRuntime/circular.ts +6 -0
- package/src/internal/managedRuntime.ts +36 -22
- package/src/internal/option.ts +4 -1
- package/src/internal/pool.ts +7 -1
- package/src/internal/redBlackTree.ts +4 -1
- package/src/internal/resource.ts +16 -5
- package/src/internal/runtime.ts +3 -0
- package/src/internal/scopedRef.ts +12 -8
- package/src/internal/stm/core.ts +2 -3
- package/src/internal/trie.ts +4 -1
- package/src/internal/version.ts +1 -1
package/src/Types.ts
CHANGED
|
@@ -254,6 +254,18 @@ export type NoInfer<A> = [A][A extends any ? 0 : never]
|
|
|
254
254
|
*/
|
|
255
255
|
export type Invariant<A> = (_: A) => A
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* @since 3.9.0
|
|
259
|
+
* @category models
|
|
260
|
+
*/
|
|
261
|
+
export declare namespace Invariant {
|
|
262
|
+
/**
|
|
263
|
+
* @since 3.9.0
|
|
264
|
+
* @category models
|
|
265
|
+
*/
|
|
266
|
+
export type Type<A> = A extends Invariant<infer U> ? U : never
|
|
267
|
+
}
|
|
268
|
+
|
|
257
269
|
/**
|
|
258
270
|
* Covariant helper.
|
|
259
271
|
*
|
|
@@ -262,6 +274,18 @@ export type Invariant<A> = (_: A) => A
|
|
|
262
274
|
*/
|
|
263
275
|
export type Covariant<A> = (_: never) => A
|
|
264
276
|
|
|
277
|
+
/**
|
|
278
|
+
* @since 3.9.0
|
|
279
|
+
* @category models
|
|
280
|
+
*/
|
|
281
|
+
export declare namespace Covariant {
|
|
282
|
+
/**
|
|
283
|
+
* @since 3.9.0
|
|
284
|
+
* @category models
|
|
285
|
+
*/
|
|
286
|
+
export type Type<A> = A extends Covariant<infer U> ? U : never
|
|
287
|
+
}
|
|
288
|
+
|
|
265
289
|
/**
|
|
266
290
|
* Contravariant helper.
|
|
267
291
|
*
|
|
@@ -270,6 +294,18 @@ export type Covariant<A> = (_: never) => A
|
|
|
270
294
|
*/
|
|
271
295
|
export type Contravariant<A> = (_: A) => void
|
|
272
296
|
|
|
297
|
+
/**
|
|
298
|
+
* @since 3.9.0
|
|
299
|
+
* @category models
|
|
300
|
+
*/
|
|
301
|
+
export declare namespace Contravariant {
|
|
302
|
+
/**
|
|
303
|
+
* @since 3.9.0
|
|
304
|
+
* @category models
|
|
305
|
+
*/
|
|
306
|
+
export type Type<A> = A extends Contravariant<infer U> ? U : never
|
|
307
|
+
}
|
|
308
|
+
|
|
273
309
|
/**
|
|
274
310
|
* @since 2.0.0
|
|
275
311
|
*/
|
|
@@ -279,3 +315,8 @@ export type MatchRecord<S, onTrue, onFalse> = {} extends S ? onTrue : onFalse
|
|
|
279
315
|
* @since 2.0.0
|
|
280
316
|
*/
|
|
281
317
|
export type NotFunction<T> = T extends Function ? never : T
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @since 3.9.0
|
|
321
|
+
*/
|
|
322
|
+
export type NoExcessProperties<T, U> = T & { readonly [K in Exclude<keyof U, keyof T>]: never }
|
package/src/Unify.ts
CHANGED
|
@@ -34,26 +34,21 @@ export declare const ignoreSymbol: unique symbol
|
|
|
34
34
|
*/
|
|
35
35
|
export type ignoreSymbol = typeof ignoreSymbol
|
|
36
36
|
|
|
37
|
-
type MaybeReturn<F> = F extends () =>
|
|
37
|
+
type MaybeReturn<F> = F extends () => infer R ? R : NonNullable<F>
|
|
38
38
|
|
|
39
|
-
type Values<X extends [any, any]> = X extends
|
|
40
|
-
?
|
|
39
|
+
type Values<X extends [any, any]> = X extends [infer A, infer Ignore]
|
|
40
|
+
? Exclude<keyof A, Ignore> extends infer k ? k extends keyof A ? MaybeReturn<A[k]> : never : never
|
|
41
41
|
: never
|
|
42
42
|
|
|
43
|
-
type Ignore<X> = X extends {
|
|
44
|
-
[ignoreSymbol]?: any
|
|
45
|
-
} ? keyof NonNullable<X[ignoreSymbol]>
|
|
43
|
+
type Ignore<X> = X extends { [ignoreSymbol]?: infer Obj } ? keyof NonNullable<Obj>
|
|
46
44
|
: never
|
|
47
45
|
|
|
48
46
|
type ExtractTypes<
|
|
49
|
-
X
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
NonNullable<X[unifySymbol]>,
|
|
55
|
-
Ignore<X>
|
|
56
|
-
]
|
|
47
|
+
X
|
|
48
|
+
> = X extends {
|
|
49
|
+
[typeSymbol]?: infer _Type
|
|
50
|
+
[unifySymbol]?: infer _Unify
|
|
51
|
+
} ? [NonNullable<_Unify>, Ignore<X>]
|
|
57
52
|
: never
|
|
58
53
|
|
|
59
54
|
type FilterIn<A> = A extends any ? typeSymbol extends keyof A ? A : never : never
|
package/src/internal/cause.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { constFalse, constTrue, dual, identity, pipe } from "../Function.js"
|
|
|
8
8
|
import { globalValue } from "../GlobalValue.js"
|
|
9
9
|
import * as Hash from "../Hash.js"
|
|
10
10
|
import * as HashSet from "../HashSet.js"
|
|
11
|
-
import { NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
11
|
+
import { DenoInspectSymbol, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
12
12
|
import * as Option from "../Option.js"
|
|
13
13
|
import { pipeArguments } from "../Pipeable.js"
|
|
14
14
|
import type { Predicate, Refinement } from "../Predicate.js"
|
|
@@ -69,6 +69,9 @@ const proto = {
|
|
|
69
69
|
toString<E>(this: Cause.Cause<E>) {
|
|
70
70
|
return pretty(this)
|
|
71
71
|
},
|
|
72
|
+
[DenoInspectSymbol]<E>(this: Cause.Cause<E>) {
|
|
73
|
+
return this.toJSON()
|
|
74
|
+
},
|
|
72
75
|
[NodeInspectSymbol]<E>(this: Cause.Cause<E>) {
|
|
73
76
|
return this.toJSON()
|
|
74
77
|
}
|
package/src/internal/context.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as Equal from "../Equal.js"
|
|
|
3
3
|
import type { LazyArg } from "../Function.js"
|
|
4
4
|
import { dual } from "../Function.js"
|
|
5
5
|
import * as Hash from "../Hash.js"
|
|
6
|
-
import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
6
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
7
7
|
import type * as O from "../Option.js"
|
|
8
8
|
import { pipeArguments } from "../Pipeable.js"
|
|
9
9
|
import { hasProperty } from "../Predicate.js"
|
|
@@ -25,7 +25,6 @@ export const STMTypeId: STM.STMTypeId = Symbol.for(
|
|
|
25
25
|
/** @internal */
|
|
26
26
|
export const TagProto: any = {
|
|
27
27
|
...EffectPrototype,
|
|
28
|
-
_tag: "Tag",
|
|
29
28
|
_op: "Tag",
|
|
30
29
|
[STMTypeId]: effectVariance,
|
|
31
30
|
[TagTypeId]: {
|
|
@@ -42,6 +41,9 @@ export const TagProto: any = {
|
|
|
42
41
|
stack: this.stack
|
|
43
42
|
}
|
|
44
43
|
},
|
|
44
|
+
[DenoInspectSymbol]() {
|
|
45
|
+
return this.toJSON()
|
|
46
|
+
},
|
|
45
47
|
[NodeInspectSymbol]() {
|
|
46
48
|
return this.toJSON()
|
|
47
49
|
},
|
|
@@ -126,6 +128,9 @@ export const ContextProto: Omit<C.Context<unknown>, "unsafeMap"> = {
|
|
|
126
128
|
services: Array.from(this.unsafeMap).map(toJSON)
|
|
127
129
|
}
|
|
128
130
|
},
|
|
131
|
+
[DenoInspectSymbol]() {
|
|
132
|
+
return (this as any).toJSON()
|
|
133
|
+
},
|
|
129
134
|
[NodeInspectSymbol]() {
|
|
130
135
|
return (this as any).toJSON()
|
|
131
136
|
}
|
|
@@ -1055,17 +1055,17 @@ const loopDiscard = <S, X, E, R>(
|
|
|
1055
1055
|
|
|
1056
1056
|
/* @internal */
|
|
1057
1057
|
export const mapAccum: {
|
|
1058
|
-
<S, A, B, E, R>(
|
|
1058
|
+
<S, A, B, E, R, I extends Iterable<A> = Iterable<A>>(
|
|
1059
1059
|
zero: S,
|
|
1060
1060
|
f: (s: S, a: A, i: number) => Effect.Effect<readonly [S, B], E, R>
|
|
1061
|
-
): (elements:
|
|
1062
|
-
<A, S, B, E, R>(
|
|
1063
|
-
elements:
|
|
1061
|
+
): (elements: I) => Effect.Effect<[S, Arr.ReadonlyArray.With<I, B>], E, R>
|
|
1062
|
+
<A, S, B, E, R, I extends Iterable<A> = Iterable<A>>(
|
|
1063
|
+
elements: I,
|
|
1064
1064
|
zero: S,
|
|
1065
1065
|
f: (s: S, a: A, i: number) => Effect.Effect<readonly [S, B], E, R>
|
|
1066
|
-
): Effect.Effect<[S,
|
|
1067
|
-
} = dual(3, <A, S, B, E, R>(
|
|
1068
|
-
elements:
|
|
1066
|
+
): Effect.Effect<[S, Arr.ReadonlyArray.With<I, B>], E, R>
|
|
1067
|
+
} = dual(3, <A, S, B, E, R, I extends Iterable<A> = Iterable<A>>(
|
|
1068
|
+
elements: I,
|
|
1069
1069
|
zero: S,
|
|
1070
1070
|
f: (s: S, a: A, i: number) => Effect.Effect<readonly [S, B], E, R>
|
|
1071
1071
|
): Effect.Effect<[S, Array<B>], E, R> =>
|
package/src/internal/core.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { globalValue } from "../GlobalValue.js"
|
|
|
21
21
|
import * as Hash from "../Hash.js"
|
|
22
22
|
import * as HashMap from "../HashMap.js"
|
|
23
23
|
import type * as HashSet from "../HashSet.js"
|
|
24
|
-
import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
24
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
25
25
|
import * as List from "../List.js"
|
|
26
26
|
import type * as LogLevel from "../LogLevel.js"
|
|
27
27
|
import type * as LogSpan from "../LogSpan.js"
|
|
@@ -177,6 +177,9 @@ class EffectPrimitive {
|
|
|
177
177
|
toString() {
|
|
178
178
|
return format(this.toJSON())
|
|
179
179
|
}
|
|
180
|
+
[DenoInspectSymbol]() {
|
|
181
|
+
return this.toJSON()
|
|
182
|
+
}
|
|
180
183
|
[NodeInspectSymbol]() {
|
|
181
184
|
return this.toJSON()
|
|
182
185
|
}
|
|
@@ -226,6 +229,9 @@ class EffectPrimitiveFailure {
|
|
|
226
229
|
toString() {
|
|
227
230
|
return format(this.toJSON())
|
|
228
231
|
}
|
|
232
|
+
[DenoInspectSymbol]() {
|
|
233
|
+
return this.toJSON()
|
|
234
|
+
}
|
|
229
235
|
[NodeInspectSymbol]() {
|
|
230
236
|
return this.toJSON()
|
|
231
237
|
}
|
|
@@ -275,6 +281,9 @@ class EffectPrimitiveSuccess {
|
|
|
275
281
|
toString() {
|
|
276
282
|
return format(this.toJSON())
|
|
277
283
|
}
|
|
284
|
+
[DenoInspectSymbol]() {
|
|
285
|
+
return this.toJSON()
|
|
286
|
+
}
|
|
278
287
|
[NodeInspectSymbol]() {
|
|
279
288
|
return this.toJSON()
|
|
280
289
|
}
|
|
@@ -2194,6 +2203,9 @@ export const YieldableError: new(message?: string, options?: ErrorOptions) => Ca
|
|
|
2194
2203
|
toJSON() {
|
|
2195
2204
|
return { ...this }
|
|
2196
2205
|
}
|
|
2206
|
+
[DenoInspectSymbol]() {
|
|
2207
|
+
return this[NodeInspectSymbol]()
|
|
2208
|
+
}
|
|
2197
2209
|
[NodeInspectSymbol]() {
|
|
2198
2210
|
if (this.toString !== globalThis.Error.prototype.toString) {
|
|
2199
2211
|
return this.stack ? `${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}` : this.toString()
|
|
@@ -112,10 +112,16 @@ export const unsafeMakeSemaphore = (permits: number): Semaphore => new Semaphore
|
|
|
112
112
|
/** @internal */
|
|
113
113
|
export const makeSemaphore = (permits: number) => core.sync(() => unsafeMakeSemaphore(permits))
|
|
114
114
|
|
|
115
|
-
class Latch implements Effect.Latch {
|
|
115
|
+
class Latch extends Effectable.Class<void> implements Effect.Latch {
|
|
116
116
|
waiters: Array<(_: Effect.Effect<void>) => void> = []
|
|
117
117
|
scheduled = false
|
|
118
|
-
constructor(private isOpen: boolean) {
|
|
118
|
+
constructor(private isOpen: boolean) {
|
|
119
|
+
super()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
commit() {
|
|
123
|
+
return this.await
|
|
124
|
+
}
|
|
119
125
|
|
|
120
126
|
private unsafeSchedule(fiber: Fiber.RuntimeFiber<void>) {
|
|
121
127
|
if (this.scheduled || this.waiters.length === 0) {
|
package/src/internal/fiberId.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { dual, pipe } from "../Function.js"
|
|
|
4
4
|
import { globalValue } from "../GlobalValue.js"
|
|
5
5
|
import * as Hash from "../Hash.js"
|
|
6
6
|
import * as HashSet from "../HashSet.js"
|
|
7
|
-
import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
7
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
8
8
|
import * as MutableRef from "../MutableRef.js"
|
|
9
9
|
import * as Option from "../Option.js"
|
|
10
10
|
import { hasProperty } from "../Predicate.js"
|
|
@@ -58,6 +58,9 @@ class None implements FiberId.None {
|
|
|
58
58
|
_tag: this._tag
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
[DenoInspectSymbol]() {
|
|
62
|
+
return this.toJSON()
|
|
63
|
+
}
|
|
61
64
|
[NodeInspectSymbol]() {
|
|
62
65
|
return this.toJSON()
|
|
63
66
|
}
|
|
@@ -91,6 +94,9 @@ class Runtime implements FiberId.Runtime {
|
|
|
91
94
|
startTimeMillis: this.startTimeMillis
|
|
92
95
|
}
|
|
93
96
|
}
|
|
97
|
+
[DenoInspectSymbol]() {
|
|
98
|
+
return this.toJSON()
|
|
99
|
+
}
|
|
94
100
|
[NodeInspectSymbol]() {
|
|
95
101
|
return this.toJSON()
|
|
96
102
|
}
|
|
@@ -131,6 +137,9 @@ class Composite implements FiberId.Composite {
|
|
|
131
137
|
right: toJSON(this.right)
|
|
132
138
|
}
|
|
133
139
|
}
|
|
140
|
+
[DenoInspectSymbol]() {
|
|
141
|
+
return this.toJSON()
|
|
142
|
+
}
|
|
134
143
|
[NodeInspectSymbol]() {
|
|
135
144
|
return this.toJSON()
|
|
136
145
|
}
|
package/src/internal/hashMap.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as Dual from "../Function.js"
|
|
|
3
3
|
import { identity, pipe } from "../Function.js"
|
|
4
4
|
import * as Hash from "../Hash.js"
|
|
5
5
|
import type * as HM from "../HashMap.js"
|
|
6
|
-
import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
6
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
7
7
|
import * as Option from "../Option.js"
|
|
8
8
|
import { pipeArguments } from "../Pipeable.js"
|
|
9
9
|
import { hasProperty } from "../Predicate.js"
|
|
@@ -85,6 +85,9 @@ const HashMapProto: HM.HashMap<unknown, unknown> = {
|
|
|
85
85
|
values: Array.from(this).map(toJSON)
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
+
[DenoInspectSymbol]() {
|
|
89
|
+
return this.toJSON()
|
|
90
|
+
},
|
|
88
91
|
[NodeInspectSymbol]() {
|
|
89
92
|
return this.toJSON()
|
|
90
93
|
},
|
package/src/internal/hashSet.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { dual } from "../Function.js"
|
|
|
3
3
|
import * as Hash from "../Hash.js"
|
|
4
4
|
import type { HashMap } from "../HashMap.js"
|
|
5
5
|
import type * as HS from "../HashSet.js"
|
|
6
|
-
import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
6
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "../Inspectable.js"
|
|
7
7
|
import { pipeArguments } from "../Pipeable.js"
|
|
8
8
|
import type { Predicate, Refinement } from "../Predicate.js"
|
|
9
9
|
import { hasProperty } from "../Predicate.js"
|
|
@@ -49,6 +49,9 @@ const HashSetProto: Omit<HashSetImpl<unknown>, "_keyMap"> = {
|
|
|
49
49
|
values: Array.from(this).map(toJSON)
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
[DenoInspectSymbol]() {
|
|
53
|
+
return this.toJSON()
|
|
54
|
+
},
|
|
52
55
|
[NodeInspectSymbol]() {
|
|
53
56
|
return this.toJSON()
|
|
54
57
|
},
|
package/src/internal/layer.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { LazyArg } from "../Function.js"
|
|
|
10
10
|
import { dual, pipe } from "../Function.js"
|
|
11
11
|
import * as HashMap from "../HashMap.js"
|
|
12
12
|
import type * as Layer from "../Layer.js"
|
|
13
|
+
import type * as ManagedRuntime from "../ManagedRuntime.js"
|
|
13
14
|
import { pipeArguments } from "../Pipeable.js"
|
|
14
15
|
import { hasProperty } from "../Predicate.js"
|
|
15
16
|
import type * as Runtime from "../Runtime.js"
|
|
@@ -23,6 +24,7 @@ import * as effect from "./core-effect.js"
|
|
|
23
24
|
import * as core from "./core.js"
|
|
24
25
|
import * as circular from "./effect/circular.js"
|
|
25
26
|
import * as fiberRuntime from "./fiberRuntime.js"
|
|
27
|
+
import * as circularManagedRuntime from "./managedRuntime/circular.js"
|
|
26
28
|
import * as EffectOpCodes from "./opCodes/effect.js"
|
|
27
29
|
import * as OpCodes from "./opCodes/layer.js"
|
|
28
30
|
import * as ref from "./ref.js"
|
|
@@ -49,7 +51,7 @@ const layerVariance = {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/** @internal */
|
|
52
|
-
const proto = {
|
|
54
|
+
export const proto = {
|
|
53
55
|
[LayerTypeId]: layerVariance,
|
|
54
56
|
pipe() {
|
|
55
57
|
return pipeArguments(this, arguments)
|
|
@@ -79,7 +81,7 @@ export type Primitive =
|
|
|
79
81
|
|
|
80
82
|
/** @internal */
|
|
81
83
|
export type Op<Tag extends string, Body = {}> = Layer.Layer<unknown, unknown, unknown> & Body & {
|
|
82
|
-
readonly
|
|
84
|
+
readonly _op_layer: Tag
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
/** @internal */
|
|
@@ -165,7 +167,7 @@ export const isLayer = (u: unknown): u is Layer.Layer<unknown, unknown, unknown>
|
|
|
165
167
|
|
|
166
168
|
/** @internal */
|
|
167
169
|
export const isFresh = <RIn, E, ROut>(self: Layer.Layer<ROut, E, RIn>): boolean => {
|
|
168
|
-
return (self as Primitive).
|
|
170
|
+
return (self as Primitive)._op_layer === OpCodes.OP_FRESH
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
// -----------------------------------------------------------------------------
|
|
@@ -356,7 +358,7 @@ const makeBuilder = <RIn, E, ROut>(
|
|
|
356
358
|
inMemoMap = false
|
|
357
359
|
): Effect.Effect<(memoMap: Layer.MemoMap) => Effect.Effect<Context.Context<ROut>, E, RIn>> => {
|
|
358
360
|
const op = self as Primitive
|
|
359
|
-
switch (op.
|
|
361
|
+
switch (op._op_layer) {
|
|
360
362
|
case "Locally": {
|
|
361
363
|
return core.sync(() => (memoMap: Layer.MemoMap) => op.f(memoMap.getOrElseMemoize(op.self, scope)))
|
|
362
364
|
}
|
|
@@ -487,7 +489,7 @@ export const extendScope = <RIn, E, ROut>(
|
|
|
487
489
|
self: Layer.Layer<ROut, E, RIn>
|
|
488
490
|
): Layer.Layer<ROut, E, RIn | Scope.Scope> => {
|
|
489
491
|
const extendScope = Object.create(proto)
|
|
490
|
-
extendScope.
|
|
492
|
+
extendScope._op_layer = OpCodes.OP_EXTEND_SCOPE
|
|
491
493
|
extendScope.layer = self
|
|
492
494
|
return extendScope
|
|
493
495
|
}
|
|
@@ -533,7 +535,7 @@ export const flatten = dual<
|
|
|
533
535
|
/** @internal */
|
|
534
536
|
export const fresh = <A, E, R>(self: Layer.Layer<A, E, R>): Layer.Layer<A, E, R> => {
|
|
535
537
|
const fresh = Object.create(proto)
|
|
536
|
-
fresh.
|
|
538
|
+
fresh._op_layer = OpCodes.OP_FRESH
|
|
537
539
|
fresh.layer = self
|
|
538
540
|
return fresh
|
|
539
541
|
}
|
|
@@ -565,7 +567,7 @@ export function fromEffectContext<A, E, R>(
|
|
|
565
567
|
effect: Effect.Effect<Context.Context<A>, E, R>
|
|
566
568
|
): Layer.Layer<A, E, R> {
|
|
567
569
|
const fromEffect = Object.create(proto)
|
|
568
|
-
fromEffect.
|
|
570
|
+
fromEffect._op_layer = OpCodes.OP_FROM_EFFECT
|
|
569
571
|
fromEffect.effect = effect
|
|
570
572
|
return fromEffect
|
|
571
573
|
}
|
|
@@ -587,7 +589,7 @@ export const locallyEffect = dual<
|
|
|
587
589
|
) => Layer.Layer<ROut2, E2, RIn2>
|
|
588
590
|
>(2, (self, f) => {
|
|
589
591
|
const locally = Object.create(proto)
|
|
590
|
-
locally.
|
|
592
|
+
locally._op_layer = "Locally"
|
|
591
593
|
locally.self = self
|
|
592
594
|
locally.f = f
|
|
593
595
|
return locally
|
|
@@ -658,7 +660,7 @@ export const matchCause = dual<
|
|
|
658
660
|
) => Layer.Layer<A2 & A3, E2 | E3, R | R2 | R3>
|
|
659
661
|
>(2, (self, { onFailure, onSuccess }) => {
|
|
660
662
|
const fold = Object.create(proto)
|
|
661
|
-
fold.
|
|
663
|
+
fold._op_layer = OpCodes.OP_FOLD
|
|
662
664
|
fold.layer = self
|
|
663
665
|
fold.failureK = onFailure
|
|
664
666
|
fold.successK = onSuccess
|
|
@@ -866,7 +868,7 @@ export const scopedContext = <A, E, R>(
|
|
|
866
868
|
effect: Effect.Effect<Context.Context<A>, E, R>
|
|
867
869
|
): Layer.Layer<A, E, Exclude<R, Scope.Scope>> => {
|
|
868
870
|
const scoped = Object.create(proto)
|
|
869
|
-
scoped.
|
|
871
|
+
scoped._op_layer = OpCodes.OP_SCOPED
|
|
870
872
|
scoped.effect = effect
|
|
871
873
|
return scoped
|
|
872
874
|
}
|
|
@@ -920,7 +922,7 @@ export const suspend = <RIn, E, ROut>(
|
|
|
920
922
|
evaluate: LazyArg<Layer.Layer<ROut, E, RIn>>
|
|
921
923
|
): Layer.Layer<ROut, E, RIn> => {
|
|
922
924
|
const suspend = Object.create(proto)
|
|
923
|
-
suspend.
|
|
925
|
+
suspend._op_layer = OpCodes.OP_SUSPEND
|
|
924
926
|
suspend.evaluate = evaluate
|
|
925
927
|
return suspend
|
|
926
928
|
}
|
|
@@ -1024,29 +1026,52 @@ export const toRuntimeWithMemoMap = dual<
|
|
|
1024
1026
|
|
|
1025
1027
|
/** @internal */
|
|
1026
1028
|
export const provide = dual<
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1029
|
+
{
|
|
1030
|
+
<RIn, E, ROut>(
|
|
1031
|
+
that: Layer.Layer<ROut, E, RIn>
|
|
1032
|
+
): <RIn2, E2, ROut2>(
|
|
1033
|
+
self: Layer.Layer<ROut2, E2, RIn2>
|
|
1034
|
+
) => Layer.Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
|
|
1035
|
+
<const Layers extends [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(
|
|
1036
|
+
that: Layers
|
|
1037
|
+
): <A, E, R>(
|
|
1038
|
+
self: Layer.Layer<A, E, R>
|
|
1039
|
+
) => Layer.Layer<
|
|
1040
|
+
A,
|
|
1041
|
+
E | { [k in keyof Layers]: Layer.Layer.Error<Layers[k]> }[number],
|
|
1042
|
+
| { [k in keyof Layers]: Layer.Layer.Context<Layers[k]> }[number]
|
|
1043
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Layer.Success<Layers[k]> }[number]>
|
|
1044
|
+
>
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
<RIn2, E2, ROut2, RIn, E, ROut>(
|
|
1048
|
+
self: Layer.Layer<ROut2, E2, RIn2>,
|
|
1049
|
+
that: Layer.Layer<ROut, E, RIn>
|
|
1050
|
+
): Layer.Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
|
|
1051
|
+
<A, E, R, const Layers extends [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(
|
|
1052
|
+
self: Layer.Layer<A, E, R>,
|
|
1053
|
+
that: Layers
|
|
1054
|
+
): Layer.Layer<
|
|
1055
|
+
A,
|
|
1056
|
+
E | { [k in keyof Layers]: Layer.Layer.Error<Layers[k]> }[number],
|
|
1057
|
+
| { [k in keyof Layers]: Layer.Layer.Context<Layers[k]> }[number]
|
|
1058
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Layer.Success<Layers[k]> }[number]>
|
|
1059
|
+
>
|
|
1060
|
+
}
|
|
1061
|
+
>(2, (
|
|
1062
|
+
self: Layer.Layer.Any,
|
|
1063
|
+
that: Layer.Layer.Any | ReadonlyArray<Layer.Layer.Any>
|
|
1039
1064
|
) =>
|
|
1040
1065
|
suspend(() => {
|
|
1041
1066
|
const provideTo = Object.create(proto)
|
|
1042
|
-
provideTo.
|
|
1067
|
+
provideTo._op_layer = OpCodes.OP_PROVIDE
|
|
1043
1068
|
provideTo.first = Object.create(proto, {
|
|
1044
|
-
|
|
1045
|
-
first: { value: context
|
|
1046
|
-
second: { value:
|
|
1047
|
-
zipK: { value: (a: Context.Context<
|
|
1069
|
+
_op_layer: { value: OpCodes.OP_PROVIDE_MERGE, enumerable: true },
|
|
1070
|
+
first: { value: context(), enumerable: true },
|
|
1071
|
+
second: { value: Array.isArray(that) ? mergeAll(...that as any) : that },
|
|
1072
|
+
zipK: { value: (a: Context.Context<any>, b: Context.Context<any>) => pipe(a, Context.merge(b)) }
|
|
1048
1073
|
})
|
|
1049
|
-
provideTo.second =
|
|
1074
|
+
provideTo.second = self
|
|
1050
1075
|
return provideTo
|
|
1051
1076
|
}))
|
|
1052
1077
|
|
|
@@ -1063,7 +1088,7 @@ export const provideMerge = dual<
|
|
|
1063
1088
|
) => Layer.Layer<ROut | ROut2, E2 | E, RIn | Exclude<RIn2, ROut>>
|
|
1064
1089
|
>(2, <RIn2, E2, ROut2, RIn, E, ROut>(that: Layer.Layer<ROut2, E2, RIn2>, self: Layer.Layer<ROut, E, RIn>) => {
|
|
1065
1090
|
const zipWith = Object.create(proto)
|
|
1066
|
-
zipWith.
|
|
1091
|
+
zipWith._op_layer = OpCodes.OP_PROVIDE_MERGE
|
|
1067
1092
|
zipWith.first = self
|
|
1068
1093
|
zipWith.second = provide(that, self)
|
|
1069
1094
|
zipWith.zipK = (a: Context.Context<ROut>, b: Context.Context<ROut2>): Context.Context<ROut | ROut2> => {
|
|
@@ -1086,7 +1111,7 @@ export const zipWith = dual<
|
|
|
1086
1111
|
>(3, (self, that, f) =>
|
|
1087
1112
|
suspend(() => {
|
|
1088
1113
|
const zipWith = Object.create(proto)
|
|
1089
|
-
zipWith.
|
|
1114
|
+
zipWith._op_layer = OpCodes.OP_ZIP_WITH
|
|
1090
1115
|
zipWith.first = self
|
|
1091
1116
|
zipWith.second = that
|
|
1092
1117
|
zipWith.zipK = f
|
|
@@ -1291,6 +1316,16 @@ const provideSomeRuntime = dual<
|
|
|
1291
1316
|
/** @internal */
|
|
1292
1317
|
export const effect_provide = dual<
|
|
1293
1318
|
{
|
|
1319
|
+
<const Layers extends [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(
|
|
1320
|
+
layers: Layers
|
|
1321
|
+
): <A, E, R>(
|
|
1322
|
+
self: Effect.Effect<A, E, R>
|
|
1323
|
+
) => Effect.Effect<
|
|
1324
|
+
A,
|
|
1325
|
+
E | { [k in keyof Layers]: Layer.Layer.Error<Layers[k]> }[number],
|
|
1326
|
+
| { [k in keyof Layers]: Layer.Layer.Context<Layers[k]> }[number]
|
|
1327
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Layer.Success<Layers[k]> }[number]>
|
|
1328
|
+
>
|
|
1294
1329
|
<ROut, E2, RIn>(
|
|
1295
1330
|
layer: Layer.Layer<ROut, E2, RIn>
|
|
1296
1331
|
): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E | E2, RIn | Exclude<R, ROut>>
|
|
@@ -1300,8 +1335,20 @@ export const effect_provide = dual<
|
|
|
1300
1335
|
<R2>(
|
|
1301
1336
|
runtime: Runtime.Runtime<R2>
|
|
1302
1337
|
): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, R2>>
|
|
1338
|
+
<E2, R2>(
|
|
1339
|
+
managedRuntime: ManagedRuntime.ManagedRuntime<R2, E2>
|
|
1340
|
+
): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E | E2, Exclude<R, R2>>
|
|
1303
1341
|
},
|
|
1304
1342
|
{
|
|
1343
|
+
<A, E, R, const Layers extends [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(
|
|
1344
|
+
self: Effect.Effect<A, E, R>,
|
|
1345
|
+
layers: Layers
|
|
1346
|
+
): Effect.Effect<
|
|
1347
|
+
A,
|
|
1348
|
+
E | { [k in keyof Layers]: Layer.Layer.Error<Layers[k]> }[number],
|
|
1349
|
+
| { [k in keyof Layers]: Layer.Layer.Context<Layers[k]> }[number]
|
|
1350
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Layer.Success<Layers[k]> }[number]>
|
|
1351
|
+
>
|
|
1305
1352
|
<A, E, R, ROut, E2, RIn>(
|
|
1306
1353
|
self: Effect.Effect<A, E, R>,
|
|
1307
1354
|
layer: Layer.Layer<ROut, E2, RIn>
|
|
@@ -1314,16 +1361,36 @@ export const effect_provide = dual<
|
|
|
1314
1361
|
self: Effect.Effect<A, E, R>,
|
|
1315
1362
|
runtime: Runtime.Runtime<R2>
|
|
1316
1363
|
): Effect.Effect<A, E, Exclude<R, R2>>
|
|
1364
|
+
<A, E, E2, R, R2>(
|
|
1365
|
+
self: Effect.Effect<A, E, R>,
|
|
1366
|
+
managedRuntime: ManagedRuntime.ManagedRuntime<R2, E2>
|
|
1367
|
+
): Effect.Effect<A, E | E2, Exclude<R, R2>>
|
|
1317
1368
|
}
|
|
1318
1369
|
>(
|
|
1319
1370
|
2,
|
|
1320
1371
|
<A, E, R, ROut>(
|
|
1321
1372
|
self: Effect.Effect<A, E, R>,
|
|
1322
|
-
source:
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1373
|
+
source:
|
|
1374
|
+
| Layer.Layer<ROut, any, any>
|
|
1375
|
+
| Context.Context<ROut>
|
|
1376
|
+
| Runtime.Runtime<ROut>
|
|
1377
|
+
| ManagedRuntime.ManagedRuntime<ROut, any>
|
|
1378
|
+
| Array<Layer.Layer.Any>
|
|
1379
|
+
): Effect.Effect<any, any, Exclude<R, ROut>> => {
|
|
1380
|
+
if (Array.isArray(source)) {
|
|
1381
|
+
// @ts-expect-error
|
|
1382
|
+
return provideSomeLayer(self, mergeAll(...source))
|
|
1383
|
+
} else if (isLayer(source)) {
|
|
1384
|
+
return provideSomeLayer(self, source as Layer.Layer<ROut, any, any>)
|
|
1385
|
+
} else if (Context.isContext(source)) {
|
|
1386
|
+
return core.provideSomeContext(self, source)
|
|
1387
|
+
} else if (circularManagedRuntime.TypeId in source) {
|
|
1388
|
+
return core.flatMap(
|
|
1389
|
+
(source as ManagedRuntime.ManagedRuntime<ROut, any>).runtimeEffect,
|
|
1390
|
+
(rt) => provideSomeRuntime(self, rt)
|
|
1391
|
+
)
|
|
1392
|
+
} else {
|
|
1393
|
+
return provideSomeRuntime(self, source as Runtime.Runtime<ROut>)
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1329
1396
|
)
|
package/src/internal/mailbox.ts
CHANGED
|
@@ -287,6 +287,9 @@ class MailboxImpl<A, E> extends Effectable.Class<readonly [messages: Chunk.Chunk
|
|
|
287
287
|
toString(): string {
|
|
288
288
|
return Inspectable.format(this)
|
|
289
289
|
}
|
|
290
|
+
[Inspectable.DenoInspectSymbol]() {
|
|
291
|
+
return Inspectable.format(this)
|
|
292
|
+
}
|
|
290
293
|
[Inspectable.NodeInspectSymbol]() {
|
|
291
294
|
return Inspectable.format(this)
|
|
292
295
|
}
|