[Haskell-cafe] Q: haskell type inference algorithm paper

Kim-Ee Yeoh ky3 at atamo.com
Tue Feb 25 14:37:25 UTC 2014

On Tue, Feb 25, 2014 at 8:38 PM, Di Xu <xudifsd at gmail.com> wrote:

> I'm interested in its type inference algorithm, could you give me some
> paper or material reference that describe the haskell type inference
> algorithm? I want to port it to typed clojure.

Haskell type inference is still a developing research area. Suffice to say,
not even SPJ knows all about what it _should be_.

Here's a reasonable plan:

1) Start with so-called "Unification" [1]. Try manually inferring the types
of some Haskell fragments to get a sense of how it applies. The connection
should emerge as clear as day.

2) Next, study Damas-Hindley-Milner. Gain a sense of what motivates
'principal types', why they're useful, as opposed to a situation where they
are impossible to infer.

3) Finally, there's type classes. I don't know if typed clojure has them or
not, but this is really what separates Haskell from, say, Lazy ML (LML). Be
warned, this is where it gets gnarly.

[1] http://en.wikipedia.org/wiki/Unification_%28computer_science%29

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140225/bfa514cc/attachment.html>

More information about the Haskell-Cafe mailing list