Extracting an Interface for Reusable Service Implementation in Effect

In creating a service, for example, from the docs
import { Effect, Context } from "effect"
 
class Random extends Context.Tag("MyRandomService")<
  Random,
  { readonly next: Effect.Effect<number> }
>() {}

can I extract the interface out this Random class, so that I can have a reusable implementation, instead of having to declare the implementation in the Effect.provideService block?

E.g.
`
const MyRandom: Random.Type = {
  readonly next: Effect...
}
Was this page helpful?