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/Inspectable.ts
CHANGED
|
@@ -16,6 +16,18 @@ export const NodeInspectSymbol = Symbol.for("nodejs.util.inspect.custom")
|
|
|
16
16
|
*/
|
|
17
17
|
export type NodeInspectSymbol = typeof NodeInspectSymbol
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @since 3.9.0
|
|
21
|
+
* @category symbols
|
|
22
|
+
*/
|
|
23
|
+
export const DenoInspectSymbol = Symbol.for("Deno.customInspect")
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @since 3.9.0
|
|
27
|
+
* @category symbols
|
|
28
|
+
*/
|
|
29
|
+
export type DenoInspectSymbol = typeof DenoInspectSymbol
|
|
30
|
+
|
|
19
31
|
/**
|
|
20
32
|
* @since 2.0.0
|
|
21
33
|
* @category models
|
|
@@ -24,6 +36,7 @@ export interface Inspectable {
|
|
|
24
36
|
toString(): string
|
|
25
37
|
toJSON(): unknown
|
|
26
38
|
[NodeInspectSymbol](): unknown
|
|
39
|
+
[DenoInspectSymbol](): unknown
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
/**
|
|
@@ -56,6 +69,9 @@ export const BaseProto: Inspectable = {
|
|
|
56
69
|
[NodeInspectSymbol]() {
|
|
57
70
|
return this.toJSON()
|
|
58
71
|
},
|
|
72
|
+
[DenoInspectSymbol]() {
|
|
73
|
+
return this.toJSON()
|
|
74
|
+
},
|
|
59
75
|
toString() {
|
|
60
76
|
return format(this.toJSON())
|
|
61
77
|
}
|
|
@@ -75,6 +91,12 @@ export abstract class Class {
|
|
|
75
91
|
[NodeInspectSymbol]() {
|
|
76
92
|
return this.toJSON()
|
|
77
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* @since 3.9.0
|
|
96
|
+
*/
|
|
97
|
+
[DenoInspectSymbol]() {
|
|
98
|
+
return this.toJSON()
|
|
99
|
+
}
|
|
78
100
|
/**
|
|
79
101
|
* @since 2.0.0
|
|
80
102
|
*/
|
package/src/Layer.ts
CHANGED
|
@@ -76,23 +76,34 @@ export declare namespace Layer {
|
|
|
76
76
|
readonly _RIn: Types.Covariant<RIn>
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* @since 3.9.0
|
|
81
|
+
* @category type-level
|
|
82
|
+
*/
|
|
83
|
+
export interface Any {
|
|
84
|
+
readonly [LayerTypeId]: {
|
|
85
|
+
readonly _ROut: any
|
|
86
|
+
readonly _E: any
|
|
87
|
+
readonly _RIn: any
|
|
88
|
+
}
|
|
89
|
+
}
|
|
79
90
|
/**
|
|
80
91
|
* @since 2.0.0
|
|
81
92
|
* @category type-level
|
|
82
93
|
*/
|
|
83
|
-
export type Context<T extends
|
|
94
|
+
export type Context<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _RIn
|
|
84
95
|
: never
|
|
85
96
|
/**
|
|
86
97
|
* @since 2.0.0
|
|
87
98
|
* @category type-level
|
|
88
99
|
*/
|
|
89
|
-
export type Error<T extends
|
|
100
|
+
export type Error<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _E
|
|
90
101
|
: never
|
|
91
102
|
/**
|
|
92
103
|
* @since 2.0.0
|
|
93
104
|
* @category type-level
|
|
94
105
|
*/
|
|
95
|
-
export type Success<T extends
|
|
106
|
+
export type Success<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _ROut
|
|
96
107
|
: never
|
|
97
108
|
}
|
|
98
109
|
|
|
@@ -1157,8 +1168,24 @@ export const provide: {
|
|
|
1157
1168
|
* @category utils
|
|
1158
1169
|
*/
|
|
1159
1170
|
<RIn, E, ROut>(
|
|
1160
|
-
|
|
1161
|
-
): <RIn2, E2, ROut2>(
|
|
1171
|
+
that: Layer<ROut, E, RIn>
|
|
1172
|
+
): <RIn2, E2, ROut2>(self: Layer<ROut2, E2, RIn2>) => Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
|
|
1173
|
+
/**
|
|
1174
|
+
* Feeds the output services of this builder into the input of the specified
|
|
1175
|
+
* builder, resulting in a new builder with the inputs of this builder as
|
|
1176
|
+
* well as any leftover inputs, and the outputs of the specified builder.
|
|
1177
|
+
*
|
|
1178
|
+
* @since 2.0.0
|
|
1179
|
+
* @category utils
|
|
1180
|
+
*/
|
|
1181
|
+
<const Layers extends [Layer.Any, ...Array<Layer.Any>]>(that: Layers): <A, E, R>(
|
|
1182
|
+
self: Layer<A, E, R>
|
|
1183
|
+
) => Layer<
|
|
1184
|
+
A,
|
|
1185
|
+
E | { [k in keyof Layers]: Layer.Error<Layers[k]> }[number],
|
|
1186
|
+
| { [k in keyof Layers]: Layer.Context<Layers[k]> }[number]
|
|
1187
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Success<Layers[k]> }[number]>
|
|
1188
|
+
>
|
|
1162
1189
|
/**
|
|
1163
1190
|
* Feeds the output services of this builder into the input of the specified
|
|
1164
1191
|
* builder, resulting in a new builder with the inputs of this builder as
|
|
@@ -1168,9 +1195,23 @@ export const provide: {
|
|
|
1168
1195
|
* @category utils
|
|
1169
1196
|
*/
|
|
1170
1197
|
<RIn2, E2, ROut2, RIn, E, ROut>(
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
): Layer<ROut2,
|
|
1198
|
+
self: Layer<ROut2, E2, RIn2>,
|
|
1199
|
+
that: Layer<ROut, E, RIn>
|
|
1200
|
+
): Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
|
|
1201
|
+
/**
|
|
1202
|
+
* Feeds the output services of this builder into the input of the specified
|
|
1203
|
+
* builder, resulting in a new builder with the inputs of this builder as
|
|
1204
|
+
* well as any leftover inputs, and the outputs of the specified builder.
|
|
1205
|
+
*
|
|
1206
|
+
* @since 2.0.0
|
|
1207
|
+
* @category utils
|
|
1208
|
+
*/
|
|
1209
|
+
<A, E, R, const Layers extends [Layer.Any, ...Array<Layer.Any>]>(self: Layer<A, E, R>, that: Layers): Layer<
|
|
1210
|
+
A,
|
|
1211
|
+
E | { [k in keyof Layers]: Layer.Error<Layers[k]> }[number],
|
|
1212
|
+
| { [k in keyof Layers]: Layer.Context<Layers[k]> }[number]
|
|
1213
|
+
| Exclude<R, { [k in keyof Layers]: Layer.Success<Layers[k]> }[number]>
|
|
1214
|
+
>
|
|
1174
1215
|
} = internal.provide
|
|
1175
1216
|
|
|
1176
1217
|
/**
|
package/src/List.ts
CHANGED
|
@@ -28,7 +28,7 @@ import * as Equal from "./Equal.js"
|
|
|
28
28
|
import * as Equivalence from "./Equivalence.js"
|
|
29
29
|
import { dual, identity, unsafeCoerce } from "./Function.js"
|
|
30
30
|
import * as Hash from "./Hash.js"
|
|
31
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
31
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
32
32
|
import type { nonEmpty, NonEmptyIterable } from "./NonEmptyIterable.js"
|
|
33
33
|
import * as Option from "./Option.js"
|
|
34
34
|
import type { Pipeable } from "./Pipeable.js"
|
|
@@ -110,6 +110,9 @@ const ConsProto: Omit<Cons<unknown>, "head" | "tail" | typeof nonEmpty> = {
|
|
|
110
110
|
values: toArray(this).map(toJSON)
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
+
[DenoInspectSymbol]() {
|
|
114
|
+
return this.toJSON()
|
|
115
|
+
},
|
|
113
116
|
[NodeInspectSymbol]() {
|
|
114
117
|
return this.toJSON()
|
|
115
118
|
},
|
|
@@ -176,6 +179,9 @@ const NilProto: Nil<unknown> = {
|
|
|
176
179
|
_tag: "Nil"
|
|
177
180
|
}
|
|
178
181
|
},
|
|
182
|
+
[DenoInspectSymbol]() {
|
|
183
|
+
return this.toJSON()
|
|
184
|
+
},
|
|
179
185
|
[NodeInspectSymbol]() {
|
|
180
186
|
return this.toJSON()
|
|
181
187
|
},
|
package/src/ManagedRuntime.ts
CHANGED
|
@@ -5,9 +5,32 @@ import type * as Effect from "./Effect.js"
|
|
|
5
5
|
import type * as Exit from "./Exit.js"
|
|
6
6
|
import type * as Fiber from "./Fiber.js"
|
|
7
7
|
import * as internal from "./internal/managedRuntime.js"
|
|
8
|
+
import * as circular from "./internal/managedRuntime/circular.js"
|
|
8
9
|
import type * as Layer from "./Layer.js"
|
|
9
|
-
import type { Pipeable } from "./Pipeable.js"
|
|
10
10
|
import type * as Runtime from "./Runtime.js"
|
|
11
|
+
import type * as Unify from "./Unify.js"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 3.9.0
|
|
15
|
+
* @category symbol
|
|
16
|
+
*/
|
|
17
|
+
export const TypeId: unique symbol = circular.TypeId as TypeId
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @since 3.9.0
|
|
21
|
+
* @category symbol
|
|
22
|
+
*/
|
|
23
|
+
export type TypeId = typeof TypeId
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the provided argument is a `ManagedRuntime`.
|
|
27
|
+
*
|
|
28
|
+
* @param input - The value to be checked if it is a `ManagedRuntime`.
|
|
29
|
+
|
|
30
|
+
* @since 3.9.0
|
|
31
|
+
* @category guards
|
|
32
|
+
*/
|
|
33
|
+
export const isManagedRuntime: (input: unknown) => input is ManagedRuntime<unknown, unknown> = internal.isManagedRuntime
|
|
11
34
|
|
|
12
35
|
/**
|
|
13
36
|
* @since 3.4.0
|
|
@@ -29,7 +52,8 @@ export declare namespace ManagedRuntime {
|
|
|
29
52
|
* @since 2.0.0
|
|
30
53
|
* @category models
|
|
31
54
|
*/
|
|
32
|
-
export interface ManagedRuntime<in R, out ER> extends
|
|
55
|
+
export interface ManagedRuntime<in R, out ER> extends Effect.Effect<Runtime.Runtime<R>, ER> {
|
|
56
|
+
readonly [TypeId]: TypeId
|
|
33
57
|
readonly memoMap: Layer.MemoMap
|
|
34
58
|
readonly runtimeEffect: Effect.Effect<Runtime.Runtime<R>, ER>
|
|
35
59
|
readonly runtime: () => Promise<Runtime.Runtime<R>>
|
|
@@ -103,6 +127,26 @@ export interface ManagedRuntime<in R, out ER> extends Pipeable {
|
|
|
103
127
|
* Dispose of the resources associated with the runtime.
|
|
104
128
|
*/
|
|
105
129
|
readonly disposeEffect: Effect.Effect<void, never, never>
|
|
130
|
+
|
|
131
|
+
readonly [Unify.typeSymbol]?: unknown
|
|
132
|
+
readonly [Unify.unifySymbol]?: ManagedRuntimeUnify<this>
|
|
133
|
+
readonly [Unify.ignoreSymbol]?: ManagedRuntimeUnifyIgnore
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @category models
|
|
138
|
+
* @since 3.9.0
|
|
139
|
+
*/
|
|
140
|
+
export interface ManagedRuntimeUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
|
|
141
|
+
ManagedRuntime?: () => Extract<A[Unify.typeSymbol], ManagedRuntime<any, any>>
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @category models
|
|
146
|
+
* @since 3.9.0
|
|
147
|
+
*/
|
|
148
|
+
export interface ManagedRuntimeUnifyIgnore extends Effect.EffectUnifyIgnore {
|
|
149
|
+
Effect?: true
|
|
106
150
|
}
|
|
107
151
|
|
|
108
152
|
/**
|
package/src/Micro.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { constTrue, constVoid, dual, identity, type LazyArg } from "./Function.j
|
|
|
13
13
|
import { globalValue } from "./GlobalValue.js"
|
|
14
14
|
import type { TypeLambda } from "./HKT.js"
|
|
15
15
|
import type { Inspectable } from "./Inspectable.js"
|
|
16
|
-
import { NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
|
|
16
|
+
import { DenoInspectSymbol, NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
|
|
17
17
|
import * as doNotation from "./internal/doNotation.js"
|
|
18
18
|
import { StructuralPrototype } from "./internal/effectable.js"
|
|
19
19
|
import { SingleShotGen } from "./internal/singleShotGen.js"
|
|
@@ -323,6 +323,9 @@ abstract class MicroCauseImpl<Tag extends string, E> extends globalThis.Error im
|
|
|
323
323
|
toString() {
|
|
324
324
|
return this.stack
|
|
325
325
|
}
|
|
326
|
+
[DenoInspectSymbol]() {
|
|
327
|
+
return this.stack
|
|
328
|
+
}
|
|
326
329
|
[NodeInspectSymbol]() {
|
|
327
330
|
return this.stack
|
|
328
331
|
}
|
|
@@ -5253,6 +5256,9 @@ const YieldableError: new(message?: string) => YieldableError = (function() {
|
|
|
5253
5256
|
toJSON() {
|
|
5254
5257
|
return { ...this }
|
|
5255
5258
|
}
|
|
5259
|
+
[DenoInspectSymbol](): string {
|
|
5260
|
+
return this[NodeInspectSymbol]()
|
|
5261
|
+
}
|
|
5256
5262
|
[NodeInspectSymbol](): string {
|
|
5257
5263
|
const stack = this.stack
|
|
5258
5264
|
if (stack) {
|
package/src/MutableHashMap.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { NonEmptyArray } from "./Array.js"
|
|
|
5
5
|
import * as Equal from "./Equal.js"
|
|
6
6
|
import { dual } from "./Function.js"
|
|
7
7
|
import * as Hash from "./Hash.js"
|
|
8
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
8
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
9
9
|
import * as Option from "./Option.js"
|
|
10
10
|
import type { Pipeable } from "./Pipeable.js"
|
|
11
11
|
import { pipeArguments } from "./Pipeable.js"
|
|
@@ -46,6 +46,9 @@ const MutableHashMapProto: Omit<MutableHashMap<unknown, unknown>, "referential"
|
|
|
46
46
|
values: Array.from(this).map(toJSON)
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
+
[DenoInspectSymbol]() {
|
|
50
|
+
return this.toJSON()
|
|
51
|
+
},
|
|
49
52
|
[NodeInspectSymbol]() {
|
|
50
53
|
return this.toJSON()
|
|
51
54
|
},
|
package/src/MutableHashSet.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @since 2.0.0
|
|
3
3
|
*/
|
|
4
4
|
import * as Dual from "./Function.js"
|
|
5
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
5
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
6
6
|
import * as MutableHashMap from "./MutableHashMap.js"
|
|
7
7
|
import type { Pipeable } from "./Pipeable.js"
|
|
8
8
|
import { pipeArguments } from "./Pipeable.js"
|
|
@@ -40,6 +40,9 @@ const MutableHashSetProto: Omit<MutableHashSet<unknown>, "keyMap"> = {
|
|
|
40
40
|
values: Array.from(this).map(toJSON)
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
[DenoInspectSymbol]() {
|
|
44
|
+
return this.toJSON()
|
|
45
|
+
},
|
|
43
46
|
[NodeInspectSymbol]() {
|
|
44
47
|
return this.toJSON()
|
|
45
48
|
},
|
package/src/MutableList.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @since 2.0.0
|
|
3
3
|
*/
|
|
4
4
|
import * as Dual from "./Function.js"
|
|
5
|
-
import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
5
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
6
6
|
import type { Inspectable } from "./Inspectable.js"
|
|
7
7
|
import type { Pipeable } from "./Pipeable.js"
|
|
8
8
|
import { pipeArguments } from "./Pipeable.js"
|
|
@@ -63,6 +63,9 @@ const MutableListProto: Omit<MutableList<unknown>, "head" | "tail"> = {
|
|
|
63
63
|
values: Array.from(this).map(toJSON)
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
+
[DenoInspectSymbol]() {
|
|
67
|
+
return this.toJSON()
|
|
68
|
+
},
|
|
66
69
|
[NodeInspectSymbol]() {
|
|
67
70
|
return this.toJSON()
|
|
68
71
|
},
|
package/src/MutableQueue.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Chunk from "./Chunk.js"
|
|
5
5
|
import * as Dual from "./Function.js"
|
|
6
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
6
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
7
7
|
import * as MutableList from "./MutableList.js"
|
|
8
8
|
import type { Pipeable } from "./Pipeable.js"
|
|
9
9
|
import { pipeArguments } from "./Pipeable.js"
|
|
@@ -59,6 +59,9 @@ const MutableQueueProto: Omit<MutableQueue<unknown>, "queue" | "capacity"> = {
|
|
|
59
59
|
values: Array.from(this).map(toJSON)
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
[DenoInspectSymbol]() {
|
|
63
|
+
return this.toJSON()
|
|
64
|
+
},
|
|
62
65
|
[NodeInspectSymbol]() {
|
|
63
66
|
return this.toJSON()
|
|
64
67
|
},
|
package/src/MutableRef.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Equal from "./Equal.js"
|
|
5
5
|
import * as Dual from "./Function.js"
|
|
6
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
6
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
7
7
|
import type { Pipeable } from "./Pipeable.js"
|
|
8
8
|
import { pipeArguments } from "./Pipeable.js"
|
|
9
9
|
|
|
@@ -37,6 +37,9 @@ const MutableRefProto: Omit<MutableRef<unknown>, "current"> = {
|
|
|
37
37
|
current: toJSON(this.current)
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
+
[DenoInspectSymbol]() {
|
|
41
|
+
return this.toJSON()
|
|
42
|
+
},
|
|
40
43
|
[NodeInspectSymbol]() {
|
|
41
44
|
return this.toJSON()
|
|
42
45
|
},
|
package/src/Pool.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as internal from "./internal/pool.js"
|
|
|
7
7
|
import type { Pipeable } from "./Pipeable.js"
|
|
8
8
|
import type * as Scope from "./Scope.js"
|
|
9
9
|
import type * as Types from "./Types.js"
|
|
10
|
+
import type * as Unify from "./Unify.js"
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @since 2.0.0
|
|
@@ -28,7 +29,7 @@ export type PoolTypeId = typeof PoolTypeId
|
|
|
28
29
|
* @since 2.0.0
|
|
29
30
|
* @category models
|
|
30
31
|
*/
|
|
31
|
-
export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Pipeable {
|
|
32
|
+
export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Effect.Effect<A, E, Scope.Scope>, Pipeable {
|
|
32
33
|
/**
|
|
33
34
|
* Retrieves an item from the pool in a scoped effect. Note that if
|
|
34
35
|
* acquisition fails, then the returned effect will fail for that same reason.
|
|
@@ -42,6 +43,30 @@ export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Pipe
|
|
|
42
43
|
* than eagerly.
|
|
43
44
|
*/
|
|
44
45
|
invalidate(item: A): Effect.Effect<void>
|
|
46
|
+
|
|
47
|
+
readonly [Unify.typeSymbol]?: unknown
|
|
48
|
+
readonly [Unify.unifySymbol]?: PoolUnify<this>
|
|
49
|
+
readonly [Unify.ignoreSymbol]?: PoolUnifyIgnore
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @category models
|
|
54
|
+
* @since 3.9.0
|
|
55
|
+
*/
|
|
56
|
+
export interface PoolUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
|
|
57
|
+
Pool?: () => Extract<A[Unify.typeSymbol], Pool<any, any>> extends Pool<infer A0, infer _E0> | infer _ ?
|
|
58
|
+
A0 extends any ? Extract<A[Unify.typeSymbol], Pool<A0, any>> extends Pool<A0, infer E1> ? Pool<A0, E1>
|
|
59
|
+
: never
|
|
60
|
+
: never :
|
|
61
|
+
never
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @category models
|
|
66
|
+
* @since 3.9.0
|
|
67
|
+
*/
|
|
68
|
+
export interface PoolUnifyIgnore extends Effect.EffectUnifyIgnore {
|
|
69
|
+
Effect?: true
|
|
45
70
|
}
|
|
46
71
|
|
|
47
72
|
/**
|
package/src/Predicate.ts
CHANGED
|
@@ -855,6 +855,22 @@ export const isPromiseLike = (
|
|
|
855
855
|
input: unknown
|
|
856
856
|
): input is PromiseLike<unknown> => hasProperty(input, "then") && isFunction(input.then)
|
|
857
857
|
|
|
858
|
+
/**
|
|
859
|
+
* Tests if a value is a `RegExp`.
|
|
860
|
+
*
|
|
861
|
+
* @param input - The value to test.
|
|
862
|
+
*
|
|
863
|
+
* @example
|
|
864
|
+
* import { Predicate } from "effect"
|
|
865
|
+
*
|
|
866
|
+
* assert.deepStrictEqual(Predicate.isRegExp(/a/), true)
|
|
867
|
+
* assert.deepStrictEqual(Predicate.isRegExp("a"), false)
|
|
868
|
+
*
|
|
869
|
+
* @category guards
|
|
870
|
+
* @since 3.9.0
|
|
871
|
+
*/
|
|
872
|
+
export const isRegExp = (input: unknown): input is RegExp => input instanceof RegExp
|
|
873
|
+
|
|
858
874
|
/**
|
|
859
875
|
* @since 2.0.0
|
|
860
876
|
*/
|
package/src/Queue.ts
CHANGED
|
@@ -64,7 +64,7 @@ export type BackingQueueTypeId = typeof BackingQueueTypeId
|
|
|
64
64
|
* @since 2.0.0
|
|
65
65
|
* @category models
|
|
66
66
|
*/
|
|
67
|
-
export interface Queue<in out A> extends Enqueue<A>, Dequeue<A
|
|
67
|
+
export interface Queue<in out A> extends Enqueue<A>, Dequeue<A> {
|
|
68
68
|
/** @internal */
|
|
69
69
|
readonly queue: BackingQueue<A>
|
|
70
70
|
/** @internal */
|
|
@@ -134,7 +134,7 @@ export interface Enqueue<in A> extends Queue.EnqueueVariance<A>, BaseQueue, Pipe
|
|
|
134
134
|
* @since 2.0.0
|
|
135
135
|
* @category models
|
|
136
136
|
*/
|
|
137
|
-
export interface Dequeue<out A> extends Effect.Effect<A>, Queue.DequeueVariance<A>, BaseQueue
|
|
137
|
+
export interface Dequeue<out A> extends Effect.Effect<A>, Queue.DequeueVariance<A>, BaseQueue {
|
|
138
138
|
/**
|
|
139
139
|
* Takes the oldest value in the queue. If the queue is empty, this will return
|
|
140
140
|
* a computation that resumes when an item has been added to the queue.
|
package/src/RegExp.ts
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @since 2.0.0
|
|
5
5
|
*/
|
|
6
|
+
import * as predicate from "./Predicate.js"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tests if a value is a `RegExp`.
|
|
10
|
+
*
|
|
11
|
+
* @param input - The value to test.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { RegExp } from "effect"
|
|
15
|
+
*
|
|
16
|
+
* assert.deepStrictEqual(RegExp.isRegExp(/a/), true)
|
|
17
|
+
* assert.deepStrictEqual(RegExp.isRegExp("a"), false)
|
|
18
|
+
*
|
|
19
|
+
* @category guards
|
|
20
|
+
* @since 3.9.0
|
|
21
|
+
*/
|
|
22
|
+
export const isRegExp: (input: unknown) => input is RegExp = predicate.isRegExp
|
|
6
23
|
|
|
7
24
|
/**
|
|
8
25
|
* Escapes special characters in a regular expression pattern.
|
package/src/Resource.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type * as Schedule from "./Schedule.js"
|
|
|
8
8
|
import type * as Scope from "./Scope.js"
|
|
9
9
|
import type * as ScopedRef from "./ScopedRef.js"
|
|
10
10
|
import type * as Types from "./Types.js"
|
|
11
|
+
import type * as Unify from "./Unify.js"
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @since 2.0.0
|
|
@@ -28,11 +29,31 @@ export type ResourceTypeId = typeof ResourceTypeId
|
|
|
28
29
|
* @since 2.0.0
|
|
29
30
|
* @category models
|
|
30
31
|
*/
|
|
31
|
-
export interface Resource<in out A, in out E = never> extends Resource.Variance<A, E> {
|
|
32
|
+
export interface Resource<in out A, in out E = never> extends Effect.Effect<A, E>, Resource.Variance<A, E> {
|
|
32
33
|
/** @internal */
|
|
33
34
|
readonly scopedRef: ScopedRef.ScopedRef<Exit.Exit<A, E>>
|
|
34
35
|
/** @internal */
|
|
35
36
|
readonly acquire: Effect.Effect<A, E, Scope.Scope>
|
|
37
|
+
|
|
38
|
+
readonly [Unify.typeSymbol]?: unknown
|
|
39
|
+
readonly [Unify.unifySymbol]?: ResourceUnify<this>
|
|
40
|
+
readonly [Unify.ignoreSymbol]?: ResourceUnifyIgnore
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @category models
|
|
45
|
+
* @since 3.9.0
|
|
46
|
+
*/
|
|
47
|
+
export interface ResourceUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
|
|
48
|
+
Resource?: () => Extract<A[Unify.typeSymbol], Resource<any, any>>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @category models
|
|
53
|
+
* @since 3.9.0
|
|
54
|
+
*/
|
|
55
|
+
export interface ResourceUnifyIgnore extends Effect.EffectUnifyIgnore {
|
|
56
|
+
Effect?: true
|
|
36
57
|
}
|
|
37
58
|
|
|
38
59
|
/**
|
package/src/ScopedRef.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { Pipeable } from "./Pipeable.js"
|
|
|
8
8
|
import type * as Scope from "./Scope.js"
|
|
9
9
|
import type * as Synchronized from "./SynchronizedRef.js"
|
|
10
10
|
import type * as Types from "./Types.js"
|
|
11
|
+
import type * as Unify from "./Unify.js"
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @since 2.0.0
|
|
@@ -31,9 +32,29 @@ export type ScopedRefTypeId = typeof ScopedRefTypeId
|
|
|
31
32
|
* @since 2.0.0
|
|
32
33
|
* @category models
|
|
33
34
|
*/
|
|
34
|
-
export interface ScopedRef<in out A> extends ScopedRef.Variance<A>, Pipeable {
|
|
35
|
+
export interface ScopedRef<in out A> extends Effect.Effect<A>, ScopedRef.Variance<A>, Pipeable {
|
|
35
36
|
/** @internal */
|
|
36
37
|
readonly ref: Synchronized.SynchronizedRef<readonly [Scope.Scope.Closeable, A]>
|
|
38
|
+
|
|
39
|
+
readonly [Unify.typeSymbol]?: unknown
|
|
40
|
+
readonly [Unify.unifySymbol]?: ScopedRefUnify<this>
|
|
41
|
+
readonly [Unify.ignoreSymbol]?: ScopedRefUnifyIgnore
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @category models
|
|
46
|
+
* @since 3.9.0
|
|
47
|
+
*/
|
|
48
|
+
export interface ScopedRefUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
|
|
49
|
+
ScopedRef?: () => Extract<A[Unify.typeSymbol], ScopedRef<any>>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @category models
|
|
54
|
+
* @since 3.9.0
|
|
55
|
+
*/
|
|
56
|
+
export interface ScopedRefUnifyIgnore extends Effect.EffectUnifyIgnore {
|
|
57
|
+
Effect?: true
|
|
37
58
|
}
|
|
38
59
|
|
|
39
60
|
/**
|
package/src/SortedMap.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as Equal from "./Equal.js"
|
|
|
5
5
|
import * as Dual from "./Function.js"
|
|
6
6
|
import { pipe } from "./Function.js"
|
|
7
7
|
import * as Hash from "./Hash.js"
|
|
8
|
-
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
8
|
+
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
9
9
|
import * as Option from "./Option.js"
|
|
10
10
|
import type { Order } from "./Order.js"
|
|
11
11
|
import type { Pipeable } from "./Pipeable.js"
|
|
@@ -62,6 +62,9 @@ const SortedMapProto: Omit<SortedMap<unknown, unknown>, "tree"> = {
|
|
|
62
62
|
values: Array.from(this).map(toJSON)
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
+
[DenoInspectSymbol]() {
|
|
66
|
+
return this.toJSON()
|
|
67
|
+
},
|
|
65
68
|
[NodeInspectSymbol]() {
|
|
66
69
|
return this.toJSON()
|
|
67
70
|
},
|
package/src/SortedSet.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Dual from "./Function.js"
|
|
|
7
7
|
import { pipe } from "./Function.js"
|
|
8
8
|
import * as Hash from "./Hash.js"
|
|
9
9
|
import type { Inspectable } from "./Inspectable.js"
|
|
10
|
-
import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
10
|
+
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
|
|
11
11
|
import type { Order } from "./Order.js"
|
|
12
12
|
import type { Pipeable } from "./Pipeable.js"
|
|
13
13
|
import { pipeArguments } from "./Pipeable.js"
|
|
@@ -62,6 +62,9 @@ const SortedSetProto: Omit<SortedSet<unknown>, "keyTree"> = {
|
|
|
62
62
|
values: Array.from(this).map(toJSON)
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
+
[DenoInspectSymbol]() {
|
|
66
|
+
return this.toJSON()
|
|
67
|
+
},
|
|
65
68
|
[NodeInspectSymbol]() {
|
|
66
69
|
return this.toJSON()
|
|
67
70
|
},
|
package/src/Tuple.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as Equivalence from "./Equivalence.js"
|
|
|
7
7
|
import { dual } from "./Function.js"
|
|
8
8
|
import type { TypeLambda } from "./HKT.js"
|
|
9
9
|
import * as order from "./Order.js"
|
|
10
|
+
import type { TupleOf } from "./Types.js"
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @category type lambdas
|
|
@@ -61,6 +62,71 @@ export const getFirst = <L, R>(self: readonly [L, R]): L => self[0]
|
|
|
61
62
|
*/
|
|
62
63
|
export const getSecond = <L, R>(self: readonly [L, R]): R => self[1]
|
|
63
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Transforms each element of tuple using the given function, treating tuple homomorphically
|
|
67
|
+
*
|
|
68
|
+
* @param self - A tuple.
|
|
69
|
+
* @param f - The function to transform elements of the tuple.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* import { pipe, Tuple } from "effect"
|
|
73
|
+
*
|
|
74
|
+
* const result = pipe(
|
|
75
|
+
* ["a", 1, false] as const,
|
|
76
|
+
* Tuple.map((el) => el.toString().toUpperCase())
|
|
77
|
+
* )
|
|
78
|
+
* assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
|
|
79
|
+
*
|
|
80
|
+
* @category mapping
|
|
81
|
+
* @since 3.9.0
|
|
82
|
+
*/
|
|
83
|
+
export const map: {
|
|
84
|
+
/**
|
|
85
|
+
* Transforms each element of tuple using the given function, treating tuple homomorphically
|
|
86
|
+
*
|
|
87
|
+
* @param self - A tuple.
|
|
88
|
+
* @param f - The function to transform elements of the tuple.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* import { pipe, Tuple } from "effect"
|
|
92
|
+
*
|
|
93
|
+
* const result = pipe(
|
|
94
|
+
* ["a", 1, false] as const,
|
|
95
|
+
* Tuple.map((el) => el.toString().toUpperCase())
|
|
96
|
+
* )
|
|
97
|
+
* assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
|
|
98
|
+
*
|
|
99
|
+
* @category mapping
|
|
100
|
+
* @since 3.9.0
|
|
101
|
+
*/
|
|
102
|
+
<T extends ReadonlyArray<any> | [], B>(fn: (element: T[number]) => B): (self: T) => TupleOf<T["length"], B>
|
|
103
|
+
/**
|
|
104
|
+
* Transforms each element of tuple using the given function, treating tuple homomorphically
|
|
105
|
+
*
|
|
106
|
+
* @param self - A tuple.
|
|
107
|
+
* @param f - The function to transform elements of the tuple.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* import { pipe, Tuple } from "effect"
|
|
111
|
+
*
|
|
112
|
+
* const result = pipe(
|
|
113
|
+
* ["a", 1, false] as const,
|
|
114
|
+
* Tuple.map((el) => el.toString().toUpperCase())
|
|
115
|
+
* )
|
|
116
|
+
* assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
|
|
117
|
+
*
|
|
118
|
+
* @category mapping
|
|
119
|
+
* @since 3.9.0
|
|
120
|
+
*/
|
|
121
|
+
<B, T extends ReadonlyArray<any> | []>(self: T, fn: (element: T[number]) => B): TupleOf<T["length"], B>
|
|
122
|
+
} = dual(
|
|
123
|
+
2,
|
|
124
|
+
<N extends number, A, B>(
|
|
125
|
+
self: TupleOf<N, A>,
|
|
126
|
+
fn: (element: A) => B
|
|
127
|
+
): TupleOf<N, B> => self.map((element) => fn(element)) as TupleOf<N, B>
|
|
128
|
+
)
|
|
129
|
+
|
|
64
130
|
/**
|
|
65
131
|
* Transforms both elements of a tuple using the given functions.
|
|
66
132
|
*
|