Skip to content
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

Paper: Recovering Purity with Comonads and Capabilities #12

Open
glaebhoerl opened this issue Jul 15, 2019 · 0 comments
Open

Paper: Recovering Purity with Comonads and Capabilities #12

glaebhoerl opened this issue Jul 15, 2019 · 0 comments

Comments

@glaebhoerl
Copy link

I thought you might find this interesting:

http://semantic-domain.blogspot.com/2019/07/all-comonads-all-time.html
https://www.cl.cam.ac.uk/~nk480/popl20-cap-submission.pdf

There are some similarities with Rust's (planned) const-generics system (swapping const for Pure as appropriate):

  • const expressions can only refer to const variables

  • const values can lose their constness and be used as normal runtime/impure values (the comonadic "extract", I don't remember which Greek letter they used for it in the paper)

  • A const fn can be applied to a const expression to yield a const result; a non-const fn can't

And some differences:

  • const T in Rust isn't a type, but part of the "generics" system

  • Relatedly, there's no comonadic "duplicate" (const T -> const (const T))) -- which might make more sense if const were a type

  • And of course, one of them is for tracking "known at compile-time" and the other is for tracking purity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant