eh it’s not that clear. all uses of implicits reduce the number of characters typed. there’s no functionality they unlock that you would not gain with another explicit parameter (or 2) and a helper class/type(s). by reducing characters typed they enable a different syntax that you wouldn’t normally do because without implicits it’s cumbersome. but then if code is unwieldy because it’s got too many letters, there’s probably a good argument for a feature that reduces letters.
i agree about ExecutionContext. I have done a lot of scala and really find implicits useful to reduce lines but the cost is so high. it’s to point where the scala chat room at work is people posting compiler messages and the answer a lot of the time is you need this magic import.
the takeaway i have is if functional programming and monads and referential transparency are some top tier of programming, is this import Implicits._; MoreImplicits._ and param’s of A[B[_], D] really the way things should be? is this what people as eschewing when they say functional is the way to go? it just feels so overkill but you have to use it all over your stack to make the map/flatmap chain work. and once every method is just some long for comprehension you are finally “winning”
In Haskell, typeclasses are language-level construct, not needing any implicits, and monadic code is easy to write using do-notation which is syntax sugar over binding ("comprehensions").
In Scala, typeclasses are a pattern, something achievable using a bunch of language features strung together, and implicits are likely an inevitable part of that mix. For-comprehensions is what "sequential computation" really is if you want to represent it as a function, and not forget to check intermediate results. It has numerous advantages, but again, on the language level it's a pattern, a contraption that makes monadic style possible, but not necessarily easy on the eyes.
i agree about ExecutionContext. I have done a lot of scala and really find implicits useful to reduce lines but the cost is so high. it’s to point where the scala chat room at work is people posting compiler messages and the answer a lot of the time is you need this magic import.
the takeaway i have is if functional programming and monads and referential transparency are some top tier of programming, is this import Implicits._; MoreImplicits._ and param’s of A[B[_], D] really the way things should be? is this what people as eschewing when they say functional is the way to go? it just feels so overkill but you have to use it all over your stack to make the map/flatmap chain work. and once every method is just some long for comprehension you are finally “winning”