<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 25, 2014 at 8:38 PM, Di Xu <span dir="ltr"><<a href="mailto:xudifsd@gmail.com" target="_blank">xudifsd@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.</blockquote>

</div><br></div><div>Haskell type inference is still a developing research area. Suffice to say, not even SPJ knows all about what it _should be_.<br><br></div><div>Here's a reasonable plan:<br><br></div><div>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.<br>

<br></div><div>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.<br><br></div><div>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.<br>

</div><div><br>[1] <a href="http://en.wikipedia.org/wiki/Unification_%28computer_science%29">http://en.wikipedia.org/wiki/Unification_%28computer_science%29</a><br></div><div><br>-- Kim-Ee</div><div class="gmail_extra">
</div></div>