Lifting Values to an Effect with Match and Corresponding Channel
I have 2 values (one representing an Error and the other an Entity) how to lift them to an effect with the corresponding channel with a Match?
//Expected Type: Effect.Effect<never,SomeSchemaTaggedError | AnotherSchemaTaggedError,SomeEntity>
const someUseCase = (data: A) => Effect.gen(function* ($) {
return pipe(
Match.value(SomeComputation(data)), //SomeSchemaTaggedError | SomeEntity
Match.tags({
SomeSchemaTaggedError: (e) => yield* $(e),
SomeEntity: (entity) => yield* $(Effect.succed(entity))
}),
Match.orElse(() => yield* $(new AnotherSchemaTaggedError(`Something went wrong`)));
});