Ticket #1610: 1610.array.1.patch

File 1610.array.1.patch, 103.6 KB (added by igloo, 7 years ago)
Line 
1
2New patches:
3
4[Make arrays safer (e.g. trac #1046)
5Ian Lynagh <igloo@earth.li>**20070810142846
6 This is a divergence from Haskell 98.
7  * Add (numElements :: Ix i => a i e -> Int) to IArray class
8  * Array types get an extra field for numElements, e.g.
9    {{{
10    -data UArray i e = UArray !i !i ByteArray#
11    +data UArray i e = UArray !i !i !Int ByteArray#
12    }}}
13    This is a cache of rangeSize(l,u)
14  * Add safeRangeSize (always returns >= 0)
15  * Add safeIndex (use unsafeIndex (no Ix inRange check),
16                   but check index < numElements)
17  * unsafeForeignPtrToStorableArray gained an (Ix i) context
18] {
19hunk ./Data/Array/Base.hs 76
20+    numElements      :: Ix i => a i e -> Int
21hunk ./Data/Array/Base.hs 87
22+{-# INLINE safeRangeSize #-}
23+safeRangeSize :: Ix i => (i, i) -> Int
24+safeRangeSize (l,u) = let r = rangeSize (l, u)
25+                      in if r < 0 then error "Negative range size"
26+                                  else r
27+
28+{-# INLINE safeIndex #-}
29+safeIndex :: Ix i => (i, i) -> Int -> i -> Int
30+safeIndex (l,u) n i = let i' = unsafeIndex (l,u) i
31+                      in if i' < n then i'
32+                         else error "Error in array index"
33+
34hunk ./Data/Array/Base.hs 167
35-array (l,u) ies = unsafeArray (l,u) [(index (l,u) i, e) | (i, e) <- ies]
36+array (l,u) ies
37+    = let n = safeRangeSize (l,u)
38+      in unsafeArray (l,u)
39+                     [(safeIndex (l,u) n i, e) | (i, e) <- ies]
40hunk ./Data/Array/Base.hs 185
41-listArray (l,u) es = unsafeArray (l,u) (zip [0 .. rangeSize (l,u) - 1] es)
42+listArray (l,u) es =
43+    let n = safeRangeSize (l,u)
44+    in unsafeArray (l,u) (zip [0 .. n - 1] es)
45hunk ./Data/Array/Base.hs 193
46-    let n = rangeSize (l,u)
47+    let n = safeRangeSize (l,u)
48hunk ./Data/Array/Base.hs 211
49-    let n = rangeSize (l,u)
50+    let n = safeRangeSize (l,u)
51hunk ./Data/Array/Base.hs 282
52-arr ! i = case bounds arr of (l,u) -> unsafeAt arr (index (l,u) i)
53+arr ! i = case bounds arr of
54+              (l,u) -> unsafeAt arr $ safeIndex (l,u) (numElements arr) i
55hunk ./Data/Array/Base.hs 295
56-    (l,u) -> [unsafeAt arr i | i <- [0 .. rangeSize (l,u) - 1]]
57+    (l,u) -> [unsafeAt arr i | i <- [0 .. numElements arr - 1]]
58hunk ./Data/Array/Base.hs 301
59-    (l,u) -> [(i, unsafeAt arr (unsafeIndex (l,u) i)) | i <- range (l,u)]
60+    (l,u) -> [(i, arr ! i) | i <- range (l,u)]
61hunk ./Data/Array/Base.hs 318
62-accumArray :: (IArray a e, Ix i)
63-       => (e -> e' -> e)       -- ^ An accumulating function
64-       -> e                    -- ^ A default element
65-       -> (i,i)                -- ^ The bounds of the array
66-       -> [(i, e')]            -- ^ List of associations
67-       -> a i e                -- ^ Returns: the array
68+accumArray :: (IArray a e, Ix i)
69+           => (e -> e' -> e)     -- ^ An accumulating function
70+           -> e                  -- ^ A default element
71+           -> (i,i)              -- ^ The bounds of the array
72+           -> [(i, e')]          -- ^ List of associations
73+           -> a i e              -- ^ Returns: the array
74hunk ./Data/Array/Base.hs 325
75-    unsafeAccumArray f init (l,u) [(index (l,u) i, e) | (i, e) <- ies]
76+    let n = safeRangeSize (l, u)
77+    in unsafeAccumArray f init (l,u)
78+                        [(safeIndex (l,u) n i, e) | (i, e) <- ies]
79hunk ./Data/Array/Base.hs 349
80-    (l,u) -> unsafeReplace arr [(index (l,u) i, e) | (i, e) <- ies]
81+    (l,u) -> unsafeReplace arr [ (safeIndex (l,u) (numElements arr) i, e)
82+                               | (i, e) <- ies]
83hunk ./Data/Array/Base.hs 362
84-    (l,u) -> unsafeAccum f arr [(index (l,u) i, e) | (i, e) <- ies]
85+    (l,u) -> let n = numElements arr
86+             in unsafeAccum f arr [(safeIndex (l,u) n i, e) | (i, e) <- ies]
87hunk ./Data/Array/Base.hs 370
88-    (l,u) -> unsafeArray (l,u) [(i, f (unsafeAt arr i)) |
89-                               i <- [0 .. rangeSize (l,u) - 1]]
90+    (l,u) -> let n = numElements arr
91+             in unsafeArray (l,u) [ (i, f (unsafeAt arr i))
92+                                  | i <- [0 .. n - 1]]
93+
94hunk ./Data/Array/Base.hs 379
95-    unsafeArray (l,u) [(unsafeIndex (l,u) i, arr ! f i) | i <- range (l,u)]
96+    array (l,u) [(i, arr ! f i) | i <- range (l,u)]
97hunk ./Data/Array/Base.hs 387
98+    {-# INLINE numElements #-}
99+    numElements      = Arr.numElements
100hunk ./Data/Array/Base.hs 420
101-data UArray i e = UArray !i !i ByteArray#
102+data UArray i e = UArray !i !i !Int ByteArray#
103hunk ./Data/Array/Base.hs 423
104-data UArray i e = UArray !i !i !ByteArray
105+data UArray i e = UArray !i !i !Int !ByteArray
106hunk ./Data/Array/Base.hs 439
107-unsafeFreezeSTUArray (STUArray l u marr#) = ST $ \s1# ->
108+unsafeFreezeSTUArray (STUArray l u n marr#) = ST $ \s1# ->
109hunk ./Data/Array/Base.hs 441
110-    (# s2#, UArray l u arr# #) }
111+    (# s2#, UArray l u n arr# #) }
112hunk ./Data/Array/Base.hs 446
113-unsafeFreezeSTUArray (STUArray l u marr) = do
114+unsafeFreezeSTUArray (STUArray l u n marr) = do
115hunk ./Data/Array/Base.hs 448
116-    return (UArray l u arr)
117+    return (UArray l u n arr)
118hunk ./Data/Array/Base.hs 483
119-eqUArray arr1@(UArray l1 u1 _) arr2@(UArray l2 u2 _) =
120-    if rangeSize (l1,u1) == 0 then rangeSize (l2,u2) == 0 else
121+eqUArray arr1@(UArray l1 u1 n1 _) arr2@(UArray l2 u2 n2 _) =
122+    if n1 == 0 then n2 == 0 else
123hunk ./Data/Array/Base.hs 486
124-    and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. rangeSize (l1,u1) - 1]]
125+    and [unsafeAt arr1 i == unsafeAt arr2 i | i <- [0 .. n1 - 1]]
126hunk ./Data/Array/Base.hs 494
127-cmpIntUArray arr1@(UArray l1 u1 _) arr2@(UArray l2 u2 _) =
128-    if rangeSize (l1,u1) == 0 then if rangeSize (l2,u2) == 0 then EQ else LT else
129-    if rangeSize (l2,u2) == 0 then GT else
130+cmpIntUArray arr1@(UArray l1 u1 n1 _) arr2@(UArray l2 u2 n2 _) =
131+    if n1 == 0 then if n2 == 0 then EQ else LT else
132+    if n2 == 0 then GT else
133hunk ./Data/Array/Base.hs 498
134-        EQ    -> foldr cmp (compare u1 u2) [0 .. rangeSize (l1, min u1 u2) - 1]
135+        EQ    -> foldr cmp (compare u1 u2) [0 .. (n1 `min` n2) - 1]
136hunk ./Data/Array/Base.hs 528
137-unsafeAtBArray (UArray _ _ arr) = readByteArray arr
138+unsafeAtBArray (UArray _ _ _ arr) = readByteArray arr
139hunk ./Data/Array/Base.hs 533
140-    bounds (UArray l u _) = (l,u)
141+    bounds (UArray l u _ _) = (l,u)
142+    {-# INLINE numElements #-}
143+    numElements (UArray _ _ n _) = n
144hunk ./Data/Array/Base.hs 540
145-    unsafeAt (UArray _ _ arr#) (I# i#) =
146+    unsafeAt (UArray _ _ _ arr#) (I# i#) =
147hunk ./Data/Array/Base.hs 545
148-    unsafeAt (UArray _ _ arr) i =
149+    unsafeAt (UArray _ _ _ arr) i =
150hunk ./Data/Array/Base.hs 557
151-    bounds (UArray l u _) = (l,u)
152+    bounds (UArray l u _ _) = (l,u)
153+    {-# INLINE numElements #-}
154+    numElements (UArray _ _ n _) = n
155hunk ./Data/Array/Base.hs 564
156-    unsafeAt (UArray _ _ arr#) (I# i#) = C# (indexWideCharArray# arr# i#)
157+    unsafeAt (UArray _ _ _ arr#) (I# i#) = C# (indexWideCharArray# arr# i#)
158hunk ./Data/Array/Base.hs 578
159-    bounds (UArray l u _) = (l,u)
160+    bounds (UArray l u _ _) = (l,u)
161+    {-# INLINE numElements #-}
162+    numElements (UArray _ _ n _) = n
163hunk ./Data/Array/Base.hs 585
164-    unsafeAt (UArray _ _ arr#) (I# i#) = I# (indexIntArray# arr# i#)
165+    unsafeAt (UArray _ _ _ arr#) (I# i#) = I# (indexIntArray# arr# i#)
166hunk ./Data/Array/Base.hs 599
167-    bounds (UArray l u _) = (l,u)
168+    bounds (UArray l u _ _) = (l,u)
169+    {-# INLINE numElements #-}
170+    numElements (UArray _ _ n _) = n
171hunk ./Data/Array/Base.hs 606
172-    unsafeAt (UArray _ _ arr#) (I# i#) = W# (indexWordArray# arr# i#)
173+    unsafeAt (UArray _ _ _ arr#) (I# i#) = W# (indexWordArray# arr# i#)
174hunk ./Data/Array/Base.hs 620
175-    bounds (UArray l u _) = (l,u)
176+    bounds (UArray l u _ _) = (l,u)
177+    {-# INLINE numElements #-}
178+    numElements (UArray _ _ n _) = n
179hunk ./Data/Array/Base.hs 627
180-    unsafeAt (UArray _ _ arr#) (I# i#) = Ptr (indexAddrArray# arr# i#)
181+    unsafeAt (UArray _ _ _ arr#) (I# i#) = Ptr (indexAddrArray# arr# i#)
182hunk ./Data/Array/Base.hs 641
183-    bounds (UArray l u _) = (l,u)
184+    bounds (UArray l u _ _) = (l,u)
185+    {-# INLINE numElements #-}
186+    numElements (UArray _ _ n _) = n
187hunk ./Data/Array/Base.hs 648
188-    unsafeAt (UArray _ _ arr#) (I# i#) = FunPtr (indexAddrArray# arr# i#)
189+    unsafeAt (UArray _ _ _ arr#) (I# i#) = FunPtr (indexAddrArray# arr# i#)
190hunk ./Data/Array/Base.hs 662
191-    bounds (UArray l u _) = (l,u)
192+    bounds (UArray l u _ _) = (l,u)
193+    {-# INLINE numElements #-}
194+    numElements (UArray _ _ n _) = n
195hunk ./Data/Array/Base.hs 669
196-    unsafeAt (UArray _ _ arr#) (I# i#) = F# (indexFloatArray# arr# i#)
197+    unsafeAt (UArray _ _ _ arr#) (I# i#) = F# (indexFloatArray# arr# i#)
198hunk ./Data/Array/Base.hs 683
199-    bounds (UArray l u _) = (l,u)
200+    bounds (UArray l u _ _) = (l,u)
201+    {-# INLINE numElements #-}
202+    numElements (UArray _ _ n _) = n
203hunk ./Data/Array/Base.hs 690
204-    unsafeAt (UArray _ _ arr#) (I# i#) = D# (indexDoubleArray# arr# i#)
205+    unsafeAt (UArray _ _ _ arr#) (I# i#) = D# (indexDoubleArray# arr# i#)
206hunk ./Data/Array/Base.hs 704
207-    bounds (UArray l u _) = (l,u)
208+    bounds (UArray l u _ _) = (l,u)
209+    {-# INLINE numElements #-}
210+    numElements (UArray _ _ n _) = n
211hunk ./Data/Array/Base.hs 711
212-    unsafeAt (UArray _ _ arr#) (I# i#) = StablePtr (indexStablePtrArray# arr# i#)
213+    unsafeAt (UArray _ _ _ arr#) (I# i#) = StablePtr (indexStablePtrArray# arr# i#)
214hunk ./Data/Array/Base.hs 733
215-    bounds (UArray l u _) = (l,u)
216+    bounds (UArray l u _ _) = (l,u)
217+    {-# INLINE numElements #-}
218+    numElements (UArray _ _ n _) = n
219hunk ./Data/Array/Base.hs 740
220-    unsafeAt (UArray _ _ arr#) (I# i#) = I8# (indexInt8Array# arr# i#)
221+    unsafeAt (UArray _ _ _ arr#) (I# i#) = I8# (indexInt8Array# arr# i#)
222hunk ./Data/Array/Base.hs 754
223-    bounds (UArray l u _) = (l,u)
224+    bounds (UArray l u _ _) = (l,u)
225+    {-# INLINE numElements #-}
226+    numElements (UArray _ _ n _) = n
227hunk ./Data/Array/Base.hs 761
228-    unsafeAt (UArray _ _ arr#) (I# i#) = I16# (indexInt16Array# arr# i#)
229+    unsafeAt (UArray _ _ _ arr#) (I# i#) = I16# (indexInt16Array# arr# i#)
230hunk ./Data/Array/Base.hs 775
231-    bounds (UArray l u _) = (l,u)
232+    bounds (UArray l u _ _) = (l,u)
233+    {-# INLINE numElements #-}
234+    numElements (UArray _ _ n _) = n
235hunk ./Data/Array/Base.hs 782
236-    unsafeAt (UArray _ _ arr#) (I# i#) = I32# (indexInt32Array# arr# i#)
237+    unsafeAt (UArray _ _ _ arr#) (I# i#) = I32# (indexInt32Array# arr# i#)
238hunk ./Data/Array/Base.hs 796
239-    bounds (UArray l u _) = (l,u)
240+    bounds (UArray l u _ _) = (l,u)
241+    {-# INLINE numElements #-}
242+    numElements (UArray _ _ n _) = n
243hunk ./Data/Array/Base.hs 803
244-    unsafeAt (UArray _ _ arr#) (I# i#) = I64# (indexInt64Array# arr# i#)
245+    unsafeAt (UArray _ _ _ arr#) (I# i#) = I64# (indexInt64Array# arr# i#)
246hunk ./Data/Array/Base.hs 817
247-    bounds (UArray l u _) = (l,u)
248+    bounds (UArray l u _ _) = (l,u)
249+    {-# INLINE numElements #-}
250+    numElements (UArray _ _ n _) = n
251hunk ./Data/Array/Base.hs 824
252-    unsafeAt (UArray _ _ arr#) (I# i#) = W8# (indexWord8Array# arr# i#)
253+    unsafeAt (UArray _ _ _ arr#) (I# i#) = W8# (indexWord8Array# arr# i#)
254hunk ./Data/Array/Base.hs 838
255-    bounds (UArray l u _) = (l,u)
256+    bounds (UArray l u _ _) = (l,u)
257+    {-# INLINE numElements #-}
258+    numElements (UArray _ _ n _) = n
259hunk ./Data/Array/Base.hs 845
260-    unsafeAt (UArray _ _ arr#) (I# i#) = W16# (indexWord16Array# arr# i#)
261+    unsafeAt (UArray _ _ _ arr#) (I# i#) = W16# (indexWord16Array# arr# i#)
262hunk ./Data/Array/Base.hs 859
263-    bounds (UArray l u _) = (l,u)
264+    bounds (UArray l u _ _) = (l,u)
265+    {-# INLINE numElements #-}
266+    numElements (UArray _ _ n _) = n
267hunk ./Data/Array/Base.hs 866
268-    unsafeAt (UArray _ _ arr#) (I# i#) = W32# (indexWord32Array# arr# i#)
269+    unsafeAt (UArray _ _ _ arr#) (I# i#) = W32# (indexWord32Array# arr# i#)
270hunk ./Data/Array/Base.hs 880
271-    bounds (UArray l u _) = (l,u)
272+    bounds (UArray l u _ _) = (l,u)
273+    {-# INLINE numElements #-}
274+    numElements (UArray _ _ n _) = n
275hunk ./Data/Array/Base.hs 887
276-    unsafeAt (UArray _ _ arr#) (I# i#) = W64# (indexWord64Array# arr# i#)
277+    unsafeAt (UArray _ _ _ arr#) (I# i#) = W64# (indexWord64Array# arr# i#)
278hunk ./Data/Array/Base.hs 929
279-    getBounds   :: Ix i => a i e -> m (i,i)
280+    getBounds      :: Ix i => a i e -> m (i,i)
281+    -- | Returns the number of elements in the array
282+    getNumElements :: Ix i => a i e -> m Int
283hunk ./Data/Array/Base.hs 955
284+        let n = safeRangeSize (l,u)
285hunk ./Data/Array/Base.hs 957
286-        sequence_ [unsafeWrite marr i init | i <- [0 .. rangeSize (l,u) - 1]]
287+        sequence_ [unsafeWrite marr i init | i <- [0 .. n - 1]]
288hunk ./Data/Array/Base.hs 988
289-    let n = rangeSize (l,u)
290+    let n = safeRangeSize (l,u)
291hunk ./Data/Array/Base.hs 1001
292-  unsafeRead marr (index (l,u) i)
293+  n <- getNumElements marr
294+  unsafeRead marr (safeIndex (l,u) n i)
295hunk ./Data/Array/Base.hs 1009
296-  unsafeWrite marr (index (l,u) i) e
297+  n <- getNumElements marr
298+  unsafeWrite marr (safeIndex (l,u) n i) e
299hunk ./Data/Array/Base.hs 1017
300-  sequence [unsafeRead marr i | i <- [0 .. rangeSize (l,u) - 1]]
301+  n <- getNumElements marr
302+  sequence [unsafeRead marr i | i <- [0 .. n - 1]]
303hunk ./Data/Array/Base.hs 1026
304-  sequence [ do e <- unsafeRead marr (index (l,u) i); return (i,e)
305+  n <- getNumElements marr
306+  sequence [ do e <- unsafeRead marr (safeIndex (l,u) n i); return (i,e)
307hunk ./Data/Array/Base.hs 1036
308+  n <- getNumElements marr
309hunk ./Data/Array/Base.hs 1041
310-        | i <- [0 .. rangeSize (l,u) - 1]]
311+        | i <- [0 .. n - 1]]
312hunk ./Data/Array/Base.hs 1048
313-mapIndices (l,u) f marr = do
314-    marr' <- newArray_ (l,u)
315+mapIndices (l',u') f marr = do
316+    marr' <- newArray_ (l',u')
317+    n' <- getNumElements marr'
318hunk ./Data/Array/Base.hs 1052
319-        e <- readArray marr (f i)
320-        unsafeWrite marr' (unsafeIndex (l,u) i) e
321-        | i <- range (l,u)]
322+        e <- readArray marr (f i')
323+        unsafeWrite marr' (safeIndex (l',u') n' i') e
324+        | i' <- range (l',u')]
325hunk ./Data/Array/Base.hs 1063
326+    {-# INLINE getNumElements #-}
327+    getNumElements arr = return $! ArrST.numElementsSTArray arr
328hunk ./Data/Array/Base.hs 1075
329+    {-# INLINE getNumElements #-}
330+    getNumElements arr = strictToLazyST (return $! ArrST.numElementsSTArray arr)
331hunk ./Data/Array/Base.hs 1107
332-data STUArray s i a = STUArray !i !i (MutableByteArray# s)
333+data STUArray s i a = STUArray !i !i !Int (MutableByteArray# s)
334hunk ./Data/Array/Base.hs 1110
335-data STUArray s i a = STUArray !i !i !(MutableByteArray s)
336+data STUArray s i a = STUArray !i !i !Int !(MutableByteArray s)
337hunk ./Data/Array/Base.hs 1116
338+{-# INLINE unsafeNewArraySTUArray_ #-}
339+unsafeNewArraySTUArray_ :: Ix i
340+                        => (i,i) -> (Int# -> Int#) -> ST s (STUArray s i e)
341+unsafeNewArraySTUArray_ (l,u) elemsToBytes
342+ = case rangeSize (l,u) of
343+       n@(I# n#) ->
344+           ST $ \s1# ->
345+               case newByteArray# (elemsToBytes n#) s1# of
346+                   (# s2#, marr# #) ->
347+                       (# s2#, STUArray l u n marr# #)
348+
349hunk ./Data/Array/Base.hs 1129
350-    getBounds (STUArray l u _) = return (l,u)
351+    getBounds (STUArray l u _ _) = return (l,u)
352+    {-# INLINE getNumElements #-}
353+    getNumElements (STUArray _ _ n _) = return n
354hunk ./Data/Array/Base.hs 1134
355-        case rangeSize (l,u)            of { I# n# ->
356+        case safeRangeSize (l,u)            of { n@(I# n#) ->
357hunk ./Data/Array/Base.hs 1142
358-        (# s3#, STUArray l u marr# #) }}}}
359+        (# s3#, STUArray l u n marr# #) }}}}
360hunk ./Data/Array/Base.hs 1146
361-    unsafeNewArray_ (l,u) = ST $ \s1# ->
362-        case rangeSize (l,u)            of { I# n# ->
363-        case newByteArray# (bOOL_SCALE n#) s1# of { (# s2#, marr# #) ->
364-        (# s2#, STUArray l u marr# #) }}
365+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) bOOL_SCALE
366hunk ./Data/Array/Base.hs 1150
367-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
368+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
369hunk ./Data/Array/Base.hs 1154
370-    unsafeWrite (STUArray _ _ marr#) (I# i#) e = ST $ \s1# ->
371+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) e = ST $ \s1# ->
372hunk ./Data/Array/Base.hs 1164
373-    getBounds (STUArray l u _) = return (l,u)
374+    getBounds (STUArray l u _ _) = return (l,u)
375+    {-# INLINE getNumElements #-}
376+    getNumElements (STUArray _ _ n _) = return n
377hunk ./Data/Array/Base.hs 1168
378-    unsafeNewArray_ (l,u) = ST $ \s1# ->
379-        case rangeSize (l,u)            of { I# n# ->
380-        case newByteArray# (n# *# 4#) s1# of { (# s2#, marr# #) ->
381-        (# s2#, STUArray l u marr# #) }}
382+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 4#)
383hunk ./Data/Array/Base.hs 1172
384-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
385+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
386hunk ./Data/Array/Base.hs 1176
387-    unsafeWrite (STUArray _ _ marr#) (I# i#) (C# e#) = ST $ \s1# ->
388+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (C# e#) = ST $ \s1# ->
389hunk ./Data/Array/Base.hs 1182
390-    getBounds (STUArray l u _) = return (l,u)
391+    getBounds (STUArray l u _ _) = return (l,u)
392+    {-# INLINE getNumElements #-}
393+    getNumElements (STUArray _ _ n _) = return n
394hunk ./Data/Array/Base.hs 1186
395-    unsafeNewArray_ (l,u) = ST $ \s1# ->
396-        case rangeSize (l,u)            of { I# n# ->
397-        case newByteArray# (wORD_SCALE n#) s1# of { (# s2#, marr# #) ->
398-        (# s2#, STUArray l u marr# #) }}
399+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) wORD_SCALE
400hunk ./Data/Array/Base.hs 1190
401-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
402+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
403hunk ./Data/Array/Base.hs 1194
404-    unsafeWrite (STUArray _ _ marr#) (I# i#) (I# e#) = ST $ \s1# ->
405+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (I# e#) = ST $ \s1# ->
406hunk ./Data/Array/Base.hs 1200
407-    getBounds (STUArray l u _) = return (l,u)
408+    getBounds (STUArray l u _ _) = return (l,u)
409+    {-# INLINE getNumElements #-}
410+    getNumElements (STUArray _ _ n _) = return n
411hunk ./Data/Array/Base.hs 1204
412-    unsafeNewArray_ (l,u) = ST $ \s1# ->
413-        case rangeSize (l,u)            of { I# n# ->
414-        case newByteArray# (wORD_SCALE n#) s1# of { (# s2#, marr# #) ->
415-        (# s2#, STUArray l u marr# #) }}
416+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) wORD_SCALE
417hunk ./Data/Array/Base.hs 1208
418-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
419+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
420hunk ./Data/Array/Base.hs 1212
421-    unsafeWrite (STUArray _ _ marr#) (I# i#) (W# e#) = ST $ \s1# ->
422+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (W# e#) = ST $ \s1# ->
423hunk ./Data/Array/Base.hs 1218
424-    getBounds (STUArray l u _) = return (l,u)
425+    getBounds (STUArray l u _ _) = return (l,u)
426+    {-# INLINE getNumElements #-}
427+    getNumElements (STUArray _ _ n _) = return n
428hunk ./Data/Array/Base.hs 1222
429-    unsafeNewArray_ (l,u) = ST $ \s1# ->
430-        case rangeSize (l,u)            of { I# n# ->
431-        case newByteArray# (wORD_SCALE n#) s1# of { (# s2#, marr# #) ->
432-        (# s2#, STUArray l u marr# #) }}
433+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) wORD_SCALE
434hunk ./Data/Array/Base.hs 1226
435-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
436+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
437hunk ./Data/Array/Base.hs 1230
438-    unsafeWrite (STUArray _ _ marr#) (I# i#) (Ptr e#) = ST $ \s1# ->
439+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (Ptr e#) = ST $ \s1# ->
440hunk ./Data/Array/Base.hs 1236
441-    getBounds (STUArray l u _) = return (l,u)
442+    getBounds (STUArray l u _ _) = return (l,u)
443+    {-# INLINE getNumElements #-}
444+    getNumElements (STUArray _ _ n _) = return n
445hunk ./Data/Array/Base.hs 1240
446-    unsafeNewArray_ (l,u) = ST $ \s1# ->
447-        case rangeSize (l,u)            of { I# n# ->
448-        case newByteArray# (wORD_SCALE n#) s1# of { (# s2#, marr# #) ->
449-        (# s2#, STUArray l u marr# #) }}
450+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) wORD_SCALE
451hunk ./Data/Array/Base.hs 1244
452-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
453+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
454hunk ./Data/Array/Base.hs 1248
455-    unsafeWrite (STUArray _ _ marr#) (I# i#) (FunPtr e#) = ST $ \s1# ->
456+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (FunPtr e#) = ST $ \s1# ->
457hunk ./Data/Array/Base.hs 1254
458-    getBounds (STUArray l u _) = return (l,u)
459+    getBounds (STUArray l u _ _) = return (l,u)
460+    {-# INLINE getNumElements #-}
461+    getNumElements (STUArray _ _ n _) = return n
462hunk ./Data/Array/Base.hs 1258
463-    unsafeNewArray_ (l,u) = ST $ \s1# ->
464-        case rangeSize (l,u)            of { I# n# ->
465-        case newByteArray# (fLOAT_SCALE n#) s1# of { (# s2#, marr# #) ->
466-        (# s2#, STUArray l u marr# #) }}
467+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) fLOAT_SCALE
468hunk ./Data/Array/Base.hs 1262
469-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
470+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
471hunk ./Data/Array/Base.hs 1266
472-    unsafeWrite (STUArray _ _ marr#) (I# i#) (F# e#) = ST $ \s1# ->
473+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (F# e#) = ST $ \s1# ->
474hunk ./Data/Array/Base.hs 1272
475-    getBounds (STUArray l u _) = return (l,u)
476+    getBounds (STUArray l u _ _) = return (l,u)
477+    {-# INLINE getNumElements #-}
478+    getNumElements (STUArray _ _ n _) = return n
479hunk ./Data/Array/Base.hs 1276
480-    unsafeNewArray_ (l,u) = ST $ \s1# ->
481-        case rangeSize (l,u)            of { I# n# ->
482-        case newByteArray# (dOUBLE_SCALE n#) s1# of { (# s2#, marr# #) ->
483-        (# s2#, STUArray l u marr# #) }}
484+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) dOUBLE_SCALE
485hunk ./Data/Array/Base.hs 1280
486-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
487+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
488hunk ./Data/Array/Base.hs 1284
489-    unsafeWrite (STUArray _ _ marr#) (I# i#) (D# e#) = ST $ \s1# ->
490+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (D# e#) = ST $ \s1# ->
491hunk ./Data/Array/Base.hs 1290
492-    getBounds (STUArray l u _) = return (l,u)
493+    getBounds (STUArray l u _ _) = return (l,u)
494+    {-# INLINE getNumElements #-}
495+    getNumElements (STUArray _ _ n _) = return n
496hunk ./Data/Array/Base.hs 1294
497-    unsafeNewArray_ (l,u) = ST $ \s1# ->
498-        case rangeSize (l,u)            of { I# n# ->
499-        case newByteArray# (wORD_SCALE n#) s1# of { (# s2#, marr# #) ->
500-        (# s2#, STUArray l u marr# #) }}
501+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) wORD_SCALE
502hunk ./Data/Array/Base.hs 1298
503-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
504+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
505hunk ./Data/Array/Base.hs 1302
506-    unsafeWrite (STUArray _ _ marr#) (I# i#) (StablePtr e#) = ST $ \s1# ->
507+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (StablePtr e#) = ST $ \s1# ->
508hunk ./Data/Array/Base.hs 1308
509-    getBounds (STUArray l u _) = return (l,u)
510+    getBounds (STUArray l u _ _) = return (l,u)
511+    {-# INLINE getNumElements #-}
512+    getNumElements (STUArray _ _ n _) = return n
513hunk ./Data/Array/Base.hs 1312
514-    unsafeNewArray_ (l,u) = ST $ \s1# ->
515-        case rangeSize (l,u)            of { I# n# ->
516-        case newByteArray# n# s1#       of { (# s2#, marr# #) ->
517-        (# s2#, STUArray l u marr# #) }}
518+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (\x -> x)
519hunk ./Data/Array/Base.hs 1316
520-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
521+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
522hunk ./Data/Array/Base.hs 1320
523-    unsafeWrite (STUArray _ _ marr#) (I# i#) (I8# e#) = ST $ \s1# ->
524+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (I8# e#) = ST $ \s1# ->
525hunk ./Data/Array/Base.hs 1326
526-    getBounds (STUArray l u _) = return (l,u)
527+    getBounds (STUArray l u _ _) = return (l,u)
528+    {-# INLINE getNumElements #-}
529+    getNumElements (STUArray _ _ n _) = return n
530hunk ./Data/Array/Base.hs 1330
531-    unsafeNewArray_ (l,u) = ST $ \s1# ->
532-        case rangeSize (l,u)            of { I# n# ->
533-        case newByteArray# (n# *# 2#) s1# of { (# s2#, marr# #) ->
534-        (# s2#, STUArray l u marr# #) }}
535+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 2#)
536hunk ./Data/Array/Base.hs 1334
537-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
538+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
539hunk ./Data/Array/Base.hs 1338
540-    unsafeWrite (STUArray _ _ marr#) (I# i#) (I16# e#) = ST $ \s1# ->
541+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (I16# e#) = ST $ \s1# ->
542hunk ./Data/Array/Base.hs 1344
543-    getBounds (STUArray l u _) = return (l,u)
544+    getBounds (STUArray l u _ _) = return (l,u)
545+    {-# INLINE getNumElements #-}
546+    getNumElements (STUArray _ _ n _) = return n
547hunk ./Data/Array/Base.hs 1348
548-    unsafeNewArray_ (l,u) = ST $ \s1# ->
549-        case rangeSize (l,u)            of { I# n# ->
550-        case newByteArray# (n# *# 4#) s1# of { (# s2#, marr# #) ->
551-        (# s2#, STUArray l u marr# #) }}
552+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 4#)
553hunk ./Data/Array/Base.hs 1352
554-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
555+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
556hunk ./Data/Array/Base.hs 1356
557-    unsafeWrite (STUArray _ _ marr#) (I# i#) (I32# e#) = ST $ \s1# ->
558+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (I32# e#) = ST $ \s1# ->
559hunk ./Data/Array/Base.hs 1362
560-    getBounds (STUArray l u _) = return (l,u)
561+    getBounds (STUArray l u _ _) = return (l,u)
562+    {-# INLINE getNumElements #-}
563+    getNumElements (STUArray _ _ n _) = return n
564hunk ./Data/Array/Base.hs 1366
565-    unsafeNewArray_ (l,u) = ST $ \s1# ->
566-        case rangeSize (l,u)            of { I# n# ->
567-        case newByteArray# (n# *# 8#) s1# of { (# s2#, marr# #) ->
568-        (# s2#, STUArray l u marr# #) }}
569+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 8#)
570hunk ./Data/Array/Base.hs 1370
571-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
572+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
573hunk ./Data/Array/Base.hs 1374
574-    unsafeWrite (STUArray _ _ marr#) (I# i#) (I64# e#) = ST $ \s1# ->
575+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (I64# e#) = ST $ \s1# ->
576hunk ./Data/Array/Base.hs 1380
577-    getBounds (STUArray l u _) = return (l,u)
578+    getBounds (STUArray l u _ _) = return (l,u)
579+    {-# INLINE getNumElements #-}
580+    getNumElements (STUArray _ _ n _) = return n
581hunk ./Data/Array/Base.hs 1384
582-    unsafeNewArray_ (l,u) = ST $ \s1# ->
583-        case rangeSize (l,u)            of { I# n# ->
584-        case newByteArray# n# s1#       of { (# s2#, marr# #) ->
585-        (# s2#, STUArray l u marr# #) }}
586+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (\x -> x)
587hunk ./Data/Array/Base.hs 1388
588-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
589+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
590hunk ./Data/Array/Base.hs 1392
591-    unsafeWrite (STUArray _ _ marr#) (I# i#) (W8# e#) = ST $ \s1# ->
592+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (W8# e#) = ST $ \s1# ->
593hunk ./Data/Array/Base.hs 1398
594-    getBounds (STUArray l u _) = return (l,u)
595+    getBounds (STUArray l u _ _) = return (l,u)
596+    {-# INLINE getNumElements #-}
597+    getNumElements (STUArray _ _ n _) = return n
598hunk ./Data/Array/Base.hs 1402
599-    unsafeNewArray_ (l,u) = ST $ \s1# ->
600-        case rangeSize (l,u)            of { I# n# ->
601-        case newByteArray# (n# *# 2#) s1# of { (# s2#, marr# #) ->
602-        (# s2#, STUArray l u marr# #) }}
603+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 2#)
604hunk ./Data/Array/Base.hs 1406
605-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
606+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
607hunk ./Data/Array/Base.hs 1410
608-    unsafeWrite (STUArray _ _ marr#) (I# i#) (W16# e#) = ST $ \s1# ->
609+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (W16# e#) = ST $ \s1# ->
610hunk ./Data/Array/Base.hs 1416
611-    getBounds (STUArray l u _) = return (l,u)
612+    getBounds (STUArray l u _ _) = return (l,u)
613+    {-# INLINE getNumElements #-}
614+    getNumElements (STUArray _ _ n _) = return n
615hunk ./Data/Array/Base.hs 1420
616-    unsafeNewArray_ (l,u) = ST $ \s1# ->
617-        case rangeSize (l,u)            of { I# n# ->
618-        case newByteArray# (n# *# 4#) s1# of { (# s2#, marr# #) ->
619-        (# s2#, STUArray l u marr# #) }}
620+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 4#)
621hunk ./Data/Array/Base.hs 1424
622-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
623+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
624hunk ./Data/Array/Base.hs 1428
625-    unsafeWrite (STUArray _ _ marr#) (I# i#) (W32# e#) = ST $ \s1# ->
626+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (W32# e#) = ST $ \s1# ->
627hunk ./Data/Array/Base.hs 1434
628-    getBounds (STUArray l u _) = return (l,u)
629+    getBounds (STUArray l u _ _) = return (l,u)
630+    {-# INLINE getNumElements #-}
631+    getNumElements (STUArray _ _ n _) = return n
632hunk ./Data/Array/Base.hs 1438
633-    unsafeNewArray_ (l,u) = ST $ \s1# ->
634-        case rangeSize (l,u)            of { I# n# ->
635-        case newByteArray# (n# *# 8#) s1# of { (# s2#, marr# #) ->
636-        (# s2#, STUArray l u marr# #) }}
637+    unsafeNewArray_ (l,u) = unsafeNewArraySTUArray_ (l,u) (*# 8#)
638hunk ./Data/Array/Base.hs 1442
639-    unsafeRead (STUArray _ _ marr#) (I# i#) = ST $ \s1# ->
640+    unsafeRead (STUArray _ _ _ marr#) (I# i#) = ST $ \s1# ->
641hunk ./Data/Array/Base.hs 1446
642-    unsafeWrite (STUArray _ _ marr#) (I# i#) (W64# e#) = ST $ \s1# ->
643+    unsafeWrite (STUArray _ _ _ marr#) (I# i#) (W64# e#) = ST $ \s1# ->
644hunk ./Data/Array/Base.hs 1482
645-       marr <- newMutableByteArray (rangeSize (l,u) * sizeOf dummy)
646-       return (STUArray l u marr)
647+        let n = safeRangeSize (l,u)
648+        marr <- newMutableByteArray (n * sizeOf dummy)
649+        return (STUArray l u n marr)
650hunk ./Data/Array/Base.hs 1487
651-unsafeReadMBArray (STUArray _ _ marr) = readMutableByteArray marr
652+unsafeReadMBArray (STUArray _ _ _ marr) = readMutableByteArray marr
653hunk ./Data/Array/Base.hs 1490
654-unsafeWriteMBArray (STUArray _ _ marr) = writeMutableByteArray marr
655+unsafeWriteMBArray (STUArray _ _ _ marr) = writeMutableByteArray marr
656+
657+getBoundsMBArray :: Storable e => STUArray s i e -> (i, i)
658+getBoundsMBArray (STUArray l u _ _) = return (l,u)
659hunk ./Data/Array/Base.hs 1495
660-getBoundsMBArray (STUArray l u _) = return (l,u)
661+getNumElementsMBArray :: Storable e => STUArray s i e -> Int
662+getNumElementsMBArray (STUArray _ _ n _) = return n
663hunk ./Data/Array/Base.hs 1500
664+    getNumElements = getNumElementsMBArray
665hunk ./Data/Array/Base.hs 1502
666-        marr <- newMutableByteArray (bOOL_SCALE (rangeSize (l,u)))
667-        return (STUArray l u marr)
668+        let n = rangeSize (l,u)
669+        marr <- newMutableByteArray (bOOL_SCALE n)
670+        return (STUArray l u n marr)
671hunk ./Data/Array/Base.hs 1506
672-    unsafeRead (STUArray _ _ marr) i = do
673+    unsafeRead (STUArray _ _ _ marr) i = do
674hunk ./Data/Array/Base.hs 1511
675-    unsafeWrite (STUArray _ _ marr) i e = do
676+    unsafeWrite (STUArray _ _ _ marr) i e = do
677hunk ./Data/Array/Base.hs 1520
678+    getNumElements = getNumElementsMBArray
679hunk ./Data/Array/Base.hs 1528
680+    getNumElements = getNumElementsMBArray
681hunk ./Data/Array/Base.hs 1536
682+    getNumElements = getNumElementsMBArray
683hunk ./Data/Array/Base.hs 1544
684+    getNumElements = getNumElementsMBArray
685hunk ./Data/Array/Base.hs 1552
686+    getNumElements = getNumElementsMBArray
687hunk ./Data/Array/Base.hs 1560
688+    getNumElements = getNumElementsMBArray
689hunk ./Data/Array/Base.hs 1568
690+    getNumElements = getNumElementsMBArray
691hunk ./Data/Array/Base.hs 1576
692+    getNumElements = getNumElementsMBArray
693hunk ./Data/Array/Base.hs 1584
694+    getNumElements = getNumElementsMBArray
695hunk ./Data/Array/Base.hs 1592
696+    getNumElements = getNumElementsMBArray
697hunk ./Data/Array/Base.hs 1600
698+    getNumElements = getNumElementsMBArray
699hunk ./Data/Array/Base.hs 1608
700+    getNumElements = getNumElementsMBArray
701hunk ./Data/Array/Base.hs 1616
702+    getNumElements = getNumElementsMBArray
703hunk ./Data/Array/Base.hs 1624
704+    getNumElements = getNumElementsMBArray
705hunk ./Data/Array/Base.hs 1632
706+    getNumElements = getNumElementsMBArray
707hunk ./Data/Array/Base.hs 1640
708+    getNumElements = getNumElementsMBArray
709hunk ./Data/Array/Base.hs 1669
710+  n <- getNumElements marr
711hunk ./Data/Array/Base.hs 1671
712-                   | i <- [0 .. rangeSize (l,u) - 1]]
713+                   | i <- [0 .. n - 1]]
714+  -- The old array may be lying about the number of elements in
715+  -- (l,u), so recalculate it to be safe.
716+  let n' = safeRangeSize (l,u)
717hunk ./Data/Array/Base.hs 1679
718-freezeSTUArray (STUArray l u marr#) = ST $ \s1# ->
719+freezeSTUArray (STUArray l u n marr#) = ST $ \s1# ->
720hunk ./Data/Array/Base.hs 1685
721-    (# s4#, UArray l u arr# #) }}}}}
722+    (# s4#, UArray l u n arr# #) }}}}}
723hunk ./Data/Array/Base.hs 1748
724-    sequence_ [unsafeWrite marr i (unsafeAt arr i)
725-               | i <- [0 .. rangeSize (l,u) - 1]]
726+    let n = safeRangeSize (l,u)
727+    sequence_ [ unsafeWrite marr i (unsafeAt arr i)
728+              | i <- [0 .. n - 1]]
729hunk ./Data/Array/Base.hs 1755
730-thawSTUArray (UArray l u arr#) = ST $ \s1# ->
731+thawSTUArray (UArray l u n arr#) = ST $ \s1# ->
732hunk ./Data/Array/Base.hs 1760
733-    (# s3#, STUArray l u marr# #) }}}}
734+    (# s3#, STUArray l u n marr# #) }}}}
735hunk ./Data/Array/Base.hs 1774
736-thawSTUArray (UArray l u arr) = do
737+thawSTUArray (UArray l u n arr) = do
738hunk ./Data/Array/Base.hs 1776
739-    return (STUArray l u marr)
740+    return (STUArray l u n marr)
741hunk ./Data/Array/Base.hs 1824
742-unsafeThawSTUArray (UArray l u marr#) =
743-    return (STUArray l u (unsafeCoerce# marr#))
744+unsafeThawSTUArray (UArray l u n marr#) =
745+    return (STUArray l u n (unsafeCoerce# marr#))
746hunk ./Data/Array/Base.hs 1839
747-castSTUArray (STUArray l u marr#) = return (STUArray l u marr#)
748+castSTUArray (STUArray l u n marr#) = return (STUArray l u n marr#)
749hunk ./Data/Array/Base.hs 1844
750-castSTUArray (STUArray l u marr) = return (STUArray l u marr)
751+castSTUArray (STUArray l u n marr) = return (STUArray l u n marr)
752hunk ./Data/Array/Diff.hs 166
753+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
754hunk ./Data/Array/Diff.hs 173
755+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
756hunk ./Data/Array/Diff.hs 180
757+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
758hunk ./Data/Array/Diff.hs 187
759+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
760hunk ./Data/Array/Diff.hs 194
761+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
762hunk ./Data/Array/Diff.hs 201
763+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
764hunk ./Data/Array/Diff.hs 208
765+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
766hunk ./Data/Array/Diff.hs 215
767+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
768hunk ./Data/Array/Diff.hs 222
769+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
770hunk ./Data/Array/Diff.hs 229
771+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
772hunk ./Data/Array/Diff.hs 236
773+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
774hunk ./Data/Array/Diff.hs 243
775+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
776hunk ./Data/Array/Diff.hs 250
777+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
778hunk ./Data/Array/Diff.hs 257
779+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
780hunk ./Data/Array/Diff.hs 264
781+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
782hunk ./Data/Array/Diff.hs 271
783+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
784hunk ./Data/Array/Diff.hs 278
785+    numElements   a      = unsafePerformIO $ numElementsDiffArray a
786hunk ./Data/Array/Diff.hs 373
787+numElementsDiffArray :: (MArray a e IO, Ix ix)
788+                     => IOToDiffArray a ix e
789+                     -> IO Int
790+numElementsDiffArray a
791+ = do d <- readMVar (varDiffArray a)
792+      case d of
793+          Current a' -> getNumElements a'
794+          Diff a' _  -> numElementsDiffArray a'
795+
796hunk ./Data/Array/IO/Internals.hs 54
797+    getNumElements = return . getNumElementsIOArray
798hunk ./Data/Array/IO/Internals.hs 58
799+    {-# INLINE getNumElements #-}
800+    getNumElements (IOArray marr) = stToIO $ getNumElements marr
801hunk ./Data/Array/IO/Internals.hs 83
802+    {-# INLINE getNumElements #-}
803+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
804hunk ./Data/Array/IO/Internals.hs 101
805+    {-# INLINE getNumElements #-}
806+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
807hunk ./Data/Array/IO/Internals.hs 119
808+    {-# INLINE getNumElements #-}
809+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
810hunk ./Data/Array/IO/Internals.hs 137
811+    {-# INLINE getNumElements #-}
812+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
813hunk ./Data/Array/IO/Internals.hs 155
814+    {-# INLINE getNumElements #-}
815+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
816hunk ./Data/Array/IO/Internals.hs 173
817+    {-# INLINE getNumElements #-}
818+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
819hunk ./Data/Array/IO/Internals.hs 191
820+    {-# INLINE getNumElements #-}
821+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
822hunk ./Data/Array/IO/Internals.hs 209
823+    {-# INLINE getNumElements #-}
824+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
825hunk ./Data/Array/IO/Internals.hs 227
826+    {-# INLINE getNumElements #-}
827+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
828hunk ./Data/Array/IO/Internals.hs 245
829+    {-# INLINE getNumElements #-}
830+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
831hunk ./Data/Array/IO/Internals.hs 263
832+    {-# INLINE getNumElements #-}
833+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
834hunk ./Data/Array/IO/Internals.hs 281
835+    {-# INLINE getNumElements #-}
836+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
837hunk ./Data/Array/IO/Internals.hs 299
838+    {-# INLINE getNumElements #-}
839+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
840hunk ./Data/Array/IO/Internals.hs 317
841+    {-# INLINE getNumElements #-}
842+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
843hunk ./Data/Array/IO/Internals.hs 335
844+    {-# INLINE getNumElements #-}
845+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
846hunk ./Data/Array/IO/Internals.hs 353
847+    {-# INLINE getNumElements #-}
848+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
849hunk ./Data/Array/IO/Internals.hs 371
850+    {-# INLINE getNumElements #-}
851+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr
852hunk ./Data/Array/IO.hs 131
853-hGetArray handle (IOUArray (STUArray l u ptr)) count
854+hGetArray handle (IOUArray (STUArray l u n ptr)) count
855hunk ./Data/Array/IO.hs 134
856-  | count < 0 || count > rangeSize (l,u)
857+  | count < 0 || count > n
858hunk ./Data/Array/IO.hs 183
859-hPutArray handle (IOUArray (STUArray l u raw)) count
860+hPutArray handle (IOUArray (STUArray l u n raw)) count
861hunk ./Data/Array/IO.hs 186
862-  | count < 0 || count > rangeSize (l,u)
863+  | count < 0 || count > n
864hunk ./Data/Array/Storable.hs 50
865-data StorableArray i e = StorableArray !i !i !(ForeignPtr e)
866+data StorableArray i e = StorableArray !i !i Int !(ForeignPtr e)
867hunk ./Data/Array/Storable.hs 53
868-    getBounds (StorableArray l u _) = return (l,u)
869+    getBounds (StorableArray l u _ _) = return (l,u)
870+
871+    getNumElements (StorableArray l u n _) = return n
872hunk ./Data/Array/Storable.hs 61
873-        return (StorableArray l u fp)
874+        return (StorableArray l u size fp)
875hunk ./Data/Array/Storable.hs 66
876-        fp <- mallocForeignPtrArray (rangeSize (l,u))
877-        return (StorableArray l u fp)
878+        let n = rangeSize (l,u)
879+        fp <- mallocForeignPtrArray n
880+        return (StorableArray l u n fp)
881hunk ./Data/Array/Storable.hs 71
882-       
883-    unsafeRead (StorableArray _ _ fp) i =
884+
885+    unsafeRead (StorableArray _ _ _ fp) i =
886hunk ./Data/Array/Storable.hs 75
887-    unsafeWrite (StorableArray _ _ fp) i e =
888+    unsafeWrite (StorableArray _ _ _ fp) i e =
889hunk ./Data/Array/Storable.hs 83
890-withStorableArray (StorableArray _ _ fp) f = withForeignPtr fp f
891+withStorableArray (StorableArray _ _ _ fp) f = withForeignPtr fp f
892hunk ./Data/Array/Storable.hs 89
893-touchStorableArray (StorableArray _ _ fp) = touchForeignPtr fp
894+touchStorableArray (StorableArray _ _ _ fp) = touchForeignPtr fp
895hunk ./Data/Array/Storable.hs 94
896-unsafeForeignPtrToStorableArray
897-   :: ForeignPtr e -> (i,i) -> IO (StorableArray i e)
898+unsafeForeignPtrToStorableArray
899+   :: Ix i => ForeignPtr e -> (i,i) -> IO (StorableArray i e)
900hunk ./Data/Array/Storable.hs 97
901-   return (StorableArray l u p)
902+   return (StorableArray l u (rangeSize (l,u)) p)
903}
904
905Context:
906
907[Remove the rest of base to leave an "array" package
908Ian Lynagh <igloo@earth.li>**20070801235500]
909[Remove a number of modules now in a "containers" package
910Ian Lynagh <igloo@earth.li>**20070801223858]
911[Temporarily fix breakage for nhc98.
912Malcolm.Wallace@cs.york.ac.uk**20070801163750
913 A recent patch to System.IO introduced a cyclic dependency on Foreign.C.Error,
914 and also inadvertently dragged along System.Posix.Internals which has
915 non-H'98 layout, causing many build problems.  The solution for now
916 is to #ifndef __NHC__ all of the recent the openTempFile additions,
917 and mark them non-portable once again.  (I also took the opportunity
918 to note a number of other non-portable functions in their Haddock
919 comments.)
920]
921[Generalise the type of synthesize, as suggested by Trac #1571
922simonpj@microsoft**20070801125208
923 
924 I have not looked at the details, but the type checker is happy with the
925 more general type, and more general types are usually a Good Thing.
926 
927]
928[Fix fdToHandle on Windows
929Ian Lynagh <igloo@earth.li>**20070730133139
930 The old setmode code was throwing an exception, and I'm not sure it is
931 meant to do what we need anyway. For now we assume that all FDs are
932 both readable and writable.
933]
934[Handle buffers should be allocated with newPinnedByteArray# always
935Simon Marlow <simonmar@microsoft.com>**20070725095550
936 Not just on Windows.  This change is required because we now use safe
937 foreign calls for I/O on blocking file descriptors with the threaded
938 RTS.  Exposed by concio001.thr on MacOS X: MacOS apparently uses
939 smaller buffers by default, so they weren't being allocated as large
940 objects.
941 
942]
943[Remove System.Posix.Signals (moving to unix)
944Ian Lynagh <igloo@earth.li>**20070729215213]
945[Correct Windows OS name in cabal configuration
946Ian Lynagh <igloo@earth.li>**20070729161739]
947[bytestring is now in its own package
948Ian Lynagh <igloo@earth.li>**20070729132215]
949[Use cabal configurations rather than Setup hacks
950Ian Lynagh <igloo@earth.li>**20070729132157]
951[Export throwErrnoPath* functions
952Ian Lynagh <igloo@earth.li>**20070722002923]
953[Add simple haddock docs for throwErrnoPath* functions
954Ian Lynagh <igloo@earth.li>**20070722002817]
955[Move throwErrnoPath* functions from unix:System.Posix.Error
956Ian Lynagh <igloo@earth.li>**20070722002746]
957[fix Hugs implementation of openTempFile
958Ross Paterson <ross@soi.city.ac.uk>**20070724114003]
959[Hugs only: avoid dependency cycle
960Ross Paterson <ross@soi.city.ac.uk>**20070724113852]
961[open(Binary)TempFile is now portable
962Ian Lynagh <igloo@earth.li>**20070722152752]
963[Tweak temporary file filename chooser
964Ian Lynagh <igloo@earth.li>**20070722105445]
965[Move open(Binary)TempFile to System.IO
966Ian Lynagh <igloo@earth.li>**20070722010205]
967[Rename openFd to fdToHandle'
968Ian Lynagh <igloo@earth.li>**20070721235538
969 The name collision with System.Posix.IO.openFd made my brain hurt.
970]
971[Add a test for Data.Map, for a bug on the libraries@ list
972Ian Lynagh <igloo@earth.li>**20070721002119]
973[fix Data.Map.updateAt
974Bertram Felgenhauer <int-e@gmx.de>**20070718150340
975 See http://haskell.org/pipermail/libraries/2007-July/007785.html for a piece
976 of code triggering the bug. updateAt threw away parts of the tree making up
977 the map.
978]
979[in hClose, free the handle buffer by replacing it with an empty one
980Simon Marlow <simonmar@microsoft.com>**20070719161419
981 This helps reduce the memory requirements for a closed but unfinalised
982 Handle.
983]
984[Implement GHC.Environment.getFullArgs
985Ian Lynagh <igloo@earth.li>**20070717141918
986 This returns all the arguments, including those normally eaten by the
987 RTS (+RTS ... -RTS).
988 This is mainly for ghc-inplace, where we need to pass /all/ the
989 arguments on to the real ghc. e.g. ioref001(ghci) was failing because
990 the +RTS -K32m -RTS wasn't getting passed on.
991]
992[Define stripPrefix; fixes trac #1464
993Ian Lynagh <igloo@earth.li>**20070714235204]
994[no need to hide Maybe
995Malcolm.Wallace@cs.york.ac.uk**20070710154058]
996[Add a more efficient Data.List.foldl' for GHC (from GHC's utils/Util.lhs)
997Ian Lynagh <igloo@earth.li>**20070706205526]
998[Remove include-dirs ../../includes and ../../rts
999Ian Lynagh <igloo@earth.li>**20070705205356
1000 We get these by virtue of depending on the rts package.
1001]
1002[FIX #1131 (newArray_ allocates an array full of garbage)
1003Simon Marlow <simonmar@microsoft.com>**20070704102020
1004 Now newArray_ returns a deterministic result in the ST monad, and
1005 behaves as before in other contexts.  The current newArray_ is renamed
1006 to unsafeNewArray_; the MArray class therefore has one more method
1007 than before.
1008]
1009[change nhc98 option from -prelude to --prelude
1010Malcolm.Wallace@cs.york.ac.uk**20070702150355]
1011[Word is a type synonym in nhc98 - so class instance not permitted.
1012Malcolm.Wallace@cs.york.ac.uk**20070629122035]
1013[fix bug in writes to blocking FDs in the non-threaded RTS
1014Simon Marlow <simonmar@microsoft.com>**20070628134320]
1015[Modernize printf.
1016lennart.augustsson@credit-suisse.com**20070628083852
1017 
1018 Add instances for Int8, Int16, Int32, Int64, Word, Word8, Word16, Word32, and
1019 Word64.
1020 Handle + flag.
1021 Handle X, E, and G formatting characters.
1022 Rewrite internals to make it simpler.
1023]
1024[Speed up number printing and remove the need for Array by using the standard 'intToDigit' routine
1025John Meacham <john@repetae.net>**20070608182353]
1026[Use "--  //" (2 spaces) rather than "-- //" (1) to avoid tripping haddock up
1027Ian Lynagh <igloo@earth.li>**20070627010930
1028 Are we nearly there yet?
1029]
1030[Use a combination of Haskell/C comments to ensure robustness.
1031Malcolm.Wallace@cs.york.ac.uk**20070626095222
1032 e.g. -- // ensures that _no_ preprocessor will try to tokenise the
1033 rest of the line.
1034]
1035[Change C-style comments to Haskell-style.
1036Malcolm.Wallace@cs.york.ac.uk**20070625094515
1037 These two headers are only ever used for pre-processing Haskell code,
1038 and are never seen by any C tools except cpp.  Using the Haskell comment
1039 convention means that cpphs no longer needs to be given the --strip
1040 option to remove C comments from open code.  This is a Good Thing,
1041 because all of /* */ and // are valid Haskell operator names, and there
1042 is no compelling reason to forbid using them in files which also happen
1043 to have C-preprocessor directives.
1044]
1045[makefileHook needs to generate PrimopWrappers.hs too
1046Simon Marlow <simonmar@microsoft.com>**20070622073424]
1047[Hugs now gets MonadFix(mfix) from its prelude
1048Ross Paterson <ross@soi.city.ac.uk>**20070620000343]
1049[Typo (consUtils.hs -> consUtils.h)
1050Ian Lynagh <igloo@earth.li>**20070619124140]
1051[install dependent include files and Typeable.h
1052Bertram Felgenhauer <int-e@gmx.de>**20070613041734]
1053[update prototype following inputReady->fdReady change
1054Simon Marlow <simonmar@microsoft.com>**20070614095309]
1055[FIX hGetBuf001: cut-and-pasto in readRawBufferNoBlock
1056Simon Marlow <simonmar@microsoft.com>**20070614094222]
1057[fix description of CWStringLen
1058Ross Paterson <ross@soi.city.ac.uk>**20070605223345]
1059[Remove unsafeCoerce-importing kludgery in favor of Unsafe.Coerce
1060Isaac Dupree <id@isaac.cedarswampstudios.org>**20070601203625]
1061[--configure-option and --ghc-option are now provided by Cabal
1062Ross Paterson <ross@soi.city.ac.uk>**20070604115233]
1063[Data.PackedString: Data.Generics is GHC-only
1064Ross Paterson <ross@soi.city.ac.uk>**20070529232427]
1065[Add Data instance for PackedString; patch from greenrd in trac #1263
1066Ian Lynagh <igloo@earth.li>**20070529205420]
1067[Control.Concurrent documentation fix
1068shae@ScannedInAvian.com**20070524163325]
1069[add nhc98-options: field to .cabal file
1070Malcolm.Wallace@cs.york.ac.uk**20070528122626]
1071[add a dummy implementation of System.Timeout.timeout for nhc98
1072Malcolm.Wallace@cs.york.ac.uk**20070528110309]
1073[Add System.Timeout to base.cabal
1074Ian Lynagh <igloo@earth.li>**20070527123314
1075 Filtered out for non-GHC by Setup.hs.
1076]
1077[add module Data.Fixed to nhc98 build
1078Malcolm.Wallace@cs.york.ac.uk**20070525141021]
1079[DIRS now lives in package Makefile, not script/pkgdirlist
1080Malcolm.Wallace@cs.york.ac.uk**20070525111749]
1081[delete unused constants
1082Ross Paterson <ross@soi.city.ac.uk>**20070525001741]
1083[remove System.Cmd and System.Time too
1084Malcolm.Wallace@cs.york.ac.uk**20070524163200]
1085[remove locale as well
1086Malcolm.Wallace@cs.york.ac.uk**20070524161943]
1087[nhc98 version of instance Show (a->b) copied from Prelude
1088Malcolm.Wallace@cs.york.ac.uk**20070524160615]
1089[remove directory, pretty, and random bits from base for nhc98
1090Malcolm.Wallace@cs.york.ac.uk**20070524160608]
1091[Remove Makefile and package.conf.in (used in the old build system)
1092Ian Lynagh <igloo@earth.li>**20070524142545]
1093[Split off process package
1094Ian Lynagh <igloo@earth.li>**20070523210523]
1095[Fix comment: maperrno is in Win32Utils.c, not runProcess.c
1096Ian Lynagh <igloo@earth.li>**20070523181331]
1097[System.Locale is now split out
1098Ian Lynagh <igloo@earth.li>**20070519132638]
1099[Split off directory, random and old-time packages
1100Ian Lynagh <igloo@earth.li>**20070519120642]
1101[Remove Control.Parallel*, now in package parallel
1102Ian Lynagh <igloo@earth.li>**20070518165431]
1103[Remove the pretty-printing modules (now in package pretty(
1104Ian Lynagh <igloo@earth.li>**20070518162521]
1105[add install-includes: field
1106Simon Marlow <simonmar@microsoft.com>**20070517094948]
1107[correct the documentation for newForeignPtr
1108Simon Marlow <simonmar@microsoft.com>**20070516082019]
1109[When doing safe writes, handle EAGAIN rather than raising an exception
1110Simon Marlow <simonmar@microsoft.com>**20070515114615
1111 It might be that stdin was set to O_NONBLOCK by someone else, and we
1112 should handle this case.  (this happens with GHCi, I'm not quite sure why)
1113]
1114[Use FilePath to make paths when building GHC/Prim.hs and GHC/PrimopWrappers.hs
1115Ian Lynagh <igloo@earth.li>**20070514110409]
1116[fix imports for non-GHC
1117Ross Paterson <ross@soi.city.ac.uk>**20070513001138]
1118[Give an example of how intersection takes elements from the first set
1119Ian Lynagh <igloo@earth.li>**20070512160253]
1120[further clarify the docs for 'evaluate'
1121Malcolm.Wallace@cs.york.ac.uk**20070508101124]
1122[improve documentation for evaluate
1123Simon Marlow <simonmar@microsoft.com>**20070508081712]
1124[FIX: #724 (tee complains if used in a process started by ghc)
1125Simon Marlow <simonmar@microsoft.com>**20070507123537
1126 
1127 Now, we only set O_NONBLOCK on file descriptors that we create
1128 ourselves.  File descriptors that we inherit (stdin, stdout, stderr)
1129 are kept in blocking mode.  The way we deal with this differs between
1130 the threaded and non-threaded runtimes:
1131 
1132  - with -threaded, we just make a safe foreign call to read(), which
1133    may block, but this is ok.
1134 
1135  - without -threaded, we test the descriptor with select() before
1136    attempting any I/O.  This isn't completely safe - someone else
1137    might read the data between the select() and the read() - but it's
1138    a reasonable compromise and doesn't seem to measurably affect
1139    performance.
1140]
1141[the "unknown" types are no longer required
1142Simon Marlow <simonmar@microsoft.com>**20070426135931]
1143[Build GHC/Prim.hs and GHC/PrimopWrappers.hs from Cabal
1144Ian Lynagh <igloo@earth.li>**20070509142655]
1145[Make Control.Exception buildable by nhc98.
1146Malcolm.Wallace@cs.york.ac.uk**20070504105548
1147 The nhc98 does not have true exceptions, but these additions should be
1148 enough infrastructure to pretend that it does.  Only IO exceptions will
1149 actually work.
1150]
1151[Trim imports, remove a cycle
1152simonpj@microsoft**20070503123010
1153 
1154 A first attempt at removing gratuitous cycles in the base package.
1155 I've removed the useless module GHC.Dynamic, which gets rid of a cycle;
1156 and trimmed off various unnecesary imports.
1157 
1158 This also fixes the IsString import problem.
1159 
1160]
1161[Be less quiet about building the base package
1162simonpj@microsoft**20070503093707]
1163[Remove Splittable class (a vestige of linear implicit parameters)
1164simonpj@microsoft**20070221104329]
1165[Add IsString to exports of GHC.Exts
1166simonpj@microsoft**20070221104249]
1167[tweak documentation as per suggestion from Marc Weber on libraries@haskell.org
1168Simon Marlow <simonmar@microsoft.com>**20070426075921]
1169[Add extra libraries when compiling with GHC on Windows
1170Ian Lynagh <igloo@earth.li>**20070424213127]
1171[Follow Cabal changes in Setup.hs
1172Ian Lynagh <igloo@earth.li>**20070418114345]
1173[inclusion of libc.h is conditional on __APPLE__
1174Malcolm.Wallace@cs.york.ac.uk**20070417085556]
1175[MERGE: fix ugly uses of memcpy foreign import inside ST
1176Simon Marlow <simonmar@microsoft.com>**20070416101530
1177 fixes cg026
1178]
1179[Fix configure with no --with-cc
1180Ian Lynagh <igloo@earth.li>**20070415165143]
1181[MacOS 10.3 needs #include <libc.h> as well
1182Malcolm.Wallace@cs.york.ac.uk**20070414155507]
1183[For nhc98 only, use hsc2hs to determine System.Posix.Types.
1184Malcolm.Wallace@cs.york.ac.uk**20070413155831
1185 Avoids the existing autoconf stuff, by introducing an auxiliary module
1186 called NHC.PosixTypes that uses hsc2hs, which is then simply re-exported
1187 from System.Posix.Types.
1188]
1189[we need a makefileHook too
1190Simon Marlow <simonmar@microsoft.com>**20070413151307]
1191[Remove unnecesary SOURCE import of GHC.Err in GHC.Pack
1192Ian Lynagh <igloo@earth.li>**20070412235908]
1193[add System.Posix.Types to default nhc98 build
1194Malcolm.Wallace@cs.york.ac.uk**20070412195026]
1195[mark System.IO.openTempFile as non-portable in haddocks
1196Malcolm.Wallace@cs.york.ac.uk**20070412135359]
1197[Don't turn on -Werror in Data.Fixed
1198Ian Lynagh <igloo@earth.li>**20070411155721
1199 This may be responsible for the x86_64/Linux nightly build failing.
1200]
1201[Fix -Wall warnings
1202Ian Lynagh <igloo@earth.li>**20070411004929]
1203[Add missing case in removePrefix
1204Ian Lynagh <igloo@earth.li>**20070411002537]
1205[Allow additional options to pass on to ./configure to be given
1206Ian Lynagh <igloo@earth.li>**20070406151856]
1207[Hugs only: fix location of unsafeCoerce
1208Ross Paterson <ross@soi.city.ac.uk>**20070406113731]
1209[fix isPortableBuild test
1210Ross Paterson <ross@soi.city.ac.uk>**20070406111304]
1211[Unsafe.Coerce doesn't need Prelude
1212Ian Lynagh <igloo@earth.li>**20070405175930]
1213[make Setup and base.cabal suitable for building the libraries with GHC
1214Ian Lynagh <igloo@earth.li>**20070308163824]
1215[HsByteArray doesn't exist
1216Ian Lynagh <igloo@earth.li>**20070404163051]
1217[Don't use Fd/FD in foreign decls
1218Ian Lynagh <igloo@earth.li>**20070404155822
1219 Using CInt makes it much easier to verify that it is right, and we won't
1220 get caught out by possible newtype switches between CInt/Int.
1221]
1222[HsByteArray doesn't exist
1223Ian Lynagh <igloo@earth.li>**20070404155732]
1224[Fix braino
1225Ian Lynagh <igloo@earth.li>**20070404144508]
1226[Fix incorrect changes to C types in a foreign import for nhc98.
1227Malcolm.Wallace@cs.york.ac.uk**20070404120954
1228 If we use type CTime, it needs to be imported.  Also, CTime is not an
1229 instance of Integral, so use some other mechanism to convert it.
1230]
1231[Fix C/Haskell type mismatches
1232Ian Lynagh <igloo@earth.li>**20070403194943]
1233[add new module Unsafe.Coerce to build system
1234Malcolm.Wallace@cs.york.ac.uk**20070403131333]
1235[Fix type mismatches between foreign imports and HsBase.h
1236Ian Lynagh <igloo@earth.li>**20070403001611
1237 
1238 Merge to stable, checking for interface changes.
1239]
1240[put 'unsafeCoerce' in a standard location
1241Malcolm.Wallace@cs.york.ac.uk**20061113114103]
1242[fix for nhc98 build
1243Malcolm.Wallace@cs.york.ac.uk**20070402141712]
1244[Function crossMapP for fixing desugaring of comprehensions
1245Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070402082906
1246 
1247 Merge into 6.6 branch.
1248]
1249[Add min/max handling operations for IntSet/IntMap
1250jeanphilippe.bernardy@gmail.com**20070315072352]
1251[Monoid instance for Maybe and two wrappers: First and Last. trac proposal #1189
1252Jeffrey Yasskin <jyasskin@gmail.com>**20070309062550]
1253[Fix the type of wgencat
1254Ian Lynagh <igloo@earth.li>**20070329164223]
1255[fix strictness of foldr/build rule for take, see #1219
1256Simon Marlow <simonmar@microsoft.com>**20070327103941]
1257[remove Makefile.inc (only affects nhc98)
1258Malcolm.Wallace@cs.york.ac.uk**20070320120057]
1259[copyBytes copies bytes, not elements; fixes trac #1203
1260Ian Lynagh <igloo@earth.li>**20070312113555]
1261[Add ioeGetLocation, ioeSetLocation to System/IO/Error.hs; trac #1191
1262Ian Lynagh <igloo@earth.li>**20070304130315]
1263[fix race condition in prodServiceThread
1264Simon Marlow <simonmar@microsoft.com>**20070307134330
1265 See #1187
1266]
1267[Prevent duplication of unsafePerformIO on a multiprocessor
1268Simon Marlow <simonmar@microsoft.com>**20070306145424
1269 Fixes #986.  The idea is to add a new operation
1270 
1271   noDuplicate :: IO ()
1272 
1273 it is guaranteed that if two threads have executed noDuplicate, then
1274 they are not duplicating any computation.
1275 
1276 We now provide two new unsafe operations:
1277 
1278 unsafeDupablePerformIO    :: IO a -> a
1279 unsafeDupableInterleaveIO :: IO a -> IO a
1280 
1281 which are equivalent to the old unsafePerformIO and unsafeInterleaveIO
1282 respectively.  The new versions of these functions are defined as:
1283 
1284 unsafePerformIO    m = unsafeDupablePerformIO (noDuplicate >> m)
1285 unsafeInterleaveIO m = unsafeDupableInterleaveIO (noDuplicate >> m)
1286]
1287[expand docs for forkOS
1288Simon Marlow <simonmar@microsoft.com>**20070305160921]
1289[document timeout limitations
1290Peter Simons <simons@cryp.to>**20070228223540]
1291[So many people were involved in the writing of this module that
1292Peter Simons <simons@cryp.to>**20070228223415
1293 it feels unfair to single anyone out as the lone copyright
1294 holder.
1295]
1296[This patch adds a timeout function to the base libraries. Trac #980 is
1297Peter Simons <simons@cryp.to>**20070126222615
1298 concerned with this issue. The design guideline for this implementation
1299 is that 'timeout N E' should behave exactly the same as E as long as E
1300 doesn't time out. In our implementation, this means that E has the same
1301 myThreadId it would have without the timeout wrapper. Any exception E
1302 might throw cancels the timeout and propagates further up. It also
1303 possible for E to receive exceptions thrown to it by another thread.
1304]
1305[PArr: fixed permutations
1306Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070305055807]
1307[Add Data.String, containing IsString(fromString); trac proposal #1126
1308Ian Lynagh <igloo@earth.li>**20070130134841
1309 This is used by the overloaded strings extension (-foverloaded-strings in GHC).
1310]
1311[GHC.PArr: add bounds checking
1312Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070302053224]
1313[Bump nhc98 stack size for System/Time.hsc
1314sven.panne@aedion.de**20070301153009]
1315[FDs are CInts now, fixing non-GHC builds
1316sven.panne@aedion.de**20070225105620]
1317[Fixed PArr.dropP
1318Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070222032405
1319 - Thanks to Audrey Tang for the bug report
1320]
1321[Keep the same FD in both halves of a duplex handle when dup'ing
1322Ian Lynagh <igloo@earth.li>**20070220141039
1323 Otherwise we only close one of the FDs when closing the handle.
1324 Fixes trac #1149.
1325]
1326[Remove more redundant FD conversions
1327Ian Lynagh <igloo@earth.li>**20070220092520]
1328[Fix FD changes on Windows
1329Ian Lynagh <igloo@earth.li>**20070220091516]
1330[Consistently use CInt rather than Int for FDs
1331Ian Lynagh <igloo@earth.li>**20070219233854]
1332[Fix the types of minView/maxView (ticket #1134)
1333jeanphilippe.bernardy@gmail.com**20070210065115]
1334[fix for hashString, from Jan-Willem Maessen (see #1137)
1335Simon Marlow <simonmar@microsoft.com>**20070215094304
1336 
1337]
1338[fix to getUSecOfDay(): arithmetic was overflowing
1339Simon Marlow <simonmar@microsoft.com>**20070214161719]
1340[The Windows counterpart to 'wrapround of thread delays'
1341Ian Lynagh <igloo@earth.li>**20070209173510]
1342[wrapround of thread delays
1343Neil Davies <SemanticPhilosopher@gmail.com>**20070129160519
1344 
1345   * made the wrapround of the underlying O/S occur before the wrapround
1346     of the delayed threads by making threads delay in microseconds since
1347     O/S epoch (1970 - Unix, 1601 - Windows) stored in Word64.
1348   * removed redundant calls reading O/S realtime clock
1349   * removed rounding to 1/50th of sec for timers
1350   * Only for Unix version of scheduler.
1351]
1352[Whitespace changes only
1353Ian Lynagh <igloo@earth.li>**20070206232722]
1354[Add some type sigs
1355Ian Lynagh <igloo@earth.li>**20070206232439]
1356[Use static inline rather than extern inline/inline
1357Ian Lynagh <igloo@earth.li>**20070205203628
1358 I understand this is more portable, and it also fixes warnings when
1359 C things we are wrapping are themselves static inlines (which FD_ISSET
1360 is on ppc OS X).
1361]
1362[add derived instances for Dual monoid
1363Ross Paterson <ross@soi.city.ac.uk>**20070202190847]
1364[add doc pointers to Foldable
1365Ross Paterson <ross@soi.city.ac.uk>**20070202110931
1366 
1367 Could be applied to STABLE.
1368]
1369[Eliminate some warnings
1370Ian Lynagh <igloo@earth.li>**20060729220854
1371 Eliminate warnings in the libraries caused by mixing pattern matching
1372 with numeric literal matching.
1373]
1374[Remove IsString(fromString) from the Prelude
1375Ian Lynagh <igloo@earth.li>**20070130124136]
1376[Add Kleisli composition
1377Don Stewart <dons@cse.unsw.edu.au>**20061113015442]
1378[IsString is GHC-only (so why is it in the Prelude?)
1379Ross Paterson <ross@soi.city.ac.uk>**20070123183007]
1380[Applicative and Monad instances for Tree
1381Ross Paterson <ross@soi.city.ac.uk>**20070115174510]
1382[Add IsString class for overloaded string literals.
1383lennart@augustsson.net**20061221210532]
1384[Added examples, more detailed documentation to Data.List Extracting sublists functions
1385Andriy Palamarchuk <apa3a@yahoo.com>**20061204164710]
1386[fix threadDelay
1387Simon Marlow <simonmar@microsoft.com>**20070117091702
1388 In "Add support for the IO manager thread" I accidentally spammed part
1389 of "Make sure the threaded threadDelay sleeps at least as long as it
1390 is asked", which is why the ThreadDelay001 test has been failing.
1391]
1392[update section on "blocking"
1393Simon Marlow <simonmar@microsoft.com>**20070116124328]
1394[Fix crash with   (minBound :: Int*) `div (-1)   as result is maxBound + 1.
1395Ian Lynagh <igloo@earth.li>**20070115142005]
1396[version of example using Tomasz Zielonka's technique
1397Ross Paterson <ross@soi.city.ac.uk>**20070105175907]
1398[Added Unknowns for higher kinds
1399Pepe Iborra <mnislaih@gmail.com>**20061108155938]
1400[Improved the Show instance for Unknown
1401Pepe Iborra <mnislaih@gmail.com>**20060813111816]
1402[Show instance for GHC.Base.Unknown
1403mnislaih@gmail.com**20060801233530]
1404[Introduce Unknowns for the closure viewer. Add breakpointCond which was missing
1405mnislaih@gmail.com**20060725174537]
1406[Fix missing comma in Fractional documentation
1407Alec Berryman <alec@thened.net>**20061201173237]
1408[Mention that throwTo does not guarantee promptness of delivery
1409simonpj@microsoft**20061211123215]
1410[Add note about synhronous delivery of throwTo
1411simonpj@microsoft**20061211122257]
1412[documentation for installHandler
1413Simon Marlow <simonmar@microsoft.com>**20061205154927
1414 merge to 6.6
1415]
1416[dos2unix
1417Simon Marlow <simonmar@microsoft.com>**20061204095439]
1418[don't try to compile this on Unix
1419Simon Marlow <simonmar@microsoft.com>**20061204095427]
1420[TAG 6.6 release
1421Ian Lynagh <igloo@earth.li>**20061011124740]
1422[TAG Version 2.1
1423Ian Lynagh <igloo@earth.li>**20061009114014]
1424[Bump version number
1425Ian Lynagh <igloo@earth.li>**20061009114009]
1426[Add support for the IO manager thread on Windows
1427Simon Marlow <simonmar@microsoft.com>**20061201152042
1428 Fixes #637.  The test program in that report now works for me with
1429 -threaded, but it doesn't work without -threaded (I don't know if
1430 that's new behaviour or not, though).
1431]
1432[deriving (Eq, Ord, Enum, Show, Read, Typeab) for ConsoleEvent
1433Simon Marlow <simonmar@microsoft.com>**20061201144032]
1434[Make sure the threaded threadDelay sleeps at least as long as it is asked to
1435Ian Lynagh <igloo@earth.li>**20061128204807]
1436[Add comments about argument order to the definitions of gmapQ and constrFields
1437simonpj@microsoft**20061124164505]
1438[Hugs: add Control.Parallel.Strategies
1439Ross Paterson <ross@soi.city.ac.uk>**20061124161039]
1440[Move instance of Show Ptr to Ptr.hs (fewer orphans)
1441simonpj@microsoft.com**20061124100639]
1442[Add type signatures
1443simonpj@microsoft.com**20061124100621]
1444[Add an example of the use of unfoldr, following doc feedback from dozer
1445Don Stewart <dons@cse.unsw.edu.au>**20061124011249]
1446[trim imports
1447Ross Paterson <ross@soi.city.ac.uk>**20061123190352]
1448[Data.Graph is now portable (enable for nhc98)
1449Malcolm.Wallace@cs.york.ac.uk**20061123174913]
1450[remove Data.FunctorM and Data.Queue
1451Ross Paterson <ross@soi.city.ac.uk>**20061112001046
1452 
1453 These were deprecated in 6.6, and can thus be removed in 6.8.
1454]
1455[make Data.Graph portable (no change to the interface)
1456Ross Paterson <ross@soi.city.ac.uk>**20061122010040
1457 
1458 The algorithm now uses STArrays on GHC and IntSets elsewhere.
1459 (Hugs has STArrays, but avoiding them saves a -98, and boxed arrays
1460 aren't fast under Hugs anyway.)
1461]
1462[One less unsafeCoerce# in the tree
1463Don Stewart <dons@cse.unsw.edu.au>**20061120120242]
1464[typo in comment
1465Ross Paterson <ross@soi.city.ac.uk>**20061120115106]
1466[fix shift docs to match ffi spec
1467Ross Paterson <ross@soi.city.ac.uk>**20061117003144]
1468[(nhc98) use new primitive implementations of h{Put,Get}Buf.
1469Malcolm.Wallace@cs.york.ac.uk**20061116173104]
1470[The wrong 'cycle' was exported from Data.ByteString.Lazy.Char8, spotted by sjanssen
1471Don Stewart <dons@cse.unsw.edu.au>**20061110021311]
1472[LPS chunk sizes should be 16 bytes, not 17.
1473Don Stewart <dons@cse.unsw.edu.au>**20061110021254]
1474[Update comments on Prelude organisation in GHC/Base.lhs
1475Ian Lynagh <igloo@earth.li>**20061115001926]
1476[Control.Parallel.Strategies clean-up: Added export list to avoid exporting seq, fixed import list strangeness that haddock choked on, and moved the deprecated functions to a separate section.
1477bringert@cs.chalmers.se**20061113224202]
1478[Control.Parallel.Strategies: added NFData instances for Data.Int.*, Data.Word.*, Maybe, Either, Map, Set, Tree, IntMap, IntSet.
1479bringert@cs.chalmers.se**20061113221843]
1480[Control.Parallel.Strategies: deprecate sPar, sSeq, Assoc, fstPairFstList, force and sforce.
1481bringert@cs.chalmers.se**20061113215219
1482 Code comments indicated that sPar and sSeq have been superceded by sparking and demanding, and that Assoc, fstPairFstList, force and sforce are examples and hacks needed by the Lolita system.
1483]
1484[add Control.Monad.Instances to nhc98 build
1485Malcolm.Wallace@cs.york.ac.uk**20061113113221]
1486[Control.Parallel.Strategies: clarified documentation of parListChunk.
1487bringert@cs.chalmers.se**20061112232904]
1488[Added and cleaned up Haddock comments in Control.Parallel.Strategies.
1489bringert@cs.chalmers.se**20061112220445
1490 Many of the definitions in Control.Parallel.Strategies had missing or unclear Haddock comments. I converted most of the existing plain code comments to haddock comments, added some missing documentation and cleaned up the existing Haddock mark-up.
1491]
1492[Fix broken pragmas; spotted by Bulat Ziganshin
1493Ian Lynagh <igloo@earth.li>**20061111205916]
1494[add doc link to bound threads section
1495Ross Paterson <ross@soi.city.ac.uk>**20060929103252]
1496[hide Data.Array.IO.Internals
1497Ross Paterson <ross@soi.city.ac.uk>**20061111113248
1498 
1499 It's hidden from haddock, and everything it exports is re-exported by
1500 Data.Array.IO.
1501]
1502[add Data.Function
1503Malcolm.Wallace@cs.york.ac.uk**20061110142710]
1504[add Data.Function
1505Ross Paterson <ross@soi.city.ac.uk>**20061110141354]
1506[whitespace only
1507Ross Paterson <ross@soi.city.ac.uk>**20061110141326]
1508[move fix to Data.Function
1509Ross Paterson <ross@soi.city.ac.uk>**20061110141120]
1510[import Prelude
1511Ross Paterson <ross@soi.city.ac.uk>**20061110140445]
1512[Added Data.Function (Trac ticket #979).
1513Nils Anders Danielsson <nad@cs.chalmers.se>**20061110122503
1514 + A module with simple combinators working solely on and with
1515   functions.
1516 + The only new function is "on".
1517 + Some functions from the Prelude are re-exported.
1518]
1519[__hscore_long_path_size is not portable beyond GHC
1520Malcolm.Wallace@cs.york.ac.uk**20061110113222]
1521[redefine writeFile and appendFile using withFile
1522Ross Paterson <ross@soi.city.ac.uk>**20061107140359]
1523[add withFile and withBinaryFile (#966)
1524Ross Paterson <ross@soi.city.ac.uk>**20061107134510]
1525[remove conflicting import for nhc98
1526Malcolm.Wallace@cs.york.ac.uk**20061108111215]
1527[Add intercalate to Data.List (ticket #971)
1528Josef Svenningsson <josef.svenningsson@gmail.com>**20061102122052]
1529[non-GHC: fix canonicalizeFilePath
1530Ross Paterson <ross@soi.city.ac.uk>**20061107133902
1531 
1532 I've also removed the #ifdef __GLASGOW_HASKELL__ from the proper
1533 Windows versions of a few functions.  These will need testing with
1534 Hugs on Windows.
1535]
1536[enable canonicalizePath for non-GHC platforms
1537Simon Marlow <simonmar@microsoft.com>**20061107121141]
1538[Update documentation for hWaitForInput
1539Simon Marlow <simonmar@microsoft.com>**20061107111430
1540 See #972
1541 Merge to 6.6 branch.
1542]
1543[Use unchecked shifts to implement Data.Bits.rotate
1544Samuel Bronson <naesten@gmail.com>**20061012125553
1545 This should get rid of those cases, maybe lower the size enough that the inliner will like it?
1546]
1547[fix Haddock module headers
1548Ross Paterson <ross@soi.city.ac.uk>**20061106124140]
1549[fix example in docs
1550Ross Paterson <ross@soi.city.ac.uk>**20061106115628]
1551[Add intercalate and split to Data.List
1552Josef Svenningsson <josef.svenningsson@gmail.com>*-20061024172357]
1553[Data.Generics.Basics is GHC-only
1554Ross Paterson <ross@soi.city.ac.uk>**20061102111736]
1555[#ifdef around non-portable Data.Generics.Basics
1556Malcolm.Wallace@cs.york.ac.uk**20061102103445]
1557[Add deriving Data to Complex
1558simonpj@microsoft**20061101102059]
1559[minor clarification of RandomGen doc
1560Ross Paterson <ross@soi.city.ac.uk>**20061030230842]
1561[rearrange docs a bit
1562Ross Paterson <ross@soi.city.ac.uk>**20061030161223]
1563[Add intercalate and split to Data.List
1564Josef Svenningsson <josef.svenningsson@gmail.com>**20061024172357]
1565[Export pseq from Control.Parallel, and use it in Control.Parallel.Strategies
1566Simon Marlow <simonmar@microsoft.com>**20061027150141]
1567[`par` should be infixr 0
1568Simon Marlow <simonmar@microsoft.com>**20061027130800
1569 Alas, I didn't spot this due to lack of testing, and the symptom is
1570 that an expression like x `par` y `seq z will have exactly the wrong
1571 parallelism properties.  The workaround is to add parantheses.
1572 
1573 I think we could push this to the 6.6 branch.
1574]
1575[fix example in comment
1576Ross Paterson <ross@soi.city.ac.uk>**20061023163925]
1577[Use the new Any type for dynamics (GHC only)
1578simonpj@microsoft**20061019160408]
1579[add Data.Sequence to nhc98 build
1580Malcolm.Wallace@cs.york.ac.uk**20061012135200]
1581[Remove Data.FiniteMap, add Control.Applicative, Data.Traversable, and
1582Malcolm.Wallace@cs.york.ac.uk**20061012095605
1583 Data.Foldable to the nhc98 build.
1584]
1585[STM invariants
1586tharris@microsoft.com**20061007123253]
1587[Inline shift in GHC's Bits instances for {Int,Word}{,8,16,32,64}
1588Samuel Bronson <naesten@gmail.com>**20061009020906]
1589[Don't create GHC.Prim when bootstrapping; we can't, and we don't need it
1590Ian Lynagh <igloo@earth.li>**20061004165355]
1591[Data.ByteString: fix lazyness of take, drop & splitAt
1592Don Stewart <dons@cse.unsw.edu.au>**20061005011703
1593 
1594 ByteString.Lazy's take, drop and splitAt were too strict when demanding
1595 a byte string. Spotted by Einar Karttunen. Thanks to him and to Bertram
1596 Felgenhauer for explaining the problem and the fix.
1597 
1598]
1599[Fix syntax error that prevents building Haddock documentation on Windows
1600brianlsmith@gmail.com**20060917013530]
1601[Hugs only: unbreak typeRepKey
1602Ross Paterson <ross@soi.city.ac.uk>**20060929102743]
1603[make hGetBufNonBlocking do something on Windows w/ -threaded
1604Simon Marlow <simonmar@microsoft.com>**20060927145811
1605 hGetBufNonBlocking will behave the same as hGetBuf on Windows now, which
1606 is better than just crashing (which it did previously).
1607]
1608[add typeRepKey :: TypeRep -> IO Int
1609Simon Marlow <simonmar@microsoft.com>**20060927100342
1610 See feature request #880
1611]
1612[fix header comment
1613Ross Paterson <ross@soi.city.ac.uk>**20060926135843]
1614[Add strict versions of insertWith and insertWithKey (Data.Map)
1615jeanphilippe.bernardy@gmail.com**20060910162443]
1616[doc tweaks, including more precise equations for evaluate
1617Ross Paterson <ross@soi.city.ac.uk>**20060910115259]
1618[Sync Data.ByteString with stable branch
1619Don Stewart <dons@cse.unsw.edu.au>**20060909050111
1620 
1621 This patch:
1622     * hides the LPS constructor (its in .Base if you need it)
1623     * adds functions to convert between strict and lazy bytestrings
1624     * and adds readInteger
1625 
1626]
1627[Typeable1 instances for STM and TVar
1628Ross Paterson <ross@soi.city.ac.uk>**20060904231425]
1629[remove obsolete Hugs stuff
1630Ross Paterson <ross@soi.city.ac.uk>**20060904223944]
1631[Cleaner isInfixOf suggestion from Ross Paterson
1632John Goerzen <jgoerzen@complete.org>**20060901143654]
1633[New function isInfixOf that searches a list for a given sublist
1634John Goerzen <jgoerzen@complete.org>**20060831151556
1635 
1636 Example:
1637 
1638 isInfixOf "Haskell" "I really like Haskell." -> True
1639 isInfixOf "Ial" "I really like Haskell." -> False
1640 
1641 This function was first implemented in MissingH as MissingH.List.contains
1642]
1643[Better doc on Data.Map.lookup: explain what the monad is for
1644jeanphilippe.bernardy@gmail.com**20060903133440]
1645[fix hDuplicateTo on Windows
1646Simon Marlow <simonmar@microsoft.com>**20060901150016
1647 deja vu - I'm sure I remember fixing this before...
1648]
1649[Improve documentation of atomically
1650simonpj@microsoft**20060714120207]
1651[Add missing method genRange for StdGen (fixes #794)
1652simonpj@microsoft**20060707151901
1653 
1654        MERGE TO STABLE
1655 
1656 Trac #794 reports (correctly) that the implementation of StdGen
1657 only returns numbers in the range (0..something) rather than
1658 (minBound, maxBound), which is what StdGen's genRange claims.
1659 
1660 This commit fixes the problem, by implementing genRange for StdGen
1661 (previously it just used the default method).
1662 
1663 
1664]
1665[mark nhc98 import hack
1666Ross Paterson <ross@soi.city.ac.uk>**20060831125219]
1667[remove some outdated comments
1668Simon Marlow <simonmar@microsoft.com>**20060831104200]
1669[import Control.Arrow.ArrowZero to help nhc98's type checker
1670Malcolm.Wallace@cs.york.ac.uk**20060831101105]
1671[remove Text.Regex(.Posix) from nhc98 build
1672Malcolm.Wallace@cs.york.ac.uk**20060831101016]
1673[add Data.Foldable.{msum,asum}, plus tweaks to comments
1674Ross Paterson <ross@soi.city.ac.uk>**20060830163521]
1675[fix doc typo
1676Ross Paterson <ross@soi.city.ac.uk>**20060830134123]
1677[add Data.Foldable.{for_,forM_} and Data.Traversable.{for,forM}
1678Ross Paterson <ross@soi.city.ac.uk>**20060830133805
1679 
1680 generalizing Control.Monad.{forM_,forM}
1681]
1682[Make length a good consumer
1683simonpj@microsoft*-20060508142726
1684 
1685 Make length into a good consumer.  Fixes Trac bug #707.
1686 
1687 (Before length simply didn't use foldr.)
1688 
1689]
1690[Add Control.Monad.forM and forM_
1691Don Stewart <dons@cse.unsw.edu.au>**20060824081118
1692 
1693 flip mapM_ is more and more common, I find. Several suggestions have
1694 been made to add this, as foreach or something similar. This patch
1695 does just that:
1696 
1697     forM  :: (Monad m) => [a] -> (a -> m b) -> m [b]
1698     forM_ :: (Monad m) => [a] -> (a -> m b) -> m ()
1699 
1700 So we can write:
1701     
1702     Prelude Control.Monad> forM_ [1..4] $ \x -> print x
1703     1
1704     2
1705     3
1706     4
1707 
1708]
1709[Hide internal module from haddock in Data.ByteString
1710Don Stewart <dons@cse.unsw.edu.au>**20060828011515]
1711[add advice on avoiding import ambiguities
1712Ross Paterson <ross@soi.city.ac.uk>**20060827170407]
1713[expand advice on importing these modules
1714Ross Paterson <ross@soi.city.ac.uk>**20060827164044]
1715[add Haddock marker
1716Ross Paterson <ross@soi.city.ac.uk>**20060827115140]
1717[Clarify how one hides Prelude.catch
1718Don Stewart <dons@cse.unsw.edu.au>**20060826124346
1719 
1720 User feedback indicated that an example was required, of how to hide
1721 Prelude.catch, so add such an example to the docs
1722 
1723]
1724[Workaround for OSes that don't have intmax_t and uintmax_t
1725Ian Lynagh <igloo@earth.li>**20060825134936
1726 OpenBSD (and possibly others) do not have intmax_t and uintmax_t types:
1727     http://www.mail-archive.com/haskell-prime@haskell.org/msg01548.html
1728 so substitute (unsigned) long long if we have them, otherwise
1729 (unsigned) long.
1730 
1731]
1732[add docs for par
1733Simon Marlow <simonmar@microsoft.com>**20060825110610]
1734[document minimal complete definition for Bits
1735Ross Paterson <ross@soi.city.ac.uk>**20060824140504]
1736[C regex library bits have moved to the regex-posix package
1737Simon Marlow <simonmar@microsoft.com>**20060824132311]
1738[Add shared Typeable support (ghc only)
1739Esa Ilari Vuokko <ei@vuokko.info>**20060823003126]
1740[this should have been removed with the previous patch
1741Simon Marlow <simonmar@microsoft.com>**20060824121223]
1742[remove Text.Regx & Text.Regex.Posix
1743Simon Marlow <simonmar@microsoft.com>**20060824094615
1744 These are subsumed by the new regex-base, regex-posix and regex-compat
1745 packages.
1746]
1747[explicitly tag Data.ByteString rules with the FPS prefix.
1748Don Stewart <dons@cse.unsw.edu.au>**20060824041326]
1749[Add spec rules for sections in Data.ByteString
1750Don Stewart <dons@cse.unsw.edu.au>**20060824012611]
1751[Sync Data.ByteString with current stable branch, 0.7
1752Don Stewart <dons@cse.unsw.edu.au>**20060823143338]
1753[add notes about why copyFile doesn't remove the target
1754Simon Marlow <simonmar@microsoft.com>**20060823095059]
1755[copyFile: try removing the target file before opening it for writing
1756Simon Marlow <simonmar@microsoft.com>*-20060822121909]
1757[copyFile: try removing the target file before opening it for writing
1758Simon Marlow <simonmar@microsoft.com>**20060822121909]
1759[add alternative functors and extra instances
1760Ross Paterson <ross@soi.city.ac.uk>**20060821152151
1761 
1762 * Alternative class, for functors with a monoid
1763 * instances for Const
1764 * instances for arrows
1765]
1766[generate Haddock docs on all platforms
1767Simon Marlow <simonmar@microsoft.com>**20060821131612]
1768[remove extra comma from import
1769Ross Paterson <ross@soi.city.ac.uk>**20060819173954]
1770[fix docs for withC(A)StringLen
1771Ross Paterson <ross@soi.city.ac.uk>**20060818170328]
1772[use Haskell'98 compliant indentation in do blocks
1773Malcolm.Wallace@cs.york.ac.uk**20060818130810]
1774[use correct names of IOArray operations for nhc98
1775Malcolm.Wallace@cs.york.ac.uk**20060818130714]
1776[add mapMaybe and mapEither, plus WithKey variants
1777Ross Paterson <ross@soi.city.ac.uk>**20060817235041]
1778[remove Text.Html from nhc98 build
1779Malcolm.Wallace@cs.york.ac.uk**20060817135502]
1780[eliminate more HOST_OS tests
1781Ross Paterson <ross@soi.city.ac.uk>**20060815190609]
1782[Hugs only: disable unused process primitives
1783Ross Paterson <ross@soi.city.ac.uk>**20060813184435
1784 
1785 These were the cause of Hugs bug #30, I think, and weren't used by Hugs anyway.
1786]
1787[markup fix to Data.HashTable
1788Ross Paterson <ross@soi.city.ac.uk>**20060812103835]
1789[revert removal of ghcconfig.h from package.conf.in
1790Ross Paterson <ross@soi.city.ac.uk>**20060812082702
1791 
1792 as it's preprocessed with -undef (pointed out by Esa Ilari Vuokko)
1793]
1794[fix Data.HashTable for non-GHC
1795Ross Paterson <ross@soi.city.ac.uk>**20060811231521]
1796[remove deprecated 'withObject'
1797Simon Marlow <simonmar@microsoft.com>**20060811152350]
1798[Jan-Willem Maessen's improved implementation of Data.HashTable
1799Simon Marlow <simonmar@microsoft.com>**20060811151024
1800 Rather than incrementally enlarging the hash table, this version
1801 just does it in one go when the table gets too full.
1802]
1803[Warning police: Make some prototypes from the RTS known
1804sven.panne@aedion.de**20060811144629]
1805[Warning police: Removed useless catch-all clause
1806sven.panne@aedion.de**20060811142208]
1807[reduce dependency on ghcconfig.h
1808Ross Paterson <ross@soi.city.ac.uk>**20060811124030
1809 
1810 The only remaining use is in cbits/dirUtils.h, which tests solaris2_HOST_OS
1811 
1812 (Also System.Info uses ghcplatform.h and several modules import MachDeps.h
1813 to get SIZEOF_* and ALIGNMENT_* from ghcautoconf.h)
1814]
1815[(non-GHC only) track MArray interface change
1816Ross Paterson <ross@soi.city.ac.uk>**20060810182902]
1817[move Text.Html to a separate package
1818Simon Marlow <simonmar@microsoft.com>**20060810113017]
1819[bump version to 2.0
1820Simon Marlow <simonmar@microsoft.com>**20060810112833]
1821[Remove deprecated Data.FiniteMap and Data.Set interfaces
1822Simon Marlow <simonmar@microsoft.com>**20060809153810]
1823[move altzone test from ghc to base package
1824Ross Paterson <ross@soi.city.ac.uk>**20060809124259]
1825[remove unnecessary #include "ghcconfig.h"
1826Ross Paterson <ross@soi.city.ac.uk>**20060809123812]
1827[Change the API of MArray to allow resizable arrays
1828Simon Marlow <simonmar@microsoft.com>**20060809100548
1829 See #704
1830 
1831 The MArray class doesn't currently allow a mutable array to change its
1832 size, because of the pure function
1833 
1834   bounds :: (HasBounds a, Ix i) => a i e -> (i,i)
1835 
1836 This patch removes the HasBounds class, and adds
1837 
1838   getBounds :: (MArray a e m, Ix i) => a i e -> m (i,i)
1839 
1840 to the MArray class, and
1841 
1842   bounds :: (IArray a e, Ix i) => a i e -> (i,i)
1843 
1844 to the IArray class.
1845 
1846 The reason that bounds had to be incorporated into the IArray class is
1847 because I couldn't make DiffArray work without doing this.  DiffArray
1848 acts as a layer converting an MArray into an IArray, and there was no
1849 way (that I could find) to define an instance of HasBounds for
1850 DiffArray.
1851]
1852[deprecate this module.
1853Simon Marlow <simonmar@microsoft.com>**20060808100708]
1854[add traceShow (see #474)
1855Simon Marlow <simonmar@microsoft.com>**20060807155545]
1856[remove spurious 'extern "C" {'
1857Simon Marlow <simonmar@microsoft.com>**20060724160258]
1858[Fix unsafeIndex for large ranges
1859Simon Marlow <simonmar@microsoft.com>**20060721100225]
1860[disambiguate uses of foldr for nhc98 to compile without errors
1861Malcolm.Wallace@cs.york.ac.uk**20060711161614]
1862[make Control.Monad.Instances compilable by nhc98
1863Malcolm.Wallace@cs.york.ac.uk**20060711160941]
1864[breakpointCond
1865Lemmih <lemmih@gmail.com>**20060708055528]
1866[UNDO: Merge "unrecognized long opt" fix from 6.4.2
1867Simon Marlow <simonmar@microsoft.com>**20060705142537
1868 This patch undid the previous patch, "RequireOrder: do not collect
1869 unrecognised options after a non-opt".  I asked Sven to revert it, but
1870 didn't get an answer.
1871 
1872 See bug #473.
1873]
1874[Avoid strictness in accumulator for unpackFoldr
1875Don Stewart <dons@cse.unsw.edu.au>**20060703091806
1876 
1877 The seq on the accumulator for unpackFoldr will break in the presence of
1878 head/build rewrite rules. The empty list case will be forced, producing
1879 an exception. This is a known issue with seq and rewrite rules that we
1880 just stumbled on to.
1881 
1882]
1883[Disable unpack/build fusion
1884Don Stewart <dons@cse.unsw.edu.au>**20060702083913
1885 
1886 unpack/build on bytestrings seems to trigger a bug when interacting with
1887 head/build fusion in GHC.List. The bytestring001 testcase catches it.
1888 
1889 I'll investigate further, but best to disable this for now (its not
1890 often used anyway).
1891 
1892 Note that with -frules-off or ghc 6.4.2 things are fine. It seems to
1893 have emerged with the recent rules changes.
1894 
1895]
1896[Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head
1897Don Stewart <dons@cse.unsw.edu.au>**20060701084345
1898 
1899 This patch imports the Data.ByteString.Lazy module, and its helpers,
1900 providing a ByteString implemented as a lazy list of strict cache-sized
1901 chunks. This type allows the usual lazy operations to be written on
1902 bytestrings, including lazy IO, with much improved space and time over
1903 the [Char] equivalents.
1904 
1905]
1906[Wibble in docs for new ForeignPtr functionsn
1907Don Stewart <dons@cse.unsw.edu.au>**20060609075924]
1908[comments for Applicative and Traversable
1909Ross Paterson <ross@soi.city.ac.uk>**20060622170436]
1910[default to NoBuffering on Windows for a read/write text file
1911Simon Marlow <simonmar@microsoft.com>**20060622144446
1912 Fixes (works around) #679
1913]
1914[remove dead code
1915Simon Marlow <simonmar@microsoft.com>**20060622144433]
1916[clarify and expand docs
1917Simon Marlow <simonmar@microsoft.com>**20060622112911]
1918[Add minView and maxView to Map and Set
1919jeanphilippe.bernardy@gmail.com**20060616180121]
1920[add signature for registerDelay
1921Ross Paterson <ross@soi.city.ac.uk>**20060614114456]
1922[a few doc comments
1923Ross Paterson <ross@soi.city.ac.uk>**20060613142704]
1924[Optimised foreign pointer representation, for heap-allocated objects
1925Don Stewart <dons@cse.unsw.edu.au>**20060608015011]
1926[Add the inline function, and many comments
1927simonpj@microsoft.com**20060605115814
1928 
1929 This commit adds the 'inline' function described in the
1930 related patch in the compiler.
1931 
1932 I've also added comments about the 'lazy' function.
1933 
1934]
1935[small intro to exceptions
1936Ross Paterson <ross@soi.city.ac.uk>**20060525111604]
1937[export breakpoint
1938Simon Marlow <simonmar@microsoft.com>**20060525090456]
1939[Merge in changes from fps head. Highlights:
1940Don Stewart <dons@cse.unsw.edu.au>**20060525065012
1941 
1942     Wed May 24 15:49:38 EST 2006  sjanssen@cse.unl.edu
1943       * instance Monoid ByteString
1944 
1945     Wed May 24 15:04:04 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1946       * Rearange export lists for the .Char8 modules
1947 
1948     Wed May 24 14:59:56 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1949       * Implement mapAccumL and reimplement mapIndexed using loopU
1950 
1951     Wed May 24 14:47:32 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1952       * Change the implementation of the unfoldr(N) functions.
1953       Use a more compact implementation for unfoldrN and change it's behaviour
1954       to only return Just in the case that it actually 'overflowed' the N, so
1955       the boundary case of unfolding exactly N gives Nothing.
1956       Implement unfoldr and Lazy.unfoldr in terms of unfoldrN. Use fibonacci
1957       growth for the chunk size in unfoldr
1958 
1959     Wed May 24 08:32:29 EST 2006  sjanssen@cse.unl.edu
1960       * Add unfoldr to ByteString and .Char8
1961       A preliminary implementation of unfoldr.
1962 
1963     Wed May 24 01:39:41 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1964       * Reorder the export lists to better match the Data.List api
1965 
1966     Tue May 23 14:04:32 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1967       * pack{Byte,Char} -> singleton. As per fptools convention
1968 
1969     Tue May 23 14:00:51 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1970       * elemIndexLast -> elemIndexEnd
1971 
1972     Tue May 23 13:57:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1973       * In the search for a more orthogonal api, we kill breakFirst/breakLast,
1974         which were of dubious value
1975 
1976     Tue May 23 12:24:09 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1977       * Abolish elems. It's name implied it was unpack, but its type didn't. it made no sense
1978 
1979     Tue May 23 10:42:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1980       * Minor doc tidyup. Use haddock markup better.
1981 
1982     Tue May 23 11:00:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1983       * Simplify the join() implementation. Spotted by Duncan.
1984 
1985]
1986[add a way to ask the IO manager thread to exit
1987Simon Marlow <simonmar@microsoft.com>**20060524121823]
1988[Sync with FPS head, including the following patches:
1989Don Stewart <dons@cse.unsw.edu.au>**20060520030436
1990         
1991     Thu May 18 15:45:46 EST 2006  sjanssen@cse.unl.edu
1992       * Export unsafeTake and unsafeDrop
1993 
1994     Fri May 19 11:53:08 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1995       * Add foldl1'
1996 
1997     Fri May 19 13:41:24 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1998       * Add fuseable scanl, scanl1 + properties
1999 
2000     Fri May 19 18:20:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2001       * Spotted another chance to use unsafeTake,Drop (in groupBy)
2002 
2003     Thu May 18 09:24:25 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2004       * More effecient findIndexOrEnd based on the impl of findIndex
2005 
2006     Thu May 18 09:22:49 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2007       * Eliminate special case in findIndex since it's handled anyway.
2008 
2009     Thu May 18 09:19:08 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2010       * Add unsafeTake and unsafeDrop
2011       These versions assume the n is in the bounds of the bytestring, saving
2012       two comparison tests. Then use them in varous places where we think this
2013       holds. These cases need double checking (and there are a few remaining
2014       internal uses of take / drop that might be possible to convert).
2015       Not exported for the moment.
2016 
2017     Tue May 16 23:15:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2018       * Handle n < 0 in drop and splitAt. Spotted by QC.
2019 
2020     Tue May 16 22:46:22 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2021       * Handle n <= 0 cases for unfoldr and replicate. Spotted by QC
2022 
2023     Tue May 16 21:34:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2024       * mapF -> map', filterF -> filter'
2025 
2026]
2027[haddock fix
2028Ross Paterson <ross@soi.city.ac.uk>**20060518154723]
2029[simplify indexing in Data.Sequence
2030Ross Paterson <ross@soi.city.ac.uk>**20060518154316]
2031[Move Eq, Ord, Show instances for ThreadId to GHC.Conc
2032Simon Marlow <simonmar@microsoft.com>**20060518113339
2033 Eliminates orphans.
2034]
2035[Better error handling in the IO manager thread
2036Simon Marlow <simonmar@microsoft.com>**20060518113303
2037 In particular, handle EBADF just like rts/posix/Select.c, by waking up
2038 all the waiting threads.  Other errors are thrown, instead of just
2039 being ignored.
2040]
2041[#define _REENTRANT 1  (needed to get the right errno on some OSs)
2042Simon Marlow <simonmar@microsoft.com>**20060518104151
2043 Part 2 of the fix for threaded RTS problems on Solaris and possibly
2044 *BSD (Part 1 was the same change in ghc/includes/Rts.h).
2045]
2046[copyCString* should be in IO. Spotted by Tomasz Zielonka
2047Don Stewart <dons@cse.unsw.edu.au>**20060518012154]
2048[add import Prelude to get dependencies right for Data/Fixed.hs
2049Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20060517222044
2050 Hopefully this fixes parallel builds.
2051]
2052[Fix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF -> map', filter' while we're here
2053Don Stewart <dons@cse.unsw.edu.au>**20060517020150]
2054[Use our own realloc. Thus reduction functions (like filter) allocate on the Haskell heap. Makes around 10% difference.
2055Don Stewart <dons@cse.unsw.edu.au>**20060513051736]
2056[Last two CInt fixes for 64 bit, and bracket writeFile while we're here
2057Don Stewart <dons@cse.unsw.edu.au>**20060512050750]
2058[Some small optimisations, generalise the type of unfold
2059Don Stewart <dons@cse.unsw.edu.au>**20060510043309
2060 
2061     Tue May  9 22:36:29 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2062       * Surely the error function should not be inlined.
2063 
2064     Tue May  9 22:35:53 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2065       * Reorder memory writes for better cache locality.
2066 
2067     Tue May  9 23:28:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
2068       * Generalise the type of unfoldrN
2069       
2070       The type of unfoldrN was overly constrained:
2071       unfoldrN :: Int -> (Word8 -> Maybe (Word8, Word8)) -> Word8 -> ByteString
2072       
2073       if we compare that to unfoldr:
2074       unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
2075       
2076       So we can generalise unfoldrN to this type:
2077       unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> ByteString
2078       
2079       and something similar for the .Char8 version. If people really do want to
2080       use it a lot with Word8/Char then perhaps we should add a specialise pragma.
2081 
2082     Wed May 10 13:26:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2083       * Add foldl', and thus a fusion rule for length . {map,filter,fold},
2084       that avoids creating an array at all if the end of the pipeline is a 'length' reduction
2085 
2086 **END OF DESCRIPTION***
2087 
2088 Place the long patch description above the ***END OF DESCRIPTION*** marker.
2089 The first line of this file will be the patch name.
2090 
2091 
2092 This patch contains the following changes:
2093 
2094 M ./Data/ByteString.hs -8 +38
2095 M ./Data/ByteString/Char8.hs -6 +12
2096]
2097[portable implementation of WordPtr/IntPtr for non-GHC
2098Ross Paterson <ross@soi.city.ac.uk>**20060510001826
2099 
2100 plus much tweaking of imports to avoid cycles
2101]
2102[add WordPtr and IntPtr types to Foreign.Ptr, with associated conversions
2103Simon Marlow <simonmar@microsoft.com>**20060509092606
2104 
2105 As suggested by John Meacham. 
2106 
2107 I had to move the Show instance for Ptr into GHC.ForeignPtr to avoid
2108 recursive dependencies.
2109]
2110[add CIntPtr, CUIntPtr, CIntMax, CUIntMax types
2111Simon Marlow <simonmar@microsoft.com>**20060509092427]
2112[add GHC.Dynamic
2113Simon Marlow <simonmar@microsoft.com>**20060509082739]
2114[Two things. #if defined(__GLASGOW_HASKELL__) on INLINE [n] pragmas (for jhc). And careful use of INLINE on words/unwords halves runtime for those functions
2115Don Stewart <dons@cse.unsw.edu.au>**20060509023425]
2116[Make length a good consumer
2117simonpj@microsoft**20060508142726
2118 
2119 Make length into a good consumer.  Fixes Trac bug #707.
2120 
2121 (Before length simply didn't use foldr.)
2122 
2123]
2124[Trim imports
2125simonpj@microsoft**20060508142557]
2126[Make unsafePerformIO lazy
2127simonpj@microsoft**20060508142507
2128 
2129 The stricteness analyser used to have a HACK which ensured that NOINLNE things
2130 were not strictness-analysed.  The reason was unsafePerformIO. Left to itself,
2131 the strictness analyser would discover this strictness for unsafePerformIO:
2132        unsafePerformIO:  C(U(AV))
2133 But then consider this sub-expression
2134        unsafePerformIO (\s -> let r = f x in
2135                               case writeIORef v r s of (# s1, _ #) ->
2136                               (# s1, r #)
2137 The strictness analyser will now find that r is sure to be eval'd,
2138 and may then hoist it out.  This makes tests/lib/should_run/memo002
2139 deadlock.
2140 
2141 Solving this by making all NOINLINE things have no strictness info is overkill.
2142 In particular, it's overkill for runST, which is perfectly respectable.
2143 Consider
2144        f x = runST (return x)
2145 This should be strict in x.
2146 
2147 So the new plan is to define unsafePerformIO using the 'lazy' combinator:
2148 
2149        unsafePerformIO (IO m) = lazy (case m realWorld# of (# _, r #) -> r)
2150 
2151 Remember, 'lazy' is a wired-in identity-function Id, of type a->a, which is
2152 magically NON-STRICT, and is inlined after strictness analysis.  So
2153 unsafePerformIO will look non-strict, and that's what we want.
2154 
2155]
2156[Sync with FPS head.
2157Don Stewart <dons@cse.unsw.edu.au>**20060508122322
2158 
2159 Mon May  8 10:40:14 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2160   * Fix all uses for Int that should be CInt or CSize in ffi imports.
2161   Spotted by Igloo, dcoutts
2162 
2163 Mon May  8 16:09:41 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2164   * Import nicer loop/loop fusion rule from ghc-ndp
2165 
2166 Mon May  8 17:36:07 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2167   * Fix stack leak in split on > 60M strings
2168 
2169 Mon May  8 17:50:13 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2170   * Try same fix for stack overflow in elemIndices
2171 
2172]
2173[Fix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan and Ian
2174Don Stewart <dons@cse.unsw.edu.au>**20060508010311]
2175[Fixed import list syntax
2176Sven Panne <sven.panne@aedion.de>**20060507155008]
2177[Faster filterF, filterNotByte
2178dons@cse.unsw.edu.au**20060507042301]
2179[Much faster find, findIndex. Hint from sjanssen
2180dons@cse.unsw.edu.au**20060507033048]
2181[Merge "unrecognized long opt" fix from 6.4.2
2182Sven Panne <sven.panne@aedion.de>**20060506110519]
2183[
2184dons@cse.unsw.edu.au**20060506061029
2185 Sat May  6 13:01:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2186   * Do loopU realloc on the Haskell heap. And add a really tough stress test
2187 
2188 Sat May  6 12:28:58 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2189   * Use simple, 3x faster concat. Plus QC properties. Suggested by sjanssen and dcoutts
2190 
2191 Sat May  6 15:59:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2192   * dcoutt's packByte bug squashed
2193   
2194   With inlinePerformIO, ghc head was compiling:
2195   
2196    packByte 255 `compare` packByte 127
2197   
2198   into roughly
2199   
2200    case mallocByteString 2 of
2201        ForeignPtr f internals ->
2202             case writeWord8OffAddr# f 0 255 of _ ->
2203             case writeWord8OffAddr# f 0 127 of _ ->
2204             case eqAddr# f f of
2205                    False -> case compare (GHC.Prim.plusAddr# f 0)
2206                                          (GHC.Prim.plusAddr# f 0)
2207   
2208   which is rather stunning. unsafePerformIO seems to prevent whatever
2209   magic inlining was leading to this. Only affected the head.
2210   
2211]
2212[Add array fusion versions of map, filter and foldl
2213dons@cse.unsw.edu.au**20060505060858
2214 
2215 This patch adds fusable map, filter and foldl, using the array fusion
2216 code for unlifted, flat arrays, from the Data Parallel Haskell branch,
2217 after kind help from Roman Leshchinskiy,
2218 
2219 Pipelines of maps, filters and folds should now need to walk the
2220 bytestring once only, and intermediate bytestrings won't be constructed.
2221 
2222]
2223[fix for non-GHC
2224Ross Paterson <ross@soi.city.ac.uk>**20060504093044]
2225[use bracket in appendFile (like writeFile)
2226Ross Paterson <ross@soi.city.ac.uk>**20060504091528]
2227[writeFile: close the file on error
2228Simon Marlow <simonmar@microsoft.com>**20060504084505
2229 Suggested by Ross Paterson, via Neil Mitchell
2230 
2231]
2232[Sync with FPS head
2233dons@cse.unsw.edu.au**20060503105259
2234 
2235 This patch brings Data.ByteString into sync with the FPS head.
2236 The most significant of which is the new Haskell counting sort.
2237 
2238 Changes:
2239 
2240 Sun Apr 30 18:16:29 EST 2006  sjanssen@cse.unl.edu
2241   * Fix foldr1 in Data.ByteString and Data.ByteString.Char8
2242 
2243 Mon May  1 11:51:16 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
2244   * Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell
2245 
2246 Mon May  1 16:42:04 EST 2006  sjanssen@cse.unl.edu
2247   * Fix groupBy to match Data.List.groupBy.
2248 
2249 Wed May  3 15:01:07 EST 2006  sjanssen@cse.unl.edu
2250   * Migrate to counting sort.
2251   
2252   Data.ByteString.sort used C's qsort(), which is O(n log n).  The new algorithm
2253   is O(n), and is faster for strings larger than approximately thirty bytes.  We
2254   also reduce our dependency on cbits!
2255 
2256]
2257[improve performance of Integer->String conversion
2258Simon Marlow <simonmar@microsoft.com>**20060503113306
2259 See
2260  http://www.haskell.org//pipermail/libraries/2006-April/005227.html
2261 
2262 Submitted by: bertram.felgenhauer@googlemail.com
2263 
2264 
2265]
2266[inline withMVar, modifyMVar, modifyMVar_
2267Simon Marlow <simonmar@microsoft.com>**20060503111152]
2268[Fix string truncating in hGetLine -- it was a pasto from Simon's code
2269Simon Marlow <simonmar@microsoft.com>**20060503103504
2270 (from Don Stewart)
2271]
2272[Merge in Data.ByteString head. Fixes ByteString+cbits in hugs
2273Don Stewart <dons@cse.unsw.edu.au>**20060429040733]
2274[Import Data.ByteString from fps 0.5.
2275Don Stewart <dons@cse.unsw.edu.au>**20060428130718
2276 Fast, packed byte vectors, providing a better PackedString.
2277 
2278]
2279[fix previous patch
2280Ross Paterson <ross@soi.city.ac.uk>**20060501154847]
2281[fixes for non-GHC
2282Ross Paterson <ross@soi.city.ac.uk>**20060501144322]
2283[fix imports for mingw32 && !GHC
2284Ross Paterson <ross@soi.city.ac.uk>**20060427163248]
2285[RequireOrder: do not collect unrecognised options after a non-opt
2286Simon Marlow <simonmar@microsoft.com>**20060426121110
2287 The documentation for RequireOrder says "no option processing after
2288 first non-option", so it doesn't seem right that we should process the
2289 rest of the arguments to collect the unrecognised ones.  Presumably
2290 the client wants to know about the unrecognised options up to the
2291 first non-option, and will be using a different option parser for the
2292 rest of the command line.
2293 
2294 eg. before:
2295 
2296 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
2297 ([],["bar","--foo"],["--foo"],[])
2298 
2299 after:
2300 
2301 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
2302 ([],["bar","--foo"],[],[])
2303]
2304[fix for Haddock 0.7
2305Ashley Yakeley <ashley@semantic.org>**20060426072521]
2306[add Data.Fixed module
2307Ashley Yakeley <ashley@semantic.org>**20060425071853]
2308[add instances
2309Ross Paterson <ross@soi.city.ac.uk>**20060424102146]
2310[add superclasses to Applicative and Traversable
2311Ross Paterson <ross@soi.city.ac.uk>**20060411144734
2312 
2313 Functor is now a superclass of Applicative, and Functor and Foldable
2314 are now superclasses of Traversable.  The new hierarchy makes clear the
2315 inclusions between the classes, but means more work in defining instances.
2316 Default definitions are provided to help.
2317]
2318[add Functor and Monad instances for Prelude types
2319Ross Paterson <ross@soi.city.ac.uk>**20060410111443]
2320[GHC.Base.breakpoint
2321Lemmih <lemmih@gmail.com>**20060407125827]
2322[Track the GHC source tree reorganisation
2323Simon Marlow <simonmar@microsoft.com>**20060407041631]
2324[in the show instance for Exception, print the type of dynamic exceptions
2325Simon Marlow <simonmar@microsoft.com>**20060406112444
2326 Unfortunately this requires some recursve module hackery to get at
2327 the show instance for Typeable.
2328]
2329[implement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC
2330Simon Marlow <simonmar@microsoft.com>**20060405155448]
2331[add  forkOnIO :: Int -> IO () -> IO ThreadId
2332Simon Marlow <simonmar@microsoft.com>**20060327135018]
2333[Rework previous: not a gcc bug after all
2334Simon Marlow <simonmar@microsoft.com>**20060323161229
2335 It turns out that we were relying on behaviour that is undefined in C,
2336 and undefined behaviour in C means "the compiler can do whatever the
2337 hell it likes with your entire program".  So avoid that.
2338]
2339[work around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show
2340Simon Marlow <simonmar@microsoft.com>**20060323134514
2341 See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824
2342]
2343[commit mysteriously missing parts of "runIOFastExit" patch
2344Simon Marlow <simonmar@microsoft.com>**20060321101535]
2345[add runIOFastExit :: IO a -> IO a
2346Simon Marlow <simonmar@microsoft.com>**20060320124333
2347 Similar to runIO, but calls stg_exit() directly to exit, rather than
2348 shutdownHaskellAndExit().  Needed for running GHCi in the test suite.
2349]
2350[Fix a broken invariant
2351Simon Marlow <simonmar@microsoft.com>**20060316134151
2352 Patch from #694,  for the problem "empty is an identity for <> and $$" is
2353 currently broken by eg. isEmpty (empty<>empty)"
2354]
2355[Add unsafeSTToIO :: ST s a -> IO a
2356Simon Marlow <simonmar@microsoft.com>**20060315160232
2357 Implementation for Hugs is missing, but should be easy.  We need this
2358 for the forthcoming nested data parallelism implementation.
2359]
2360[Added 'alter'
2361jeanphilippe.bernardy@gmail.com**20060315143539
2362 Added 'alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a' to IntMap and Map
2363 This addresses ticket #665
2364]
2365[deprecate FunctorM in favour of Foldable and Traversable
2366Ross Paterson <ross@soi.city.ac.uk>**20060315092942
2367 as discussed on the libraries list.
2368]
2369[Simplify Eq, Ord, and Show instances for UArray
2370Simon Marlow <simonmar@microsoft.com>**20060313142701
2371 The Eq, Ord, and Show instances of UArray were written out longhand
2372 with one instance per element type.  It is possible to condense these
2373 into a single instance for each class, at the expense of using more
2374 extensions (non-std context on instance declaration).
2375 
2376 Suggestion by: Frederik Eaton <frederik@ofb.net>
2377 
2378]
2379[Oops typo in intSet notMember
2380jeanphilippe.bernardy@gmail.com**20060311224713]
2381[IntMap lookup now returns monad instead of Maybe.
2382jeanphilippe.bernardy@gmail.com**20060311224502]
2383[Added notMember to Data.IntSet and Data.IntMap
2384jeanphilippe.bernardy@gmail.com**20060311085221]
2385[add Data.Set.notMember and Data.Map.notMember
2386John Meacham <john@repetae.net>**20060309191806]
2387[addToClockTime: handle picoseconds properly
2388Simon Marlow <simonmar@microsoft.com>**20060310114532
2389 fixes #588
2390]
2391[make head/build rule apply to all types, not just Bool.
2392John Meacham <john@repetae.net>**20060303045753]
2393[Avoid overflow when normalising clock times
2394Ian Lynagh <igloo@earth.li>**20060210144638]
2395[Years have 365 days, not 30*365
2396Ian Lynagh <igloo@earth.li>**20060210142853]
2397[declare blkcmp() static
2398Simon Marlow <simonmar@microsoft.com>**20060223134317]
2399[typo in comment in Foldable class
2400Ross Paterson <ross@soi.city.ac.uk>**20060209004901]
2401[simplify fmap
2402Ross Paterson <ross@soi.city.ac.uk>**20060206095048]
2403[update ref in comment
2404Ross Paterson <ross@soi.city.ac.uk>**20060206095139]
2405[Give -foverlapping-instances to Data.Typeable
2406simonpj@microsoft**20060206133439
2407 
2408 For some time, GHC has made -fallow-overlapping-instances "sticky":
2409 any instance in a module compiled with -fallow-overlapping-instances
2410 can overlap when imported, regardless of whether the importing module
2411 allows overlap.  (If there is an overlap, both instances must come from
2412 modules thus compiled.)
2413 
2414 Instances in Data.Typeable might well want to be overlapped, so this
2415 commit adds the flag to Data.Typeable (with an explanatory comment)
2416 
2417 
2418]
2419[Add -fno-bang-patterns to modules using both bang and glasgow-exts
2420simonpj@microsoft.com**20060203175759]
2421[When splitting a bucket, keep the contents in the same order
2422Simon Marlow <simonmar@microsoft.com>**20060201130427
2423 To retain the property that multiple inserts shadow each other
2424 (see ticket #661, test hash001)
2425]
2426[add foldr/build optimisation for take and replicate
2427Simon Marlow <simonmar@microsoft.com>**20060126164603
2428 This allows take to be deforested, and improves performance of
2429 replicate and replicateM/replicateM_.  We have a separate problem that
2430 means expressions involving [n..m] aren't being completely optimised
2431 because eftIntFB isn't being inlined but otherwise the results look
2432 good. 
2433 
2434 Sadly this has invalidated a number of the nofib benchmarks which were
2435 erroneously using take to duplicate work in a misguided attempt to
2436 lengthen their runtimes (ToDo).
2437]
2438[Generate PrimopWrappers.hs with Haddock docs
2439Simon Marlow <simonmar@microsoft.com>**20060124131121
2440 Patch originally from Dinko Tenev <dinko.tenev@gmail.com>, modified
2441 to add log message by me.
2442]
2443[[project @ 2006-01-19 14:47:15 by ross]
2444ross**20060119144715
2445 backport warning avoidance from Haddock
2446]
2447[[project @ 2006-01-18 11:45:47 by malcolm]
2448malcolm**20060118114547
2449 Fix import of Ix for nhc98.
2450]
2451[[project @ 2006-01-17 09:38:38 by ross]
2452ross**20060117093838
2453 add Ix instance for GeneralCategory.
2454]
2455[TAG Initial conversion from CVS complete
2456John Goerzen <jgoerzen@complete.org>**20060112154126]
2457Patch bundle hash:
24586b93e27f29e0fa6f181dc4e70471eae13d7fd0dc