Ticket #1611: patch.diff

File patch.diff, 106.5 KB (added by guest, 6 years ago)

The patch

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