Skip to content

Commit d1a9825

Browse files
committed
Polishings
1 parent 1521576 commit d1a9825

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

docs/docs/reference/contextual-instance/conversions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ instance of Conversion[String, Token] {
1414
def apply(str: String): Token = new KeyWord(str)
1515
}
1616
```
17-
Using an instance alias, this can be expressed more concisely as:
17+
Using an alias instance, this can be expressed more concisely as:
1818
```scala
1919
instance of Conversion[String, Token] = new KeyWord(_)
2020
```

docs/docs/reference/contextual-instance/import-implied.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object B {
1818
In the code above, the `import A._` clause of object `B` will import all members
1919
of `A` _except_ the instance `tc`. Conversely, the second import `import instance A._` will import _only_ that instance.
2020

21-
Generally, a normal import clause brings all members except implicit instance values into scope whereas an `import instance` clause brings only implicit instance values into scope.
21+
Generally, a normal import clause brings all members except implicit instances into scope whereas an `import instance` clause brings only implicit instances into scope.
2222

2323
There are two main benefits arising from these rules:
2424

@@ -32,22 +32,22 @@ There are two main benefits arising from these rules:
3232

3333
### Relationship with Old-Style Implicits
3434

35-
The rules of evidence imports above have the consequence that a library
35+
The rules of instance imports above have the consequence that a library
3636
would have to migrate in lockstep with all its users from old style implicit definitions and
37-
normal imports to evidence definitions and evidence imports.
37+
normal imports to instance definitions and instance imports.
3838

3939
The following modifications avoid this hurdle to migration.
4040

41-
1. An evidence import also brings old style implicits into scope. So, in Scala 3.0
41+
1. An instance import also brings old style implicits into scope. So, in Scala 3.0
4242
an old-style implicit definition can be brought into scope either by a normal or
43-
by an evidence import.
43+
by an instance import.
4444

4545
2. In Scala 3.1, an old-style implicits accessed implicitly through a normal import
4646
will give a deprecation warning.
4747

4848
3. In some version after 3.1, an old-style implicits accessed implicitly through a normal import
4949
will give a compiler error.
5050

51-
These rules mean that library users can use `import evidence` to access old-style implicits in Scala 3.0,
51+
These rules mean that library users can use `import instance` to access old-style implicits in Scala 3.0,
5252
and will be gently nudged and then forced to do so in later versions. Libraries can then switch to
53-
evidence definitions once their user base has migrated.
53+
instance definitions once their user base has migrated.

docs/docs/reference/contextual-instance/instance-defs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ instance [T] given (ord: Ord[T]) of Ord[List[T]] { ... }
4646
```
4747
If a name is not given, the compiler will synthesize one from the type(s) in the `for` clause.
4848

49-
## instance Aliases
49+
## Alias Instances
5050

51-
An instance alias defines an implicit instance that is equal to some expression. E.g., assuming a global method `currentThreadPool` returning a value with a member `context`, one could define:
51+
An alias instance defines an implicit instance that is equal to some expression. E.g., assuming a global method `currentThreadPool` returning a value with a member `context`, one could define:
5252
```scala
5353
instance ctx of ExecutionContext = currentThreadPool().context
5454
```
@@ -59,7 +59,7 @@ Alias instances may be anonymous, e.g.
5959
```scala
6060
instance of Position = enclosingTree.position
6161
```
62-
An instance alias can have type and context parameters just like any other instance definition, but it can only implement a single type.
62+
An alias instance can have type and context parameters just like any other instance definition, but it can only implement a single type.
6363

6464
## Syntax
6565

docs/docs/reference/contextual-instance/relationship-implicits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Implicit classes in Scala 2 are often used to define extension methods, which ar
139139

140140
### Implicit Values
141141

142-
Implicit `val` definitions in Scala 2 can be expressed in Dotty using a regular `val` definition and an instance alias. E.g., Scala 2's
142+
Implicit `val` definitions in Scala 2 can be expressed in Dotty using a regular `val` definition and an alias instance. E.g., Scala 2's
143143
```scala
144144
lazy implicit val pos: Position = tree.sourcePos
145145
```
@@ -151,7 +151,7 @@ can be expressed in Dotty as
151151

152152
### Abstract Implicits
153153

154-
An abstract implicit `val` or `def` in Scala 2 can be expressed in Dotty using a regular abstract definition and an instance alias. E.g., Scala 2's
154+
An abstract implicit `val` or `def` in Scala 2 can be expressed in Dotty using a regular abstract definition and an alias instance. E.g., Scala 2's
155155
```scala
156156
implicit def symDeco: SymDeco
157157
```

docs/docs/reference/contextual/relationship-implicits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Implicit classes in Scala 2 are often used to define extension methods, which ar
137137

138138
### Implicit Values
139139

140-
Implicit `val` definitions in Scala 2 can be expressed in Dotty using a regular `val` definition and an instance alias. E.g., Scala 2's
140+
Implicit `val` definitions in Scala 2 can be expressed in Dotty using a regular `val` definition and an alias instance. E.g., Scala 2's
141141
```scala
142142
lazy implicit val pos: Position = tree.sourcePos
143143
```

0 commit comments

Comments
 (0)