-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Blog Post: Announcing Dotty 0.6.0 and 0.7.0-RC1 #4053
Conversation
dfcee12
to
7bb287c
Compare
You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html) | ||
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html). | ||
|
||
### Unused Parameters [#3342](https://github.com/lampepfl/dotty/pull/3342) |
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.
@nicolasstucki Do you want to do this?
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.
@nicolasstucki Probably we should say a couple words about going from phantom types to unused parameters (#2040 (comment)), probably in the release notes rather than in the docs for the latest release (to avoid confusing new users). Starting point:
TL;DR: With unused parameters you can mark values of arbitrary types to be erased at runtime, instead of having to implement separate phantom types.
This needs a section on improved GADT support and a section on improved completions in the IDE. I'm not available to write this myself thid week unfortunately. |
``` | ||
|
||
You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html) | ||
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html). |
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.
Are these links up-date?
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.
These links will become valid once the page is generated. An alternative would be to write absolute links (e.g. http://dotty.epfl.ch/docs/reference/enums/enums.html) so that they are also valid links in GitHub
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.
Sorry: I was asking if the docs in the target pages have been updated (and I thought not).
You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html) | ||
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html). | ||
|
||
### Unused Parameters [#3342](https://github.com/lampepfl/dotty/pull/3342) |
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.
@nicolasstucki Probably we should say a couple words about going from phantom types to unused parameters (#2040 (comment)), probably in the release notes rather than in the docs for the latest release (to avoid confusing new users). Starting point:
TL;DR: With unused parameters you can mark values of arbitrary types to be erased at runtime, instead of having to implement separate phantom types.
@allanrenucci PRs on GADTs include #3918, #4034 (finding more...) |
Soundness was improved by #3918, although there are still holes related to variance until #4013 is merged. @liufengyun also did work related to gadt exhaustiveness checking |
Technically `case some =>` works (and binds `some` to `this`) but I don't think this was intended.
bf7b0e5
to
dc81fd3
Compare
|
||
## What’s new in the 0.7.0-RC1 technology preview? | ||
|
||
### Enums Simplicification [#4003](https://github.com/lampepfl/dotty/pull/4003) |
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.
Typo: Simplification
[#3645](https://github.com/lampepfl/dotty/issues/3645), | ||
and improved handling of matches using repeated type variables | ||
[#4030](https://github.com/lampepfl/dotty/issues/4030). | ||
More test cases appear in [#3999](https://github.com/lampepfl/dotty/pull/3999). |
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.
I would drop this line.
} | ||
``` | ||
|
||
Earlier Dotty releases had issues typechecking such interpreters. |
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.
I would say versions instead of releases.
} | ||
``` | ||
|
||
Earlier Dotty releases had issues typechecking such interpreters. |
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.
I think it's important to note that Scala 2 also has unresolved issues typechecking GADTs, like with the neg example in https://github.com/lampepfl/dotty/pull/3990/files#diff-e7b3b26b928fa129081481ffc513af95
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.
Added a bit; I think Dotty's already much better than Scalac, but I haven't tried enough personally to make strong claims this in release notes. Feel free to add stronger claims you feel comfortable with.
@@ -162,7 +162,7 @@ object Interpreter { | |||
} | |||
``` | |||
|
|||
Earlier Dotty releases had issues typechecking such interpreters. | |||
Earlier Scalac and Dotty releases had issues typechecking such interpreters. |
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.
This makes it sound like recent releases of scalac have fixed this, but they haven't. Also I would use the term "Scala 2" and not "Scalac".
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.
The most convincing thing to do would be to give an example that doesn't typecheck in Dotty but does in Scala 2.
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.
This program works in Scalac, while trickier ones trigger bugs in Scalac or Dotty. I propose to write "Scala 2 and Dotty have issues [...]", since we fixed some.
case class MapS[S, T](xs: Exp[List[S]], f: Exp[S => T]) extends Exp[List[T]]
case class Map[S, T, That](xs: Exp[List[S]], f: Exp[S => T])(implicit val cbf: CanBuildFrom[List[S], T, That]) extends Exp[That]
//...
case m @ Map(xs, f) =>
//val f1: Exp[Any => Any] = f //accepted by Scalac, rejected by Dotty!
eval(xs).map(eval(f))(m.cbf)
case MapS(xs, f) =>
eval(xs) map eval(f) //rejected by Dotty, not 100% sure why. Passing the
//alternatively:
case m: MapS[s, t] =>
//(eval(m.xs) map eval(m.f))(List.canBuildFrom) //fails in Dotty
(eval(m.xs) map eval(m.f))(List.canBuildFrom[t]) //succeeds in Dotty
Failures in #4069 might be relevant.
EDIT: full example in #4076.
Earlier Scalac and Dotty releases had issues typechecking such interpreters. | ||
We fixed multiple bugs about GADT type checking and exhaustiveness checking, including | ||
Scala 2 and Dotty have issues typechecking such interpreters. | ||
In this release we fixed multiple bugs about GADT type checking and exhaustiveness checking, including |
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.
@smarter @allanrenucci WDYT? A bit less bold, which seems appropriate.
I've written an alternative version of the GADT section, I'll let others decide which one is better. |
@lampepfl/dotty-core Feel free to edit