Effect CommunityEC
Effect Community2y ago
2 replies
whatplan

The Use of LazyArg<Effect> in the `orElse` Function

why does orElse take a LazyArg<Effect> as the fallback, instead of just an
Effect
?

I am looking at it like flatMap vs zipRight, one takes the result of the previous effect, so requires a function. Where the other is independent so it does not.

Compare that to catchAll vs orElse. Catch all of course requires a function to get the error from the previous effect, but why is the orElse fallback effect lazy?
Was this page helpful?