[Haskell-cafe] Type system

David Menendez dave at zednenem.com
Fri Mar 14 16:26:10 EDT 2008


On Fri, Mar 14, 2008 at 2:50 PM, Andrew Coppin
<andrewcoppin at btinternet.com> wrote:
> Haskell has an expressive and powerful type system - which I love. It
>  also has a seemingly endless list of weird and obscure type system
>  extensions. And there are various things you can do in Haskell which
>  *require* some pretty serious type system hackery.

Well, there wouldn't be much point to a type system extension if you
could do just as well without it.

>  And yet they commonly pop up in Haskell. Can anybody put their finger on
>  precisely why that is?

It's because Haskell is, among other things, a research language. Part
of its stated purpose is providing a basis for experimenting with type
systems and implementation strategies and so forth.

When Haskell 98 was written, higher-ranked polymorphism wasn't
considered practical, and no one had invented multi-parameter type
classes yet. Even type classes started out as an experiment, and then
they were extended to constructor classes (e.g., classes like Monad
where the parameter is a type constructor, not a ground type).

Eventually, the most successful extensions will be rolled into the
next Haskell standard.

The same thing happens in Java. Generics (what we call type
constructors) were available in various extended Javas before being
added to the main standard. The Haskell process is just a lot slower
because we're doing things very few have done before.

-- 
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list