<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>To refine Alejandro's answer a bit: The OutsideIn(X) paper is really the one to read. It's long, but I think it would have to be! The later papers he mentions describe enhancements to the internal, typed language (called variously System FC or GHC Core -- they're more or less the same). With these enhancements came some changes to type inference, but not major ones. The "Promotion" paper describes a bit about polymorphic kind inference in datatype definitions, but the details aren't really there. The "Closed Type Families" paper does not really address type inference, as the closed type families feature (somewhat surprisingly) doesn't interact much with type inference at all.</div><div><br></div><div>It would be great to see this work be adopted into another language. Good luck!</div><div>Richard</div><br><div><div>On Feb 25, 2014, at 8:46 AM, Alejandro Serrano Mena <<a href="mailto:trupill@gmail.com">trupill@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">The current version of GHC does type inference by (an advanced version of) the OutsideIn(X) algorithm.<div>You can check the original paper at <a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/constraints/jfp-outsidein.pdf">http://research.microsoft.com/en-us/um/people/simonpj/papers/constraints/jfp-outsidein.pdf</a></div>

<div>The initial algorithm was then enhanced with datatype promotion and closed type families, which you can learn about in "Giving Haskell a Promotion" and "Closed Type Families with Overlapping Equations".</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-25 14:38 GMT+01:00 Di Xu <span dir="ltr"><<a href="mailto:xudifsd@gmail.com" target="_blank">xudifsd@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi, all<div><br></div><div>I'm new to haskell, I'm learning haskell for its type system, and I found haskell type inference is excellent, 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.</div>


</div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></blockquote></div><br></body></html>