Skip to content

Realizability: fixes and cleanups of docs #5730

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

Merged
merged 5 commits into from
Jan 22, 2019

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented Jan 16, 2019

This is my attempt at documenting realizability and stability. If this makes enough sense, I think one turn this into documentation.

There's also a behavior change, but I moved that in ##5726. I'll probably rebase this once that's merged.

@@ -50,7 +50,15 @@ object CheckRealizable {
private val LateInitialized = Lazy | Erased
}

/** Compute realizability status */
/** Compute realizability status.
Copy link
Contributor Author

@Blaisorblade Blaisorblade Jan 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abeln You asked questions (back in #5558) about stability and realizability, do you have a chance to take a look at this comment?

@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Jan 17, 2019

Relevant sections of the Scala spec:

https://www.scala-lang.org/files/archive/spec/2.13/03-types.html#paths
https://www.scala-lang.org/files/archive/spec/2.13/03-types.html#stable-types
https://www.scala-lang.org/files/archive/spec/2.13/03-types.html#volatile-types

But Dotty does not strictly follow those definitions. A future PR should describe their relation.

final def isStable(implicit ctx: Context): Boolean = {
/** Is this a denotation of a stable term (or an arbitrary type)?
* Terms are stable if they are idempotent (as in TreeInfo.Idempotent): that is, they always return the same value,
* if any.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relation between stable and idempotent was a bit surprising to me and @odersky, but I think I just convinced him (in a quick chat) this makes sense. Counterexamples welcome!

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Blaisorblade Paolo G. Giarrusso

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Blaisorblade Paolo G. Giarrusso

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Blaisorblade Paolo G. Giarrusso

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Blaisorblade Paolo G. Giarrusso

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Blaisorblade Paolo G. Giarrusso
@Blaisorblade Blaisorblade force-pushed the realizability-cleanup-doc branch from c05e58b to b0c8e68 Compare January 22, 2019 15:21
@Blaisorblade Blaisorblade merged commit 1ace71d into scala:master Jan 22, 2019
@Blaisorblade Blaisorblade deleted the realizability-cleanup-doc branch January 22, 2019 20:35
@Blaisorblade
Copy link
Contributor Author

@odersky This is the documentation/refactoring PR I mentioned... Merged since it got approved (and it's only comments and refactorings), tho we can revisit this if needed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants