
4 Dec
2006
4 Dec
'06
9 p.m.
On Mon, 04 Dec 2006, Simon Marlow
An implementation is entitlesd to assume the following laws about these operations:
range (l,u) !! index (l,u) i == i -- when i is in scope inRange (l,u) i == i `elem` range (l,u) map index (range (l,u)) == [0..rangeSize (l,u)]
Even if these laws are not satisfied, is the implementation really allowed to segfault? I would have guessed that the array operations should still be equivalent to some pure Haskell program (e.g. undefined). If "laws not satisfied => any behaviour OK" were the correct interpretation, then it would be OK for the Array implementation to wipe all your files at the first encounter of a broken Ix law... ;) -- /NAD