effect 3.12.10 → 3.12.12
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/README.md +38 -49
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/Chunk.js +8 -1
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Effect.js +26 -22
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Layer.js.map +1 -1
- package/dist/cjs/Match.js +659 -38
- package/dist/cjs/Match.js.map +1 -1
- package/dist/cjs/Reloadable.js.map +1 -1
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schedule.js +1074 -309
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/Schema.js +3 -1
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/internal/channel/channelExecutor.js +5 -1
- package/dist/cjs/internal/channel/channelExecutor.js.map +1 -1
- package/dist/cjs/internal/channel.js +1 -3
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +3 -2
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +6 -5
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/reloadable.js.map +1 -1
- package/dist/cjs/internal/schedule.js.map +1 -1
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stm/stm.js.map +1 -1
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Channel.d.ts +4 -4
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +26 -5
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +6 -6
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +12 -12
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/Match.d.ts +731 -48
- package/dist/dts/Match.d.ts.map +1 -1
- package/dist/dts/Reloadable.d.ts +13 -13
- package/dist/dts/Reloadable.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +4 -4
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +2294 -633
- package/dist/dts/Schedule.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +10 -4
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +8 -8
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/index.d.ts +25 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/stm/stm.d.ts +2 -2
- package/dist/dts/internal/stm/stm.d.ts.map +1 -1
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/Chunk.js +8 -1
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Effect.js +26 -22
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Layer.js.map +1 -1
- package/dist/esm/Match.js +665 -40
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Reloadable.js.map +1 -1
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schedule.js +1074 -309
- package/dist/esm/Schedule.js.map +1 -1
- package/dist/esm/Schema.js +3 -1
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/channel/channelExecutor.js +5 -1
- package/dist/esm/internal/channel/channelExecutor.js.map +1 -1
- package/dist/esm/internal/channel.js +1 -3
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +3 -2
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +6 -5
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/reloadable.js.map +1 -1
- package/dist/esm/internal/schedule.js.map +1 -1
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stm/stm.js.map +1 -1
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Channel.ts +14 -17
- package/src/Chunk.ts +26 -5
- package/src/Effect.ts +43 -41
- package/src/Layer.ts +30 -39
- package/src/Match.ts +733 -49
- package/src/Reloadable.ts +17 -27
- package/src/STM.ts +10 -17
- package/src/Schedule.ts +2325 -653
- package/src/Schema.ts +5 -5
- package/src/Stream.ts +26 -33
- package/src/index.ts +25 -0
- package/src/internal/channel/channelExecutor.ts +5 -1
- package/src/internal/channel.ts +46 -42
- package/src/internal/core-effect.ts +84 -84
- package/src/internal/effect/circular.ts +3 -2
- package/src/internal/fiberRuntime.ts +7 -6
- package/src/internal/layer.ts +52 -52
- package/src/internal/reloadable.ts +25 -28
- package/src/internal/schedule.ts +29 -23
- package/src/internal/sink.ts +16 -15
- package/src/internal/stm/stm.ts +54 -46
- package/src/internal/stream.ts +100 -100
- package/src/internal/version.ts +1 -1
package/package.json
CHANGED
package/src/Channel.ts
CHANGED
|
@@ -2456,12 +2456,9 @@ export const provideService: {
|
|
|
2456
2456
|
* @since 2.0.0
|
|
2457
2457
|
* @category context
|
|
2458
2458
|
*/
|
|
2459
|
-
<
|
|
2460
|
-
tag: T,
|
|
2461
|
-
service: Context.Tag.Service<T>
|
|
2462
|
-
): <OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>(
|
|
2459
|
+
<I, S>(tag: Context.Tag<I, S>, service: Types.NoInfer<S>): <OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>(
|
|
2463
2460
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
2464
|
-
) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<Env,
|
|
2461
|
+
) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<Env, I>>
|
|
2465
2462
|
/**
|
|
2466
2463
|
* Provides the effect with the single service it requires. If the effect
|
|
2467
2464
|
* requires more than one service use `provideContext` instead.
|
|
@@ -2469,11 +2466,11 @@ export const provideService: {
|
|
|
2469
2466
|
* @since 2.0.0
|
|
2470
2467
|
* @category context
|
|
2471
2468
|
*/
|
|
2472
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env,
|
|
2469
|
+
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, I, S>(
|
|
2473
2470
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
2474
|
-
tag:
|
|
2475
|
-
service:
|
|
2476
|
-
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<Env,
|
|
2471
|
+
tag: Context.Tag<I, S>,
|
|
2472
|
+
service: Types.NoInfer<S>
|
|
2473
|
+
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<Env, I>>
|
|
2477
2474
|
} = channel.provideService
|
|
2478
2475
|
|
|
2479
2476
|
/**
|
|
@@ -2829,23 +2826,23 @@ export const updateService: {
|
|
|
2829
2826
|
* @since 2.0.0
|
|
2830
2827
|
* @category context
|
|
2831
2828
|
*/
|
|
2832
|
-
<
|
|
2833
|
-
tag:
|
|
2834
|
-
f: (resource:
|
|
2829
|
+
<I, S>(
|
|
2830
|
+
tag: Context.Tag<I, S>,
|
|
2831
|
+
f: (resource: Types.NoInfer<S>) => Types.NoInfer<S>
|
|
2835
2832
|
): <OutElem, OutErr, InErr, OutDone, InDone, R>(
|
|
2836
2833
|
self: Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone, R>
|
|
2837
|
-
) => Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone,
|
|
2834
|
+
) => Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone, I | R>
|
|
2838
2835
|
/**
|
|
2839
2836
|
* Updates a service in the context of this channel.
|
|
2840
2837
|
*
|
|
2841
2838
|
* @since 2.0.0
|
|
2842
2839
|
* @category context
|
|
2843
2840
|
*/
|
|
2844
|
-
<OutElem, OutErr, InErr, OutDone, InDone, R,
|
|
2841
|
+
<OutElem, OutErr, InErr, OutDone, InDone, R, I, S>(
|
|
2845
2842
|
self: Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone, R>,
|
|
2846
|
-
tag:
|
|
2847
|
-
f: (resource:
|
|
2848
|
-
): Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone,
|
|
2843
|
+
tag: Context.Tag<I, S>,
|
|
2844
|
+
f: (resource: Types.NoInfer<S>) => Types.NoInfer<S>
|
|
2845
|
+
): Channel<OutElem, unknown, OutErr, InErr, OutDone, InDone, I | R>
|
|
2849
2846
|
} = channel.updateService
|
|
2850
2847
|
|
|
2851
2848
|
/**
|
package/src/Chunk.ts
CHANGED
|
@@ -1059,26 +1059,47 @@ export const flatMap: {
|
|
|
1059
1059
|
})
|
|
1060
1060
|
|
|
1061
1061
|
/**
|
|
1062
|
-
*
|
|
1062
|
+
* Iterates over each element of a `Chunk` and applies a function to it.
|
|
1063
|
+
*
|
|
1064
|
+
* **Details**
|
|
1065
|
+
*
|
|
1066
|
+
* This function processes every element of the given `Chunk`, calling the
|
|
1067
|
+
* provided function `f` on each element. It does not return a new value;
|
|
1068
|
+
* instead, it is primarily used for side effects, such as logging or
|
|
1069
|
+
* accumulating data in an external variable.
|
|
1063
1070
|
*
|
|
1064
1071
|
* @since 2.0.0
|
|
1065
1072
|
* @category combinators
|
|
1066
1073
|
*/
|
|
1067
1074
|
export const forEach: {
|
|
1068
1075
|
/**
|
|
1069
|
-
*
|
|
1076
|
+
* Iterates over each element of a `Chunk` and applies a function to it.
|
|
1077
|
+
*
|
|
1078
|
+
* **Details**
|
|
1079
|
+
*
|
|
1080
|
+
* This function processes every element of the given `Chunk`, calling the
|
|
1081
|
+
* provided function `f` on each element. It does not return a new value;
|
|
1082
|
+
* instead, it is primarily used for side effects, such as logging or
|
|
1083
|
+
* accumulating data in an external variable.
|
|
1070
1084
|
*
|
|
1071
1085
|
* @since 2.0.0
|
|
1072
1086
|
* @category combinators
|
|
1073
1087
|
*/
|
|
1074
|
-
<A, B>(f: (a: A) => B): (self: Chunk<A>) => void
|
|
1088
|
+
<A, B>(f: (a: A, index: number) => B): (self: Chunk<A>) => void
|
|
1075
1089
|
/**
|
|
1076
|
-
*
|
|
1090
|
+
* Iterates over each element of a `Chunk` and applies a function to it.
|
|
1091
|
+
*
|
|
1092
|
+
* **Details**
|
|
1093
|
+
*
|
|
1094
|
+
* This function processes every element of the given `Chunk`, calling the
|
|
1095
|
+
* provided function `f` on each element. It does not return a new value;
|
|
1096
|
+
* instead, it is primarily used for side effects, such as logging or
|
|
1097
|
+
* accumulating data in an external variable.
|
|
1077
1098
|
*
|
|
1078
1099
|
* @since 2.0.0
|
|
1079
1100
|
* @category combinators
|
|
1080
1101
|
*/
|
|
1081
|
-
<A, B>(self: Chunk<A>, f: (a: A) => B): void
|
|
1102
|
+
<A, B>(self: Chunk<A>, f: (a: A, index: number) => B): void
|
|
1082
1103
|
} = dual(2, <A, B>(self: Chunk<A>, f: (a: A) => B): void => toReadonlyArray(self).forEach(f))
|
|
1083
1104
|
|
|
1084
1105
|
/**
|
package/src/Effect.ts
CHANGED
|
@@ -15002,10 +15002,7 @@ export const provideService: {
|
|
|
15002
15002
|
* @since 2.0.0
|
|
15003
15003
|
* @category Context
|
|
15004
15004
|
*/
|
|
15005
|
-
<
|
|
15006
|
-
tag: T,
|
|
15007
|
-
service: Context.Tag.Service<T>
|
|
15008
|
-
): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, Context.Tag.Identifier<T>>>
|
|
15005
|
+
<I, S>(tag: Context.Tag<I, S>, service: NoInfer<S>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, I>>
|
|
15009
15006
|
/**
|
|
15010
15007
|
* Provides an implementation for a service in the context of an effect.
|
|
15011
15008
|
*
|
|
@@ -15058,11 +15055,7 @@ export const provideService: {
|
|
|
15058
15055
|
* @since 2.0.0
|
|
15059
15056
|
* @category Context
|
|
15060
15057
|
*/
|
|
15061
|
-
<A, E, R,
|
|
15062
|
-
self: Effect<A, E, R>,
|
|
15063
|
-
tag: T,
|
|
15064
|
-
service: Context.Tag.Service<T>
|
|
15065
|
-
): Effect<A, E, Exclude<R, Context.Tag.Identifier<T>>>
|
|
15058
|
+
<A, E, R, I, S>(self: Effect<A, E, R>, tag: Context.Tag<I, S>, service: NoInfer<S>): Effect<A, E, Exclude<R, I>>
|
|
15066
15059
|
} = effect.provideService
|
|
15067
15060
|
|
|
15068
15061
|
/**
|
|
@@ -15102,10 +15095,10 @@ export const provideServiceEffect: {
|
|
|
15102
15095
|
* @since 2.0.0
|
|
15103
15096
|
* @category Context
|
|
15104
15097
|
*/
|
|
15105
|
-
<
|
|
15106
|
-
tag:
|
|
15107
|
-
effect: Effect<
|
|
15108
|
-
): <A, E, R>(self: Effect<A, E, R>) => Effect<A,
|
|
15098
|
+
<I, S, E1, R1>(
|
|
15099
|
+
tag: Context.Tag<I, S>,
|
|
15100
|
+
effect: Effect<NoInfer<S>, E1, R1>
|
|
15101
|
+
): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E | E1, R1 | Exclude<R, I>>
|
|
15109
15102
|
/**
|
|
15110
15103
|
* Dynamically provides an implementation for a service using an effect.
|
|
15111
15104
|
*
|
|
@@ -15124,11 +15117,11 @@ export const provideServiceEffect: {
|
|
|
15124
15117
|
* @since 2.0.0
|
|
15125
15118
|
* @category Context
|
|
15126
15119
|
*/
|
|
15127
|
-
<A, E, R,
|
|
15120
|
+
<A, E, R, I, S, E1, R1>(
|
|
15128
15121
|
self: Effect<A, E, R>,
|
|
15129
|
-
tag:
|
|
15130
|
-
effect: Effect<
|
|
15131
|
-
): Effect<A, E | E1, R1 | Exclude<R,
|
|
15122
|
+
tag: Context.Tag<I, S>,
|
|
15123
|
+
effect: Effect<NoInfer<S>, E1, R1>
|
|
15124
|
+
): Effect<A, E | E1, R1 | Exclude<R, I>>
|
|
15132
15125
|
} = effect.provideServiceEffect
|
|
15133
15126
|
|
|
15134
15127
|
/**
|
|
@@ -15279,10 +15272,10 @@ export const updateService: {
|
|
|
15279
15272
|
* @since 2.0.0
|
|
15280
15273
|
* @category Context
|
|
15281
15274
|
*/
|
|
15282
|
-
<
|
|
15283
|
-
tag:
|
|
15284
|
-
f: (service:
|
|
15285
|
-
): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R |
|
|
15275
|
+
<I, S>(
|
|
15276
|
+
tag: Context.Tag<I, S>,
|
|
15277
|
+
f: (service: NoInfer<S>) => NoInfer<S>
|
|
15278
|
+
): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R | I>
|
|
15286
15279
|
/**
|
|
15287
15280
|
* Updates a service in the context with a new implementation.
|
|
15288
15281
|
*
|
|
@@ -15301,11 +15294,11 @@ export const updateService: {
|
|
|
15301
15294
|
* @since 2.0.0
|
|
15302
15295
|
* @category Context
|
|
15303
15296
|
*/
|
|
15304
|
-
<A, E, R,
|
|
15297
|
+
<A, E, R, I, S>(
|
|
15305
15298
|
self: Effect<A, E, R>,
|
|
15306
|
-
tag:
|
|
15307
|
-
f: (service:
|
|
15308
|
-
): Effect<A, E, R |
|
|
15299
|
+
tag: Context.Tag<I, S>,
|
|
15300
|
+
f: (service: NoInfer<S>) => NoInfer<S>
|
|
15301
|
+
): Effect<A, E, R | I>
|
|
15309
15302
|
} = effect.updateService
|
|
15310
15303
|
|
|
15311
15304
|
/**
|
|
@@ -27590,7 +27583,7 @@ export const fn:
|
|
|
27590
27583
|
const errorDef = new Error()
|
|
27591
27584
|
Error.stackTraceLimit = limit
|
|
27592
27585
|
if (typeof nameOrBody !== "string") {
|
|
27593
|
-
return function(this: any, ...args: Array<any>) {
|
|
27586
|
+
return defineLength(nameOrBody.length, function(this: any, ...args: Array<any>) {
|
|
27594
27587
|
const limit = Error.stackTraceLimit
|
|
27595
27588
|
Error.stackTraceLimit = 2
|
|
27596
27589
|
const errorCall = new Error()
|
|
@@ -27607,12 +27600,12 @@ export const fn:
|
|
|
27607
27600
|
errorDef,
|
|
27608
27601
|
errorCall
|
|
27609
27602
|
})
|
|
27610
|
-
} as any
|
|
27603
|
+
}) as any
|
|
27611
27604
|
}
|
|
27612
27605
|
const name = nameOrBody
|
|
27613
27606
|
const options = pipeables[0]
|
|
27614
|
-
return (body: Function, ...pipeables: Array<any>) =>
|
|
27615
|
-
|
|
27607
|
+
return (body: Function, ...pipeables: Array<any>) =>
|
|
27608
|
+
defineLength(body.length, function(this: any, ...args: Array<any>) {
|
|
27616
27609
|
const limit = Error.stackTraceLimit
|
|
27617
27610
|
Error.stackTraceLimit = 2
|
|
27618
27611
|
const errorCall = new Error()
|
|
@@ -27627,10 +27620,16 @@ export const fn:
|
|
|
27627
27620
|
errorDef,
|
|
27628
27621
|
errorCall
|
|
27629
27622
|
})
|
|
27630
|
-
}
|
|
27631
|
-
}
|
|
27623
|
+
})
|
|
27632
27624
|
}
|
|
27633
27625
|
|
|
27626
|
+
function defineLength<F extends Function>(length: number, fn: F) {
|
|
27627
|
+
return Object.defineProperty(fn, "length", {
|
|
27628
|
+
value: length,
|
|
27629
|
+
configurable: true
|
|
27630
|
+
})
|
|
27631
|
+
}
|
|
27632
|
+
|
|
27634
27633
|
function fnApply(options: {
|
|
27635
27634
|
readonly self: any
|
|
27636
27635
|
readonly body: Function
|
|
@@ -27695,14 +27694,17 @@ function fnApply(options: {
|
|
|
27695
27694
|
* @category Tracing
|
|
27696
27695
|
*/
|
|
27697
27696
|
export const fnUntraced: fn.Gen = (body: Function, ...pipeables: Array<any>) =>
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
|
|
27702
|
-
|
|
27703
|
-
let effect = core.fromIterator(() => body.apply(this, args))
|
|
27704
|
-
for (const x of pipeables) {
|
|
27705
|
-
effect = x(effect)
|
|
27697
|
+
defineLength(
|
|
27698
|
+
body.length,
|
|
27699
|
+
pipeables.length === 0
|
|
27700
|
+
? function(this: any, ...args: Array<any>) {
|
|
27701
|
+
return core.fromIterator(() => body.apply(this, args))
|
|
27706
27702
|
}
|
|
27707
|
-
|
|
27708
|
-
|
|
27703
|
+
: function(this: any, ...args: Array<any>) {
|
|
27704
|
+
let effect = core.fromIterator(() => body.apply(this, args))
|
|
27705
|
+
for (const x of pipeables) {
|
|
27706
|
+
effect = x(effect)
|
|
27707
|
+
}
|
|
27708
|
+
return effect
|
|
27709
|
+
}
|
|
27710
|
+
)
|
package/src/Layer.ts
CHANGED
|
@@ -352,19 +352,14 @@ export const effect: {
|
|
|
352
352
|
* @since 2.0.0
|
|
353
353
|
* @category constructors
|
|
354
354
|
*/
|
|
355
|
-
<
|
|
356
|
-
tag: T
|
|
357
|
-
): <E, R>(effect: Effect.Effect<Context.Tag.Service<T>, E, R>) => Layer<Context.Tag.Identifier<T>, E, R>
|
|
355
|
+
<I, S>(tag: Context.Tag<I, S>): <E, R>(effect: Effect.Effect<Types.NoInfer<S>, E, R>) => Layer<I, E, R>
|
|
358
356
|
/**
|
|
359
357
|
* Constructs a layer from the specified effect.
|
|
360
358
|
*
|
|
361
359
|
* @since 2.0.0
|
|
362
360
|
* @category constructors
|
|
363
361
|
*/
|
|
364
|
-
<
|
|
365
|
-
tag: T,
|
|
366
|
-
effect: Effect.Effect<Context.Tag.Service<T>, E, R>
|
|
367
|
-
): Layer<Context.Tag.Identifier<T>, E, R>
|
|
362
|
+
<I, S, E, R>(tag: Context.Tag<I, S>, effect: Effect.Effect<Types.NoInfer<S>, E, R>): Layer<I, E, R>
|
|
368
363
|
} = internal.fromEffect
|
|
369
364
|
|
|
370
365
|
/**
|
|
@@ -496,11 +491,11 @@ export const flatten: {
|
|
|
496
491
|
*/
|
|
497
492
|
export const fresh: <A, E, R>(self: Layer<A, E, R>) => Layer<A, E, R> = internal.fresh
|
|
498
493
|
|
|
499
|
-
const fromFunction: <
|
|
500
|
-
tagA:
|
|
501
|
-
tagB:
|
|
502
|
-
f: (a:
|
|
503
|
-
) => Layer<
|
|
494
|
+
const fromFunction: <I1, S1, I2, S2>(
|
|
495
|
+
tagA: Context.Tag<I1, S1>,
|
|
496
|
+
tagB: Context.Tag<I2, S2>,
|
|
497
|
+
f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
|
|
498
|
+
) => Layer<I2, never, I1> = internal.fromFunction
|
|
504
499
|
|
|
505
500
|
export {
|
|
506
501
|
/**
|
|
@@ -762,11 +757,11 @@ export const project: {
|
|
|
762
757
|
* @since 2.0.0
|
|
763
758
|
* @category utils
|
|
764
759
|
*/
|
|
765
|
-
<
|
|
766
|
-
tagA:
|
|
767
|
-
tagB:
|
|
768
|
-
f: (a:
|
|
769
|
-
): <RIn, E>(self: Layer<
|
|
760
|
+
<I1, S1, I2, S2>(
|
|
761
|
+
tagA: Context.Tag<I1, S1>,
|
|
762
|
+
tagB: Context.Tag<I2, S2>,
|
|
763
|
+
f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
|
|
764
|
+
): <RIn, E>(self: Layer<I1, E, RIn>) => Layer<I2, E, RIn>
|
|
770
765
|
/**
|
|
771
766
|
* Projects out part of one of the services output by this layer using the
|
|
772
767
|
* specified function.
|
|
@@ -774,12 +769,12 @@ export const project: {
|
|
|
774
769
|
* @since 2.0.0
|
|
775
770
|
* @category utils
|
|
776
771
|
*/
|
|
777
|
-
<RIn, E,
|
|
778
|
-
self: Layer<
|
|
779
|
-
tagA:
|
|
780
|
-
tagB:
|
|
781
|
-
f: (a:
|
|
782
|
-
): Layer<
|
|
772
|
+
<RIn, E, I1, S1, I2, S2>(
|
|
773
|
+
self: Layer<I1, E, RIn>,
|
|
774
|
+
tagA: Context.Tag<I1, S1>,
|
|
775
|
+
tagB: Context.Tag<I2, S2>,
|
|
776
|
+
f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
|
|
777
|
+
): Layer<I2, E, RIn>
|
|
783
778
|
} = internal.project
|
|
784
779
|
|
|
785
780
|
/**
|
|
@@ -903,19 +898,19 @@ export const scoped: {
|
|
|
903
898
|
* @since 2.0.0
|
|
904
899
|
* @category constructors
|
|
905
900
|
*/
|
|
906
|
-
<
|
|
907
|
-
|
|
908
|
-
)
|
|
901
|
+
<I, S>(
|
|
902
|
+
tag: Context.Tag<I, S>
|
|
903
|
+
): <E, R>(effect: Effect.Effect<Types.NoInfer<S>, E, R>) => Layer<I, E, Exclude<R, Scope.Scope>>
|
|
909
904
|
/**
|
|
910
905
|
* Constructs a layer from the specified scoped effect.
|
|
911
906
|
*
|
|
912
907
|
* @since 2.0.0
|
|
913
908
|
* @category constructors
|
|
914
909
|
*/
|
|
915
|
-
<
|
|
916
|
-
tag:
|
|
917
|
-
effect: Effect.Effect<
|
|
918
|
-
): Layer<
|
|
910
|
+
<I, S, E, R>(
|
|
911
|
+
tag: Context.Tag<I, S>,
|
|
912
|
+
effect: Effect.Effect<Types.NoInfer<S>, E, R>
|
|
913
|
+
): Layer<I, E, Exclude<R, Scope.Scope>>
|
|
919
914
|
} = internal.scoped
|
|
920
915
|
|
|
921
916
|
/**
|
|
@@ -945,9 +940,7 @@ export const scopedContext: <A, E, R>(
|
|
|
945
940
|
* @since 2.0.0
|
|
946
941
|
* @category constructors
|
|
947
942
|
*/
|
|
948
|
-
export const service: <
|
|
949
|
-
tag: T
|
|
950
|
-
) => Layer<Context.Tag.Identifier<T>, never, Context.Tag.Identifier<T>> = internal.service
|
|
943
|
+
export const service: <I, S>(tag: Context.Tag<I, S>) => Layer<I, never, I> = internal.service
|
|
951
944
|
|
|
952
945
|
/**
|
|
953
946
|
* Constructs a layer from the specified value.
|
|
@@ -962,14 +955,14 @@ export const succeed: {
|
|
|
962
955
|
* @since 2.0.0
|
|
963
956
|
* @category constructors
|
|
964
957
|
*/
|
|
965
|
-
<
|
|
958
|
+
<I, S>(tag: Context.Tag<I, S>): (resource: Types.NoInfer<S>) => Layer<I>
|
|
966
959
|
/**
|
|
967
960
|
* Constructs a layer from the specified value.
|
|
968
961
|
*
|
|
969
962
|
* @since 2.0.0
|
|
970
963
|
* @category constructors
|
|
971
964
|
*/
|
|
972
|
-
<
|
|
965
|
+
<I, S>(tag: Context.Tag<I, S>, resource: Types.NoInfer<S>): Layer<I>
|
|
973
966
|
} = internal.succeed
|
|
974
967
|
|
|
975
968
|
/**
|
|
@@ -1003,16 +996,14 @@ export const sync: {
|
|
|
1003
996
|
* @since 2.0.0
|
|
1004
997
|
* @category constructors
|
|
1005
998
|
*/
|
|
1006
|
-
<
|
|
1007
|
-
tag: T
|
|
1008
|
-
): (evaluate: LazyArg<Context.Tag.Service<T>>) => Layer<Context.Tag.Identifier<T>>
|
|
999
|
+
<I, S>(tag: Context.Tag<I, S>): (evaluate: LazyArg<Types.NoInfer<S>>) => Layer<I>
|
|
1009
1000
|
/**
|
|
1010
1001
|
* Lazily constructs a layer from the specified value.
|
|
1011
1002
|
*
|
|
1012
1003
|
* @since 2.0.0
|
|
1013
1004
|
* @category constructors
|
|
1014
1005
|
*/
|
|
1015
|
-
<
|
|
1006
|
+
<I, S>(tag: Context.Tag<I, S>, evaluate: LazyArg<Types.NoInfer<S>>): Layer<I>
|
|
1016
1007
|
} = internal.sync
|
|
1017
1008
|
|
|
1018
1009
|
/**
|