You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traits can now have value parameters, just like classes do. This replaces the more complex [early initializer](http://dotty.epfl.ch/docs/reference/dropped/early-initializers.html) syntax.
Multiversal equality is an optin way to check that comparisons using `==` and
71
-
`!=` only apply to compatible types. It thus closes the biggest remaining hurdle
68
+
Multiversal equality is an opt-in way to check that comparisons using `==` and
69
+
`!=` only apply to compatible types. It thus removes the biggest remaining hurdle
72
70
to type-based refactoring. Normally, one would wish that one could change the type
73
71
of some value or operation in a large code base, fix all type errors, and obtain
74
72
at the end a working program. But universal equality `==` works for all types.
@@ -90,8 +88,8 @@ Listed in this section are new language constructs that help precise, typechecke
90
88
are not tracked. We want to put in the hooks to allow to change this over time. The idea
91
89
is to treat effects as capabilities represented as implicit parameters. Some effect types
92
90
will be defined by the language, others can be added by libraries. Initially, the language
93
-
will likely only cover exceptions as effect capabilities, but it can be extended later
94
-
to mutations and possibly other effects. To ensure backwards compatibility, all effect
91
+
will likely only cover exceptions as effect capabilities, but this can be extended later
92
+
to mutations and other effects. To ensure backwards compatibility, all effect
95
93
capabilities are initially available in `Predef`. Un-importing effect capabilities from
96
94
`Predef` will enable stricter effect checking, and provide stronger guarantees of purity.
97
95
@@ -103,9 +101,8 @@ The primary goal of the language constructs in this section is to make common pr
103
101
-[Enums](http://dotty.epfl.ch/docs/reference/enums/enums.html)`enum Color { case Red, Green, Blue }`
104
102
105
103
Enums give a simple way to express a type with a finite set of named values. They
106
-
are found in most languages. The previous encodings of enums in Scala were all had
107
-
problems that prevented universal adoption. The new native `enum` construct in Scala
108
-
is quite flexible; among others it gives a more concise way to write [algebraic data types](http://dotty.epfl.ch/docs/reference/enums/adts.html),
104
+
are found in most languages. The previous encodings of enums as library-defined types
105
+
were not fully satisfactory and consequently were used widely. The new native `enum` construct in Scala is quite flexible; among others it gives a more concise way to write [algebraic data types](http://dotty.epfl.ch/docs/reference/enums/adts.html),
109
106
which would otherwise be expressed by a sealed base trait with case classes as alternatives.
110
107
Scala enums will interoperate with the host platform. They support multiversal equality
111
108
out of the box, i.e. an enum can only be compared to values of the same enum type.
@@ -133,6 +130,5 @@ The primary goal of the language constructs in this section is to enable high-le
133
130
Parameters of methods and functions can be declared `erased`. This means that
134
131
the corresponding arguments are only used for type checking purposes and no code
135
132
will be generated for them. Typical candidates for erased parameters are type
136
-
constraints impressed through implicits such as `=:=` and `<:<`. Erased parameters
137
-
help both runtime (since no argument has to be constructed) and compile time
138
-
(since potentially large arguments can be eliminated early).
133
+
constraints such as `=:=` and `<:<` that are expressed through implicits.
134
+
Erased parameters improve both run times (since no argument has to be constructed) and compile times (since potentially large arguments can be eliminated early).
0 commit comments