-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove ApplicativeError#catchNonFatalEval #2006
Comments
I'm usually "that guy" but in this case I don't see a problem. These methods are for lifting expressions whose evaluation is partial but deterministic, like So I think the case here is distinct from effect-capturing operations in cate-effect. I haven't had time to read the thread carefully so I won't comment on its use there. |
My problem with the signature of |
In my opinion creating val e = Eval.always { 1 / 0 } And then: try e.value catch { case _ => 0 } See, the world didn't implode? Which brings us back to my pet peeve that we still don't have a lazy |
Well, the world didn't implode because you "cheated" by using |
I added it (I think) so maybe no surprise: I’m negative on it but it is not a huge deal. You can always recover it by doing catchNonFatal(e.value). I hate to speak for @non and he can correct me, but knowing him I would be very surprised if he had a notion that Eval should never cause an effect to happen. I’m not really sure why we think this. I’m mostly negative on removing methods because we fear they encourage something someone doesn’t like. My position is to never throw except where there is a logic error (code believed to be unreachable but difficult or expensive to prove to be unreachable at the type level). Yet, other people don’t always follow this rule and I thought the method was a convenience, but like I say, a very minor one. |
@SystemFw using This is exactly the same situation with the cats-effect/78 issue — we are talking about lifting an My question there for @durban, for which I did not receive a satisfactory answer is this — what makes by-name parameters special and why can't And to get it out of my chest, I also think that So here's why I strongly disagree:
Of course, priorities and mentalities change, this might be a sign of maturity, or it might be a sign of mismanaging expectations, however this also constitutes breakage for users in a very bad sense. To get this far in the development process without a clear understanding of what But anyway, if you really declare that my understanding of
Thanks, |
Removing Eval is a non-starter in my view. A huge amount of cats code uses it and people who have adopted cats use it a lot. It is not marginal and baked into many of the typeclasses (for instance where we want lazy return values). |
I guess I mostly see the use of Re: @johnynek's point there's nothing stopping you from using |
@johnynek I think this because, unlike when Things that are able to suspend side-effects lawfully should be instances of cats-effect That being said, I feel way less strongly about this than I feel about typelevel/cats-effect#78 , because like @tpolecat I expect this to be used for stuff like P.S. @alexandru I haven't investigated that, so I can't say that I agree or disagree, but if we were to remove |
As I've already tried to explain over at typelevel/cats-effect#78, my position is that for that, |
My 2 cents: I don't think that I've seen an argument for removing this that's compelling enough to break compatibility. I don't see anyone arguing against the existence of a method similar to this one. It seems that the main argument against this method is that it should use a by-name parameter instead of an |
Then how about making it |
@durban preserving backwards binary compatibility is only one component. There still doesn't seem to be consensus that |
The majority of people who have weighed in on this vote to keep it the way that it is. Since this seems to have stagnated, I'm going to go ahead and close it out. |
ApplicativeError#catchNonFatalEval
usesEval
for effect capture. However, as far as I can tell,Eval
is not for effect capture. For related discussion, see typelevel/cats-effect#78 (possibly that discussion should be continued, instead of starting a parallel one here)./cc @djspiewak @alexandru
The text was updated successfully, but these errors were encountered: