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
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/relationship-implicits.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,10 +86,10 @@ Explicit arguments to parameters of given clauses _must_ be written using `given
86
86
mirroring the definition syntax. E.g, `max(2, 3)(given IntOrd`).
87
87
Scala 2 uses normal applications `max(2, 3)(IntOrd)` instead. The Scala 2 syntax has some inherent ambiguities and restrictions which are overcome by the new syntax. For instance, multiple implicit parameter lists are not available in the old syntax, even though they can be simulated using auxiliary objects in the "Aux" pattern.
88
88
89
-
The `the` method corresponds to `implicitly` in Scala 2.
89
+
The `summon` method corresponds to `implicitly` in Scala 2.
90
90
It is precisely the same as the `the` method in Shapeless.
91
-
The difference between `the` (in both versions) and `implicitly` is
92
-
that `the` can return a more precise type than the type that was
91
+
The difference between `summon` (or `the`) and `implicitly` is
92
+
that `summon` can return a more precise type than the type that was
Copy file name to clipboardExpand all lines: docs/docs/reference/new-types/union-types-spec.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,14 +38,14 @@ case _: (A | B) => ...
38
38
A& (B|C) =:=A&B|A&C
39
39
```
40
40
41
-
From these rules it follows that the _least upper bound_ (lub) of a set of type
41
+
From these rules it follows that the _least upper bound_ (lub) of a set of types
42
42
is the union of these types. This replaces the
43
43
[definition of least upper bound in the Scala 2 specification](https://www.scala-lang.org/files/archive/spec/2.12/03-types.html#least-upper-bounds-and-greatest-lower-bounds).
44
44
45
45
## Motivation
46
46
47
47
The primary reason for introducing union types in Scala is that they allow us to
48
-
guarantee that for every set of type, we can always form a finite lub. This is
48
+
guarantee that for every set of types, we can always form a finite lub. This is
49
49
both useful in practice (infinite lubs in Scala 2 were approximated in an ad-hoc
50
50
way, resulting in imprecise and sometimes incredibly long types) and in theory
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/export.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ Export clauses can appear in classes or they can appear at the top-level. An exp
93
93
94
94
It is a standard recommendation to prefer composition over inheritance. This is really an application of the principle of least power: Composition treats components as blackboxes whereas inheritance can affect the internal workings of components through overriding. Sometimes the close coupling implied by inheritance is the best solution for a problem, but where this is not necessary the looser coupling of composition is better.
95
95
96
-
So far, object oriented languages including Scala made it much easer to use inheritance than composition. Inheritance only requires an `extends` clause whereas composition required a verbose elaboration of a sequence of forwarders. So in that sense, OO languages are pushing
96
+
So far, object oriented languages including Scala made it much easier to use inheritance than composition. Inheritance only requires an `extends` clause whereas composition required a verbose elaboration of a sequence of forwarders. So in that sense, OO languages are pushing
97
97
programmers to a solution that is often too powerful. Export clauses redress the balance. They make composition relationships as concise and easy to express as inheritance relationships. Export clauses also offer more flexibility than extends clauses since members can be renamed or omitted.
98
98
99
99
Export clauses also fill a gap opened by the shift from package objects to toplevel definitions. One occasionally useful idiom that gets lost in this shift is a package object inheriting from some class. The idiom is often used in a facade like pattern, to make members
0 commit comments