2 ms·
I think it would be great if we could replace implicits by: 1) a simple mechanism for "enrichment" (aka. retro-active extension, virtual classes) 2) functiona
by adriaanm 15y ago
I think it would be great if we could replace implicits by:
1) a simple mechanism for "enrichment" (aka. retro-active extension, virtual classes)
2) functional type-level computation (as opposed to the mini-prolog engine that is implicit search + type inference).
Reducing complexity is complicated, unfortunately. We [have been|are] thinking about both of these alternative features, though.
---
ps: The following part of the article is inaccurate: "Turns out that Scala will search up to one level up the type hierarchy for a matching shape for the implicit."
Check out the "implicits without the import tax" part of http://eed3si9n.com/implicit-parameter-precedence-again http://eed3si9n.com/implicit-parameter-precedence-again. The implicit scope includes all the superclasses (and their companion objects) of all the parts of the type of the implicit value that's being resolved.