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/delegates.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: "Given Instances"
4
4
---
5
5
6
6
Given instances (or, simply, "givens") define "canonical" values of certain types
7
-
that serve for synthesizing arguments to [given clauses](./given-clauses.html). Example:
7
+
that serve for synthesizing arguments to [given clauses](./given-clauses.md). Example:
8
8
9
9
```scala
10
10
traitOrd[T] {
@@ -34,7 +34,7 @@ This code defines a trait `Ord` with two given instances. `IntOrd` defines
34
34
a given for the type `Ord[Int]` whereas `ListOrd[T]` defines givens
35
35
for `Ord[List[T]]` for all types `T` that come with a given instance for `Ord[T]` themselves.
36
36
The `given (ord: Ord[T])` clause in `ListOrd` defines an implicit parameter.
37
-
Given clauses are further explained in the [next section](./given-clauses.html).
37
+
Given clauses are further explained in the [next section](./given-clauses.md).
38
38
39
39
## Anonymous Given Instances
40
40
@@ -74,7 +74,7 @@ If a `given` definition has type parameters or a given clause, a fresh instance
74
74
75
75
## Syntax
76
76
77
-
Here is the new syntax of given instances, seen as a delta from the [standard context free syntax of Scala 3](http://dotty.epfl.ch/docs/internals/syntax.html).
77
+
Here is the new syntax of given instances, seen as a delta from the [standard context free syntax of Scala 3](../../internals/syntax.md).
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/given-clauses.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ def the[T] given (x: T): x.type = x
98
98
99
99
## Syntax
100
100
101
-
Here is the new syntax of parameters and arguments seen as a delta from the [standard context free syntax of Scala 3](http://dotty.epfl.ch/docs/internals/syntax.html).
101
+
Here is the new syntax of parameters and arguments seen as a delta from the [standard context free syntax of Scala 3](../../internals/syntax.md).
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/motivation.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -47,25 +47,25 @@ Existing Scala programmers by and large have gotten used to the status quo and s
47
47
48
48
The following pages introduce a redesign of contextual abstractions in Scala. They introduce four fundamental changes:
49
49
50
-
1. [GivenInstances](./delegates.html) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types.
50
+
1. [GivenInstances](./delegates.md) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types.
51
51
52
-
2. [GivenClauses](./given-clauses.html) are a new syntax forimplicit _parameters_ and their _arguments_. Both are introduced with the same keyword, `given`. This unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several implicit parameter sections, and to have implicit parameters followed by normal ones.
52
+
2. [GivenClauses](./given-clauses.md) are a new syntax forimplicit _parameters_ and their _arguments_. Both are introduced with the same keyword, `given`. This unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several implicit parameter sections, and to have implicit parameters followed by normal ones.
53
53
54
-
3. [GivenImports](./import-delegate.html) are a newclassof imports that specifically importgiveninstancesandnothingelse. Giveninstances_mustbe_importedwith`import given`, aplainimportwillnolongerbringthemintoscope.
54
+
3. [GivenImports](./import-delegate.md) are a newclassof imports that specifically importgiveninstancesandnothingelse. Giveninstances_mustbe_importedwith`import given`, aplainimportwillnolongerbringthemintoscope.
55
55
56
-
4. [ImplicitConversions](./conversions.html) are now expressed asgiven instances of a standard `Conversion` class. All other forms of implicit conversions will be phased out.
56
+
4. [ImplicitConversions](./conversions.md) are now expressed asgiven instances of a standard `Conversion` class. All other forms of implicit conversions will be phased out.
57
57
58
58
This section also contains pages describing other language features that are related to context abstraction. Theseare:
59
59
60
-
- [ContextBounds](./context-bounds.html), which carry over unchanged.
61
-
- [ExtensionMethods](./extension-methods.html) replace implicit classes in a way that integrates better with typeclasses.
62
-
- [ImplementingTypeclasses](./typeclasses.html) demonstrates how some common typeclasses can be implemented using the new constructs.
63
-
- [TypeclassDerivation](./derivation.html) introduces constructs to automatically derive typeclass instances forADTs.
64
-
- [MultiversalEquality](./multiversal-equality.html) introduces a special typeclass
60
+
- [ContextBounds](./context-bounds.md), which carry over unchanged.
61
+
- [ExtensionMethods](./extension-methods.md) replace implicit classes in a way that integrates better with typeclasses.
62
+
- [ImplementingTypeclasses](./typeclasses.md) demonstrates how some common typeclasses can be implemented using the new constructs.
63
+
- [TypeclassDerivation](./derivation.md) introduces constructs to automatically derive typeclass instances forADTs.
64
+
- [MultiversalEquality](./multiversal-equality.md) introduces a special typeclass
65
65
to support typesafe equality.
66
-
- [ImplicitFunctionTypes](./implicit-function-types.html) provide a way to abstract over givenclauses.
67
-
- [ImplicitBy-NameParameters](./implicit-by-name-parameters.html) are an essential tool to define recursive synthesized values without looping.
68
-
- [RelationshipwithScala2Implicits](./relationship-implicits.html) discusses the relationship between old-style implicits and new-style givens and how to migrate from one to the other.
66
+
- [ImplicitFunctionTypes](./implicit-function-types.md) provide a way to abstract over givenclauses.
67
+
- [ImplicitBy-NameParameters](./implicit-by-name-parameters.md) are an essential tool to define recursive synthesized values without looping.
68
+
- [RelationshipwithScala2Implicits](./relationship-implicits.md) discusses the relationship between old-style implicits and new-style givens and how to migrate from one to the other.
69
69
70
70
Overall, the new design achieves a better separation of term inference from the rest of the language: There is a single way to define giveninstances instead of a multitude of forms all taking an `implicit` modifier. There is a single way to introduce implicit parameters and arguments instead of conflating implicitwith normal arguments. There is a separate way to importgiveninstancesthatdoesnotallowthemtohideinaseaofnormalimports. Andthereisasinglewaytodefineanimplicitconversionwhichisclearlymarked as suchanddoesnotrequirespecialsyntax.
0 commit comments