import { Context, Effect } from 'effect'
interface A {
a: 'a'
}
export const A = Context.Tag<A>()
interface B {
a: 'a'
b: 'b'
}
export const B = Context.Tag<B>()
const program = Effect.map(B, b => b.b)
const runnable = Effect.provideService(
program,
A,
A.of({ a: 'a' }),
)
Effect.runPromise(runnable)
import { Context, Effect } from 'effect'
interface A {
a: 'a'
}
export const A = Context.Tag<A>()
interface B {
a: 'a'
b: 'b'
}
export const B = Context.Tag<B>()
const program = Effect.map(B, b => b.b)
const runnable = Effect.provideService(
program,
A,
A.of({ a: 'a' }),
)
Effect.runPromise(runnable)