3 ms·
Haskell's type system may be sophisticated, but it's also very simple. There's no sub-typing of any sort, for example. With a bit of mathematical notation--whi
by tikhonj 14y ago
Haskell's type system may be sophisticated, but it's also very simple. There's no sub-typing of any sort, for example.
With a bit of mathematical notation--which may be a little foreign but is not that complicated--you can fit all of Haskell's type inference rules on a single page. These rules specify how the type system behaves and how to infer types! (The type inference, which may seem magical, is just a constraint satisfaction problem and so is easy to specify.)
I would not be surprised if Go's typing rules are more complex than Haskell's. All while giving you less static guarantees and less thorough type inference.
- sirclueless 14y agoHaskell has algebraic datatypes and typeclasses. Both of those are more complex than Go's type system, which is more or less just primitives, structs, and interfaces. Haskell's type system may in fact have fewer moving parts, but it has a LOT more emergent complexity than Go's does.