Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
dgunay wants to merge12 commits intorust-unofficial:main
base:main
Choose a base branch
Loading
fromdgunay:patch-1
Draft

Create typestate.md#100

dgunay wants to merge12 commits intorust-unofficial:mainfromdgunay:patch-1

Conversation

@dgunay
Copy link

Neat pattern for Rust that lets you encode valid/invalid states using the type system.

hendrikmaus, alexeden, simonsan, jhwgh1968, rwestphal, and dzmitry-lahoda reacted with thumbs up emoji
Neat pattern for Rust that lets you encode valid/invalid states using the type system.
Formatting and minor clarifications.
@dgunay
Copy link
Author

It may be more idiomatic to call these "session types", but the article I referenced calls them typestates.

@dgunay
Copy link
Author

Is this repo still maintained?@lambda-fairy

@lambda-fairy
Copy link
Collaborator

Not really. I think this repo needs someone with time & a vision to make it useful.

@simonsansimonsan added C-additionCategory: Adding new content, something that didn't exist in the repository before S-reviewStatus: A PR that is currently under review or where a review is the next step labelsDec 31, 2020
@simonsan
Copy link
Collaborator

@dgunay Hey, thank you for your contribution! Could you please rebase your branch onmaster please and linktypestate.md inSUMMARY.md? We'll review this PR the upcoming days.

@simonsan
Copy link
Collaborator

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.

dgunay reacted with thumbs up emoji

@simonsansimonsan added C-waiting forCategory: Waiting for feedback of the initial author or some external dependency/issue and removed S-reviewStatus: A PR that is currently under review or where a review is the next step labelsJan 3, 2021
@dgunay
Copy link
Author

dgunay commentedJan 4, 2021
edited
Loading

@dgunay Hey, thank you for your contribution! Could you please rebase your branch onmaster please and linktypestate.md inSUMMARY.md? We'll review this PR the upcoming days.

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
Copy link
Contributor

git fetchgit rebase origin/master... edit if there are confilctsgit add ...git rebase --continue  # do this as many times as neededgit push -f

Copy link
Collaborator

@simonsansimonsan left a 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.

@simonsan
Copy link
Collaborator

@dgunay Hey, thank you for your contribution! Could you please rebase your branch onmaster please and linktypestate.md inSUMMARY.md? We'll review this PR the upcoming days.

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?

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

@simonsansimonsan marked this pull request as draftJanuary 4, 2021 07:43
@simonsansimonsan mentioned this pull requestJan 4, 2021
@pickfire
Copy link
Contributor

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 reacted with thumbs up emoji

@simonsan
Copy link
Collaborator

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.

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
Copy link
Contributor

pickfire commentedJan 11, 2021
edited
Loading

I mean something like usingstructs to have types as state. Like fromLetter { data: ... } toClosedLetter toOpenedLetter or something like that, I once read another article like this.

@simonsansimonsan added C-staleCategory: An issue/a PR that hasn't been worked on in a longer time (usually 90 days) A-patternArea: Content about Patterns and removed C-waiting forCategory: Waiting for feedback of the initial author or some external dependency/issue labelsJan 21, 2021
@pickfirepickfire mentioned this pull requestFeb 22, 2021
@simonsan
Copy link
Collaborator

@pickfire
Copy link
Contributor

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 reacted with thumbs up emoji

@simonsan
Copy link
Collaborator

@simonsan
Copy link
Collaborator

Closing in favour of#249

@simonsan
Copy link
Collaborator

Reopening due to change of scope of#249

@simonsansimonsan reopened thisApr 2, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@simonsansimonsansimonsan requested changes

+1 more reviewer

@rcohrcohrcoh left review comments

Reviewers whose approvals may not affect merge requirements

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

A-patternArea: Content about PatternsC-additionCategory: Adding new content, something that didn't exist in the repository beforeC-staleCategory: An issue/a PR that hasn't been worked on in a longer time (usually 90 days)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@dgunay@lambda-fairy@simonsan@pickfire@rcoh

[8]ページ先頭

©2009-2025 Movatter.jp