by qidydl · 6y ago · 0 comments
For a similar example, Scala's old collections library had a ton of machinery to ensure that `map` and co. would specialize correctly.[0] But the user never sees that, because they added a mechanism called "use cases", that allow you to override the signature shown in the docs with a simpler one.[1]
[0]: https://github.com/scala/scala/blob/v2.12.10/src/library/sca...
[1]: https://www.scala-lang.org/api/2.12.10/scala/collection/immu...