Effect CommunityEC
Effect Community3y ago
5 replies
bigpopakap

Combining Layer A->B and Layer A,B->C to Layer A->C

I think this might be easy, but I'm just not finding the solution:

declare const A_B_Layer: Layer<A, A_B_Error, B>;
declare const AB_C_Layer: Layer<A | B, AB_C_Error, C>;

// I want this
const A_C_Layer: Layer<A, A_B_Error | AB_C_Error, C> =>
   // ?? Is there a set of existing combinators that can do this?
   // Some combination of pipe(), passthrough() maybe, and merge() ???
Was this page helpful?