-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Un-deprecate left Either projections #8012
Conversation
the previous discussion was at #6682 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this. I'd like that we consider introducing mapLeft
or what have you in 2.14, but this combinator has its place IMO.
With the amount of support I'm seeing for this, let's go for undeprecating. There is no rush. I think there is space for a nicer, more symmetric design, but let's explore that for 2.14.x |
@martijnhoekstra to be clear: I completely agree that projections should disappear. I do feel, however, that they shouldn't take away useful combinators with them. |
Deprecating right projections makes sense -
Either
is now right-biased, there's no need for them.Deprecating left projections also seems desirable, but I feel this might have been done a bit quickly, with some unpleasant consequences.
There are existing scenarios where one might want to call
.left.map(f)
or.left.flatMap(g)
-flatMap
is particularly useful to recover on errors, for example.The current state of scala means that we'll get a warning for this (or, for the
-Xfatal-warnings
crowd, an error) without a clear workaround. Suggestions on scala/contributors were:Both of these work fine, but I doubt anyone who has to replace
e.left.flatMap(f)
by one of them will feel it's a step forward.Truth be told, I'd rather see projections disappear and
Either
getleftMap
andleftFlatMap
methods, but it's a bit late for that, with the 2.13.0 API being frozen.