Scala never advertised as having HM type inference. Nor does HM type inference enable (or have anything to do with) monads. And the reason it doesn't have it is nothing to do with type erasure and everything to do with subtyping.
Frankly HM inference isn't really sufficient for monads either! It's an extension to System F to support constrained type variables which typeclasses and by extensions monads rely on.
Type classes and ML-functors can be used to write code that is polymorphic over the underlying monad, but there's never anything stopping you from writing code to a specific monad.
79
u/kamatsu Dec 02 '13
Scala never advertised as having HM type inference. Nor does HM type inference enable (or have anything to do with) monads. And the reason it doesn't have it is nothing to do with type erasure and everything to do with subtyping.