TypeScript's type system can sometimes be tricky when dealing with higher-order functions like `E...
Is
My first try was this:
Cause I wanted to reuse the effect that it returns, to reduce GCs, but it "swallows" (hides?) the
That is what I am trying to write, but the error is:
If I understand correctly,
This means I cannot use the above code. I have to inline
Effect.retry() not typed completely?My first try was this:
Cause I wanted to reuse the effect that it returns, to reduce GCs, but it "swallows" (hides?) the
E (error) generic type... So I tried to add the types myself:That is what I am trying to write, but the error is:
If I understand correctly,
retry is generically typed as <A, R>, there is no error there.This means I cannot use the above code. I have to inline
Effect.retry(myPolicy) everywhere I need to retry effects using the same policy, e.g. return pipe(myEffect, Effect.retry(myPolicy)).