Jon Harrop
2010-02-24 12:35:53 UTC
I'd like to implement the HM type system with type inference in my language
front-end. I once lashed together something that seemed to work but, given
the theoretical foundation behind this, I'd like to follow some more
rigorous guidance this time.
I found an interesting draft paper "Algorithm W Step by Step":
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7733&rep=rep1&type=pdf
that runs through a basic implementation in Haskell. Although this is
academically interesting, the implementation sucks because it is written in
Haskell (half of the code is just working around lack of mutation!) and it
doesn't implement the interesting bit: the value restriction.
Is there a similar tutorial providing a walkthrough of the construction of a
type inferer for an impure language? For example, what is the inferred type
of the empty array and can that even be represented using the code from
that paper? Also, does anyone have a minimal implementation written in ML?
front-end. I once lashed together something that seemed to work but, given
the theoretical foundation behind this, I'd like to follow some more
rigorous guidance this time.
I found an interesting draft paper "Algorithm W Step by Step":
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7733&rep=rep1&type=pdf
that runs through a basic implementation in Haskell. Although this is
academically interesting, the implementation sucks because it is written in
Haskell (half of the code is just working around lack of mutation!) and it
doesn't implement the interesting bit: the value restriction.
Is there a similar tutorial providing a walkthrough of the construction of a
type inferer for an impure language? For example, what is the inferred type
of the empty array and can that even be represented using the code from
that paper? Also, does anyone have a minimal implementation written in ML?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u