-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Go over std and core and add pure declarations #1315
Comments
fix to #1315 + small additions to std::either and result
I've opened #1422 because i could not find a related issue. |
I did another pass. I guess we're waiting on #1422 to close this. |
Let's not do this immediately, given that some reflection on purity checking / typestate in general is still pending. (See #2178) |
Since #1422 is now implemented, maybe it's time for another round off pure-adding? |
Okay -- I'm still hesitant, as there is a certain amount of unresolved fear and uncertainty about typestate, but I guess it won't take too much time to do a quick go-round. |
I mostly think of str::count_* et al. Not sure how typestate interfers there. |
It doesn't interfere -- it's just that |
Couldn't the current |
It's not a question of replacing |
I understood pcwalton's comment in #2178 as Typestate won't be eliminated ever. I think pure functions are very important for documenting code and making code secure/reliable. |
I understood his comment as saying that typestate won't be eliminated when it comes to checking definite-assignment, but that the question of whether typestate predicates with arbitrary user-defined functions will be eliminated or not is still open. Of course, I may have misunderstood... No, I don't know of anyplace where the upsides/downsides of removing them are documented. As far as I know (but I wasn't here from the beginning, so I may have missed some stuff), |
I don't feel like this is so relevant anymore now that typestate is gone. It can be done lazily. |
Noticed some fns in std and core could be annotated as pure. This should be done so that they may be used from predicates.
This probably needs to happen twice, once now and once later, after mutation of local variables is possible in pure functions. It would also help if there could be pure blocks.
The text was updated successfully, but these errors were encountered: