Wednesday, March 25, 2009

HMinCaml

Copperbox revision 517.

More type inference doodles, this one inspired by Kuan and MacQueen's paper from ML'07.

Tuesday, March 24, 2009

HMinCaml

Copperbox revision 516.

More work on type inference, though I'm not getting very far. I've added another doodle that infers a much smaller subset of ML than MinCaml, but this has problems with letrec or maybe app (or maybe both).

Monday, March 23, 2009

HMinCaml

Copperbox revision 515.

I've added a pretty printer for the top-level syntax, so I can check that I'm parsing source files correctly.

Sunday, March 22, 2009

HMinCaml

Copperbox revision 514.

I've put my unification code from the type inference sketch into HMinCaml, though I suspect it will be wiser to translate the original ML code than to do more work integrating my type inference code.

HMinCaml

Copperbox revision 513.

Fixed the bug in the attribute grammar sketch of algorithm W.

Worryingly perhaps, I'm not sure why the solution works. The App node now manually increments the counter of its child node (arg) rather than the its own counter. This pattern was in course notes from Utrecht, so its clearly valid but mysterious to me.

HMinCaml

Copperbox revision 512.

I've added a monadic version of algorithm W which works, but I haven't found the bug in the attribute grammar version. As the monadic version is a direct translation of the attribute grammar, it points to the (implicit) copy rules in the attribute grammar not working the way I expect.

HMinCaml

Copperbox revision 511.

I've implemented a sketch of the type inference algorithm W (a sketch meaning that it isn't integrated with HMinCaml and works on a smaller set of datatypes).

It's largely an attribute grammar version of the code in Martin Grabmuller's "Algorithm W Step by Step", with some modifications so the naming conventions are closer to the presentation in "Generalizing Hindley-Milner Type Inference Algorithms". Unfortunately it seems to have a bug at present, as it fails one of the test cases from "... Step by Step" which it should pass.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.