
26 Aug
2005
26 Aug
'05
4:04 p.m.
makeArray :: Int -> Int -> a -> ST s (STArray s Int a) makeArray lower upper val = newArray (-lower, upper) val ^ Is negation of lower intentional here?
Yes, 'tis. Arguable as to whether or not it's a good idea, as it changes the inerface. In my program I use two types of array: - indexed from 1 to n - indexed from a -ve lower to a +ve upper So in this case it made sense to just pass the lower bound and negate it in the wrapper.