Lennart Augustsson has recently developed a Haskell library called Orthotope for dealing with multidimensional arrays. It can reflect shape and dimension information in types. You can also watch a video presentation about Orthotope.
There is likely no way to translate this to OCaml without significant type system extensions, but some of the concepts and ideas might inspire similar work.