Skip to content

Commit 3fe93ce

Browse files
committed
Fix typo in doc page and update MimaFilters
1 parent 7d754d6 commit 3fe93ce

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/_docs/reference/experimental/typeclasses-syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def reduce[A : Monoid](xs: List[A]): A = ???
3434
Since we don't have a name for the `Monoid` instance of `A`, we need to resort to `summon` in the body of `reduce`:
3535
```scala
3636
def reduce[A : Monoid](xs: List[A]): A =
37-
xs.foldLeft(summon Monoid[A])(_ `combine` _)
37+
xs.foldLeft(summon[Monoid[A]].unit)(_ `combine` _)
3838
```
3939
That's generally considered too painful to write and read, hence people usually adopt one of two alternatives. Either, eschew context bounds and switch to using clauses:
4040
```scala

project/MiMaFilters.scala

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ object MiMaFilters {
1111
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.modularity"),
1212
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$modularity$"),
1313
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.compiletime.package#package.deferred"),
14+
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.WitnessNames"),
1415
),
1516

1617
// Additions since last LTS

0 commit comments

Comments
 (0)