I'm looking on the Haskell 98 Report, and the definition of (==) for values of type Array a b looks wrong to me. Here is the definition given:

  a == a' = (assocs a == assocs a')

But this fails to account for the array length in each dimension; hence, if


then


are all True, even though


This violates the most fundamental property of equality: that if a == b, then you can substitute a for b in an expression without changing the value of the expression.

I can't possibly be the first person to have noticed this. So why is equality for Arrays defined this way?