[MLton] A little exercise for the type checker:

Jesper Louis Andersen jlouis@mongers.org
Thu, 12 Feb 2004 22:57:32 +0100


fun pair x y = fn z => z x y;
fun run z = 
let val x1 = fn y => pair y y in
  let val x2 = fn y => x1(x1(y)) in
    let val x3 = fn y => x2(x2(y)) in
      let val x4 = fn y => x3(x3(y)) in
        x4(z)
      end
    end
  end
end

annah$ mlton -show-basis true test.sml | wc -l
     327

Scary!

I also read the paper on contification. Very clever optimization I must
say.


-- 
j.