-
Notifications
You must be signed in to change notification settings - Fork 1.4k
More ZIO 2.0 Renames #5229
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
More ZIO 2.0 Renames #5229
Conversation
Suggestion for the Unfortunately it's not perfect with the other combinators. |
Yes. Could also do |
Just brainstorming on convention here:
|
I think that generally makes sense. One potential issue to think about there is |
Updated the table with the above suggestions if people want to see how everything looks. Seems pretty good other than the |
Re bracket - if we’re going from first principles here then bracket is a totally arbitrary word that’s not directly associated with resources. We could name it tryAcquireWith, for example. |
I like that idea. Maybe |
I like |
@adamgfraser I like that. |
@jdegoes Okay updated table with proposals for everything. Can you confirm you are good with the above and then I will make the changes? |
@adamgfraser This looks mostly perfect. However, thinking about what we want to do with: The reason I bring this up now is because it has implications for The |
@jdegoes Yeah, I agree about the |
+1 for eval |
Updated the list with the |
@adamgfraser |
Importing zio.prelude._ could bring in syntax for mapZPure etc; importing zio.interop.cats._ would bring in syntax for mapF. It does generalize better than mapEval. |
Even in our own code base we use |
Okay, updated the table with everything. I think we have a plan here. Only thing I think we have not addressed is |
One thing I think we should standardize on:
In words, "disambiguate only when necessary". |
@jdegoes I think that is a good principle. Is there a place where we are not doing that? |
In ZIO Test |
The |
How about a polymorphic |
Yes I think we could do something there. Let me work on it. May also make sense to do in a follow up PR. |
Agreed to do in followup. Let me know when this one is ready! |
@jdegoes This is ready. |
A colossal undertaking. Prepares us for the next phase of ZIO. Thank you for your work on this! 🙏 |
Resolves #5221. Resolves #5224.
Follow up work on ZIO 2.0 renames. To keep track of things here is a table listing the old and new names of operators. Operating marked as
Done
are already changed in theseries/2.x
brach. Operators marked asPending
are done in this PR. Other ones still need to be done and some have proposed changes for discussion.They fall into a couple of categories:
_
suffix variants - we have a lot of these where the return value isn't necessary. In other cases we have used theXYZ
versusXYZWith
convention but I don't think that really works with a lot of these. For example, neithercollectAll
norcollectAll_
take an additional argument beyond the collection so calling one of themcollectAllWith
seems a little weird. We could use a new convention for this.effect
constructors - with the existing changes we are moving away from theeffectXYZ
convention and I think need to do the same thing for other operators. Proposals are below.ZManaged
constructors - there are a bunch ofZManaged
constructors that fit a little uneasily with the renaming ofmake
andmakeExit
tobracket
andbracketExit
.Also, I am thinking we should change all
fromEffect
operators (e.g.ZManaged.fromEffect
) tofromZIO
.@jdegoes Can you let me know if you are on board with these changes and if you have any ideas on the question marks?