-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add scala.Try
as alias of scala.util.Try
to scala
package.
#7549
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
Conversation
He-Pin
commented
Dec 17, 2018
- Add scala.Try type and value aliases (just like for Either), but not for Success/Failure.
- Move scala.util.Success and scala.util.Failure into the scala.util.Try companion object
- Add deprecated type/value aliases scala.util.Success = scala.util.Try.Success, same for Failure. The deprecation message should recommend using Try.Success/Try.Failure (instead of importing them).
Could you squash the two commits? |
@lrytz Squashed. |
After minimal reflection, moving success/failure means I can't wildcard import because of apply pollution. That seems inconvenient, and a non-starter. Green field, I'd call them |
hmm, not sure if that bothers me, since style-wise |
I see there is no forum to obtain more opinions? no ticket at all? Edit: I think aliasing I don't strongly disagree, except flu symptoms make me ornery: I would always The reason to pattern match is to avoid allocation?
The other day, and maybe it was the cold medicine talking, I was thinking about There's also a colorful quote from William James online. They suggest that "a person is a success or failure" is an invention of the 19th C., which also deployed "resilience" (which is just a result) in the modern sense as a way to cope with being a success or failure.
|
I am of a mild opinion to keep the status quo. The proposed new situation is not clearly better IMO, so why bother everyone with having to change their code? |
the big win here would be to ultimately get rid of |
Meanwhile, we just added |
|
|
@Ichoran |
@sjrd - Yes, but wherever they go, if we get rid of |
Yes sure. In the meantime, I believe this is not something we should do piecewise. If the justification for moving one thing is that the eventual goal is to get rid of |
Basically anything that sounds like it's related to bondage should go in a different package. Also, |
1. Move `Success` and `Failure` inside the `Try`'s companion object, 2.Add alias for to `scala.util`'s package object and deprecated them in favor of `Scala.Try`, `Try.Success` and `Try.Failure`.
Honestly, I'm not sure that we should get rid of The question of whether or not |
I'm convinced (by Seb and Nth) that this should wait for 2.14 and be part of a package of related changes rather happening independently. @hepin1989 thanks for your work on this, hopefully we can pick this up again later in some form |
@SethTisue I am totally fine with it:) |