Multi-dimentional array calculus in Standard ML