effect-app 2.19.4 → 2.19.5
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/CHANGELOG.md +6 -0
- package/_cjs/Chunk.cjs +0 -31
- package/_cjs/Chunk.cjs.map +1 -1
- package/_cjs/Config/SecretURL.cjs +0 -9
- package/_cjs/Config/SecretURL.cjs.map +1 -1
- package/_cjs/Context.cjs +0 -6
- package/_cjs/Context.cjs.map +1 -1
- package/_cjs/Effect.cjs +0 -41
- package/_cjs/Effect.cjs.map +1 -1
- package/_cjs/NonEmptySetBase.cjs.map +1 -1
- package/_cjs/Option.cjs +0 -13
- package/_cjs/Option.cjs.map +1 -1
- package/_cjs/Pure.cjs +17 -85
- package/_cjs/Pure.cjs.map +1 -1
- package/_cjs/Schema/ext.cjs +0 -3
- package/_cjs/Schema/ext.cjs.map +1 -1
- package/_cjs/Set.cjs +0 -4
- package/_cjs/Set.cjs.map +1 -1
- package/_cjs/Tag.cjs +0 -9
- package/_cjs/Tag.cjs.map +1 -1
- package/_cjs/Unify.cjs +0 -16
- package/_cjs/Unify.cjs.map +1 -1
- package/_cjs/_ext/date.cjs +0 -42
- package/_cjs/_ext/date.cjs.map +1 -1
- package/_cjs/_ext/misc.cjs +0 -33
- package/_cjs/_ext/misc.cjs.map +1 -1
- package/_cjs/_ext/ord.ext.cjs +0 -9
- package/_cjs/_ext/ord.ext.cjs.map +1 -1
- package/_cjs/ids.cjs.map +1 -1
- package/_cjs/utils.cjs +0 -16
- package/_cjs/utils.cjs.map +1 -1
- package/dist/Chunk.d.ts +0 -31
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +1 -32
- package/dist/Config/SecretURL.d.ts +0 -13
- package/dist/Config/SecretURL.d.ts.map +1 -1
- package/dist/Config/SecretURL.js +1 -10
- package/dist/Context.d.ts +0 -6
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +1 -7
- package/dist/Effect.d.ts +0 -41
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1 -42
- package/dist/NonEmptySetBase.d.ts +0 -3
- package/dist/NonEmptySetBase.d.ts.map +1 -1
- package/dist/NonEmptySetBase.js +1 -1
- package/dist/Option.d.ts +0 -13
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +1 -14
- package/dist/Pure.d.ts +0 -77
- package/dist/Pure.d.ts.map +1 -1
- package/dist/Pure.js +17 -85
- package/dist/Schema/ext.d.ts +0 -3
- package/dist/Schema/ext.d.ts.map +1 -1
- package/dist/Schema/ext.js +1 -4
- package/dist/Set.d.ts +0 -11
- package/dist/Set.d.ts.map +1 -1
- package/dist/Set.js +1 -5
- package/dist/Tag.d.ts +0 -3
- package/dist/Tag.d.ts.map +1 -1
- package/dist/Tag.js +1 -10
- package/dist/Unify.d.ts +0 -16
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +1 -17
- package/dist/_ext/date.d.ts +0 -42
- package/dist/_ext/date.d.ts.map +1 -1
- package/dist/_ext/date.js +1 -43
- package/dist/_ext/misc.d.ts +0 -15
- package/dist/_ext/misc.d.ts.map +1 -1
- package/dist/_ext/misc.js +1 -34
- package/dist/_ext/ord.ext.d.ts +0 -9
- package/dist/_ext/ord.ext.d.ts.map +1 -1
- package/dist/_ext/ord.ext.js +1 -10
- package/dist/ids.d.ts +0 -6
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +1 -1
- package/dist/internal/Prelude.d.ts +0 -33
- package/dist/utils.d.ts +0 -20
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -17
- package/package.json +1 -1
- package/src/Chunk.ts +0 -31
- package/src/Config/SecretURL.ts +0 -13
- package/src/Context.ts +0 -6
- package/src/Effect.ts +0 -41
- package/src/NonEmptySetBase.ts +0 -3
- package/src/Option.ts +0 -13
- package/src/Pure.ts +0 -109
- package/src/Schema/ext.ts +0 -3
- package/src/Set.ts +0 -11
- package/src/Tag.ts +0 -9
- package/src/Unify.ts +0 -16
- package/src/_ext/date.ts +0 -42
- package/src/_ext/misc.ts +0 -35
- package/src/_ext/ord.ext.ts +0 -9
- package/src/ids.ts +0 -6
- package/src/internal/Prelude.d.ts +0 -33
- package/src/utils.ts +0 -20
package/src/Pure.ts
CHANGED
|
@@ -7,9 +7,6 @@ const S1 = Symbol()
|
|
|
7
7
|
const S2 = Symbol()
|
|
8
8
|
const W = Symbol()
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* @tsplus type PureEnv
|
|
12
|
-
*/
|
|
13
10
|
export interface PureState<S, S2 = S> {
|
|
14
11
|
readonly [S1]: (_: S) => void
|
|
15
12
|
readonly [S2]: () => S2
|
|
@@ -17,17 +14,11 @@ export interface PureState<S, S2 = S> {
|
|
|
17
14
|
state: S2
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
/**
|
|
21
|
-
* @tsplus type PureEnv
|
|
22
|
-
*/
|
|
23
17
|
export interface PureLog<W> {
|
|
24
18
|
readonly [W]: () => W
|
|
25
19
|
log: Chunk.Chunk<W>
|
|
26
20
|
}
|
|
27
21
|
|
|
28
|
-
/**
|
|
29
|
-
* @tsplus type PureEnv
|
|
30
|
-
*/
|
|
31
22
|
export interface PureEnv<W, S, S2 = S> extends PureState<S, S2>, PureLog<W> {}
|
|
32
23
|
|
|
33
24
|
export interface PureEnvTest extends PureState<any>, PureLog<any> {}
|
|
@@ -49,9 +40,6 @@ export function makePureEnv<W, S, S2 = S>(s: S2): PureEnv<W, S, S2> {
|
|
|
49
40
|
return new PureEnvBase<W, S, S2>(s)
|
|
50
41
|
}
|
|
51
42
|
|
|
52
|
-
/**
|
|
53
|
-
* @tsplus unify PureEnv
|
|
54
|
-
*/
|
|
55
43
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
44
|
export function unifyPureEnv<X extends PureEnv<any, any, any>>(
|
|
57
45
|
self: X
|
|
@@ -64,16 +52,10 @@ export function unifyPureEnv<X extends PureEnv<any, any, any>>(
|
|
|
64
52
|
return self
|
|
65
53
|
}
|
|
66
54
|
|
|
67
|
-
/**
|
|
68
|
-
* @tsplus type Pure
|
|
69
|
-
*/
|
|
70
55
|
export type Pure<W, S, S2, R, E, A> = Effect.Effect<A, E, PureEnvEnv<W, S, S2> | R>
|
|
71
56
|
|
|
72
57
|
// type dsl<W, S, S2> = ProgramDSL<W, S, S2>
|
|
73
58
|
|
|
74
|
-
/**
|
|
75
|
-
* @tsplus static Pure.Ops GMUA_
|
|
76
|
-
*/
|
|
77
59
|
export function GMUA_<W, S, S2, GR, GE, GA, MR, ME, MA, UR, UE, UA>(
|
|
78
60
|
get: Pure<W, S, S2, GR, GE, GA>,
|
|
79
61
|
modify: (i: GA) => Pure<W, S, S2, MR, ME, readonly [GA, MA]>,
|
|
@@ -82,9 +64,6 @@ export function GMUA_<W, S, S2, GR, GE, GA, MR, ME, MA, UR, UE, UA>(
|
|
|
82
64
|
return Effect.flatMap(get, modify).pipe(Effect.flatMap(([s, a]) => Effect.map(update(s), () => a)))
|
|
83
65
|
}
|
|
84
66
|
|
|
85
|
-
/**
|
|
86
|
-
* @tsplus static Pure.Ops GMUA
|
|
87
|
-
*/
|
|
88
67
|
export function GMUA<W, S, S2, GA, MR, ME, MA>(modify: (i: GA) => Pure<W, S, S2, MR, ME, readonly [GA, MA]>) {
|
|
89
68
|
return <GR, GE, UR, UE, UA>(
|
|
90
69
|
get: Pure<W, S, S2, GR, GE, GA>,
|
|
@@ -92,10 +71,6 @@ export function GMUA<W, S, S2, GA, MR, ME, MA>(modify: (i: GA) => Pure<W, S, S2,
|
|
|
92
71
|
) => GMUA_(get, modify, update)
|
|
93
72
|
}
|
|
94
73
|
|
|
95
|
-
/**
|
|
96
|
-
* @tsplus static Pure.Ops GMU_
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
74
|
export function GMU_<W, S, S2, GR, GE, GA, MR, ME, UR, UE, UA>(
|
|
100
75
|
get: Pure<W, S, S2, GR, GE, GA>,
|
|
101
76
|
modify: (i: GA) => Pure<W, S, S2, MR, ME, GA>,
|
|
@@ -104,9 +79,6 @@ export function GMU_<W, S, S2, GR, GE, GA, MR, ME, UR, UE, UA>(
|
|
|
104
79
|
return Effect.flatMap(get, modify).pipe(Effect.flatMap(update))
|
|
105
80
|
}
|
|
106
81
|
|
|
107
|
-
/**
|
|
108
|
-
* @tsplus static Pure.Ops GMU
|
|
109
|
-
*/
|
|
110
82
|
export function GMU<W, S, S2, GA, MR, ME>(modify: (i: GA) => Pure<W, S, S2, MR, ME, GA>) {
|
|
111
83
|
return <GR, GE, UR, UE, UA>(
|
|
112
84
|
get: Pure<W, S, S2, GR, GE, GA>,
|
|
@@ -124,40 +96,24 @@ export interface PureEnvEnv<W, S, S2> extends Context.ServiceTagged<typeof PureE
|
|
|
124
96
|
env: PureEnv<W, S, S2>
|
|
125
97
|
}
|
|
126
98
|
|
|
127
|
-
/**
|
|
128
|
-
* @tsplus static Pure.Ops get
|
|
129
|
-
*/
|
|
130
99
|
export function get<S>(): Pure<never, S, S, never, never, S> {
|
|
131
100
|
return Effect.map(castTag<never, S, S>(), (_) => _.env.state)
|
|
132
101
|
}
|
|
133
102
|
|
|
134
|
-
/**
|
|
135
|
-
* @tsplus static Pure.Ops set
|
|
136
|
-
*/
|
|
137
103
|
export function set<S>(s: S): Pure<never, S, S, never, never, void> {
|
|
138
104
|
return Effect.map(castTag<never, S, S>(), (_) => _.env.state = s)
|
|
139
105
|
}
|
|
140
106
|
|
|
141
107
|
export type PureLogT<W> = Pure<W, unknown, never, never, never, void>
|
|
142
108
|
|
|
143
|
-
/**
|
|
144
|
-
* @tsplus static Pure.Ops log
|
|
145
|
-
*/
|
|
146
109
|
export function log<W>(w: W): PureLogT<W> {
|
|
147
110
|
return Effect.map(castTag<W, unknown, never>(), (_) => _.env.log = Chunk.append(_.env.log, w))
|
|
148
111
|
}
|
|
149
112
|
|
|
150
|
-
/**
|
|
151
|
-
* @tsplus static Pure.Ops logMany
|
|
152
|
-
*/
|
|
153
113
|
export function logMany<W>(w: Iterable<W>): PureLogT<W> {
|
|
154
114
|
return Effect.map(castTag<W, unknown, never>(), (_) => _.env.log = Chunk.appendAll(_.env.log, Chunk.fromIterable(w)))
|
|
155
115
|
}
|
|
156
116
|
|
|
157
|
-
/**
|
|
158
|
-
* @tsplus static Pure.Ops runAll
|
|
159
|
-
* @tsplus fluent effect/io/Effect runAll
|
|
160
|
-
*/
|
|
161
117
|
export function runAll<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
162
118
|
self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
|
|
163
119
|
s: S4
|
|
@@ -181,10 +137,6 @@ export function runAll<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
|
181
137
|
return Effect.provide(a, Layer.succeed(tagg, { env: makePureEnv<W3, S3, S4>(s) as any }) as any) as any
|
|
182
138
|
}
|
|
183
139
|
|
|
184
|
-
/**
|
|
185
|
-
* @tsplus static Pure.Ops runResult
|
|
186
|
-
* @tsplus fluent effect/io/Effect runResult
|
|
187
|
-
*/
|
|
188
140
|
export function runResult<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
189
141
|
self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
|
|
190
142
|
s: S4
|
|
@@ -192,10 +144,6 @@ export function runResult<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
|
192
144
|
return Effect.map(runAll(self, s), ([log, r]) => tuple(log, Effect.map(r, ([s]) => s)))
|
|
193
145
|
}
|
|
194
146
|
|
|
195
|
-
/**
|
|
196
|
-
* @tsplus static Pure.Ops runTerm
|
|
197
|
-
* @tsplus fluent effect/io/Effect runTerm
|
|
198
|
-
*/
|
|
199
147
|
export function runTerm<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
200
148
|
self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
|
|
201
149
|
s: S4
|
|
@@ -203,10 +151,6 @@ export function runTerm<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
|
203
151
|
return Effect.flatMap(runAll(self, s), ([evts, r]) => Effect.map(r, ([s3, a]) => tuple(s3, Chunk.toArray(evts), a)))
|
|
204
152
|
}
|
|
205
153
|
|
|
206
|
-
/**
|
|
207
|
-
* @tsplus static Pure.Ops runTermDiscard
|
|
208
|
-
* @tsplus fluent effect/io/Effect runTermDiscard
|
|
209
|
-
*/
|
|
210
154
|
export function runTermDiscard<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
211
155
|
self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
|
|
212
156
|
s: S4
|
|
@@ -214,10 +158,6 @@ export function runTermDiscard<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
|
214
158
|
return Effect.map(runTerm(self, s), ([s3, w3]) => tuple(s3, w3))
|
|
215
159
|
}
|
|
216
160
|
|
|
217
|
-
/**
|
|
218
|
-
* @tsplus static Pure.Ops runA
|
|
219
|
-
* @tsplus fluent effect/io/Effect runA
|
|
220
|
-
*/
|
|
221
161
|
export function runA<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
222
162
|
self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
|
|
223
163
|
s: S4
|
|
@@ -225,9 +165,6 @@ export function runA<R, E, A, W3, S1, S3, S4 extends S1>(
|
|
|
225
165
|
return Effect.map(runAll(self, s), ([log, r]) => tuple(log, Effect.map(r, ([, a]) => a)))
|
|
226
166
|
}
|
|
227
167
|
|
|
228
|
-
/**
|
|
229
|
-
* @tsplus static Pure.Ops modifyWith
|
|
230
|
-
*/
|
|
231
168
|
export function modify<S2, A, S3>(
|
|
232
169
|
mod: (s: S2) => readonly [S3, A]
|
|
233
170
|
): Effect.Effect<A, never, { env: PureEnv<never, S2, S3> }> {
|
|
@@ -238,9 +175,6 @@ export function modify<S2, A, S3>(
|
|
|
238
175
|
})) as any
|
|
239
176
|
}
|
|
240
177
|
|
|
241
|
-
/**
|
|
242
|
-
* @tsplus static Pure.Ops modifyWithEffect
|
|
243
|
-
*/
|
|
244
178
|
export function modifyM<W, R, E, A, S2, S3>(
|
|
245
179
|
mod: (s: S2) => Effect.Effect<readonly [S3, A], E, FixEnv<R, W, S2, S3>>
|
|
246
180
|
): Effect.Effect<A, E, FixEnv<R, W, S2, S3>> {
|
|
@@ -251,9 +185,6 @@ export function modifyM<W, R, E, A, S2, S3>(
|
|
|
251
185
|
) as any
|
|
252
186
|
}
|
|
253
187
|
|
|
254
|
-
/**
|
|
255
|
-
* @tsplus static Pure.Ops updateWith
|
|
256
|
-
*/
|
|
257
188
|
export function updateWith<S2, S3>(upd: (s: S2) => S3) {
|
|
258
189
|
return modify((_: S2) => {
|
|
259
190
|
const r = upd(_)
|
|
@@ -261,9 +192,6 @@ export function updateWith<S2, S3>(upd: (s: S2) => S3) {
|
|
|
261
192
|
})
|
|
262
193
|
}
|
|
263
194
|
|
|
264
|
-
/**
|
|
265
|
-
* @tsplus static Pure.Ops updateWithEffect
|
|
266
|
-
*/
|
|
267
195
|
export function updateWithEffect<W, R, E, S2, S3>(
|
|
268
196
|
upd: (s: S2, log: (evt: W) => PureLogT<W>) => Effect.Effect<S3, E, FixEnv<R, W, S2, S3>>
|
|
269
197
|
): Effect.Effect<S3, E, FixEnv<R, W, S2, S3>> {
|
|
@@ -278,9 +206,6 @@ export type FixEnv<R, W, S, S2> =
|
|
|
278
206
|
// return Effect.accessM((_: PureState<S>) => Ref.get(_.state).map(self))
|
|
279
207
|
// }
|
|
280
208
|
|
|
281
|
-
// /**
|
|
282
|
-
// * @tsplus static Pure.Ops getM
|
|
283
|
-
// */
|
|
284
209
|
// export function getM<W, S, R, E, A>(self: (s: S) => Pure<W, S, R, E, A>): Pure<W, S, R, E, A> {
|
|
285
210
|
// return Effect.accessM((_: PureState<S>) => Ref.get(_.state).flatMap(self))
|
|
286
211
|
// }
|
|
@@ -298,25 +223,6 @@ export type FixEnv<R, W, S, S2> =
|
|
|
298
223
|
// return (self: (s: S) => Pure<W, S, R, E, A>) => access(_ => Ref.get(_.state).flatMap(self))
|
|
299
224
|
// }
|
|
300
225
|
|
|
301
|
-
/**
|
|
302
|
-
* @tsplus type Pure.Ops
|
|
303
|
-
*/
|
|
304
|
-
export interface PureOps {
|
|
305
|
-
// $: PureAspects
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// /**
|
|
309
|
-
// * @tsplus type Pure.Ops
|
|
310
|
-
// */
|
|
311
|
-
|
|
312
|
-
// export interface PureAspects {}
|
|
313
|
-
export const Pure: PureOps = {
|
|
314
|
-
// $: {}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// /**
|
|
318
|
-
// * @tsplus static Pure.Ops makeDSL
|
|
319
|
-
// */
|
|
320
226
|
// export function makeProgramDSL<W, S, S2 = S>(): ProgramDSL<W, S, S2> {
|
|
321
227
|
// return makeDSL_<W,S, S2>()
|
|
322
228
|
// }
|
|
@@ -422,35 +328,20 @@ export const Pure: PureOps = {
|
|
|
422
328
|
|
|
423
329
|
// type dsl_<W,S, S2 = S> = ReturnType<typeof makeDSL_<W, S, S2>>
|
|
424
330
|
|
|
425
|
-
// /**
|
|
426
|
-
// * @tsplus type Pure/DSL
|
|
427
|
-
// */
|
|
428
331
|
// export interface ProgramDSL<W, S, S2 = S> extends dsl_<W, S, S2> { }
|
|
429
332
|
|
|
430
|
-
// /**
|
|
431
|
-
// * @tsplus fluent Pure/DSL modifyWithEffect
|
|
432
|
-
// */
|
|
433
333
|
// export function dslmodifyM<W, S, R, E, A>(dsl: ProgramDSL<W, S>, mod: (s: S, dsl: ProgramDSL<W, S>) => Effect.Effect<R, E, readonly [S, A]>) {
|
|
434
334
|
// return dsl.modifyM(_ => mod(_, dsl))
|
|
435
335
|
// }
|
|
436
336
|
|
|
437
|
-
// /**
|
|
438
|
-
// * @tsplus fluent Pure/DSL modifyWith
|
|
439
|
-
// */
|
|
440
337
|
// export function dslmodify<W, S, A>(dsl: ProgramDSL<W, S>, mod: (s: S, dsl: ProgramDSL<W, S>) => readonly [S, A]) {
|
|
441
338
|
// return dsl.modify(_ => mod(_, dsl))
|
|
442
339
|
// }
|
|
443
340
|
|
|
444
|
-
// /**
|
|
445
|
-
// * @tsplus fluent Pure/DSL updateWithEffect
|
|
446
|
-
// */
|
|
447
341
|
// export function dslupdateM<W, S, R, E, S2, S3>(dsl: ProgramDSL<W, S, S2>, upd: (s: S2, dsl: ProgramDSL<W, S, S2>) => Effect.Effect<R, E, S3>) {
|
|
448
342
|
// return dsl.updateM(_ => upd(_, dsl))
|
|
449
343
|
// }
|
|
450
344
|
|
|
451
|
-
// /**
|
|
452
|
-
// * @tsplus fluent Pure/DSL updateWith
|
|
453
|
-
// */
|
|
454
345
|
// export function dslupdate<W, S>(dsl: ProgramDSL<W, S>, upd: (s: S, dsl: ProgramDSL<W, S>) => S) {
|
|
455
346
|
// return dsl.update(_ => upd(_, dsl))
|
|
456
347
|
// }
|
package/src/Schema/ext.ts
CHANGED
|
@@ -125,9 +125,6 @@ export const defaultMap = <A, A2, I, R>(s: Schema<ReadonlyMap<A, A2>, I, R>) =>
|
|
|
125
125
|
export const defaultSet = <A, I, R>(s: Schema<ReadonlySet<A>, I, R>) =>
|
|
126
126
|
s.pipe(withDefaultConstructor(() => new Set<A>()))
|
|
127
127
|
|
|
128
|
-
/**
|
|
129
|
-
* @tsplus getter effect/schema/Schema withDefaultMake
|
|
130
|
-
*/
|
|
131
128
|
export const withDefaultMake = <Self extends S.Schema<any, any, never>>(s: Self) => {
|
|
132
129
|
const a = Object.assign(S.decodeSync(s) as WithDefaults<Self>, s)
|
|
133
130
|
Object.setPrototypeOf(a, s)
|
package/src/Set.ts
CHANGED
|
@@ -6,9 +6,6 @@ import { not } from "effect/Predicate"
|
|
|
6
6
|
import type { Predicate, Refinement } from "./Function.js"
|
|
7
7
|
import { identity, pipe, tuple } from "./Function.js"
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @tsplus fluent ets/Set find
|
|
11
|
-
*/
|
|
12
9
|
export function find_<A, B extends A>(
|
|
13
10
|
as: ReadonlySet<A>,
|
|
14
11
|
refinement: Refinement<A, B>
|
|
@@ -18,9 +15,6 @@ export function find_<A>(set: ReadonlySet<A>, predicate: Predicate<A>) {
|
|
|
18
15
|
return [...set].find(predicate)
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
/**
|
|
22
|
-
* @tsplus fluent ets/Set findFirst
|
|
23
|
-
*/
|
|
24
18
|
export function findFirst_<A, B extends A>(
|
|
25
19
|
set: ReadonlySet<A>,
|
|
26
20
|
refinement: Refinement<A, B>
|
|
@@ -30,9 +24,6 @@ export function findFirst_<A>(set: ReadonlySet<A>, predicate: Predicate<A>): Opt
|
|
|
30
24
|
return Option.fromNullable([...set].find(predicate))
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
/**
|
|
34
|
-
* @tsplus fluent ets/Set findFirstMap
|
|
35
|
-
*/
|
|
36
27
|
export function findFirstMap_<A, B>(
|
|
37
28
|
set: ReadonlySet<A>,
|
|
38
29
|
f: (a: A) => Option.Option<B>
|
|
@@ -152,7 +143,6 @@ export function some<A>(predicate: Predicate<A>): (set: Set<A>) => boolean {
|
|
|
152
143
|
|
|
153
144
|
/**
|
|
154
145
|
* true if one or more elements match predicate
|
|
155
|
-
* @tsplus fluent ets/Set some
|
|
156
146
|
*/
|
|
157
147
|
export function some_<A>(set: Set<A>, predicate: Predicate<A>): boolean {
|
|
158
148
|
return some(predicate)(set)
|
|
@@ -256,7 +246,6 @@ export function filter<A>(predicate: Predicate<A>): (set: Set<A>) => Set<A> {
|
|
|
256
246
|
|
|
257
247
|
/**
|
|
258
248
|
* Filter set values using predicate
|
|
259
|
-
* @tsplus fluent ets/Set filter
|
|
260
249
|
*/
|
|
261
250
|
export function filter_<A, B extends A>(
|
|
262
251
|
set: Set<A>,
|
package/src/Tag.ts
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
// /**
|
|
2
|
-
// * @tsplus fluent effect/data/Context/Tag withEffect_
|
|
3
|
-
// */
|
|
4
1
|
// export function accessM_<T, I, R, E, A>(self: Tag<T, I>, f: (x: T) => Effect<R, E, A>) {
|
|
5
2
|
// return Effect.serviceWithEffect(self)(f)
|
|
6
3
|
// }
|
|
7
4
|
|
|
8
5
|
import { Layer } from "effect"
|
|
9
6
|
|
|
10
|
-
// /**
|
|
11
|
-
// * @tsplus fluent effect/data/Context/Tag with_
|
|
12
|
-
// */
|
|
13
7
|
// export function access_<T, I, B>(self: Tag<T, I>, f: (x: T) => B) {
|
|
14
8
|
// return Effect.serviceWith(self)(f)
|
|
15
9
|
// }
|
|
16
10
|
|
|
17
|
-
/**
|
|
18
|
-
* @tsplus fluent effect/data/Context/Tag makeLayer
|
|
19
|
-
*/
|
|
20
11
|
export const makeLayer = Layer.succeed
|
package/src/Unify.ts
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
import type { Chunk, Either, Option } from "effect"
|
|
5
5
|
import type { Effect, EffectTypeId } from "effect/Effect"
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @tsplus unify effect/io/Effect
|
|
9
|
-
*/
|
|
10
7
|
export function unifyEffect<X extends { readonly [EffectTypeId]: Effect.VarianceStruct<any, any, any> }>(
|
|
11
8
|
self: X
|
|
12
9
|
): Effect<
|
|
@@ -17,20 +14,12 @@ export function unifyEffect<X extends { readonly [EffectTypeId]: Effect.Variance
|
|
|
17
14
|
return self as any
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
/**
|
|
21
|
-
* @tsplus unify effect/data/Chunk
|
|
22
|
-
*/
|
|
23
17
|
export function unifyChunk<X extends Chunk.Chunk<any>>(
|
|
24
18
|
self: X
|
|
25
19
|
): Chunk.Chunk<[X] extends [Chunk.Chunk<infer A>] ? A : never> {
|
|
26
20
|
return self
|
|
27
21
|
}
|
|
28
22
|
|
|
29
|
-
/**
|
|
30
|
-
* @tsplus unify effect/data/Either
|
|
31
|
-
* @tsplus unify effect/data/Either.Left
|
|
32
|
-
* @tsplus unify effect/data/Either.Right
|
|
33
|
-
*/
|
|
34
23
|
export function unifyEither<X extends Either.Either<any, any>>(
|
|
35
24
|
self: X
|
|
36
25
|
): Either.Either<
|
|
@@ -40,11 +29,6 @@ export function unifyEither<X extends Either.Either<any, any>>(
|
|
|
40
29
|
return self
|
|
41
30
|
}
|
|
42
31
|
|
|
43
|
-
/**
|
|
44
|
-
* @tsplus unify effect/data/Option
|
|
45
|
-
* @tsplus unify effect/data/Option.Some
|
|
46
|
-
* @tsplus unify effect/data/Option.None
|
|
47
|
-
*/
|
|
48
32
|
export function unifyOption<X extends Option.Option<any>>(
|
|
49
33
|
self: X
|
|
50
34
|
): Option.Option<
|
package/src/_ext/date.ts
CHANGED
|
@@ -15,70 +15,28 @@ import {
|
|
|
15
15
|
subYears
|
|
16
16
|
} from "date-fns"
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* @tsplus fluent Date addDays
|
|
20
|
-
*/
|
|
21
18
|
export const DateAddDays: (date: Date, amount: number) => Date = addDays
|
|
22
|
-
/**
|
|
23
|
-
* @tsplus fluent Date subDays
|
|
24
|
-
*/
|
|
25
19
|
export const DateSubDays: (date: Date, amount: number) => Date = subDays
|
|
26
20
|
|
|
27
|
-
/**
|
|
28
|
-
* @tsplus fluent Date addHours
|
|
29
|
-
*/
|
|
30
21
|
export const DateAddHours: (date: Date, amount: number) => Date = addHours
|
|
31
|
-
/**
|
|
32
|
-
* @tsplus fluent Date subHours
|
|
33
|
-
*/
|
|
34
22
|
export const DateSubHours: (date: Date, amount: number) => Date = subHours
|
|
35
23
|
|
|
36
|
-
/**
|
|
37
|
-
* @tsplus fluent Date addMinutes
|
|
38
|
-
*/
|
|
39
24
|
export const DateAddMinutes: (date: Date, amount: number) => Date = addMinutes
|
|
40
25
|
|
|
41
|
-
/**
|
|
42
|
-
* @tsplus fluent Date subMinutes
|
|
43
|
-
*/
|
|
44
26
|
export const DateSubMinutes: (date: Date, amount: number) => Date = subMinutes
|
|
45
27
|
|
|
46
|
-
/**
|
|
47
|
-
* @tsplus fluent Date addSeconds
|
|
48
|
-
*/
|
|
49
28
|
export const DateAddSeconds: (date: Date, amount: number) => Date = addSeconds
|
|
50
29
|
|
|
51
|
-
/**
|
|
52
|
-
* @tsplus fluent Date subSeconds
|
|
53
|
-
*/
|
|
54
30
|
export const DateSubSeconds: (date: Date, amount: number) => Date = subSeconds
|
|
55
31
|
|
|
56
|
-
/**
|
|
57
|
-
* @tsplus fluent Date addYears
|
|
58
|
-
*/
|
|
59
32
|
export const DateAddYears: (date: Date, amount: number) => Date = addYears
|
|
60
33
|
|
|
61
|
-
/**
|
|
62
|
-
* @tsplus fluent Date subYears
|
|
63
|
-
*/
|
|
64
34
|
export const DateSubYears: (date: Date, amount: number) => Date = subYears
|
|
65
35
|
|
|
66
|
-
/**
|
|
67
|
-
* @tsplus fluent Date addMonths
|
|
68
|
-
*/
|
|
69
36
|
export const DateAddMonths: (date: Date, amount: number) => Date = addMonths
|
|
70
37
|
|
|
71
|
-
/**
|
|
72
|
-
* @tsplus fluent Date subMonths
|
|
73
|
-
*/
|
|
74
38
|
export const DateSubMonths: (date: Date, amount: number) => Date = subMonths
|
|
75
39
|
|
|
76
|
-
/**
|
|
77
|
-
* @tsplus fluent Date addWeeks
|
|
78
|
-
*/
|
|
79
40
|
export const DateAddWeeks: (date: Date, amount: number) => Date = addWeeks
|
|
80
41
|
|
|
81
|
-
/**
|
|
82
|
-
* @tsplus fluent Date subWeeks
|
|
83
|
-
*/
|
|
84
42
|
export const DateSubWeeks: (date: Date, amount: number) => Date = subWeeks
|
package/src/_ext/misc.ts
CHANGED
|
@@ -11,9 +11,6 @@ export type _E<T extends Effect.Effect<any, any, any>> = [T] extends [
|
|
|
11
11
|
] ? E
|
|
12
12
|
: never
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* @tsplus fluent effect/data/Option encaseInEffect
|
|
16
|
-
*/
|
|
17
14
|
export function encaseMaybeInEffect_<E, A>(
|
|
18
15
|
o: Option.Option<A>,
|
|
19
16
|
onError: LazyArg<E>
|
|
@@ -21,9 +18,6 @@ export function encaseMaybeInEffect_<E, A>(
|
|
|
21
18
|
return Option.match(o, { onNone: () => Effect.fail(onError()), onSome: Effect.succeed })
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
/**
|
|
25
|
-
* @tsplus fluent effect/data/Option encaseInEither
|
|
26
|
-
*/
|
|
27
21
|
export function encaseMaybeEither_<E, A>(
|
|
28
22
|
o: Option.Option<A>,
|
|
29
23
|
onError: LazyArg<E>
|
|
@@ -31,18 +25,12 @@ export function encaseMaybeEither_<E, A>(
|
|
|
31
25
|
return Option.match(o, { onNone: () => Either.left(onError()), onSome: Either.right })
|
|
32
26
|
}
|
|
33
27
|
|
|
34
|
-
/**
|
|
35
|
-
* @tsplus getter effect/io/Effect toNullable
|
|
36
|
-
*/
|
|
37
28
|
export function toNullable<R, E, A>(
|
|
38
29
|
self: Effect.Effect<Option.Option<A>, E, R>
|
|
39
30
|
) {
|
|
40
31
|
return Effect.map(self, (_) => Option.getOrNull(_))
|
|
41
32
|
}
|
|
42
33
|
|
|
43
|
-
/**
|
|
44
|
-
* @tsplus fluent effect/io/Effect scope
|
|
45
|
-
*/
|
|
46
34
|
export function scope<R, E, A, R2, E2, A2>(
|
|
47
35
|
scopedEffect: Effect.Effect<A, E, R | Scope.Scope>,
|
|
48
36
|
effect: Effect.Effect<A2, E2, R2>
|
|
@@ -50,32 +38,9 @@ export function scope<R, E, A, R2, E2, A2>(
|
|
|
50
38
|
return Effect.zipRight(scopedEffect, effect).pipe(Effect.scoped)
|
|
51
39
|
}
|
|
52
40
|
|
|
53
|
-
/**
|
|
54
|
-
* @tsplus fluent effect/io/Effect flatMapScoped
|
|
55
|
-
*/
|
|
56
41
|
export function flatMapScoped<R, E, A, R2, E2, A2>(
|
|
57
42
|
scopedEffect: Effect.Effect<A, E, R | Scope.Scope>,
|
|
58
43
|
effect: (a: A) => Effect.Effect<A2, E2, R2>
|
|
59
44
|
): Effect.Effect<A2, E | E2, Exclude<R | R2, Scope.Scope>> {
|
|
60
45
|
return scopedEffect.pipe(Effect.flatMap(effect), Effect.scoped)
|
|
61
46
|
}
|
|
62
|
-
|
|
63
|
-
// /**
|
|
64
|
-
// * @tsplus fluent effect/io/Effect withScoped
|
|
65
|
-
// */
|
|
66
|
-
// export function withScoped<R, E, A, R2, E2, A2>(
|
|
67
|
-
// effect: Effect.Effect<R2, E2, A2>,
|
|
68
|
-
// scopedEffect: Effect.Effect<R | Scope.Scope, E, A>
|
|
69
|
-
// ): Effect.Effect<Exclude<R | R2, Scope.Scope>, E | E2, A2> {
|
|
70
|
-
// return scopedEffect.zipRight(effect).scoped
|
|
71
|
-
// }
|
|
72
|
-
|
|
73
|
-
// /**
|
|
74
|
-
// * @tsplus fluent effect/io/Effect withScoped
|
|
75
|
-
// */
|
|
76
|
-
// export function withScopedFlatMap<R, E, A, R2, E2, A2>(
|
|
77
|
-
// effect: (a: A) => Effect.Effect<R2, E2, A2>,
|
|
78
|
-
// scopedEffect: Effect.Effect<R | Scope.Scope, E, A>
|
|
79
|
-
// ): Effect.Effect<Exclude<R | R2, Scope.Scope>, E | E2, A2> {
|
|
80
|
-
// return scopedEffect.flatMap(effect).scoped
|
|
81
|
-
// }
|
package/src/_ext/ord.ext.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Chunk } from "effect"
|
|
2
2
|
import type { Equivalence } from "effect"
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @tsplus getter Generator toArray
|
|
6
|
-
*/
|
|
7
4
|
export function toArray<A>(
|
|
8
5
|
gen: Generator<A, void, unknown>
|
|
9
6
|
) {
|
|
@@ -12,9 +9,6 @@ export function toArray<A>(
|
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Remove duplicates from an array, keeping the first occurrence of an element.
|
|
15
|
-
*
|
|
16
|
-
* @tsplus static effect/data/Chunk.Ops uniq
|
|
17
|
-
* @tsplus pipeable effect/data/Chunk uniq
|
|
18
12
|
*/
|
|
19
13
|
export function uniq<A>(E: Equivalence.Equivalence<A>) {
|
|
20
14
|
return (self: Chunk.Chunk<A>): Chunk.Chunk<A> => {
|
|
@@ -33,9 +27,6 @@ export function uniq<A>(E: Equivalence.Equivalence<A>) {
|
|
|
33
27
|
* Test if a value is a member of an array. Takes a `Equivalence.Equivalence<A>` as a single
|
|
34
28
|
* argument which returns the function to use to search for a value of type `A`
|
|
35
29
|
* in an array of type `Chunk.Chunk<A>`.
|
|
36
|
-
*
|
|
37
|
-
* @tsplus static effect/data/Chunk.Ops elem2
|
|
38
|
-
* @tsplus pipeable effect/data/Chunk elem2
|
|
39
30
|
*/
|
|
40
31
|
export function elem<A>(E: Equivalence.Equivalence<A>, value: A) {
|
|
41
32
|
return (self: Chunk.Chunk<A>): boolean => {
|
package/src/ids.ts
CHANGED
|
@@ -9,9 +9,6 @@ export interface RequestIdBrand extends StringIdBrand {
|
|
|
9
9
|
readonly RequestId: unique symbol
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* @tsplus type RequestId
|
|
14
|
-
*/
|
|
15
12
|
export type RequestId = NonEmptyString255
|
|
16
13
|
// a request id may be made from a span id, which does not comply with StringId schema.
|
|
17
14
|
export const RequestId = extendM(
|
|
@@ -29,8 +26,5 @@ export const RequestId = extendM(
|
|
|
29
26
|
.pipe(withDefaultMake)
|
|
30
27
|
|
|
31
28
|
export interface UserProfileIdBrand extends Simplify<B.Brand<"UserProfileId"> & StringIdBrand> {}
|
|
32
|
-
/**
|
|
33
|
-
* @tsplus type UserProfileId
|
|
34
|
-
*/
|
|
35
29
|
export type UserProfileId = StringId & UserProfileIdBrand
|
|
36
30
|
export const UserProfileId = brandedStringId<UserProfileId>()
|
|
@@ -43,60 +43,46 @@ export type Layer<in ROut, out E = never, out RIn = never> = LAYER.Layer<ROut, E
|
|
|
43
43
|
export declare namespace Either {
|
|
44
44
|
export * from "effect/Either";
|
|
45
45
|
}
|
|
46
|
-
/** @tsplus type effect/data/Either */
|
|
47
46
|
export type Either<R, L = never> = EITHER.Either<R, L>;
|
|
48
47
|
export declare namespace Order {
|
|
49
48
|
export * from "effect/Order";
|
|
50
49
|
}
|
|
51
|
-
/** @tsplus type effect/data/Order */
|
|
52
50
|
export type Order<in A> = ORD.Order<A>;
|
|
53
51
|
export declare namespace Ref {
|
|
54
52
|
export * from "effect/Ref";
|
|
55
53
|
}
|
|
56
|
-
/** @tsplus type effect/data/Ref */
|
|
57
54
|
export type Ref<in out A> = REF.Ref<A>;
|
|
58
55
|
export declare namespace Duration {
|
|
59
56
|
export * from "effect/Duration";
|
|
60
57
|
}
|
|
61
|
-
/** @tsplus type effect/data/Duration */
|
|
62
58
|
export type Duration = DUR.Duration;
|
|
63
59
|
export declare namespace Context {
|
|
64
60
|
export * from "effect-app/Context";
|
|
65
61
|
}
|
|
66
|
-
/** @tsplus type effect/data/Context */
|
|
67
62
|
export type Context<in Services> = CTX.Context<Services>;
|
|
68
63
|
export declare namespace FiberRef {
|
|
69
64
|
export * from "effect/FiberRef";
|
|
70
65
|
}
|
|
71
|
-
/** @tsplus type effect/data/FiberRef */
|
|
72
66
|
export type FiberRef<in out A> = FR.FiberRef<A>;
|
|
73
67
|
export declare namespace Cause {
|
|
74
68
|
export * from "effect/Cause";
|
|
75
69
|
}
|
|
76
|
-
/** @tsplus type effect/data/Cause */
|
|
77
70
|
export type Cause<A> = C.Cause<A>;
|
|
78
71
|
export declare namespace Exit {
|
|
79
72
|
export * from "effect/Exit";
|
|
80
73
|
}
|
|
81
|
-
/** @tsplus type effect/data/Exit */
|
|
82
74
|
export type Exit<A, E = never> = EX.Exit<A, E>;
|
|
83
75
|
export declare namespace HashMap {
|
|
84
76
|
export * from "effect/HashMap";
|
|
85
77
|
}
|
|
86
|
-
/** @tsplus type effect/data/HashMap */
|
|
87
78
|
export type HashMap<out Key, out Value> = HM.HashMap<Key, Value>;
|
|
88
79
|
export declare namespace Scope {
|
|
89
80
|
export * from "effect/Scope";
|
|
90
81
|
}
|
|
91
|
-
/** @tsplus type effect/data/Scope */
|
|
92
82
|
export type Scope = SCOPE.Scope;
|
|
93
83
|
export declare namespace Option {
|
|
94
84
|
export * from "effect/Option";
|
|
95
85
|
}
|
|
96
|
-
/**
|
|
97
|
-
* @tsplus companion effect/data/Option.Ops
|
|
98
|
-
* @tsplus type effect/data/Option
|
|
99
|
-
*/
|
|
100
86
|
export type Option<A> = O.Option<A>;
|
|
101
87
|
export declare namespace Equivalence {
|
|
102
88
|
export * from "effect/Equivalence";
|
|
@@ -113,15 +99,10 @@ export type Equal = EQL.Equal;
|
|
|
113
99
|
export declare namespace Chunk {
|
|
114
100
|
export * from "effect/Chunk";
|
|
115
101
|
}
|
|
116
|
-
/**
|
|
117
|
-
* @tsplus companion effect/data/Chunk.Ops
|
|
118
|
-
* @tsplus type effect/data/Chunk
|
|
119
|
-
*/
|
|
120
102
|
export type Chunk<out A> = CNK.Chunk<A>;
|
|
121
103
|
export declare namespace NonEmptySet {
|
|
122
104
|
export * from "effect-app/NonEmptySet";
|
|
123
105
|
}
|
|
124
|
-
/** @tsplus type ets/NonEmptySet */
|
|
125
106
|
export type NonEmptySet<A> = NS.NonEmptySet<A>;
|
|
126
107
|
export declare namespace Record {
|
|
127
108
|
export * from "effect/Record";
|
|
@@ -130,20 +111,10 @@ export type Record<K extends keyof any, T> = globalThis.Record<K, V>;
|
|
|
130
111
|
export declare namespace Array {
|
|
131
112
|
export * from "effect-app/Array";
|
|
132
113
|
}
|
|
133
|
-
/**
|
|
134
|
-
* @tsplus type Array
|
|
135
|
-
* @tsplus type Iterable
|
|
136
|
-
* @tsplus companion effect/data/Array.Ops
|
|
137
|
-
* @tsplus companion effect/data/Array.Ops
|
|
138
|
-
*/
|
|
139
114
|
export type Array<A> = globalThis.ReadonlyArray<A>;
|
|
140
115
|
export declare namespace ReadonlySet {
|
|
141
116
|
export * from "effect-app/Set";
|
|
142
117
|
}
|
|
143
|
-
/**
|
|
144
|
-
* @tsplus type ets/Set
|
|
145
|
-
* @tsplus type ets/ReadonlySet
|
|
146
|
-
*/
|
|
147
118
|
export type ReadonlySet<A> = SET.Set<A>;
|
|
148
119
|
export declare namespace Schema {
|
|
149
120
|
export * from "effect/Schema";
|
|
@@ -151,9 +122,5 @@ export declare namespace Schema {
|
|
|
151
122
|
export type Encoded<S> = SCHEMA.Schema.Encoded<S>;
|
|
152
123
|
export type Context<S> = SCHEMA.Schema.Context<S>;
|
|
153
124
|
}
|
|
154
|
-
/**
|
|
155
|
-
* @tsplus type ets/Set
|
|
156
|
-
* @tsplus type ets/Schema
|
|
157
|
-
*/
|
|
158
125
|
export type Schema<in out A, in out I = A, out R = never> = SCHEMA.Schema<A, I, R>;
|
|
159
126
|
//# sourceMappingURL=Prelude.d.ts.map
|