@@ -6,12 +6,13 @@ authorImg: /images/aggelos.jpg
6
6
date : 2019-03-04
7
7
---
8
8
9
- Hello hello! This is the second release for 2019, let's call it the _ Contextual_
10
- release and you will understand why we are super excited in a bit! ✨🎊🎉
9
+ Hello hello! This is the second release for 2019. Spark, top level definitions
10
+ and redesigned implicits ✨🎊🎉 are the most important inclusions in this release
11
+ and you will understand why we are super excited, in a bit!
11
12
12
- Without further ado, today we release the version 0.13.0-RC1 of the Dotty compiler.
13
- This release serves as a technology preview that demonstrates new language features and the
14
- compiler supporting them.
13
+ Without further ado, today we release the version 0.13.0-RC1 of the Dotty
14
+ compiler. This release serves as a technology preview that demonstrates new
15
+ language features and the compiler supporting them.
15
16
16
17
Dotty is the project name for technologies that are being considered for
17
18
inclusion in Scala 3. Scala has pioneered the fusion of object-oriented and
@@ -55,6 +56,26 @@ Scala 2, and that was enough to make our Spark assignments run correctly! This
55
56
doesn't mean that our support is perfect however, so don't hesitate to [ open an
56
57
issue] ( http://github.com/lampepfl/dotty/issues ) if something is amiss.
57
58
59
+ ## Introducing top level definitions
60
+
61
+ _ Top level_ definitions are now supported. This means that package objects are
62
+ now redundant, and will be phased out. This means that all kinds of definitions
63
+ can be written at the top level.
64
+
65
+ ``` scala
66
+ package p
67
+
68
+ type Labelled [T ] = (String , T )
69
+
70
+ val a : Labelled [Int ] = (" count" , 1 )
71
+ def b = a._2
72
+ ```
73
+
74
+ You can read about [ dropping package
75
+ objects] ( https://dotty.epfl.ch/docs/reference/dropped-features/package-objects.html )
76
+ at the documentation linked or at the relevant PR
77
+ [ #5754 ] ( https://github.com/lampepfl/dotty/pull/5754 ) .
78
+
58
79
## All things impl... implied
59
80
60
81
Scala's implicits are its most distinguished feature. They are _ the_ fundamental
@@ -125,7 +146,7 @@ implied ListOrd[T] given (ord: Ord[T]) for Ord[List[T]] {
125
146
}
126
147
```
127
148
128
- A ` given ` clause can also designate an inferable parameter for functions:
149
+ A ` given ` clause can also designate an inferable parameter for functions:
129
150
130
151
``` scala
131
152
def max [T ](x : T , y : T ) given (ord : Ord [T ]): T =
@@ -180,7 +201,7 @@ object B {
180
201
}
181
202
```
182
203
183
- You can read more about [ implied
204
+ ** You can read more about** [ implied
184
205
imports] ( https://dotty.epfl.ch/docs/reference/contextual/import-implied.html )
185
206
from the docs or the relevant PR
186
207
[ #5868 ] ( https://github.com/lampepfl/dotty/pull/5868 ) .
@@ -196,7 +217,7 @@ Context queries--previously named implicit function types (IFTs)--are now also
196
217
expressed with ` given ` , providing types for first-class context queries. This is
197
218
merely an alignment of IFTs into the new scheme.
198
219
199
- You can read about the alternative to implicits through the * Contextual
220
+ ** You can read more about** the alternative to implicits through the * Contextual
200
221
Abstractions* section of our documentation or for a deep dive from the relevant
201
222
PR chain that originated from
202
223
[ #5458 ] ( https://github.com/lampepfl/dotty/pull/5458 ) . The syntax changes for new
@@ -248,9 +269,9 @@ it has a definition like this:
248
269
def derived [T ] given Generic [T ] = ...
249
270
```
250
271
251
- You can read more about [ Typeclass
272
+ ** You can read more about** [ Typeclass
252
273
Derivation] ( https://dotty.epfl.ch/docs/reference/contextual/derivation.html ) or
253
- for a deep dive at the relevant PRs:
274
+ have a deep dive at the relevant PRs:
254
275
[ #5540 ] ( https://github.com/lampepfl/dotty/pull/5540 ) and
255
276
[ #5839 ] ( https://github.com/lampepfl/dotty/pull/5839 ) .
256
277
@@ -263,7 +284,7 @@ provide a derived implicit instance:
263
284
implied for Eql [Int , String ] = Eql .derived
264
285
```
265
286
266
- You can read how we based multiversal equality on typeclass derivation through
287
+ ** You can read more about ** how we based multiversal equality on typeclass derivation through
267
288
the relevant PR [ #5843 ] ( https://github.com/lampepfl/dotty/pull/5843 ) .
268
289
269
290
_ Implicit conversions_ are now defined by implied instances of the
@@ -275,32 +296,11 @@ implied for Conversion[String, Token] {
275
296
}
276
297
```
277
298
278
- _ Top level_ definitions are now supported. This means that package objects are
279
- now redundant, and will be phased out. This means that all kinds of definitions
280
- can be written at the top level.
281
-
282
- ``` scala
283
- package p
284
-
285
- type Labelled [T ] = (String , T )
286
- val a : Labelled [Int ] = (" count" , 1 )
287
- def b = a._2
288
-
289
- case class C ()
290
-
291
- implicit object Cops {
292
- def (x : C ) pair (y : C ) = (x, y)
293
- }
294
- ```
295
-
296
- You can read about [ dropping package
297
- objects] ( https://dotty.epfl.ch/docs/reference/dropped-features/package-objects.html )
298
- at the documentation linked or at the relevant PR
299
- [ #5754 ] ( https://github.com/lampepfl/dotty/pull/5754 ) .
300
-
301
- ** This blogpost offers only a brief summary of the new features, for more details
302
- please read our documentation page under the new section named [ * Contextual
303
- Abstractions* ] ( https://dotty.epfl.ch/docs/ ) .**
299
+ ** Note:** that these release notes contain only a brief summary of the new
300
+ features, for more details please read our documentation page under the new
301
+ section named [ * Contextual Abstractions* ] ( https://dotty.epfl.ch/docs/ ) . Equally
302
+ important with the documentation of each feature, please consult the
303
+ [ Relationship with Scala 2 Implicits] ( https://dotty.epfl.ch/docs/reference/contextual/relationship-implicits.html ) section as well.
304
304
305
305
## Implicit resolution rule changes
306
306
0 commit comments