Nimrod.
sml/nj + a bit of tidying.