12 ms·
The difference is, as you say, that the type system in Haskell is a tool that helps you write concise and correct code, whereas the type system in a language li
by Xichekolas 17y ago
The difference is, as you say, that the type system in Haskell is a tool that helps you write concise and correct code, whereas the type system in a language like Java (it is hardly the only offender) feels arbitrary and capricious.
I too once thought static typing was nothing more than useless bloat, but then I started using Haskell. Haskell's type classes are actually a useful means of handling abstraction (know something that acts like a monoid? then save yourself some effort and use foldMap). The one thing I did like about Java's class system was interfaces, and Haskell's typeclasses handle that exceptionally well.