diff --git a/docs/docs/reference/contextual/typeclasses.md b/docs/docs/reference/contextual/typeclasses.md index b9ee16eb4ed8..5c8ea5f0c5ac 100644 --- a/docs/docs/reference/contextual/typeclasses.md +++ b/docs/docs/reference/contextual/typeclasses.md @@ -27,7 +27,7 @@ implied for Monoid[String] { implied for Monoid[Int] { def (x: Int) combine (y: Int): Int = x + y - def unit: String = 0 + def unit: Int = 0 } def sum[T: Monoid](xs: List[T]): T = diff --git a/docs/docs/reference/overview.md b/docs/docs/reference/overview.md index fbca3ed4a8fc..67598df68564 100644 --- a/docs/docs/reference/overview.md +++ b/docs/docs/reference/overview.md @@ -27,10 +27,10 @@ The primary goal of the language constructs in this section is to make the langu be deprecated in the future). Intersection types are one of the core features of DOT. They are commutative: `A & B` and `B & A` represent the same type. - - [Implicit function types](http://dotty.epfl.ch/docs/reference/new-types/implicit-function-types.html) `implicit A => B`. + - [Context query types](http://dotty.epfl.ch/docs/reference/contextual/query-types.html) `given A => B`. Methods and lambdas can have implicit parameters, so it's natural to extend the - same property to function types. Implicit function types help ergonomics and performance + same property to function types. context query types help ergonomics and performance as well. They can replace many uses of monads, offering better composability and an order of magnitude improvement in runtime speed. - [Dependent function types](http://dotty.epfl.ch/docs/reference/new-types/dependent-function-types.html) `(x: T) => x.S`. @@ -59,7 +59,7 @@ Listed in this section are new language constructs that help precise, typechecke precise domain modeling. They are also very useful for interoperating with Javascript libraries and JSON protocols. - - [Multiversal Equality](http://dotty.epfl.ch/docs/reference/other-new-features/multiversal-equality.html) + - [Multiversal Equality](http://dotty.epfl.ch/docs/reference/contextual/multiversal-equality.html) Multiversal equality is an opt-in way to check that comparisons using `==` and `!=` only apply to compatible types. It thus removes the biggest remaining hurdle