I'm TAing an introduction to functional programming class at CMU. A bunch of people were asking how type inference works and I ended up sketching an implementation of algorithm W.
Hopefully this will eventually be polished enough to actually share with the people I TA.