Effect CommunityEC
Effect Communityโ€ข2y agoโ€ข
25 replies
Patrick Roza

Incorrect Type Usage in Effect.andThen

the type of Effect.andThen is wrong and unsafe, when the right function takes a different type as argument:
const a10 = Effect.andThen(Effect.succeed(0), (a: string) => Effect.succeed(a))
// Effect.Effect<(a: string) => Effect.Effect<string, never, never>, never, never>
// should instead give compiler error `number is not assignable to string`

assert.strictEqual(yield* $(a10), 0 as any)
// passes runtime
Was this page helpful?