Effect CommunityEC
Effect Communityโ€ข3y agoโ€ข
42 replies
DimitroCardellini

Questioning Dependency in TypeScript Code

Guys, I'm a little bit wondering ...
Why the dependency is CustomRandom instead of to be something like { [CustomRandom]: CustomRandom }

It is obvious that foo depends on both: Tag and interface
export const foo: Effect.Effect<
  CustomRandom,
  never,
  number
> = pipe(CustomRandom, Effect.flatMap((r) => r.next()))


I guess the type information must be enough to provide the dependency, but Effect.Effect<CustomRandom, never, number> doesn't contain information about the tag.

So, do we need to rely only on the naming convention?
Was this page helpful?