Creating a two-dimensional array:
import Data.Array
arr = listArray ((1, 1), (10, 10)) [1..] -- :: (Ix i, Num i, Num e, Enum e) => Array i e
// can be used to update a value. You need to provide a list of tuples with an index and a value. Since our index is a two-tuple, the type needs to be [((a, b), e)].
arr // _ -- _ :: [((a, b), e)]
Now I used [(1, 999)] by accident to update the first value. Of course it should have been [((1,1), 999)]. However, the mistake turned out to be type-correct!
arr2 = arr // [(1, 999)]
arr2 -- :: (Ix a, Ix b, Enum e, Num a, Num b, Num e, Num (a, b)) => Array (a, b) e
It hangs when I try to evaluate arr2, but I still wonder why this is type correct.