Hacker News new | ask | show | jobs
by jcelerier 3066 days ago
> C++'s and Haskell's typing systems don't look very similar, or even of similar complexity.

yet they are. The difference between the Haskell type system and the C++ type system is that generic constraints on types are explicitely specified with typeclasses in Haskell, while they are implicitely specified with templates in C++ (though this changes in C++20 with concepts).

To make a "conceptual leap" beyond the C++ and Haskell type systems, you have to use a language with dependent types such as Idris or Coq (and actually, dependent types can be simulated in C++ ! http://pfultz2.com/blog/2015/01/24/dependent-typing/ but like all simulations, it will be slower than if it was implemented directly by the compiler).

1 comments

That is not the only difference between both type systems. It's very different to use one or the other. Especially in practice.