> if the range of y depended on the value of x, this wouldn't turn into an array, where you need all dimensions to have regular length
Yes, that's the issue I encountered with the Monad definition. Had to handle the case where y varied, while in the Julia expression that wasn't possible.
I thought the comma in Julia's:
[ (x,y) for x in 1:3, y in 2:5 ]
was like the comma in Haskell's:
[ (x,y) | x <- [1..3], y <- [2..5] ]
but I see now that the above Haskell expression is actually the following Julia:
[ (x,y) for x in 1:3 for y in 2:5 ]
> I take it multidimensional arrays aren't common data structures in Haskell?
Nope. They're not a core type in the language, and while I did see some packages on a quick search, they unfortunately seem pretty limited. They're either limited to 2 dimensions or low lengths per dimension.
Part of the issue is probably that it'd be for the best for the dimensions to be specified in the type signature, in order to make stuff like adding 2 matrices of different dimensions a compile-time error. However, that gets complicated because you have to use numbers in type signatures and also be able to express a variable number of them. It might be workable using the DataKinds extension and 2-tuple type constructors as cons cells, but it sounds messy.
Things get a lot simpler if that's just forgotten about and such errors are raised at run-time, but that's just not what one typically strives for when writing Haskell. Tracing bugs from errors raised at run-time is also quite more troublesome than from those raised at compile-time.