Are we missing out on fancy types?

The main Haskell and ML compilers integrate many extensions to Hindley-Milner, but many other extensions are left out: intersection types, basic (DML or ATS) dependant types, constraint-handling systems like HM(X), generic types, subtyping … Some of these are new, but some of them are older than other extensions that are getting integrated into mainstream compilers. What happens to these ideas after their toy compilers leave town?

Also, why do the main compiler projects not integrate work done in each other &mdash Why doesn't SML have type classes? Why doesn't GHC have polymorphic variants?

My guess for the first question is that the work necessary to code a new type inferencer is less than what it takes to integrate a new type inferencer into a pre-existing compiler. Pushed by grant or graduation deadlines, the simpler work is done. In the meantime, people like Simon Peyton-Jones beg for GHC hackers.

As for the second question, I suspect there's a little bit of NIH syndrome acting together with grant pressure &mdash row types in HM is already done in O'Caml, why would ICFP publish a paper about doing the same thing in Haskell?

Of course, perhaps the most valuable extensions are being integrated, or perhaps these things are a matter of chance, as interests and Ph.D. students come and go.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Usability, Tractability, and Decidability...

... are all important considerations when designing a type system, in that order. The problem is, integrating many of the features you suggest make the type inference undecidable and/or untractable for common programs. This can usually be solved by requiring the programmer to provide more type annotations, but then the usability of your type system goes down.

Extending Hindley-Milner to include subtyping has been extensively studied, however, creating a such a system that is both useable and tractable (on programs that actually get written) and understandable to your above-average working programmer has been a major challenge.

Yup

Fixed.