1 --!!! Testing Immutable Arrays (part 1)
6 a1 = array (1,10) [ (i,i*i) | i <- [1..10] ]
14 test5 = a1 // [(3,3),(4,4)]
16 -- note duplicate value and absent value
18 a1' = array (1,3) [(1,'a'), (1,'b'), (3,'c')]
20 test6 = a1' ! 1 -- duplicate array index
21 test7 = a1' ! 2 -- undefined array element
22 test8 = a1' ! 3 -- 'c'
24 test10 = a1 ! 0 -- should fail
25 test11 = a1 ! 11 -- should fail
26 test12 = [ a1 ! i | i <- [1..10] ]