Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type inference implemented in C++

Is there an implementation in C++, of Damas-Hindley-Milner style type inference, preferably using modern C++ techniques?

like image 512
keveman Avatar asked Jan 08 '12 02:01

keveman


1 Answers

Here's my implementation of Hindley-Milner type inference in C++11, based on the Python code by Robert Smallshire, the Scala code by Andrew Forrest, the Perl code by Nikita Borisov and the paper "Basic Polymorphic Typechecking" by Cardelli.

It makes heavy use of boost::variant and boost::apply_visitor.

like image 175
Jared Hoberock Avatar answered Nov 07 '22 08:11

Jared Hoberock