Hi Daniel,

F# type inference is specified in the F# draft/informal specification at [link:research.microsoft.com] The algorithm can be seen as a modified form of Hindley-Milner inference, if you regard the key characteristic of HM inference being the presence of a generalization rule that makes code generic automatically. The algorithm differs from HM in some ways, e.g. order of inference matters because of integration with object-oriented programming features such as the dot-notation.

Recapping all the design decisions would take some time, and would be a good subject for a white paper. The best thing would be to take a look through the specification and come back with questions that most interest you, e.g. generalization, constraints or name resolution.

Thanks

Don

By on 9/3/2008 2:16 PM ()

Thanks for your reply Don,

I was wondering whether you have separate phases of constraint generation and solving. Are you using a constraint system like HM(X)?

I am interested in type checkers because I was thinking about writing a general (i.e. reusable and extendable) type inference framework for work but this seems to be quite a difficult problem. I also stumbled about the Cartesian Product Algorithm which does concrete type inference. I.e. instead of giving an abstract description of a type gives you a set like {float, int, string} e.g. as the result type of the (+) operation. HM seems to be far more popular though.

Daniel

By on 9/4/2008 7:44 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper