- Notifications
You must be signed in to change notification settings - Fork404
Create typestate.md#100
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Neat pattern for Rust that lets you encode valid/invalid states using the type system.
Formatting and minor clarifications.
dgunay commentedAug 19, 2020
It may be more idiomatic to call these "session types", but the article I referenced calls them typestates. |
dgunay commentedOct 2, 2020
Is this repo still maintained?@lambda-fairy |
lambda-fairy commentedOct 3, 2020
Not really. I think this repo needs someone with time & a vision to make it useful. |
simonsan commentedJan 1, 2021
@dgunay Hey, thank you for your contribution! Could you please rebase your branch on |
simonsan commentedJan 3, 2021
Status: I wrote the author an email, if he is fine with us taking some of his content and if he could relicense it and state it here somewhere in the repository. Until then we'll need to wait. |
Uh oh!
There was an error while loading.Please reload this page.
dgunay commentedJan 4, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi, thank you@simonsan. I am currently unfamiliar with how to do rebases (have never done them yet). I see you merged master into patch-1 - do I still need to do anything? |
pickfire commentedJan 4, 2021
|
simonsan left a comment
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.
Small review while waiting on feedback from the author of the blog post.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
simonsan commentedJan 4, 2021
No, I did it, so we let it check with the CI. I've made a small review, maybe you could address the suggestions questions in it for now? ;-) Thanks |
pickfire commentedJan 6, 2021
Note that there are other method to have type state, like each one of the state as their own struct, which is more useful when different states have different types. If different states have different types but combined with this technique, there could easily be footguns. |
simonsan commentedJan 6, 2021
Do you want to make some suggestions to change. I see a bit of a problem in that this is taken from another author as well. And I struggle a bit to reach the author. He answered me that we could link to his article and I should get back if linking is not an option for relicensing. So I wrote back that just linking the article is probably not the best way, if we want to keep it in the repository. But didn't receive an answer yet. So citation of some stuff might be fine in this regards, but just taking a lot from the article is not, I feel. So we might have to rewrite it nevertheless. Unless the author shows up here and states what he thinks (what he could, as I sent him a link to this PR). |
pickfire commentedJan 11, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I mean something like using |
simonsan commentedFeb 27, 2021
pickfire commentedFeb 27, 2021
I believe we can add something like#227 here and fix that along since it is similar enough? Here it encodes the state as variable but that encodes it as a type (which I think is more preferable). |
simonsan commentedMar 18, 2021
simonsan commentedMar 28, 2021
Closing in favour of#249 |
simonsan commentedApr 2, 2021
Reopening due to change of scope of#249 |
Neat pattern for Rust that lets you encode valid/invalid states using the type system.