effect 4.0.0-beta.27 → 4.0.0-beta.29
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/Brand.d.ts +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +300 -184
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +99 -61
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +1 -1
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/Function.d.ts +1 -9
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +2 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Newtype.d.ts +291 -0
- package/dist/Newtype.d.ts.map +1 -0
- package/dist/Newtype.js +161 -0
- package/dist/Newtype.js.map +1 -0
- package/dist/PlatformError.d.ts +2 -2
- package/dist/References.d.ts +6 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +6 -1
- package/dist/References.js.map +1 -1
- package/dist/RequestResolver.d.ts +19 -19
- package/dist/RequestResolver.js +10 -10
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Schedule.d.ts +142 -80
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +58 -32
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +9 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +11 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +1 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +3 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +1 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/Stdio.d.ts +6 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +8 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +8 -4
- package/dist/Stream.js.map +1 -1
- package/dist/Types.d.ts +1 -22
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +71 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +3 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +12 -28
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -18
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +20 -1
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +65 -12
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +159 -45
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +4 -11
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +0 -5
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +35 -8
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +5 -5
- package/dist/unstable/cluster/Reply.d.ts +3 -3
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts +45 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +22 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +3 -7
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +5 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +21 -17
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +6 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +6 -6
- package/dist/unstable/http/HttpServerRequest.d.ts +11 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +291 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +47 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +227 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/UrlParams.d.ts +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +1 -0
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +7 -2
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +33 -15
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +39 -9
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +26 -2
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -8
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +46 -20
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +5 -5
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +2 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.js +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +1 -1
- package/package.json +1 -1
- package/src/Brand.ts +1 -1
- package/src/Data.ts +1 -2
- package/src/Effect.ts +300 -184
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +1 -0
- package/src/Function.ts +2 -10
- package/src/Newtype.ts +308 -0
- package/src/References.ts +6 -1
- package/src/RequestResolver.ts +20 -20
- package/src/Schedule.ts +142 -80
- package/src/Scheduler.ts +12 -0
- package/src/Schema.ts +4 -2
- package/src/SchemaAST.ts +1 -4
- package/src/Stdio.ts +8 -4
- package/src/Stream.ts +8 -4
- package/src/Types.ts +1 -23
- package/src/index.ts +72 -3
- package/src/internal/effect.ts +3 -0
- package/src/unstable/ai/LanguageModel.ts +16 -37
- package/src/unstable/ai/McpSchema.ts +14 -0
- package/src/unstable/ai/McpServer.ts +224 -53
- package/src/unstable/ai/Toolkit.ts +5 -14
- package/src/unstable/ai/internal/codec-transformer.ts +0 -7
- package/src/unstable/cli/Prompt.ts +31 -9
- package/src/unstable/http/Cookies.ts +84 -0
- package/src/unstable/http/HttpClient.ts +5 -6
- package/src/unstable/http/HttpClientRequest.ts +21 -17
- package/src/unstable/http/HttpEffect.ts +8 -0
- package/src/unstable/http/HttpServerRequest.ts +388 -1
- package/src/unstable/http/HttpServerResponse.ts +328 -1
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +1 -0
- package/src/unstable/reactivity/Atom.ts +62 -35
- package/src/unstable/reactivity/AtomHttpApi.ts +45 -11
- package/src/unstable/reactivity/AtomRegistry.ts +30 -2
- package/src/unstable/reactivity/AtomRpc.ts +48 -17
- package/src/unstable/rpc/Rpc.ts +1 -3
- package/src/unstable/rpc/RpcMiddleware.ts +12 -6
- package/src/unstable/rpc/RpcServer.ts +2 -2
- package/src/unstable/rpc/Utils.ts +1 -1
- package/src/unstable/sql/SqlResolver.ts +2 -2
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight wrapper types that prevent accidental mixing of structurally
|
|
3
|
+
* identical values (e.g. `UserId` vs `OrderId`, both `string` at runtime).
|
|
4
|
+
*
|
|
5
|
+
* **Mental model**
|
|
6
|
+
*
|
|
7
|
+
* - **Newtype** — a compile-time wrapper around a **carrier** type (the
|
|
8
|
+
* underlying primitive or object). At runtime the value is unchanged; the
|
|
9
|
+
* tag exists only in the type system.
|
|
10
|
+
* - **Key** — a unique string literal that distinguishes one newtype from
|
|
11
|
+
* another (e.g. `"Label"`, `"UserId"`).
|
|
12
|
+
* - **Carrier** — the underlying type the newtype wraps (e.g. `string`,
|
|
13
|
+
* `number`).
|
|
14
|
+
* - **Iso** — a lossless two-way conversion between a newtype and its carrier,
|
|
15
|
+
* created with {@link makeIso}. Use `iso.set(carrier)` to wrap and
|
|
16
|
+
* `iso.get(newtype)` to unwrap.
|
|
17
|
+
*
|
|
18
|
+
* **Common tasks**
|
|
19
|
+
*
|
|
20
|
+
* - Define a newtype → declare an `interface` extending
|
|
21
|
+
* `Newtype.Newtype<Key, Carrier>`
|
|
22
|
+
* - Wrap / unwrap values → {@link makeIso} (returns an `Optic.Iso`)
|
|
23
|
+
* - Unwrap only → {@link value}
|
|
24
|
+
* - Lift an `Equivalence` → {@link makeEquivalence}
|
|
25
|
+
* - Lift an `Order` → {@link makeOrder}
|
|
26
|
+
* - Lift a `Combiner` → {@link makeCombiner}
|
|
27
|
+
* - Lift a `Reducer` → {@link makeReducer}
|
|
28
|
+
*
|
|
29
|
+
* **Gotchas**
|
|
30
|
+
*
|
|
31
|
+
* - Newtypes are **purely compile-time**. There is zero runtime overhead;
|
|
32
|
+
* `value` and `makeIso` use identity casts.
|
|
33
|
+
* - Two newtypes sharing the same key string will be assignable to each other.
|
|
34
|
+
* Choose unique key strings.
|
|
35
|
+
* - A newtype value is **not** assignable to its carrier type without
|
|
36
|
+
* explicitly unwrapping via {@link value} or an iso.
|
|
37
|
+
*
|
|
38
|
+
* **Quickstart**
|
|
39
|
+
*
|
|
40
|
+
* **Example** (defining and using a newtype)
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { Newtype } from "effect"
|
|
44
|
+
*
|
|
45
|
+
* // 1. Define a newtype
|
|
46
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
47
|
+
*
|
|
48
|
+
* // 2. Create an iso for wrapping/unwrapping
|
|
49
|
+
* const labelIso = Newtype.makeIso<Label>()
|
|
50
|
+
*
|
|
51
|
+
* // 3. Wrap a raw string
|
|
52
|
+
* const myLabel: Label = labelIso.set("hello")
|
|
53
|
+
*
|
|
54
|
+
* // 4. Unwrap back to string
|
|
55
|
+
* const raw: string = labelIso.get(myLabel) // "hello"
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* **See also**
|
|
59
|
+
*
|
|
60
|
+
* - {@link Newtype} (the tagged interface)
|
|
61
|
+
* - {@link makeIso} (wrap and unwrap)
|
|
62
|
+
* - {@link value} (unwrap only)
|
|
63
|
+
*
|
|
64
|
+
* @since 4.0.0
|
|
65
|
+
*/
|
|
66
|
+
import type * as Combiner from "./Combiner.ts";
|
|
67
|
+
import type * as Equivalence from "./Equivalence.ts";
|
|
68
|
+
import * as Optic from "./Optic.ts";
|
|
69
|
+
import type * as Order from "./Order.ts";
|
|
70
|
+
import type * as Reducer from "./Reducer.ts";
|
|
71
|
+
declare const TypeId = "~effect/Newtype";
|
|
72
|
+
/**
|
|
73
|
+
* A tagged interface that wraps a carrier type under a unique key, preventing
|
|
74
|
+
* accidental interchange of structurally identical values.
|
|
75
|
+
*
|
|
76
|
+
* - Define your newtype as an `interface` extending
|
|
77
|
+
* `Newtype<"MyKey", CarrierType>`.
|
|
78
|
+
* - The tag is compile-time only; no runtime wrapper is allocated.
|
|
79
|
+
* - Use {@link makeIso} to create a two-way conversion, or {@link value} to
|
|
80
|
+
* unwrap.
|
|
81
|
+
*
|
|
82
|
+
* **Example** (defining a newtype)
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { Newtype } from "effect"
|
|
86
|
+
*
|
|
87
|
+
* interface UserId extends Newtype.Newtype<"UserId", number> {}
|
|
88
|
+
* interface OrderId extends Newtype.Newtype<"OrderId", number> {}
|
|
89
|
+
*
|
|
90
|
+
* // UserId and OrderId are not assignable to each other
|
|
91
|
+
* // even though both wrap `number`.
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @see {@link makeIso} — create an iso to wrap and unwrap
|
|
95
|
+
* @see {@link value} — unwrap a newtype value
|
|
96
|
+
*
|
|
97
|
+
* @since 4.0.0
|
|
98
|
+
*/
|
|
99
|
+
export interface Newtype<in out Key extends string, out Carrier> {
|
|
100
|
+
readonly [TypeId]: {
|
|
101
|
+
readonly key: Key;
|
|
102
|
+
readonly carrier: Carrier;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @since 4.0.0
|
|
107
|
+
*/
|
|
108
|
+
export declare namespace Newtype {
|
|
109
|
+
/**
|
|
110
|
+
* A type that matches any `Newtype`, useful as a generic constraint:
|
|
111
|
+
* `<N extends Newtype.Any>`.
|
|
112
|
+
*
|
|
113
|
+
* @see {@link Newtype} — the base tagged interface
|
|
114
|
+
*
|
|
115
|
+
* @since 4.0.0
|
|
116
|
+
*/
|
|
117
|
+
type Any = Newtype<any, unknown>;
|
|
118
|
+
/**
|
|
119
|
+
* Extracts the key literal type from a newtype.
|
|
120
|
+
*
|
|
121
|
+
* - Useful in generic code that needs to inspect or constrain the key.
|
|
122
|
+
*
|
|
123
|
+
* @since 4.0.0
|
|
124
|
+
*/
|
|
125
|
+
type Key<N extends Any> = N extends Newtype<infer Key, unknown> ? Key : never;
|
|
126
|
+
/**
|
|
127
|
+
* Extracts the carrier (underlying) type from a newtype.
|
|
128
|
+
*
|
|
129
|
+
* - Useful when you need to refer to the wrapped type in generic utilities.
|
|
130
|
+
*
|
|
131
|
+
* @since 4.0.0
|
|
132
|
+
*/
|
|
133
|
+
type Carrier<N extends Any> = N extends Newtype<infer _Key, infer Carrier> ? Carrier : never;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Unwraps a newtype value, returning the underlying carrier value.
|
|
137
|
+
*
|
|
138
|
+
* - Use when you only need to read the inner value and do not need to wrap new
|
|
139
|
+
* values.
|
|
140
|
+
* - For both wrapping and unwrapping, prefer {@link makeIso}.
|
|
141
|
+
* - Zero runtime cost: this is an identity cast.
|
|
142
|
+
*
|
|
143
|
+
* **Example** (unwrapping a newtype)
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* import { Newtype } from "effect"
|
|
147
|
+
*
|
|
148
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
149
|
+
*
|
|
150
|
+
* const iso = Newtype.makeIso<Label>()
|
|
151
|
+
* const label = iso.set("hello")
|
|
152
|
+
*
|
|
153
|
+
* const raw: string = Newtype.value(label) // "hello"
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @see {@link makeIso} — two-way conversion (wrap and unwrap)
|
|
157
|
+
*
|
|
158
|
+
* @since 4.0.0
|
|
159
|
+
*/
|
|
160
|
+
export declare const value: <N extends Newtype.Any>(newtype: N) => Newtype.Carrier<N>;
|
|
161
|
+
/**
|
|
162
|
+
* Creates an `Optic.Iso` for a newtype, providing both wrapping (`set`) and
|
|
163
|
+
* unwrapping (`get`).
|
|
164
|
+
*
|
|
165
|
+
* - Use this as the primary way to construct and deconstruct newtype values.
|
|
166
|
+
* - The returned iso composes with other optics via the standard `Optic` API.
|
|
167
|
+
* - Zero runtime cost: both directions are identity casts.
|
|
168
|
+
*
|
|
169
|
+
* **Example** (wrapping and unwrapping with an iso)
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { Newtype } from "effect"
|
|
173
|
+
*
|
|
174
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
175
|
+
*
|
|
176
|
+
* const labelIso = Newtype.makeIso<Label>()
|
|
177
|
+
*
|
|
178
|
+
* const label: Label = labelIso.set("world")
|
|
179
|
+
* const str: string = labelIso.get(label) // "world"
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @see {@link value} — unwrap only
|
|
183
|
+
*
|
|
184
|
+
* @since 4.0.0
|
|
185
|
+
*/
|
|
186
|
+
export declare function makeIso<N extends Newtype.Any>(): Optic.Iso<N, Newtype.Carrier<N>>;
|
|
187
|
+
/**
|
|
188
|
+
* Lifts an `Equivalence` for the carrier type into an `Equivalence` for the
|
|
189
|
+
* newtype.
|
|
190
|
+
*
|
|
191
|
+
* - Use when you need to compare two newtype values for equality.
|
|
192
|
+
* - The returned equivalence delegates to the provided carrier equivalence.
|
|
193
|
+
* - Zero runtime cost beyond the underlying equivalence check.
|
|
194
|
+
*
|
|
195
|
+
* **Example** (comparing newtypes)
|
|
196
|
+
*
|
|
197
|
+
* ```ts
|
|
198
|
+
* import { Newtype, Equivalence } from "effect"
|
|
199
|
+
*
|
|
200
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
201
|
+
*
|
|
202
|
+
* const eq = Newtype.makeEquivalence<Label>(Equivalence.String)
|
|
203
|
+
* const iso = Newtype.makeIso<Label>()
|
|
204
|
+
*
|
|
205
|
+
* eq(iso.set("a"), iso.set("a")) // true
|
|
206
|
+
* eq(iso.set("a"), iso.set("b")) // false
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* @see {@link makeOrder} — lift an `Order` for the carrier
|
|
210
|
+
*
|
|
211
|
+
* @since 4.0.0
|
|
212
|
+
*/
|
|
213
|
+
export declare const makeEquivalence: <N extends Newtype.Any>(equivalence: Equivalence.Equivalence<Newtype.Carrier<N>>) => Equivalence.Equivalence<N>;
|
|
214
|
+
/**
|
|
215
|
+
* Lifts an `Order` for the carrier type into an `Order` for the newtype.
|
|
216
|
+
*
|
|
217
|
+
* - Use when you need to sort or compare newtype values.
|
|
218
|
+
* - The returned order delegates to the provided carrier order.
|
|
219
|
+
*
|
|
220
|
+
* **Example** (ordering newtypes)
|
|
221
|
+
*
|
|
222
|
+
* ```ts
|
|
223
|
+
* import { Newtype, Order } from "effect"
|
|
224
|
+
*
|
|
225
|
+
* interface Score extends Newtype.Newtype<"Score", number> {}
|
|
226
|
+
*
|
|
227
|
+
* const ord = Newtype.makeOrder<Score>(Order.Number)
|
|
228
|
+
* const iso = Newtype.makeIso<Score>()
|
|
229
|
+
*
|
|
230
|
+
* ord(iso.set(1), iso.set(2)) // -1
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @see {@link makeEquivalence} — lift an `Equivalence` for the carrier
|
|
234
|
+
*
|
|
235
|
+
* @since 4.0.0
|
|
236
|
+
*/
|
|
237
|
+
export declare const makeOrder: <N extends Newtype.Any>(order: Order.Order<Newtype.Carrier<N>>) => Order.Order<N>;
|
|
238
|
+
/**
|
|
239
|
+
* Lifts a `Combiner` for the carrier type into a `Combiner` for the newtype.
|
|
240
|
+
*
|
|
241
|
+
* - Use when you need to combine (e.g. concatenate, add) newtype values.
|
|
242
|
+
* - The returned combiner delegates to the provided carrier combiner.
|
|
243
|
+
*
|
|
244
|
+
* **Example** (combining newtypes)
|
|
245
|
+
*
|
|
246
|
+
* ```ts
|
|
247
|
+
* import { Newtype, Combiner } from "effect"
|
|
248
|
+
*
|
|
249
|
+
* interface Amount extends Newtype.Newtype<"Amount", number> {}
|
|
250
|
+
*
|
|
251
|
+
* const sum = Combiner.make<number>((a, b) => a + b)
|
|
252
|
+
* const combiner = Newtype.makeCombiner<Amount>(sum)
|
|
253
|
+
* const iso = Newtype.makeIso<Amount>()
|
|
254
|
+
*
|
|
255
|
+
* const total = combiner.combine(iso.set(10), iso.set(20))
|
|
256
|
+
* Newtype.value(total) // 30
|
|
257
|
+
* ```
|
|
258
|
+
*
|
|
259
|
+
* @see {@link makeReducer} — lift a `Reducer` for the carrier
|
|
260
|
+
*
|
|
261
|
+
* @since 4.0.0
|
|
262
|
+
*/
|
|
263
|
+
export declare const makeCombiner: <N extends Newtype.Any>(combiner: Combiner.Combiner<Newtype.Carrier<N>>) => Combiner.Combiner<N>;
|
|
264
|
+
/**
|
|
265
|
+
* Lifts a `Reducer` for the carrier type into a `Reducer` for the newtype.
|
|
266
|
+
*
|
|
267
|
+
* - Use when you need to fold/reduce over a collection of newtype values.
|
|
268
|
+
* - The returned reducer delegates to the provided carrier reducer.
|
|
269
|
+
*
|
|
270
|
+
* **Example** (reducing newtypes)
|
|
271
|
+
*
|
|
272
|
+
* ```ts
|
|
273
|
+
* import { Newtype, Reducer } from "effect"
|
|
274
|
+
*
|
|
275
|
+
* interface Score extends Newtype.Newtype<"Score", number> {}
|
|
276
|
+
*
|
|
277
|
+
* const sum = Reducer.make<number>((a, b) => a + b, 0)
|
|
278
|
+
* const reducer = Newtype.makeReducer<Score>(sum)
|
|
279
|
+
* const iso = Newtype.makeIso<Score>()
|
|
280
|
+
*
|
|
281
|
+
* const total = reducer.combineAll([iso.set(1), iso.set(2), iso.set(3)])
|
|
282
|
+
* Newtype.value(total) // 6
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @see {@link makeCombiner} — lift a `Combiner` for the carrier
|
|
286
|
+
*
|
|
287
|
+
* @since 4.0.0
|
|
288
|
+
*/
|
|
289
|
+
export declare const makeReducer: <N extends Newtype.Any>(reducer: Reducer.Reducer<Newtype.Carrier<N>>) => Reducer.Reducer<N>;
|
|
290
|
+
export {};
|
|
291
|
+
//# sourceMappingURL=Newtype.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Newtype.d.ts","sourceRoot":"","sources":["../src/Newtype.ts"],"names":[],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ype.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { cast } from "./Function.js";
|
|
2
|
+
import * as Optic from "./Optic.js";
|
|
3
|
+
const TypeId = "~effect/Newtype";
|
|
4
|
+
/**
|
|
5
|
+
* Unwraps a newtype value, returning the underlying carrier value.
|
|
6
|
+
*
|
|
7
|
+
* - Use when you only need to read the inner value and do not need to wrap new
|
|
8
|
+
* values.
|
|
9
|
+
* - For both wrapping and unwrapping, prefer {@link makeIso}.
|
|
10
|
+
* - Zero runtime cost: this is an identity cast.
|
|
11
|
+
*
|
|
12
|
+
* **Example** (unwrapping a newtype)
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { Newtype } from "effect"
|
|
16
|
+
*
|
|
17
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
18
|
+
*
|
|
19
|
+
* const iso = Newtype.makeIso<Label>()
|
|
20
|
+
* const label = iso.set("hello")
|
|
21
|
+
*
|
|
22
|
+
* const raw: string = Newtype.value(label) // "hello"
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link makeIso} — two-way conversion (wrap and unwrap)
|
|
26
|
+
*
|
|
27
|
+
* @since 4.0.0
|
|
28
|
+
*/
|
|
29
|
+
export const value = cast;
|
|
30
|
+
/**
|
|
31
|
+
* Creates an `Optic.Iso` for a newtype, providing both wrapping (`set`) and
|
|
32
|
+
* unwrapping (`get`).
|
|
33
|
+
*
|
|
34
|
+
* - Use this as the primary way to construct and deconstruct newtype values.
|
|
35
|
+
* - The returned iso composes with other optics via the standard `Optic` API.
|
|
36
|
+
* - Zero runtime cost: both directions are identity casts.
|
|
37
|
+
*
|
|
38
|
+
* **Example** (wrapping and unwrapping with an iso)
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { Newtype } from "effect"
|
|
42
|
+
*
|
|
43
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
44
|
+
*
|
|
45
|
+
* const labelIso = Newtype.makeIso<Label>()
|
|
46
|
+
*
|
|
47
|
+
* const label: Label = labelIso.set("world")
|
|
48
|
+
* const str: string = labelIso.get(label) // "world"
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @see {@link value} — unwrap only
|
|
52
|
+
*
|
|
53
|
+
* @since 4.0.0
|
|
54
|
+
*/
|
|
55
|
+
export function makeIso() {
|
|
56
|
+
return Optic.makeIso(value, cast);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Lifts an `Equivalence` for the carrier type into an `Equivalence` for the
|
|
60
|
+
* newtype.
|
|
61
|
+
*
|
|
62
|
+
* - Use when you need to compare two newtype values for equality.
|
|
63
|
+
* - The returned equivalence delegates to the provided carrier equivalence.
|
|
64
|
+
* - Zero runtime cost beyond the underlying equivalence check.
|
|
65
|
+
*
|
|
66
|
+
* **Example** (comparing newtypes)
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { Newtype, Equivalence } from "effect"
|
|
70
|
+
*
|
|
71
|
+
* interface Label extends Newtype.Newtype<"Label", string> {}
|
|
72
|
+
*
|
|
73
|
+
* const eq = Newtype.makeEquivalence<Label>(Equivalence.String)
|
|
74
|
+
* const iso = Newtype.makeIso<Label>()
|
|
75
|
+
*
|
|
76
|
+
* eq(iso.set("a"), iso.set("a")) // true
|
|
77
|
+
* eq(iso.set("a"), iso.set("b")) // false
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @see {@link makeOrder} — lift an `Order` for the carrier
|
|
81
|
+
*
|
|
82
|
+
* @since 4.0.0
|
|
83
|
+
*/
|
|
84
|
+
export const makeEquivalence = cast;
|
|
85
|
+
/**
|
|
86
|
+
* Lifts an `Order` for the carrier type into an `Order` for the newtype.
|
|
87
|
+
*
|
|
88
|
+
* - Use when you need to sort or compare newtype values.
|
|
89
|
+
* - The returned order delegates to the provided carrier order.
|
|
90
|
+
*
|
|
91
|
+
* **Example** (ordering newtypes)
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* import { Newtype, Order } from "effect"
|
|
95
|
+
*
|
|
96
|
+
* interface Score extends Newtype.Newtype<"Score", number> {}
|
|
97
|
+
*
|
|
98
|
+
* const ord = Newtype.makeOrder<Score>(Order.Number)
|
|
99
|
+
* const iso = Newtype.makeIso<Score>()
|
|
100
|
+
*
|
|
101
|
+
* ord(iso.set(1), iso.set(2)) // -1
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @see {@link makeEquivalence} — lift an `Equivalence` for the carrier
|
|
105
|
+
*
|
|
106
|
+
* @since 4.0.0
|
|
107
|
+
*/
|
|
108
|
+
export const makeOrder = cast;
|
|
109
|
+
/**
|
|
110
|
+
* Lifts a `Combiner` for the carrier type into a `Combiner` for the newtype.
|
|
111
|
+
*
|
|
112
|
+
* - Use when you need to combine (e.g. concatenate, add) newtype values.
|
|
113
|
+
* - The returned combiner delegates to the provided carrier combiner.
|
|
114
|
+
*
|
|
115
|
+
* **Example** (combining newtypes)
|
|
116
|
+
*
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { Newtype, Combiner } from "effect"
|
|
119
|
+
*
|
|
120
|
+
* interface Amount extends Newtype.Newtype<"Amount", number> {}
|
|
121
|
+
*
|
|
122
|
+
* const sum = Combiner.make<number>((a, b) => a + b)
|
|
123
|
+
* const combiner = Newtype.makeCombiner<Amount>(sum)
|
|
124
|
+
* const iso = Newtype.makeIso<Amount>()
|
|
125
|
+
*
|
|
126
|
+
* const total = combiner.combine(iso.set(10), iso.set(20))
|
|
127
|
+
* Newtype.value(total) // 30
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @see {@link makeReducer} — lift a `Reducer` for the carrier
|
|
131
|
+
*
|
|
132
|
+
* @since 4.0.0
|
|
133
|
+
*/
|
|
134
|
+
export const makeCombiner = cast;
|
|
135
|
+
/**
|
|
136
|
+
* Lifts a `Reducer` for the carrier type into a `Reducer` for the newtype.
|
|
137
|
+
*
|
|
138
|
+
* - Use when you need to fold/reduce over a collection of newtype values.
|
|
139
|
+
* - The returned reducer delegates to the provided carrier reducer.
|
|
140
|
+
*
|
|
141
|
+
* **Example** (reducing newtypes)
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
144
|
+
* import { Newtype, Reducer } from "effect"
|
|
145
|
+
*
|
|
146
|
+
* interface Score extends Newtype.Newtype<"Score", number> {}
|
|
147
|
+
*
|
|
148
|
+
* const sum = Reducer.make<number>((a, b) => a + b, 0)
|
|
149
|
+
* const reducer = Newtype.makeReducer<Score>(sum)
|
|
150
|
+
* const iso = Newtype.makeIso<Score>()
|
|
151
|
+
*
|
|
152
|
+
* const total = reducer.combineAll([iso.set(1), iso.set(2), iso.set(3)])
|
|
153
|
+
* Newtype.value(total) // 6
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @see {@link makeCombiner} — lift a `Combiner` for the carrier
|
|
157
|
+
*
|
|
158
|
+
* @since 4.0.0
|
|
159
|
+
*/
|
|
160
|
+
export const makeReducer = cast;
|
|
161
|
+
//# sourceMappingURL=Newtype.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Newtype.js","names":["cast","Optic","TypeId","value","makeIso","makeEquivalence","makeOrder","makeCombiner","makeReducer"],"sources":["../src/Newtype.ts"],"sourcesContent":[null],"mappings":"AAmEA,SAASA,IAAI,QAAQ,eAAe;AACpC,OAAO,KAAKC,KAAK,MAAM,YAAY;AAInC,MAAMC,MAAM,GAAG,iBAAiB;AAqEhC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMC,KAAK,GAA8DH,IAAI;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAM,SAAUI,OAAOA,CAAA;EACrB,OAAOH,KAAK,CAACG,OAAO,CAACD,KAAK,EAAEH,IAAI,CAAC;AACnC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAO,MAAMK,eAAe,GAEML,IAAI;AAEtC;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,MAAMM,SAAS,GAAsFN,IAAI;AAEhH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMO,YAAY,GAEGP,IAAI;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMQ,WAAW,GACtBR,IAAI","ignoreList":[]}
|
package/dist/PlatformError.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Data from "./Data.ts";
|
|
5
5
|
declare const TypeId = "~effect/platform/PlatformError";
|
|
6
|
-
declare const BadArgument_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").
|
|
6
|
+
declare const BadArgument_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("./Cause.ts").YieldableError & {
|
|
7
7
|
readonly _tag: "BadArgument";
|
|
8
8
|
} & Readonly<A>;
|
|
9
9
|
/**
|
|
@@ -44,7 +44,7 @@ export declare class SystemError extends Data.Error<{
|
|
|
44
44
|
*/
|
|
45
45
|
get message(): string;
|
|
46
46
|
}
|
|
47
|
-
declare const PlatformError_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").
|
|
47
|
+
declare const PlatformError_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("./Cause.ts").YieldableError & {
|
|
48
48
|
readonly _tag: "PlatformError";
|
|
49
49
|
} & Readonly<A>;
|
|
50
50
|
/**
|
package/dist/References.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogLevel, Severity } from "./LogLevel.ts";
|
|
2
2
|
import type { ReadonlyRecord } from "./Record.ts";
|
|
3
|
-
import { MaxOpsBeforeYield } from "./Scheduler.ts";
|
|
3
|
+
import { MaxOpsBeforeYield, PreventSchedulerYield } from "./Scheduler.ts";
|
|
4
4
|
import * as ServiceMap from "./ServiceMap.ts";
|
|
5
5
|
import { CurrentTraceLevel, DisablePropagation, MinimumTraceLevel, type SpanLink, Tracer } from "./Tracer.ts";
|
|
6
6
|
export {
|
|
@@ -24,6 +24,11 @@ MaxOpsBeforeYield,
|
|
|
24
24
|
* @category references
|
|
25
25
|
*/
|
|
26
26
|
MinimumTraceLevel,
|
|
27
|
+
/**
|
|
28
|
+
* @since 4.0.0
|
|
29
|
+
* @category references
|
|
30
|
+
*/
|
|
31
|
+
PreventSchedulerYield,
|
|
27
32
|
/**
|
|
28
33
|
* @since 4.0.0
|
|
29
34
|
* @category references
|
package/dist/References.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../src/References.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../src/References.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAE7G,OAAO;AACL;;;GAGG;AACH,iBAAiB;AACjB;;;GAGG;AACH,kBAAkB;AAClB;;;GAGG;AACH,iBAAiB;AACjB;;;GAGG;A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;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,eAAe,gCAE0C,CAAA;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,GAAG,SAAS,CAGxE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,eAAe,qEAEsC,CAAA"}
|
package/dist/References.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
import { constTrue, constUndefined } from "./Function.js";
|
|
14
|
-
import { MaxOpsBeforeYield } from "./Scheduler.js";
|
|
14
|
+
import { MaxOpsBeforeYield, PreventSchedulerYield } from "./Scheduler.js";
|
|
15
15
|
import * as ServiceMap from "./ServiceMap.js";
|
|
16
16
|
import { CurrentTraceLevel, DisablePropagation, MinimumTraceLevel, Tracer } from "./Tracer.js";
|
|
17
17
|
export {
|
|
@@ -35,6 +35,11 @@ MaxOpsBeforeYield,
|
|
|
35
35
|
* @category references
|
|
36
36
|
*/
|
|
37
37
|
MinimumTraceLevel,
|
|
38
|
+
/**
|
|
39
|
+
* @since 4.0.0
|
|
40
|
+
* @category references
|
|
41
|
+
*/
|
|
42
|
+
PreventSchedulerYield,
|
|
38
43
|
/**
|
|
39
44
|
* @since 4.0.0
|
|
40
45
|
* @category references
|
package/dist/References.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"References.js","names":["constTrue","constUndefined","MaxOpsBeforeYield","ServiceMap","CurrentTraceLevel","DisablePropagation","MinimumTraceLevel","Tracer","CurrentConcurrency","Reference","defaultValue","Scheduler","CurrentStackFrame","TracerEnabled","TracerTimingEnabled","TracerSpanAnnotations","TracerSpanLinks","CurrentLogAnnotations","CurrentLogLevel","MinimumLogLevel","UnhandledLogLevel","CurrentLogSpans"],"sources":["../src/References.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,SAASA,SAAS,EAAEC,cAAc,QAAQ,eAAe;AAGzD,SAASC,iBAAiB,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"file":"References.js","names":["constTrue","constUndefined","MaxOpsBeforeYield","PreventSchedulerYield","ServiceMap","CurrentTraceLevel","DisablePropagation","MinimumTraceLevel","Tracer","CurrentConcurrency","Reference","defaultValue","Scheduler","CurrentStackFrame","TracerEnabled","TracerTimingEnabled","TracerSpanAnnotations","TracerSpanLinks","CurrentLogAnnotations","CurrentLogLevel","MinimumLogLevel","UnhandledLogLevel","CurrentLogSpans"],"sources":["../src/References.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,SAASA,SAAS,EAAEC,cAAc,QAAQ,eAAe;AAGzD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,gBAAgB;AACzE,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAC7C,SAASC,iBAAiB,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAiBC,MAAM,QAAQ,aAAa;AAE7G;AACE;;;;AAIAH,iBAAiB;AACjB;;;;AAIAC,kBAAkB;AAClB;;;;AAIAJ,iBAAiB;AACjB;;;;AAIAK,iBAAiB;AACjB;;;;AAIAJ,qBAAqB;AACrB;;;;AAIAK,MAAM;AAGR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,OAAO,MAAMC,kBAAkB,gBAAGL,UAAU,CAACM,SAAS,CAAuB,sCAAsC,EAAE;EACnHC,YAAY,EAAEA,CAAA,KAAM;CACrB,CAAC;AAEF;AACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BAC,SAAS,QACJ,gBAAgB;AAYvB;;;;AAIA,OAAO,MAAMC,iBAAiB,gBAAGT,UAAU,CAACM,SAAS,CAAyB,qCAAqC,EAAE;EACnHC,YAAY,EAAEV;CACf,CAAC;AAEF;;;;;;;;;;;;;;;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