Skip to content

Commit

Permalink
Fix typo in doc page and update MimaFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Mar 11, 2024
1 parent ec3b7de commit a4c5cdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/_docs/reference/experimental/typeclasses-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def reduce[A : Monoid](xs: List[A]): A = ???
Since we don't have a name for the `Monoid` instance of `A`, we need to resort to `summon` in the body of `reduce`:
```scala
def reduce[A : Monoid](xs: List[A]): A =
xs.foldLeft(summon Monoid[A])(_ `combine` _)
xs.foldLeft(summon[Monoid[A]].unit)(_ `combine` _)
```
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:
```scala
Expand Down
1 change: 1 addition & 0 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ object MiMaFilters {
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.modularity"),
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$modularity$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.compiletime.package#package.deferred"),
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.WitnessNames"),
),

// Additions since last LTS
Expand Down

0 comments on commit a4c5cdf

Please sign in to comment.