@@ -373,16 +373,16 @@ export const mapEffect: {
|
||||
<A, ER, EW, RR, RW, B, EGet = never, RGet = never, ESet = never, RSet = never>(
|
||||
self: Lens<A, ER, EW, RR, RW>,
|
||||
get: (a: NoInfer<A>) => Effect.Effect<B, EGet, RGet>,
|
||||
update: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
set: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
): Lens<B, ER | EGet, EW | ESet, RR | RGet, RW | RSet>
|
||||
<A, ER, EW, RR, RW, B, EGet = never, RGet = never, ESet = never, RSet = never>(
|
||||
get: (a: NoInfer<A>) => Effect.Effect<B, EGet, RGet>,
|
||||
update: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
set: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
): (self: Lens<A, ER, EW, RR, RW>) => Lens<B, ER | EGet, EW | ESet, RR | RGet, RW | RSet>
|
||||
} = Function.dual(3, <A, ER, EW, RR, RW, B, EGet = never, RGet = never, ESet = never, RSet = never>(
|
||||
self: Lens<A, ER, EW, RR, RW>,
|
||||
get: (a: NoInfer<A>) => Effect.Effect<B, EGet, RGet>,
|
||||
update: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
set: (a: NoInfer<A>, b: B) => Effect.Effect<NoInfer<A>, ESet, RSet>,
|
||||
): Lens<B, ER | EGet, EW | ESet, RR | RGet, RW | RSet> => derive(self, {
|
||||
resolve: parent => Effect.flatMap(
|
||||
parent,
|
||||
@@ -390,12 +390,12 @@ export const mapEffect: {
|
||||
get(frame.value),
|
||||
value => ({
|
||||
value,
|
||||
commit: next => frame.commit(Effect.flatMap(next, b => update(frame.value, b))),
|
||||
commit: next => frame.commit(Effect.flatMap(next, b => set(frame.value, b))),
|
||||
}),
|
||||
),
|
||||
),
|
||||
mapStream: Stream.mapEffect(get),
|
||||
mapLock: lock => lock as Effect.Effect<LensImpl.Lock, EW | ESet, RW | RSet>,
|
||||
mapLock: identity<Effect.Effect<LensImpl.Lock, EW | ESet, RW | RSet>>,
|
||||
}))
|
||||
|
||||
/**
|
||||
@@ -643,7 +643,7 @@ export const tapErrorRead: {
|
||||
): Lens<A, ER | E2, EW, RR | R2, RW> => derive(self, {
|
||||
resolve: Effect.tapError(f),
|
||||
mapStream: Stream.tapError(f),
|
||||
mapLock: lock => lock,
|
||||
mapLock: identity,
|
||||
}))
|
||||
|
||||
/**
|
||||
@@ -672,7 +672,7 @@ export const tapErrorWrite: {
|
||||
),
|
||||
})),
|
||||
mapStream: identity,
|
||||
mapLock: lock => Effect.tapError(lock, f),
|
||||
mapLock: Effect.tapError(f),
|
||||
}))
|
||||
|
||||
/**
|
||||
@@ -704,7 +704,7 @@ export const tapError: {
|
||||
}),
|
||||
),
|
||||
mapStream: Stream.tapError(f),
|
||||
mapLock: lock => Effect.tapError(lock, f),
|
||||
mapLock: Effect.tapError(f),
|
||||
}))
|
||||
|
||||
|
||||
@@ -727,14 +727,11 @@ export const provideContext: {
|
||||
Effect.provide(parent, context),
|
||||
frame => ({
|
||||
value: frame.value,
|
||||
commit: next => Effect.provide(frame.commit(Effect.provide(next, context)), context),
|
||||
commit: next => Effect.provide(frame.commit(next), context),
|
||||
}),
|
||||
),
|
||||
mapStream: Stream.provideSomeContext(context),
|
||||
mapLock: lock => Effect.map(
|
||||
Effect.provide(lock, context),
|
||||
lock => self => Effect.provide(lock(Effect.provide(self, context)), context),
|
||||
),
|
||||
mapLock: Effect.provide(context),
|
||||
}))
|
||||
|
||||
/**
|
||||
@@ -762,14 +759,11 @@ export const provideService: {
|
||||
Effect.provideService(parent, tag, service),
|
||||
frame => ({
|
||||
value: frame.value,
|
||||
commit: next => Effect.provideService(frame.commit(Effect.provideService(next, tag, service)), tag, service),
|
||||
commit: next => Effect.provideService(frame.commit(next), tag, service),
|
||||
}),
|
||||
),
|
||||
mapStream: Stream.provideService(tag, service),
|
||||
mapLock: lock => Effect.map(
|
||||
Effect.provideService(lock, tag, service),
|
||||
lock => self => Effect.provideService(lock(Effect.provideService(self, tag, service)), tag, service),
|
||||
),
|
||||
mapLock: Effect.provideService(tag, service),
|
||||
}))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user