-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Use new
keywords
#231
Use new
keywords
#231
Conversation
329cbd2
to
323b4c8
Compare
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.
Nice 👍 . I like the idea of this.
All looks good except for the Unpack
changes. Perhaps you could leave those for a separate PR and address the comment?
323b4c8
to
fa6ec40
Compare
Done in this PR. |
Since this pull request has not had any activity within the last 5 days, I have marked it as stale. |
cb12ad6
to
6f82a91
Compare
6f82a91
to
cad1141
Compare
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.
💯
Motivation
There are multiple goals behind this PR.
First, is to get rid of
AbstractOperation
. Its sole purpose is to provide the static methodof
, which is just syntactic sugar.Syntactic sugar is cool, but it's not needed in Collection. We could gain some performance by completely removing them.
Then, by removing it and instantiating operation using
new
could also be a good thing for static analysis and types inference.Note
When dealing with methods having the
@pure
annotation, using the keywordnew
to create operation will trigger anImpureFunctionCall
in PSalm.However, when having nested functions in those methods, using the
new
keyword, will not trigger anImpureFunctionCall
in PSalm.This PR:
new
keyword instead of using the static methodof()
.