MP5 will allow you to write a constraint-based type inferencer for the Hask language. This will make use of the AST, built by the parser, and a provided unification algorithm. Please see the MP5 handout for more details.
UPDATE: Please download version 2 of the student grader distribution. This includes a couple of major changes. The main difference you will notice is that now the solution is bundled with the rest of the distribution. You can access this both using the solution_tcheck function from hask.top (this works the same way as the Hask.ast function in the last MP), or by running hask with the -s flag. To make sure you don't overwrite your types.ml file, the new version is named types.skel. There is only one difference, the addition of a function named newTypeState. Please copy this function, available in types.skel, into your types.ml file. You will need to do this before recompiling.
UPDATE: Please download version 3 of the student grader distribution. This now includes a proper grader with a number of examples, which will be expanded upon further later. There are two main differences between the types.skel distributed with this version and the file you already have. The first is that the definition of hasktype has been moved out of the file, so you should now include "open Hasktypes" at the top of your file and remove the definition of hasktype. The second is that the showType function has been moved down in the file -- you can either do the same or leave it where it already is. You will need to make these changes before you are able to use the grader.
UPDATE: Please grab file haskGraderTests.ml; this includes 25 new tests, especially focused on combining functions, lists, and pairs.
Also, make sure you read the "Guide for Doing MPs".
|