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/instance-defs.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ implied ListOrd[T] given (ord: Ord[T]) for Ord[List[T]] {
30
30
}
31
31
```
32
32
This code defines a trait `Ord` and two implied instance definitions. `IntOrd` defines
33
-
an implied instance for the type `Ord[Int]` whereas `ListOrd` defines implied
34
-
instances of `Ord[List[T]]` for all types `T` that come with an implied `Ord` instance themselves.
35
-
The `given` clause in `ListOrd`defines an [inferable parameter](./inferable-params.html).
33
+
an implied instance for the type `Ord[Int]` whereas `ListOrd[T]` defines implied
34
+
instances of `Ord[List[T]]` for all types `T` that come with an implied `Ord[T]` instance themselves.
35
+
The `given` clause in `ListOrd` defines an [inferable parameter](./inferable-params.html).
36
36
Inferable parameters are further explained in the next section.
37
37
38
38
## Anonymous Implied Instances
@@ -48,13 +48,11 @@ the type(s) in the `for` clause.
48
48
49
49
## Implied Alias Instances
50
50
51
-
An implied alias instance defines an implied instance that is equal to some expression. E.g.,
51
+
An implied alias instance defines an implied instance that is equal to some expression. E.g., assuming a global method `currentThreadPool` returning a value with a member `context`, one could define:
Here, we create an implied instance `ctx` of type `ExecutionContext` that resolves to the
56
-
right hand side `currentThreadPool().context`. Each time an implied instance of `ExecutionContext`
57
-
is demanded, the result of evaluating the right-hand side expression is returned.
55
+
This creates an implied instance `ctx` of type `ExecutionContext` that resolves to the right hand side `currentThreadPool().context`. Each time an implied instance of `ExecutionContext` is demanded, the result of evaluating the right-hand side expression is returned.
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/query-types.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ With that setup, the table construction code above compiles and expands to:
112
112
```
113
113
### Example: Postconditions
114
114
115
-
As a larger example, here is a way to define constructs for checking arbitrary postconditions using `ensuring`so that the checked result can be referred to simply by `result`. The example combines opaque aliases, context query types, and extension methods to provide a zero-overhead abstraction.
115
+
As a larger example, here is a way to define constructs for checking arbitrary postconditions using an extension method `ensuring`so that the checked result can be referred to simply by `result`. The example combines opaque aliases, context query types, and extension methods to provide a zero-overhead abstraction.
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/relationship-implicits.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,8 @@ The `infer` method corresponds to `implicitly` in Scala 2.
82
82
Context bounds are the same in both language versions. They expand to the respective forms of implicit parameters.
83
83
84
84
**Note:** To ease migration, context bounds in Dotty map for a limited time to old-style implicit parameters for which arguments can be passed either with `given` or
85
-
with a normal application.
85
+
with a normal application. Once old-style implicits are deprecated, context bounds
0 commit comments