2 ms·
abandon implicits entirely, What's wrong with (carefully used) implicits? What would you replace them with? Haskell has type-classes, a very similar concept, a
by YorkshireSeason 8y ago
abandon implicits entirely,
What's wrong with (carefully used) implicits? What would you replace them with? Haskell has type-classes, a very similar concept, and it's difficult to imagine contemporary Haskell programming without them.
- jjtheblunt 8y agothey're an afterthought which serve truly no purpose other than to be fancy via obfuscation?
- YorkshireSeason 8y agoImplicits are not an afterthought, but a core feature that enables efficient context-dependent parameterisation. Implicits let you avoid a lot of boiler-plate. They are especially useful for well-structured ad-hoc polymorphism, quite like Haskell's type-classes, the predecessor and close relative of implicits. If you don't like implicits, simply don't use them. You can add a style checker to your build automation that finds and rejects the keyword "implicit" in your code. As to use of implicits in libraries, you are perfectly free to pass explicit arguments instead. Odersky has a couple of recent youtube videos where he explains implicits in detail.