How to properly write a function accepting an effect and using catchTag?
I want to write a function that handles a specific tagged error converting it to a DTO.
Currently I have the following code:
And in this code the argument
Looking at the typings of
The main question is: is it possible to write a function that accepts an effect, requires this effect to contain a specific error and handles this error while producing the correct Effect type as a result?
Currently I have the following code:
And in this code the argument
userNotFoundDtoFactory for catchTag gives me the following error:Looking at the typings of
catchTag I think it would be better to use a constrained generic type parameter instead of Extract in this case but that's just my 2 cents.The main question is: is it possible to write a function that accepts an effect, requires this effect to contain a specific error and handles this error while producing the correct Effect type as a result?
