-
-
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
Rename Eval.raise to Eval.raiseError #1634
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1634 +/- ##
=======================================
Coverage 93.37% 93.37%
=======================================
Files 240 240
Lines 3937 3937
Branches 138 138
=======================================
Hits 3676 3676
Misses 261 261
Continue to review full report at Codecov.
|
I removed the labels since these methods were added since the last version. There has been no released version that can be broken. I'm +1 on naming consistency in general. |
I personally prefer the name |
I also prefer |
OK, bike-shedding time :-)) A more generic debate would be whether we want to use For example here's Roland Kuhn of Akka arguing that we need to differentiate between user input errors, which are to be expected (and recoverable) and failures, which are terminating conditions: https://twitter.com/etorreborre/status/832899323008524290 But So the two paths that I'm seeing:
I would personally prefer to go with @djspiewak in regard to your comment, I do think that renaming Personally I would have preferred just |
I give this a 👍 based on a consistency argument. I'm neutral when it comes to |
Any opinions on |
I'm +1 on this to get in agreement with MonadError. I hope we won't change MonadError since I view that as a minor change which will cost a lost of migration pain. |
If no objection, I am going to merge with 3 sign offs |
This PR renames
Eval.raise
toEval.raiseError
.This is a pet peeve of mine, but the naming of failing data constructors isn't consistent across the board, so we've got:
Eval.raise
ApplicativeError.raiseError
cats.effect.IO.fail
Future.failure
scalaz.concurrent.Task.fail
scalaz.MonadError.raiseError
fs2.Task.fail
monix.eval.Task.raiseError
If we have
raiseError
inApplicativeError
, then I see no reason to not use it across the board.And if that's not OK for some reason related to
Throwable
, then the next option should befail
, notraise
.Either way, we should standardise on something.
EDIT: trying to do the same in
cats-effect
- typelevel/cats-effect#33