Copperbox revision 517.
More type inference doodles, this one inspired by Kuan and MacQueen's paper from ML'07.
Tuesday, March 24, 2009
Monday, March 23, 2009
Sunday, March 22, 2009
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.
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.
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.
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.
Subscribe to:
Posts (Atom)
Blog Archive
About Me
- Stephen Tetley
- 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.