In practice, type signatures written in application code rarely look like that.
Don't get me wrong - Scala is complex. If you don't need the JVM, Haskell is far simpler and cleaner. But you are exaggerating the complexity of it.
In practice, type signatures written in application code rarely look like that.
Don't get me wrong - Scala is complex. If you don't need the JVM, Haskell is far simpler and cleaner. But you are exaggerating the complexity of it.
I disagree. If anything, both Scala and Haskell are comparable to C++ in terms of complexity. Haskell is in fact, a bottomless pit.
During your descent into madness, you may encounter functors, monads, comonads, free monads, higher ranked types, arrows, zippers, existentially/universally quantified types, GADTs, kinds, and the other 300 extra compiler extensions that people use on a daily basis.
Documentation is provided in the form of academic research papers.
Not that I'm saying it's not an exciting journey, but it is a long journey.
Everything you mentioned above is just a library on top of this.
In contrast, Scala has java-style subtyping built into the language, along with traits which are a weird mishmash of typeclasses and interfaces. There is quite a bit of complexity surrounding functions/methods. You have implicits to think about. Heck, just look at the type signatures in both languages and compare.
I'm not saying Haskell is easy. I'm just saying they are categorically different kinds of complexity.
Haskell, and to a bit of a lesser extent Scala, have a lot of their complexity arise from combinatorial explosion of interactions of simple features.
Also, relentless abstraction (particularly in Haskell). Yes, you can think of lots of things as arrows. But does it necessarily make it easier to write a particular problem to do so, or does the cognitive load required to maintain the abstraction <-> problem mapping outweigh the benefit of casting it as the abstraction?