Skip to content

Commit 685cb79

Browse files
committed
Rename the to summon
1 parent 6ed305b commit 685cb79

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

docs/docs/reference/contextual/derivation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ enum Opt[+T] derives Eq {
301301

302302
object Test extends App {
303303
import Opt._
304-
val eqoi = the[Eq[Opt[Int]]]
304+
val eqoi = summon[Eq[Opt[Int]]]
305305
assert(eqoi.eqv(Sm(23), Sm(23)))
306306
assert(!eqoi.eqv(Sm(23), Sm(13)))
307307
assert(!eqoi.eqv(Sm(23), Nn))
@@ -313,10 +313,10 @@ following, after a little polishing,
313313

314314
```scala
315315
given derived$Eq[T](given eqT: Eq[T]): Eq[Opt[T]] =
316-
eqSum(the[Mirror[Opt[T]]],
316+
eqSum(summon[Mirror[Opt[T]]],
317317
List(
318-
eqProduct(the[Mirror[Sm[T]]], List(the[Eq[T]]))
319-
eqProduct(the[Mirror[Nn.type]], Nil)
318+
eqProduct(summon[Mirror[Sm[T]]], List(summon[Eq[T]]))
319+
eqProduct(summon[Mirror[Nn.type]], Nil)
320320
)
321321
)
322322
```

docs/docs/reference/contextual/extension-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def (xs: List[List[T]]) flattened [T] =
155155
xs.foldLeft[List[T]](Nil)(_ ++ _)
156156

157157
def (x: T) + [T : Numeric](y: T): T =
158-
the[Numeric[T]].plus(x, y)
158+
summon[Numeric[T]].plus(x, y)
159159
```
160160

161161
As usual, type parameters of the extension method follow the defined method name. Nevertheless, such type parameters can already be used in the preceding parameter clause.

docs/docs/reference/contextual/given-clauses.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ But `f(global)(given sym, kind)` would give a type error.
8989

9090
## Summoning Instances
9191

92-
The method `theGiven` in `Predef` returns the given instance of a specific type. For example,
92+
The method `summon` in `Predef` returns the given instance of a specific type. For example,
9393
the given instance for `Ord[List[Int]]` is produced by
9494
```scala
95-
theGiven[Ord[List[Int]]] // reduces to ListOrd given IntOrd
95+
summon[Ord[List[Int]]] // reduces to ListOrd given IntOrd
9696
```
97-
The `theGiven` method is simply defined as the (non-widening) identity function over a implicit parameter.
97+
The `summon` method is simply defined as the (non-widening) identity function over a implicit parameter.
9898
```scala
99-
def theGiven[T](given x: T): x.type = x
99+
def summon[T](given x: T): x.type = x
100100
```
101101

102102
## Syntax

docs/docs/reference/contextual/implicit-by-name-parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ given optionCodec[T](given ev: => Codec[T]): Codec[Option[T]] {
1919
}
2020
}
2121

22-
val s = the[Codec[Option[Int]]]
22+
val s = summon[Codec[Option[Int]]]
2323

2424
s.write(Some(33))
2525
s.write(None)
@@ -54,7 +54,7 @@ The precise steps for synthesizing an argument for an implicit by-name parameter
5454
In the example above, the definition of `s` would be expanded as follows.
5555

5656
```scala
57-
val s = the[Test.Codec[Option[Int]]](
57+
val s = summon[Test.Codec[Option[Int]]](
5858
optionCodec[Int](intCodec)
5959
)
6060
```

docs/docs/reference/contextual/typeclasses.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait Monoid[T] extends SemiGroup[T] {
1717
def unit: T
1818
}
1919
object Monoid {
20-
def apply[T](given Monoid[T]) = the[Monoid[T]]
20+
def apply[T](given Monoid[T]) = summon[Monoid[T]]
2121
}
2222

2323
given Monoid[String] {

0 commit comments

Comments
 (0)