const runProgram = async <
E extends {
_tag: string;
},
A
>(
self: Effect.Effect<never, E, A>
) => {
const res = await Effect.runPromise(Effect.either(self));
return Either.match(res, {
onRight: (r) => ({ success: true, value: r } as const),
onLeft: (e) => {
return { success: false, errorTag: e._tag } as const;
},
});
};
const runProgram = async <
E extends {
_tag: string;
},
A
>(
self: Effect.Effect<never, E, A>
) => {
const res = await Effect.runPromise(Effect.either(self));
return Either.match(res, {
onRight: (r) => ({ success: true, value: r } as const),
onLeft: (e) => {
return { success: false, errorTag: e._tag } as const;
},
});
};