Ticket #1229: darcspatch

File darcspatch, 56.8 KB (added by jpbernardy, 7 years ago)

Implementation

Line 
1
2New patches:
3
4[Add min/max handling operations for IntSet/IntMap
5jeanphilippe.bernardy@gmail.com**20070315072352] {
6hunk ./Data/IntMap.hs 138
7+            -- * Min\/Max
8+
9+            , maxView
10+            , minView
11+            , findMin   
12+            , findMax
13+            , deleteMin
14+            , deleteMax
15+            , deleteFindMin
16+            , deleteFindMax
17+            , updateMin
18+            , updateMax
19+            , updateMinWithKey
20+            , updateMaxWithKey
21+            , minViewWithKey
22+            , maxViewWithKey
23+
24hunk ./Data/IntMap.hs 167
25-
26+import Control.Monad ( liftM )
27hunk ./Data/IntMap.hs 687
28+
29+{--------------------------------------------------------------------
30+  Min\/Max
31+--------------------------------------------------------------------}
32+
33+-- | /O(log n)/. Update the value at the minimal key.
34+updateMinWithKey :: (Key -> a -> a) -> IntMap a -> IntMap a
35+updateMinWithKey f t
36+    = case t of
37+        Bin p m l r | m < 0 -> let t' = updateMinWithKeyUnsigned f l in Bin p m t' r
38+        Bin p m l r         -> let t' = updateMinWithKeyUnsigned f r in Bin p m l t'
39+        Tip k y -> Tip k (f k y)
40+        Nil -> error "maxView: empty map has no maximal element"
41+
42+updateMinWithKeyUnsigned f t
43+    = case t of
44+        Bin p m l r -> let t' = updateMinWithKeyUnsigned f r in Bin p m l t'
45+        Tip k y -> Tip k (f k y)
46+
47+-- | /O(log n)/. Update the value at the maximal key.
48+updateMaxWithKey :: (Key -> a -> a) -> IntMap a -> IntMap a
49+updateMaxWithKey f t
50+    = case t of
51+        Bin p m l r | m < 0 -> let t' = updateMaxWithKeyUnsigned f r in Bin p m r t'
52+        Bin p m l r         -> let t' = updateMaxWithKeyUnsigned f l in Bin p m t' l
53+        Tip k y -> Tip k (f k y)
54+        Nil -> error "maxView: empty map has no maximal element"
55+
56+updateMaxWithKeyUnsigned f t
57+    = case t of
58+        Bin p m l r -> let t' = updateMaxWithKeyUnsigned f r in Bin p m l t'
59+        Tip k y -> Tip k (f k y)
60+
61+
62+-- | /O(log n)/. Retrieves the maximal (key,value) couple of the map, and the map stripped from that element.
63+-- @fail@s (in the monad) when passed an empty map.
64+maxViewWithKey :: (Monad m) => IntMap a -> m ((Key, a), IntMap a)
65+maxViewWithKey t
66+    = case t of
67+        Bin p m l r | m < 0 -> let (result, t') = maxViewUnsigned l in return (result, bin p m t' r)
68+        Bin p m l r         -> let (result, t') = maxViewUnsigned r in return (result, bin p m l t')
69+        Tip k y -> return ((k,y), Nil)
70+        Nil -> fail "maxView: empty map has no maximal element"
71+
72+maxViewUnsigned t
73+    = case t of
74+        Bin p m l r -> let (result,t') = maxViewUnsigned r in (result,bin p m l t')
75+        Tip k y -> ((k,y), Nil)
76+
77+-- | /O(log n)/. Retrieves the minimal (key,value) couple of the map, and the map stripped from that element.
78+-- @fail@s (in the monad) when passed an empty map.
79+minViewWithKey :: (Monad m) => IntMap a -> m ((Key, a), IntMap a)
80+minViewWithKey t
81+    = case t of
82+        Bin p m l r | m < 0 -> let (result, t') = minViewUnsigned r in return (result, bin p m l t')
83+        Bin p m l r         -> let (result, t') = minViewUnsigned l in return (result, bin p m t' r)
84+        Tip k y -> return ((k,y),Nil)
85+        Nil -> fail "minView: empty map has no minimal element"
86+
87+minViewUnsigned t
88+    = case t of
89+        Bin p m l r -> let (result,t') = minViewUnsigned l in (result,bin p m t' r)
90+        Tip k y -> ((k,y),Nil)
91+
92+
93+-- | /O(log n)/. Update the value at the maximal key.
94+updateMax :: (a -> a) -> IntMap a -> IntMap a
95+updateMax f = updateMaxWithKey (const f)
96+
97+-- | /O(log n)/. Update the value at the minimal key.
98+updateMin :: (a -> a) -> IntMap a -> IntMap a
99+updateMin f = updateMinWithKey (const f)
100+
101+
102+-- Duplicate the Identity monad here because base < mtl.
103+newtype Identity a = Identity { runIdentity :: a }
104+instance Monad Identity where
105+       return a = Identity a
106+       m >>= k  = k (runIdentity m)
107+-- Similar to the Arrow instance.
108+first f (x,y) = (f x,y)
109+
110+
111+-- | /O(log n)/. Retrieves the maximal key of the map, and the map stripped from that element.
112+-- @fail@s (in the monad) when passed an empty map.
113+maxView t = liftM (first snd) (maxViewWithKey t)
114+
115+-- | /O(log n)/. Retrieves the minimal key of the map, and the map stripped from that element.
116+-- @fail@s (in the monad) when passed an empty map.
117+minView t = liftM (first snd) (minViewWithKey t)
118+
119+-- | /O(log n)/. Delete and find the maximal element.
120+deleteFindMax = runIdentity . maxView
121+
122+-- | /O(log n)/. Delete and find the minimal element.
123+deleteFindMin = runIdentity . minView
124+
125+-- | /O(log n)/. The minimal key of the map.
126+findMin = fst . runIdentity . minView
127+
128+-- | /O(log n)/. The maximal key of the map.
129+findMax = fst . runIdentity . maxView
130+
131+-- | /O(log n)/. Delete the minimal key.
132+deleteMin = snd . runIdentity . minView
133+
134+-- | /O(log n)/. Delete the maximal key.
135+deleteMax = snd . runIdentity . maxView
136+
137hunk ./Data/IntSet.hs 71
138+            -- * Min\/Max
139+            , findMin   
140+            , findMax
141+            , deleteMin
142+            , deleteMax
143+            , deleteFindMin
144+            , deleteFindMax
145+            , maxView
146+            , minView
147+
148hunk ./Data/IntSet.hs 169
149+-- Invariant: Nil is never found as a child of Bin.
150+
151hunk ./Data/IntSet.hs 224
152--- | /O(log n)/. Is the element not in the set?
153+-- | /O(min(n,W))/. Is the element not in the set?
154hunk ./Data/IntSet.hs 471
155--- | /O(log n)/. The expression (@'split' x set@) is a pair @(set1,set2)@
156+-- | /O(min(n,W))/. The expression (@'split' x set@) is a pair @(set1,set2)@
157hunk ./Data/IntSet.hs 504
158--- | /O(log n)/. Performs a 'split' but also returns whether the pivot
159+-- | /O(min(n,W))/. Performs a 'split' but also returns whether the pivot
160hunk ./Data/IntSet.hs 534
161+{----------------------------------------------------------------------
162+  Min/Max
163+----------------------------------------------------------------------}
164+
165+-- | /O(min(n,W))/. Retrieves the maximal key of the set, and the set stripped from that element
166+-- @fail@s (in the monad) when passed an empty set.
167+maxView :: (Monad m) => IntSet -> m (Int, IntSet)
168+maxView t
169+    = case t of
170+        Bin p m l r | m < 0 -> let (result,t') = maxViewUnsigned l in return (result, bin p m t' r)
171+        Bin p m l r         -> let (result,t') = maxViewUnsigned r in return (result, bin p m l t')           
172+        Tip y -> return (y,Nil)
173+        Nil -> fail "maxView: empty set has no maximal element"
174+
175+maxViewUnsigned :: IntSet -> (Int, IntSet)
176+maxViewUnsigned t
177+    = case t of
178+        Bin p m l r -> let (result,t') = maxViewUnsigned r in (result, bin p m l t')
179+        Tip y -> (y, Nil)
180+
181+-- | /O(min(n,W))/. Retrieves the minimal key of the set, and the set stripped from that element
182+-- @fail@s (in the monad) when passed an empty set.
183+minView :: (Monad m) => IntSet -> m (Int, IntSet)
184+minView t
185+    = case t of
186+        Bin p m l r | m < 0 -> let (result,t') = minViewUnsigned r in return (result, bin p m l t')           
187+        Bin p m l r         -> let (result,t') = minViewUnsigned l in return (result, bin p m t' r)
188+        Tip y -> return (y, Nil)
189+        Nil -> fail "minView: empty set has no minimal element"
190+
191+minViewUnsigned :: IntSet -> (Int, IntSet)
192+minViewUnsigned t
193+    = case t of
194+        Bin p m l r -> let (result,t') = minViewUnsigned l in (result, bin p m t' r)
195+        Tip y -> (y, Nil)
196+
197+
198+-- Duplicate the Identity monad here because base < mtl.
199+newtype Identity a = Identity { runIdentity :: a }
200+instance Monad Identity where
201+       return a = Identity a
202+       m >>= k  = k (runIdentity m)
203+
204+
205+-- | /O(min(n,W))/. Delete and find the minimal element.
206+--
207+-- > deleteFindMin set = (findMin set, deleteMin set)
208+deleteFindMin :: IntSet -> (Int, IntSet)
209+deleteFindMin = runIdentity . minView
210+
211+-- | /O(min(n,W))/. Delete and find the maximal element.
212+--
213+-- > deleteFindMax set = (findMax set, deleteMax set)
214+deleteFindMax :: IntSet -> (Int, IntSet)
215+deleteFindMax = runIdentity . maxView
216+
217+-- | /O(min(n,W))/. The minimal element of a set.
218+findMin :: IntSet -> Int
219+findMin = fst . runIdentity . minView
220+
221+-- | /O(min(n,W))/. The maximal element of a set.
222+findMax :: IntSet -> Int
223+findMax = fst . runIdentity . maxView
224+
225+-- | /O(min(n,W))/. Delete the minimal element.
226+deleteMin :: IntSet -> IntSet
227+deleteMin = snd . runIdentity . minView
228+
229+-- | /O(min(n,W))/. Delete the maximal element.
230+deleteMax :: IntSet -> IntSet
231+deleteMax = snd . runIdentity . maxView
232+
233+
234+
235hunk ./Data/Map.hs 160
236+            , minViewWithKey
237+            , maxViewWithKey
238}
239
240Context:
241
242[copyBytes copies bytes, not elements; fixes trac #1203
243Ian Lynagh <igloo@earth.li>**20070312113555]
244[Add ioeGetLocation, ioeSetLocation to System/IO/Error.hs; trac #1191
245Ian Lynagh <igloo@earth.li>**20070304130315]
246[fix race condition in prodServiceThread
247Simon Marlow <simonmar@microsoft.com>**20070307134330
248 See #1187
249]
250[Prevent duplication of unsafePerformIO on a multiprocessor
251Simon Marlow <simonmar@microsoft.com>**20070306145424
252 Fixes #986.  The idea is to add a new operation
253 
254   noDuplicate :: IO ()
255 
256 it is guaranteed that if two threads have executed noDuplicate, then
257 they are not duplicating any computation.
258 
259 We now provide two new unsafe operations:
260 
261 unsafeDupablePerformIO    :: IO a -> a
262 unsafeDupableInterleaveIO :: IO a -> IO a
263 
264 which are equivalent to the old unsafePerformIO and unsafeInterleaveIO
265 respectively.  The new versions of these functions are defined as:
266 
267 unsafePerformIO    m = unsafeDupablePerformIO (noDuplicate >> m)
268 unsafeInterleaveIO m = unsafeDupableInterleaveIO (noDuplicate >> m)
269]
270[expand docs for forkOS
271Simon Marlow <simonmar@microsoft.com>**20070305160921]
272[document timeout limitations
273Peter Simons <simons@cryp.to>**20070228223540]
274[So many people were involved in the writing of this module that
275Peter Simons <simons@cryp.to>**20070228223415
276 it feels unfair to single anyone out as the lone copyright
277 holder.
278]
279[This patch adds a timeout function to the base libraries. Trac #980 is
280Peter Simons <simons@cryp.to>**20070126222615
281 concerned with this issue. The design guideline for this implementation
282 is that 'timeout N E' should behave exactly the same as E as long as E
283 doesn't time out. In our implementation, this means that E has the same
284 myThreadId it would have without the timeout wrapper. Any exception E
285 might throw cancels the timeout and propagates further up. It also
286 possible for E to receive exceptions thrown to it by another thread.
287]
288[PArr: fixed permutations
289Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070305055807]
290[Add Data.String, containing IsString(fromString); trac proposal #1126
291Ian Lynagh <igloo@earth.li>**20070130134841
292 This is used by the overloaded strings extension (-foverloaded-strings in GHC).
293]
294[GHC.PArr: add bounds checking
295Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070302053224]
296[Bump nhc98 stack size for System/Time.hsc
297sven.panne@aedion.de**20070301153009]
298[FDs are CInts now, fixing non-GHC builds
299sven.panne@aedion.de**20070225105620]
300[Fixed PArr.dropP
301Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20070222032405
302 - Thanks to Audrey Tang for the bug report
303]
304[Keep the same FD in both halves of a duplex handle when dup'ing
305Ian Lynagh <igloo@earth.li>**20070220141039
306 Otherwise we only close one of the FDs when closing the handle.
307 Fixes trac #1149.
308]
309[Remove more redundant FD conversions
310Ian Lynagh <igloo@earth.li>**20070220092520]
311[Fix FD changes on Windows
312Ian Lynagh <igloo@earth.li>**20070220091516]
313[Consistently use CInt rather than Int for FDs
314Ian Lynagh <igloo@earth.li>**20070219233854]
315[fix for hashString, from Jan-Willem Maessen (see #1137)
316Simon Marlow <simonmar@microsoft.com>**20070215094304
317 
318]
319[fix to getUSecOfDay(): arithmetic was overflowing
320Simon Marlow <simonmar@microsoft.com>**20070214161719]
321[Fix the types of minView/maxView (ticket #1134)
322jeanphilippe.bernardy@gmail.com**20070210065115]
323[The Windows counterpart to 'wrapround of thread delays'
324Ian Lynagh <igloo@earth.li>**20070209173510]
325[wrapround of thread delays
326Neil Davies <SemanticPhilosopher@gmail.com>**20070129160519
327 
328   * made the wrapround of the underlying O/S occur before the wrapround
329     of the delayed threads by making threads delay in microseconds since
330     O/S epoch (1970 - Unix, 1601 - Windows) stored in Word64.
331   * removed redundant calls reading O/S realtime clock
332   * removed rounding to 1/50th of sec for timers
333   * Only for Unix version of scheduler.
334]
335[Whitespace changes only
336Ian Lynagh <igloo@earth.li>**20070206232722]
337[Add some type sigs
338Ian Lynagh <igloo@earth.li>**20070206232439]
339[Use static inline rather than extern inline/inline
340Ian Lynagh <igloo@earth.li>**20070205203628
341 I understand this is more portable, and it also fixes warnings when
342 C things we are wrapping are themselves static inlines (which FD_ISSET
343 is on ppc OS X).
344]
345[add derived instances for Dual monoid
346Ross Paterson <ross@soi.city.ac.uk>**20070202190847]
347[add doc pointers to Foldable
348Ross Paterson <ross@soi.city.ac.uk>**20070202110931
349 
350 Could be applied to STABLE.
351]
352[Eliminate some warnings
353Ian Lynagh <igloo@earth.li>**20060729220854
354 Eliminate warnings in the libraries caused by mixing pattern matching
355 with numeric literal matching.
356]
357[Remove IsString(fromString) from the Prelude
358Ian Lynagh <igloo@earth.li>**20070130124136]
359[Add Kleisli composition
360Don Stewart <dons@cse.unsw.edu.au>**20061113015442]
361[IsString is GHC-only (so why is it in the Prelude?)
362Ross Paterson <ross@soi.city.ac.uk>**20070123183007]
363[Applicative and Monad instances for Tree
364Ross Paterson <ross@soi.city.ac.uk>**20070115174510]
365[Add IsString class for overloaded string literals.
366lennart@augustsson.net**20061221210532]
367[Added examples, more detailed documentation to Data.List Extracting sublists functions
368Andriy Palamarchuk <apa3a@yahoo.com>**20061204164710]
369[fix threadDelay
370Simon Marlow <simonmar@microsoft.com>**20070117091702
371 In "Add support for the IO manager thread" I accidentally spammed part
372 of "Make sure the threaded threadDelay sleeps at least as long as it
373 is asked", which is why the ThreadDelay001 test has been failing.
374]
375[update section on "blocking"
376Simon Marlow <simonmar@microsoft.com>**20070116124328]
377[Fix crash with   (minBound :: Int*) `div (-1)   as result is maxBound + 1.
378Ian Lynagh <igloo@earth.li>**20070115142005]
379[version of example using Tomasz Zielonka's technique
380Ross Paterson <ross@soi.city.ac.uk>**20070105175907]
381[Added Unknowns for higher kinds
382Pepe Iborra <mnislaih@gmail.com>**20061108155938]
383[Improved the Show instance for Unknown
384Pepe Iborra <mnislaih@gmail.com>**20060813111816]
385[Show instance for GHC.Base.Unknown
386mnislaih@gmail.com**20060801233530]
387[Introduce Unknowns for the closure viewer. Add breakpointCond which was missing
388mnislaih@gmail.com**20060725174537]
389[Fix missing comma in Fractional documentation
390Alec Berryman <alec@thened.net>**20061201173237]
391[Mention that throwTo does not guarantee promptness of delivery
392simonpj@microsoft**20061211123215]
393[Add note about synhronous delivery of throwTo
394simonpj@microsoft**20061211122257]
395[documentation for installHandler
396Simon Marlow <simonmar@microsoft.com>**20061205154927
397 merge to 6.6
398]
399[dos2unix
400Simon Marlow <simonmar@microsoft.com>**20061204095439]
401[don't try to compile this on Unix
402Simon Marlow <simonmar@microsoft.com>**20061204095427]
403[TAG 6.6 release
404Ian Lynagh <igloo@earth.li>**20061011124740]
405[TAG Version 2.1
406Ian Lynagh <igloo@earth.li>**20061009114014]
407[Bump version number
408Ian Lynagh <igloo@earth.li>**20061009114009]
409[Add support for the IO manager thread on Windows
410Simon Marlow <simonmar@microsoft.com>**20061201152042
411 Fixes #637.  The test program in that report now works for me with
412 -threaded, but it doesn't work without -threaded (I don't know if
413 that's new behaviour or not, though).
414]
415[deriving (Eq, Ord, Enum, Show, Read, Typeab) for ConsoleEvent
416Simon Marlow <simonmar@microsoft.com>**20061201144032]
417[Make sure the threaded threadDelay sleeps at least as long as it is asked to
418Ian Lynagh <igloo@earth.li>**20061128204807]
419[Add comments about argument order to the definitions of gmapQ and constrFields
420simonpj@microsoft**20061124164505]
421[Hugs: add Control.Parallel.Strategies
422Ross Paterson <ross@soi.city.ac.uk>**20061124161039]
423[Move instance of Show Ptr to Ptr.hs (fewer orphans)
424simonpj@microsoft.com**20061124100639]
425[Add type signatures
426simonpj@microsoft.com**20061124100621]
427[Add an example of the use of unfoldr, following doc feedback from dozer
428Don Stewart <dons@cse.unsw.edu.au>**20061124011249]
429[trim imports
430Ross Paterson <ross@soi.city.ac.uk>**20061123190352]
431[Data.Graph is now portable (enable for nhc98)
432Malcolm.Wallace@cs.york.ac.uk**20061123174913]
433[remove Data.FunctorM and Data.Queue
434Ross Paterson <ross@soi.city.ac.uk>**20061112001046
435 
436 These were deprecated in 6.6, and can thus be removed in 6.8.
437]
438[make Data.Graph portable (no change to the interface)
439Ross Paterson <ross@soi.city.ac.uk>**20061122010040
440 
441 The algorithm now uses STArrays on GHC and IntSets elsewhere.
442 (Hugs has STArrays, but avoiding them saves a -98, and boxed arrays
443 aren't fast under Hugs anyway.)
444]
445[One less unsafeCoerce# in the tree
446Don Stewart <dons@cse.unsw.edu.au>**20061120120242]
447[typo in comment
448Ross Paterson <ross@soi.city.ac.uk>**20061120115106]
449[fix shift docs to match ffi spec
450Ross Paterson <ross@soi.city.ac.uk>**20061117003144]
451[(nhc98) use new primitive implementations of h{Put,Get}Buf.
452Malcolm.Wallace@cs.york.ac.uk**20061116173104]
453[The wrong 'cycle' was exported from Data.ByteString.Lazy.Char8, spotted by sjanssen
454Don Stewart <dons@cse.unsw.edu.au>**20061110021311]
455[LPS chunk sizes should be 16 bytes, not 17.
456Don Stewart <dons@cse.unsw.edu.au>**20061110021254]
457[Update comments on Prelude organisation in GHC/Base.lhs
458Ian Lynagh <igloo@earth.li>**20061115001926]
459[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.
460bringert@cs.chalmers.se**20061113224202]
461[Control.Parallel.Strategies: added NFData instances for Data.Int.*, Data.Word.*, Maybe, Either, Map, Set, Tree, IntMap, IntSet.
462bringert@cs.chalmers.se**20061113221843]
463[Control.Parallel.Strategies: deprecate sPar, sSeq, Assoc, fstPairFstList, force and sforce.
464bringert@cs.chalmers.se**20061113215219
465 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.
466]
467[add Control.Monad.Instances to nhc98 build
468Malcolm.Wallace@cs.york.ac.uk**20061113113221]
469[Control.Parallel.Strategies: clarified documentation of parListChunk.
470bringert@cs.chalmers.se**20061112232904]
471[Added and cleaned up Haddock comments in Control.Parallel.Strategies.
472bringert@cs.chalmers.se**20061112220445
473 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.
474]
475[Fix broken pragmas; spotted by Bulat Ziganshin
476Ian Lynagh <igloo@earth.li>**20061111205916]
477[add doc link to bound threads section
478Ross Paterson <ross@soi.city.ac.uk>**20060929103252]
479[hide Data.Array.IO.Internals
480Ross Paterson <ross@soi.city.ac.uk>**20061111113248
481 
482 It's hidden from haddock, and everything it exports is re-exported by
483 Data.Array.IO.
484]
485[add Data.Function
486Malcolm.Wallace@cs.york.ac.uk**20061110142710]
487[add Data.Function
488Ross Paterson <ross@soi.city.ac.uk>**20061110141354]
489[whitespace only
490Ross Paterson <ross@soi.city.ac.uk>**20061110141326]
491[move fix to Data.Function
492Ross Paterson <ross@soi.city.ac.uk>**20061110141120]
493[import Prelude
494Ross Paterson <ross@soi.city.ac.uk>**20061110140445]
495[Added Data.Function (Trac ticket #979).
496Nils Anders Danielsson <nad@cs.chalmers.se>**20061110122503
497 + A module with simple combinators working solely on and with
498   functions.
499 + The only new function is "on".
500 + Some functions from the Prelude are re-exported.
501]
502[__hscore_long_path_size is not portable beyond GHC
503Malcolm.Wallace@cs.york.ac.uk**20061110113222]
504[redefine writeFile and appendFile using withFile
505Ross Paterson <ross@soi.city.ac.uk>**20061107140359]
506[add withFile and withBinaryFile (#966)
507Ross Paterson <ross@soi.city.ac.uk>**20061107134510]
508[remove conflicting import for nhc98
509Malcolm.Wallace@cs.york.ac.uk**20061108111215]
510[Add intercalate to Data.List (ticket #971)
511Josef Svenningsson <josef.svenningsson@gmail.com>**20061102122052]
512[non-GHC: fix canonicalizeFilePath
513Ross Paterson <ross@soi.city.ac.uk>**20061107133902
514 
515 I've also removed the #ifdef __GLASGOW_HASKELL__ from the proper
516 Windows versions of a few functions.  These will need testing with
517 Hugs on Windows.
518]
519[enable canonicalizePath for non-GHC platforms
520Simon Marlow <simonmar@microsoft.com>**20061107121141]
521[Update documentation for hWaitForInput
522Simon Marlow <simonmar@microsoft.com>**20061107111430
523 See #972
524 Merge to 6.6 branch.
525]
526[Use unchecked shifts to implement Data.Bits.rotate
527Samuel Bronson <naesten@gmail.com>**20061012125553
528 This should get rid of those cases, maybe lower the size enough that the inliner will like it?
529]
530[fix Haddock module headers
531Ross Paterson <ross@soi.city.ac.uk>**20061106124140]
532[fix example in docs
533Ross Paterson <ross@soi.city.ac.uk>**20061106115628]
534[Add intercalate and split to Data.List
535Josef Svenningsson <josef.svenningsson@gmail.com>*-20061024172357]
536[Data.Generics.Basics is GHC-only
537Ross Paterson <ross@soi.city.ac.uk>**20061102111736]
538[#ifdef around non-portable Data.Generics.Basics
539Malcolm.Wallace@cs.york.ac.uk**20061102103445]
540[Add deriving Data to Complex
541simonpj@microsoft**20061101102059]
542[minor clarification of RandomGen doc
543Ross Paterson <ross@soi.city.ac.uk>**20061030230842]
544[rearrange docs a bit
545Ross Paterson <ross@soi.city.ac.uk>**20061030161223]
546[Add intercalate and split to Data.List
547Josef Svenningsson <josef.svenningsson@gmail.com>**20061024172357]
548[Export pseq from Control.Parallel, and use it in Control.Parallel.Strategies
549Simon Marlow <simonmar@microsoft.com>**20061027150141]
550[`par` should be infixr 0
551Simon Marlow <simonmar@microsoft.com>**20061027130800
552 Alas, I didn't spot this due to lack of testing, and the symptom is
553 that an expression like x `par` y `seq z will have exactly the wrong
554 parallelism properties.  The workaround is to add parantheses.
555 
556 I think we could push this to the 6.6 branch.
557]
558[fix example in comment
559Ross Paterson <ross@soi.city.ac.uk>**20061023163925]
560[Use the new Any type for dynamics (GHC only)
561simonpj@microsoft**20061019160408]
562[add Data.Sequence to nhc98 build
563Malcolm.Wallace@cs.york.ac.uk**20061012135200]
564[Remove Data.FiniteMap, add Control.Applicative, Data.Traversable, and
565Malcolm.Wallace@cs.york.ac.uk**20061012095605
566 Data.Foldable to the nhc98 build.
567]
568[STM invariants
569tharris@microsoft.com**20061007123253]
570[Inline shift in GHC's Bits instances for {Int,Word}{,8,16,32,64}
571Samuel Bronson <naesten@gmail.com>**20061009020906]
572[Don't create GHC.Prim when bootstrapping; we can't, and we don't need it
573Ian Lynagh <igloo@earth.li>**20061004165355]
574[Data.ByteString: fix lazyness of take, drop & splitAt
575Don Stewart <dons@cse.unsw.edu.au>**20061005011703
576 
577 ByteString.Lazy's take, drop and splitAt were too strict when demanding
578 a byte string. Spotted by Einar Karttunen. Thanks to him and to Bertram
579 Felgenhauer for explaining the problem and the fix.
580 
581]
582[Fix syntax error that prevents building Haddock documentation on Windows
583brianlsmith@gmail.com**20060917013530]
584[Hugs only: unbreak typeRepKey
585Ross Paterson <ross@soi.city.ac.uk>**20060929102743]
586[make hGetBufNonBlocking do something on Windows w/ -threaded
587Simon Marlow <simonmar@microsoft.com>**20060927145811
588 hGetBufNonBlocking will behave the same as hGetBuf on Windows now, which
589 is better than just crashing (which it did previously).
590]
591[add typeRepKey :: TypeRep -> IO Int
592Simon Marlow <simonmar@microsoft.com>**20060927100342
593 See feature request #880
594]
595[fix header comment
596Ross Paterson <ross@soi.city.ac.uk>**20060926135843]
597[doc tweaks, including more precise equations for evaluate
598Ross Paterson <ross@soi.city.ac.uk>**20060910115259]
599[Sync Data.ByteString with stable branch
600Don Stewart <dons@cse.unsw.edu.au>**20060909050111
601 
602 This patch:
603     * hides the LPS constructor (its in .Base if you need it)
604     * adds functions to convert between strict and lazy bytestrings
605     * and adds readInteger
606 
607]
608[Typeable1 instances for STM and TVar
609Ross Paterson <ross@soi.city.ac.uk>**20060904231425]
610[remove obsolete Hugs stuff
611Ross Paterson <ross@soi.city.ac.uk>**20060904223944]
612[Cleaner isInfixOf suggestion from Ross Paterson
613John Goerzen <jgoerzen@complete.org>**20060901143654]
614[New function isInfixOf that searches a list for a given sublist
615John Goerzen <jgoerzen@complete.org>**20060831151556
616 
617 Example:
618 
619 isInfixOf "Haskell" "I really like Haskell." -> True
620 isInfixOf "Ial" "I really like Haskell." -> False
621 
622 This function was first implemented in MissingH as MissingH.List.contains
623]
624[Add strict versions of insertWith and insertWithKey (Data.Map)
625jeanphilippe.bernardy@gmail.com**20060910162443]
626[Better doc on Data.Map.lookup: explain what the monad is for
627jeanphilippe.bernardy@gmail.com**20060903133440]
628[fix hDuplicateTo on Windows
629Simon Marlow <simonmar@microsoft.com>**20060901150016
630 deja vu - I'm sure I remember fixing this before...
631]
632[Improve documentation of atomically
633simonpj@microsoft**20060714120207]
634[Add missing method genRange for StdGen (fixes #794)
635simonpj@microsoft**20060707151901
636 
637        MERGE TO STABLE
638 
639 Trac #794 reports (correctly) that the implementation of StdGen
640 only returns numbers in the range (0..something) rather than
641 (minBound, maxBound), which is what StdGen's genRange claims.
642 
643 This commit fixes the problem, by implementing genRange for StdGen
644 (previously it just used the default method).
645 
646 
647]
648[mark nhc98 import hack
649Ross Paterson <ross@soi.city.ac.uk>**20060831125219]
650[remove some outdated comments
651Simon Marlow <simonmar@microsoft.com>**20060831104200]
652[import Control.Arrow.ArrowZero to help nhc98's type checker
653Malcolm.Wallace@cs.york.ac.uk**20060831101105]
654[remove Text.Regex(.Posix) from nhc98 build
655Malcolm.Wallace@cs.york.ac.uk**20060831101016]
656[add Data.Foldable.{msum,asum}, plus tweaks to comments
657Ross Paterson <ross@soi.city.ac.uk>**20060830163521]
658[fix doc typo
659Ross Paterson <ross@soi.city.ac.uk>**20060830134123]
660[add Data.Foldable.{for_,forM_} and Data.Traversable.{for,forM}
661Ross Paterson <ross@soi.city.ac.uk>**20060830133805
662 
663 generalizing Control.Monad.{forM_,forM}
664]
665[Make length a good consumer
666simonpj@microsoft*-20060508142726
667 
668 Make length into a good consumer.  Fixes Trac bug #707.
669 
670 (Before length simply didn't use foldr.)
671 
672]
673[Add Control.Monad.forM and forM_
674Don Stewart <dons@cse.unsw.edu.au>**20060824081118
675 
676 flip mapM_ is more and more common, I find. Several suggestions have
677 been made to add this, as foreach or something similar. This patch
678 does just that:
679 
680     forM  :: (Monad m) => [a] -> (a -> m b) -> m [b]
681     forM_ :: (Monad m) => [a] -> (a -> m b) -> m ()
682 
683 So we can write:
684     
685     Prelude Control.Monad> forM_ [1..4] $ \x -> print x
686     1
687     2
688     3
689     4
690 
691]
692[Hide internal module from haddock in Data.ByteString
693Don Stewart <dons@cse.unsw.edu.au>**20060828011515]
694[add advice on avoiding import ambiguities
695Ross Paterson <ross@soi.city.ac.uk>**20060827170407]
696[expand advice on importing these modules
697Ross Paterson <ross@soi.city.ac.uk>**20060827164044]
698[add Haddock marker
699Ross Paterson <ross@soi.city.ac.uk>**20060827115140]
700[Clarify how one hides Prelude.catch
701Don Stewart <dons@cse.unsw.edu.au>**20060826124346
702 
703 User feedback indicated that an example was required, of how to hide
704 Prelude.catch, so add such an example to the docs
705 
706]
707[Workaround for OSes that don't have intmax_t and uintmax_t
708Ian Lynagh <igloo@earth.li>**20060825134936
709 OpenBSD (and possibly others) do not have intmax_t and uintmax_t types:
710     http://www.mail-archive.com/haskell-prime@haskell.org/msg01548.html
711 so substitute (unsigned) long long if we have them, otherwise
712 (unsigned) long.
713 
714]
715[add docs for par
716Simon Marlow <simonmar@microsoft.com>**20060825110610]
717[document minimal complete definition for Bits
718Ross Paterson <ross@soi.city.ac.uk>**20060824140504]
719[C regex library bits have moved to the regex-posix package
720Simon Marlow <simonmar@microsoft.com>**20060824132311]
721[Add shared Typeable support (ghc only)
722Esa Ilari Vuokko <ei@vuokko.info>**20060823003126]
723[this should have been removed with the previous patch
724Simon Marlow <simonmar@microsoft.com>**20060824121223]
725[remove Text.Regx & Text.Regex.Posix
726Simon Marlow <simonmar@microsoft.com>**20060824094615
727 These are subsumed by the new regex-base, regex-posix and regex-compat
728 packages.
729]
730[explicitly tag Data.ByteString rules with the FPS prefix.
731Don Stewart <dons@cse.unsw.edu.au>**20060824041326]
732[Add spec rules for sections in Data.ByteString
733Don Stewart <dons@cse.unsw.edu.au>**20060824012611]
734[Sync Data.ByteString with current stable branch, 0.7
735Don Stewart <dons@cse.unsw.edu.au>**20060823143338]
736[add notes about why copyFile doesn't remove the target
737Simon Marlow <simonmar@microsoft.com>**20060823095059]
738[copyFile: try removing the target file before opening it for writing
739Simon Marlow <simonmar@microsoft.com>*-20060822121909]
740[copyFile: try removing the target file before opening it for writing
741Simon Marlow <simonmar@microsoft.com>**20060822121909]
742[add alternative functors and extra instances
743Ross Paterson <ross@soi.city.ac.uk>**20060821152151
744 
745 * Alternative class, for functors with a monoid
746 * instances for Const
747 * instances for arrows
748]
749[generate Haddock docs on all platforms
750Simon Marlow <simonmar@microsoft.com>**20060821131612]
751[remove extra comma from import
752Ross Paterson <ross@soi.city.ac.uk>**20060819173954]
753[fix docs for withC(A)StringLen
754Ross Paterson <ross@soi.city.ac.uk>**20060818170328]
755[use Haskell'98 compliant indentation in do blocks
756Malcolm.Wallace@cs.york.ac.uk**20060818130810]
757[use correct names of IOArray operations for nhc98
758Malcolm.Wallace@cs.york.ac.uk**20060818130714]
759[add mapMaybe and mapEither, plus WithKey variants
760Ross Paterson <ross@soi.city.ac.uk>**20060817235041]
761[remove Text.Html from nhc98 build
762Malcolm.Wallace@cs.york.ac.uk**20060817135502]
763[eliminate more HOST_OS tests
764Ross Paterson <ross@soi.city.ac.uk>**20060815190609]
765[Hugs only: disable unused process primitives
766Ross Paterson <ross@soi.city.ac.uk>**20060813184435
767 
768 These were the cause of Hugs bug #30, I think, and weren't used by Hugs anyway.
769]
770[markup fix to Data.HashTable
771Ross Paterson <ross@soi.city.ac.uk>**20060812103835]
772[revert removal of ghcconfig.h from package.conf.in
773Ross Paterson <ross@soi.city.ac.uk>**20060812082702
774 
775 as it's preprocessed with -undef (pointed out by Esa Ilari Vuokko)
776]
777[fix Data.HashTable for non-GHC
778Ross Paterson <ross@soi.city.ac.uk>**20060811231521]
779[remove deprecated 'withObject'
780Simon Marlow <simonmar@microsoft.com>**20060811152350]
781[Jan-Willem Maessen's improved implementation of Data.HashTable
782Simon Marlow <simonmar@microsoft.com>**20060811151024
783 Rather than incrementally enlarging the hash table, this version
784 just does it in one go when the table gets too full.
785]
786[Warning police: Make some prototypes from the RTS known
787sven.panne@aedion.de**20060811144629]
788[Warning police: Removed useless catch-all clause
789sven.panne@aedion.de**20060811142208]
790[reduce dependency on ghcconfig.h
791Ross Paterson <ross@soi.city.ac.uk>**20060811124030
792 
793 The only remaining use is in cbits/dirUtils.h, which tests solaris2_HOST_OS
794 
795 (Also System.Info uses ghcplatform.h and several modules import MachDeps.h
796 to get SIZEOF_* and ALIGNMENT_* from ghcautoconf.h)
797]
798[(non-GHC only) track MArray interface change
799Ross Paterson <ross@soi.city.ac.uk>**20060810182902]
800[move Text.Html to a separate package
801Simon Marlow <simonmar@microsoft.com>**20060810113017]
802[bump version to 2.0
803Simon Marlow <simonmar@microsoft.com>**20060810112833]
804[Remove deprecated Data.FiniteMap and Data.Set interfaces
805Simon Marlow <simonmar@microsoft.com>**20060809153810]
806[move altzone test from ghc to base package
807Ross Paterson <ross@soi.city.ac.uk>**20060809124259]
808[remove unnecessary #include "ghcconfig.h"
809Ross Paterson <ross@soi.city.ac.uk>**20060809123812]
810[Change the API of MArray to allow resizable arrays
811Simon Marlow <simonmar@microsoft.com>**20060809100548
812 See #704
813 
814 The MArray class doesn't currently allow a mutable array to change its
815 size, because of the pure function
816 
817   bounds :: (HasBounds a, Ix i) => a i e -> (i,i)
818 
819 This patch removes the HasBounds class, and adds
820 
821   getBounds :: (MArray a e m, Ix i) => a i e -> m (i,i)
822 
823 to the MArray class, and
824 
825   bounds :: (IArray a e, Ix i) => a i e -> (i,i)
826 
827 to the IArray class.
828 
829 The reason that bounds had to be incorporated into the IArray class is
830 because I couldn't make DiffArray work without doing this.  DiffArray
831 acts as a layer converting an MArray into an IArray, and there was no
832 way (that I could find) to define an instance of HasBounds for
833 DiffArray.
834]
835[deprecate this module.
836Simon Marlow <simonmar@microsoft.com>**20060808100708]
837[add traceShow (see #474)
838Simon Marlow <simonmar@microsoft.com>**20060807155545]
839[remove spurious 'extern "C" {'
840Simon Marlow <simonmar@microsoft.com>**20060724160258]
841[Fix unsafeIndex for large ranges
842Simon Marlow <simonmar@microsoft.com>**20060721100225]
843[disambiguate uses of foldr for nhc98 to compile without errors
844Malcolm.Wallace@cs.york.ac.uk**20060711161614]
845[make Control.Monad.Instances compilable by nhc98
846Malcolm.Wallace@cs.york.ac.uk**20060711160941]
847[breakpointCond
848Lemmih <lemmih@gmail.com>**20060708055528]
849[UNDO: Merge "unrecognized long opt" fix from 6.4.2
850Simon Marlow <simonmar@microsoft.com>**20060705142537
851 This patch undid the previous patch, "RequireOrder: do not collect
852 unrecognised options after a non-opt".  I asked Sven to revert it, but
853 didn't get an answer.
854 
855 See bug #473.
856]
857[Avoid strictness in accumulator for unpackFoldr
858Don Stewart <dons@cse.unsw.edu.au>**20060703091806
859 
860 The seq on the accumulator for unpackFoldr will break in the presence of
861 head/build rewrite rules. The empty list case will be forced, producing
862 an exception. This is a known issue with seq and rewrite rules that we
863 just stumbled on to.
864 
865]
866[Disable unpack/build fusion
867Don Stewart <dons@cse.unsw.edu.au>**20060702083913
868 
869 unpack/build on bytestrings seems to trigger a bug when interacting with
870 head/build fusion in GHC.List. The bytestring001 testcase catches it.
871 
872 I'll investigate further, but best to disable this for now (its not
873 often used anyway).
874 
875 Note that with -frules-off or ghc 6.4.2 things are fine. It seems to
876 have emerged with the recent rules changes.
877 
878]
879[Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head
880Don Stewart <dons@cse.unsw.edu.au>**20060701084345
881 
882 This patch imports the Data.ByteString.Lazy module, and its helpers,
883 providing a ByteString implemented as a lazy list of strict cache-sized
884 chunks. This type allows the usual lazy operations to be written on
885 bytestrings, including lazy IO, with much improved space and time over
886 the [Char] equivalents.
887 
888]
889[Wibble in docs for new ForeignPtr functionsn
890Don Stewart <dons@cse.unsw.edu.au>**20060609075924]
891[comments for Applicative and Traversable
892Ross Paterson <ross@soi.city.ac.uk>**20060622170436]
893[default to NoBuffering on Windows for a read/write text file
894Simon Marlow <simonmar@microsoft.com>**20060622144446
895 Fixes (works around) #679
896]
897[remove dead code
898Simon Marlow <simonmar@microsoft.com>**20060622144433]
899[clarify and expand docs
900Simon Marlow <simonmar@microsoft.com>**20060622112911]
901[Add minView and maxView to Map and Set
902jeanphilippe.bernardy@gmail.com**20060616180121]
903[add signature for registerDelay
904Ross Paterson <ross@soi.city.ac.uk>**20060614114456]
905[a few doc comments
906Ross Paterson <ross@soi.city.ac.uk>**20060613142704]
907[Optimised foreign pointer representation, for heap-allocated objects
908Don Stewart <dons@cse.unsw.edu.au>**20060608015011]
909[Add the inline function, and many comments
910simonpj@microsoft.com**20060605115814
911 
912 This commit adds the 'inline' function described in the
913 related patch in the compiler.
914 
915 I've also added comments about the 'lazy' function.
916 
917]
918[small intro to exceptions
919Ross Paterson <ross@soi.city.ac.uk>**20060525111604]
920[export breakpoint
921Simon Marlow <simonmar@microsoft.com>**20060525090456]
922[Merge in changes from fps head. Highlights:
923Don Stewart <dons@cse.unsw.edu.au>**20060525065012
924 
925     Wed May 24 15:49:38 EST 2006  sjanssen@cse.unl.edu
926       * instance Monoid ByteString
927 
928     Wed May 24 15:04:04 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
929       * Rearange export lists for the .Char8 modules
930 
931     Wed May 24 14:59:56 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
932       * Implement mapAccumL and reimplement mapIndexed using loopU
933 
934     Wed May 24 14:47:32 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
935       * Change the implementation of the unfoldr(N) functions.
936       Use a more compact implementation for unfoldrN and change it's behaviour
937       to only return Just in the case that it actually 'overflowed' the N, so
938       the boundary case of unfolding exactly N gives Nothing.
939       Implement unfoldr and Lazy.unfoldr in terms of unfoldrN. Use fibonacci
940       growth for the chunk size in unfoldr
941 
942     Wed May 24 08:32:29 EST 2006  sjanssen@cse.unl.edu
943       * Add unfoldr to ByteString and .Char8
944       A preliminary implementation of unfoldr.
945 
946     Wed May 24 01:39:41 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
947       * Reorder the export lists to better match the Data.List api
948 
949     Tue May 23 14:04:32 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
950       * pack{Byte,Char} -> singleton. As per fptools convention
951 
952     Tue May 23 14:00:51 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
953       * elemIndexLast -> elemIndexEnd
954 
955     Tue May 23 13:57:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
956       * In the search for a more orthogonal api, we kill breakFirst/breakLast,
957         which were of dubious value
958 
959     Tue May 23 12:24:09 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
960       * Abolish elems. It's name implied it was unpack, but its type didn't. it made no sense
961 
962     Tue May 23 10:42:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
963       * Minor doc tidyup. Use haddock markup better.
964 
965     Tue May 23 11:00:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
966       * Simplify the join() implementation. Spotted by Duncan.
967 
968]
969[add a way to ask the IO manager thread to exit
970Simon Marlow <simonmar@microsoft.com>**20060524121823]
971[Sync with FPS head, including the following patches:
972Don Stewart <dons@cse.unsw.edu.au>**20060520030436
973         
974     Thu May 18 15:45:46 EST 2006  sjanssen@cse.unl.edu
975       * Export unsafeTake and unsafeDrop
976 
977     Fri May 19 11:53:08 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
978       * Add foldl1'
979 
980     Fri May 19 13:41:24 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
981       * Add fuseable scanl, scanl1 + properties
982 
983     Fri May 19 18:20:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
984       * Spotted another chance to use unsafeTake,Drop (in groupBy)
985 
986     Thu May 18 09:24:25 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
987       * More effecient findIndexOrEnd based on the impl of findIndex
988 
989     Thu May 18 09:22:49 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
990       * Eliminate special case in findIndex since it's handled anyway.
991 
992     Thu May 18 09:19:08 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
993       * Add unsafeTake and unsafeDrop
994       These versions assume the n is in the bounds of the bytestring, saving
995       two comparison tests. Then use them in varous places where we think this
996       holds. These cases need double checking (and there are a few remaining
997       internal uses of take / drop that might be possible to convert).
998       Not exported for the moment.
999 
1000     Tue May 16 23:15:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1001       * Handle n < 0 in drop and splitAt. Spotted by QC.
1002 
1003     Tue May 16 22:46:22 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1004       * Handle n <= 0 cases for unfoldr and replicate. Spotted by QC
1005 
1006     Tue May 16 21:34:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1007       * mapF -> map', filterF -> filter'
1008 
1009]
1010[haddock fix
1011Ross Paterson <ross@soi.city.ac.uk>**20060518154723]
1012[simplify indexing in Data.Sequence
1013Ross Paterson <ross@soi.city.ac.uk>**20060518154316]
1014[Move Eq, Ord, Show instances for ThreadId to GHC.Conc
1015Simon Marlow <simonmar@microsoft.com>**20060518113339
1016 Eliminates orphans.
1017]
1018[Better error handling in the IO manager thread
1019Simon Marlow <simonmar@microsoft.com>**20060518113303
1020 In particular, handle EBADF just like rts/posix/Select.c, by waking up
1021 all the waiting threads.  Other errors are thrown, instead of just
1022 being ignored.
1023]
1024[#define _REENTRANT 1  (needed to get the right errno on some OSs)
1025Simon Marlow <simonmar@microsoft.com>**20060518104151
1026 Part 2 of the fix for threaded RTS problems on Solaris and possibly
1027 *BSD (Part 1 was the same change in ghc/includes/Rts.h).
1028]
1029[copyCString* should be in IO. Spotted by Tomasz Zielonka
1030Don Stewart <dons@cse.unsw.edu.au>**20060518012154]
1031[add import Prelude to get dependencies right for Data/Fixed.hs
1032Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20060517222044
1033 Hopefully this fixes parallel builds.
1034]
1035[Fix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF -> map', filter' while we're here
1036Don Stewart <dons@cse.unsw.edu.au>**20060517020150]
1037[Use our own realloc. Thus reduction functions (like filter) allocate on the Haskell heap. Makes around 10% difference.
1038Don Stewart <dons@cse.unsw.edu.au>**20060513051736]
1039[Last two CInt fixes for 64 bit, and bracket writeFile while we're here
1040Don Stewart <dons@cse.unsw.edu.au>**20060512050750]
1041[Some small optimisations, generalise the type of unfold
1042Don Stewart <dons@cse.unsw.edu.au>**20060510043309
1043 
1044     Tue May  9 22:36:29 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1045       * Surely the error function should not be inlined.
1046 
1047     Tue May  9 22:35:53 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1048       * Reorder memory writes for better cache locality.
1049 
1050     Tue May  9 23:28:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
1051       * Generalise the type of unfoldrN
1052       
1053       The type of unfoldrN was overly constrained:
1054       unfoldrN :: Int -> (Word8 -> Maybe (Word8, Word8)) -> Word8 -> ByteString
1055       
1056       if we compare that to unfoldr:
1057       unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
1058       
1059       So we can generalise unfoldrN to this type:
1060       unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> ByteString
1061       
1062       and something similar for the .Char8 version. If people really do want to
1063       use it a lot with Word8/Char then perhaps we should add a specialise pragma.
1064 
1065     Wed May 10 13:26:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1066       * Add foldl', and thus a fusion rule for length . {map,filter,fold},
1067       that avoids creating an array at all if the end of the pipeline is a 'length' reduction
1068 
1069 **END OF DESCRIPTION***
1070 
1071 Place the long patch description above the ***END OF DESCRIPTION*** marker.
1072 The first line of this file will be the patch name.
1073 
1074 
1075 This patch contains the following changes:
1076 
1077 M ./Data/ByteString.hs -8 +38
1078 M ./Data/ByteString/Char8.hs -6 +12
1079]
1080[portable implementation of WordPtr/IntPtr for non-GHC
1081Ross Paterson <ross@soi.city.ac.uk>**20060510001826
1082 
1083 plus much tweaking of imports to avoid cycles
1084]
1085[add WordPtr and IntPtr types to Foreign.Ptr, with associated conversions
1086Simon Marlow <simonmar@microsoft.com>**20060509092606
1087 
1088 As suggested by John Meacham. 
1089 
1090 I had to move the Show instance for Ptr into GHC.ForeignPtr to avoid
1091 recursive dependencies.
1092]
1093[add CIntPtr, CUIntPtr, CIntMax, CUIntMax types
1094Simon Marlow <simonmar@microsoft.com>**20060509092427]
1095[add GHC.Dynamic
1096Simon Marlow <simonmar@microsoft.com>**20060509082739]
1097[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
1098Don Stewart <dons@cse.unsw.edu.au>**20060509023425]
1099[Make length a good consumer
1100simonpj@microsoft**20060508142726
1101 
1102 Make length into a good consumer.  Fixes Trac bug #707.
1103 
1104 (Before length simply didn't use foldr.)
1105 
1106]
1107[Trim imports
1108simonpj@microsoft**20060508142557]
1109[Make unsafePerformIO lazy
1110simonpj@microsoft**20060508142507
1111 
1112 The stricteness analyser used to have a HACK which ensured that NOINLNE things
1113 were not strictness-analysed.  The reason was unsafePerformIO. Left to itself,
1114 the strictness analyser would discover this strictness for unsafePerformIO:
1115        unsafePerformIO:  C(U(AV))
1116 But then consider this sub-expression
1117        unsafePerformIO (\s -> let r = f x in
1118                               case writeIORef v r s of (# s1, _ #) ->
1119                               (# s1, r #)
1120 The strictness analyser will now find that r is sure to be eval'd,
1121 and may then hoist it out.  This makes tests/lib/should_run/memo002
1122 deadlock.
1123 
1124 Solving this by making all NOINLINE things have no strictness info is overkill.
1125 In particular, it's overkill for runST, which is perfectly respectable.
1126 Consider
1127        f x = runST (return x)
1128 This should be strict in x.
1129 
1130 So the new plan is to define unsafePerformIO using the 'lazy' combinator:
1131 
1132        unsafePerformIO (IO m) = lazy (case m realWorld# of (# _, r #) -> r)
1133 
1134 Remember, 'lazy' is a wired-in identity-function Id, of type a->a, which is
1135 magically NON-STRICT, and is inlined after strictness analysis.  So
1136 unsafePerformIO will look non-strict, and that's what we want.
1137 
1138]
1139[Sync with FPS head.
1140Don Stewart <dons@cse.unsw.edu.au>**20060508122322
1141 
1142 Mon May  8 10:40:14 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1143   * Fix all uses for Int that should be CInt or CSize in ffi imports.
1144   Spotted by Igloo, dcoutts
1145 
1146 Mon May  8 16:09:41 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1147   * Import nicer loop/loop fusion rule from ghc-ndp
1148 
1149 Mon May  8 17:36:07 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1150   * Fix stack leak in split on > 60M strings
1151 
1152 Mon May  8 17:50:13 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1153   * Try same fix for stack overflow in elemIndices
1154 
1155]
1156[Fix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan and Ian
1157Don Stewart <dons@cse.unsw.edu.au>**20060508010311]
1158[Fixed import list syntax
1159Sven Panne <sven.panne@aedion.de>**20060507155008]
1160[Faster filterF, filterNotByte
1161dons@cse.unsw.edu.au**20060507042301]
1162[Much faster find, findIndex. Hint from sjanssen
1163dons@cse.unsw.edu.au**20060507033048]
1164[Merge "unrecognized long opt" fix from 6.4.2
1165Sven Panne <sven.panne@aedion.de>**20060506110519]
1166[
1167dons@cse.unsw.edu.au**20060506061029
1168 Sat May  6 13:01:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1169   * Do loopU realloc on the Haskell heap. And add a really tough stress test
1170 
1171 Sat May  6 12:28:58 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1172   * Use simple, 3x faster concat. Plus QC properties. Suggested by sjanssen and dcoutts
1173 
1174 Sat May  6 15:59:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1175   * dcoutt's packByte bug squashed
1176   
1177   With inlinePerformIO, ghc head was compiling:
1178   
1179    packByte 255 `compare` packByte 127
1180   
1181   into roughly
1182   
1183    case mallocByteString 2 of
1184        ForeignPtr f internals ->
1185             case writeWord8OffAddr# f 0 255 of _ ->
1186             case writeWord8OffAddr# f 0 127 of _ ->
1187             case eqAddr# f f of
1188                    False -> case compare (GHC.Prim.plusAddr# f 0)
1189                                          (GHC.Prim.plusAddr# f 0)
1190   
1191   which is rather stunning. unsafePerformIO seems to prevent whatever
1192   magic inlining was leading to this. Only affected the head.
1193   
1194]
1195[Add array fusion versions of map, filter and foldl
1196dons@cse.unsw.edu.au**20060505060858
1197 
1198 This patch adds fusable map, filter and foldl, using the array fusion
1199 code for unlifted, flat arrays, from the Data Parallel Haskell branch,
1200 after kind help from Roman Leshchinskiy,
1201 
1202 Pipelines of maps, filters and folds should now need to walk the
1203 bytestring once only, and intermediate bytestrings won't be constructed.
1204 
1205]
1206[fix for non-GHC
1207Ross Paterson <ross@soi.city.ac.uk>**20060504093044]
1208[use bracket in appendFile (like writeFile)
1209Ross Paterson <ross@soi.city.ac.uk>**20060504091528]
1210[writeFile: close the file on error
1211Simon Marlow <simonmar@microsoft.com>**20060504084505
1212 Suggested by Ross Paterson, via Neil Mitchell
1213 
1214]
1215[Sync with FPS head
1216dons@cse.unsw.edu.au**20060503105259
1217 
1218 This patch brings Data.ByteString into sync with the FPS head.
1219 The most significant of which is the new Haskell counting sort.
1220 
1221 Changes:
1222 
1223 Sun Apr 30 18:16:29 EST 2006  sjanssen@cse.unl.edu
1224   * Fix foldr1 in Data.ByteString and Data.ByteString.Char8
1225 
1226 Mon May  1 11:51:16 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
1227   * Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell
1228 
1229 Mon May  1 16:42:04 EST 2006  sjanssen@cse.unl.edu
1230   * Fix groupBy to match Data.List.groupBy.
1231 
1232 Wed May  3 15:01:07 EST 2006  sjanssen@cse.unl.edu
1233   * Migrate to counting sort.
1234   
1235   Data.ByteString.sort used C's qsort(), which is O(n log n).  The new algorithm
1236   is O(n), and is faster for strings larger than approximately thirty bytes.  We
1237   also reduce our dependency on cbits!
1238 
1239]
1240[improve performance of Integer->String conversion
1241Simon Marlow <simonmar@microsoft.com>**20060503113306
1242 See
1243  http://www.haskell.org//pipermail/libraries/2006-April/005227.html
1244 
1245 Submitted by: bertram.felgenhauer@googlemail.com
1246 
1247 
1248]
1249[inline withMVar, modifyMVar, modifyMVar_
1250Simon Marlow <simonmar@microsoft.com>**20060503111152]
1251[Fix string truncating in hGetLine -- it was a pasto from Simon's code
1252Simon Marlow <simonmar@microsoft.com>**20060503103504
1253 (from Don Stewart)
1254]
1255[Merge in Data.ByteString head. Fixes ByteString+cbits in hugs
1256Don Stewart <dons@cse.unsw.edu.au>**20060429040733]
1257[Import Data.ByteString from fps 0.5.
1258Don Stewart <dons@cse.unsw.edu.au>**20060428130718
1259 Fast, packed byte vectors, providing a better PackedString.
1260 
1261]
1262[fix previous patch
1263Ross Paterson <ross@soi.city.ac.uk>**20060501154847]
1264[fixes for non-GHC
1265Ross Paterson <ross@soi.city.ac.uk>**20060501144322]
1266[fix imports for mingw32 && !GHC
1267Ross Paterson <ross@soi.city.ac.uk>**20060427163248]
1268[RequireOrder: do not collect unrecognised options after a non-opt
1269Simon Marlow <simonmar@microsoft.com>**20060426121110
1270 The documentation for RequireOrder says "no option processing after
1271 first non-option", so it doesn't seem right that we should process the
1272 rest of the arguments to collect the unrecognised ones.  Presumably
1273 the client wants to know about the unrecognised options up to the
1274 first non-option, and will be using a different option parser for the
1275 rest of the command line.
1276 
1277 eg. before:
1278 
1279 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
1280 ([],["bar","--foo"],["--foo"],[])
1281 
1282 after:
1283 
1284 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
1285 ([],["bar","--foo"],[],[])
1286]
1287[fix for Haddock 0.7
1288Ashley Yakeley <ashley@semantic.org>**20060426072521]
1289[add Data.Fixed module
1290Ashley Yakeley <ashley@semantic.org>**20060425071853]
1291[add instances
1292Ross Paterson <ross@soi.city.ac.uk>**20060424102146]
1293[add superclasses to Applicative and Traversable
1294Ross Paterson <ross@soi.city.ac.uk>**20060411144734
1295 
1296 Functor is now a superclass of Applicative, and Functor and Foldable
1297 are now superclasses of Traversable.  The new hierarchy makes clear the
1298 inclusions between the classes, but means more work in defining instances.
1299 Default definitions are provided to help.
1300]
1301[add Functor and Monad instances for Prelude types
1302Ross Paterson <ross@soi.city.ac.uk>**20060410111443]
1303[GHC.Base.breakpoint
1304Lemmih <lemmih@gmail.com>**20060407125827]
1305[Track the GHC source tree reorganisation
1306Simon Marlow <simonmar@microsoft.com>**20060407041631]
1307[in the show instance for Exception, print the type of dynamic exceptions
1308Simon Marlow <simonmar@microsoft.com>**20060406112444
1309 Unfortunately this requires some recursve module hackery to get at
1310 the show instance for Typeable.
1311]
1312[implement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC
1313Simon Marlow <simonmar@microsoft.com>**20060405155448]
1314[add  forkOnIO :: Int -> IO () -> IO ThreadId
1315Simon Marlow <simonmar@microsoft.com>**20060327135018]
1316[Rework previous: not a gcc bug after all
1317Simon Marlow <simonmar@microsoft.com>**20060323161229
1318 It turns out that we were relying on behaviour that is undefined in C,
1319 and undefined behaviour in C means "the compiler can do whatever the
1320 hell it likes with your entire program".  So avoid that.
1321]
1322[work around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show
1323Simon Marlow <simonmar@microsoft.com>**20060323134514
1324 See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824
1325]
1326[commit mysteriously missing parts of "runIOFastExit" patch
1327Simon Marlow <simonmar@microsoft.com>**20060321101535]
1328[add runIOFastExit :: IO a -> IO a
1329Simon Marlow <simonmar@microsoft.com>**20060320124333
1330 Similar to runIO, but calls stg_exit() directly to exit, rather than
1331 shutdownHaskellAndExit().  Needed for running GHCi in the test suite.
1332]
1333[Fix a broken invariant
1334Simon Marlow <simonmar@microsoft.com>**20060316134151
1335 Patch from #694,  for the problem "empty is an identity for <> and $$" is
1336 currently broken by eg. isEmpty (empty<>empty)"
1337]
1338[Add unsafeSTToIO :: ST s a -> IO a
1339Simon Marlow <simonmar@microsoft.com>**20060315160232
1340 Implementation for Hugs is missing, but should be easy.  We need this
1341 for the forthcoming nested data parallelism implementation.
1342]
1343[Added 'alter'
1344jeanphilippe.bernardy@gmail.com**20060315143539
1345 Added 'alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a' to IntMap and Map
1346 This addresses ticket #665
1347]
1348[deprecate FunctorM in favour of Foldable and Traversable
1349Ross Paterson <ross@soi.city.ac.uk>**20060315092942
1350 as discussed on the libraries list.
1351]
1352[Simplify Eq, Ord, and Show instances for UArray
1353Simon Marlow <simonmar@microsoft.com>**20060313142701
1354 The Eq, Ord, and Show instances of UArray were written out longhand
1355 with one instance per element type.  It is possible to condense these
1356 into a single instance for each class, at the expense of using more
1357 extensions (non-std context on instance declaration).
1358 
1359 Suggestion by: Frederik Eaton <frederik@ofb.net>
1360 
1361]
1362[Oops typo in intSet notMember
1363jeanphilippe.bernardy@gmail.com**20060311224713]
1364[IntMap lookup now returns monad instead of Maybe.
1365jeanphilippe.bernardy@gmail.com**20060311224502]
1366[Added notMember to Data.IntSet and Data.IntMap
1367jeanphilippe.bernardy@gmail.com**20060311085221]
1368[add Data.Set.notMember and Data.Map.notMember
1369John Meacham <john@repetae.net>**20060309191806]
1370[addToClockTime: handle picoseconds properly
1371Simon Marlow <simonmar@microsoft.com>**20060310114532
1372 fixes #588
1373]
1374[make head/build rule apply to all types, not just Bool.
1375John Meacham <john@repetae.net>**20060303045753]
1376[Avoid overflow when normalising clock times
1377Ian Lynagh <igloo@earth.li>**20060210144638]
1378[Years have 365 days, not 30*365
1379Ian Lynagh <igloo@earth.li>**20060210142853]
1380[declare blkcmp() static
1381Simon Marlow <simonmar@microsoft.com>**20060223134317]
1382[typo in comment in Foldable class
1383Ross Paterson <ross@soi.city.ac.uk>**20060209004901]
1384[simplify fmap
1385Ross Paterson <ross@soi.city.ac.uk>**20060206095048]
1386[update ref in comment
1387Ross Paterson <ross@soi.city.ac.uk>**20060206095139]
1388[Give -foverlapping-instances to Data.Typeable
1389simonpj@microsoft**20060206133439
1390 
1391 For some time, GHC has made -fallow-overlapping-instances "sticky":
1392 any instance in a module compiled with -fallow-overlapping-instances
1393 can overlap when imported, regardless of whether the importing module
1394 allows overlap.  (If there is an overlap, both instances must come from
1395 modules thus compiled.)
1396 
1397 Instances in Data.Typeable might well want to be overlapped, so this
1398 commit adds the flag to Data.Typeable (with an explanatory comment)
1399 
1400 
1401]
1402[Add -fno-bang-patterns to modules using both bang and glasgow-exts
1403simonpj@microsoft.com**20060203175759]
1404[When splitting a bucket, keep the contents in the same order
1405Simon Marlow <simonmar@microsoft.com>**20060201130427
1406 To retain the property that multiple inserts shadow each other
1407 (see ticket #661, test hash001)
1408]
1409[add foldr/build optimisation for take and replicate
1410Simon Marlow <simonmar@microsoft.com>**20060126164603
1411 This allows take to be deforested, and improves performance of
1412 replicate and replicateM/replicateM_.  We have a separate problem that
1413 means expressions involving [n..m] aren't being completely optimised
1414 because eftIntFB isn't being inlined but otherwise the results look
1415 good. 
1416 
1417 Sadly this has invalidated a number of the nofib benchmarks which were
1418 erroneously using take to duplicate work in a misguided attempt to
1419 lengthen their runtimes (ToDo).
1420]
1421[Generate PrimopWrappers.hs with Haddock docs
1422Simon Marlow <simonmar@microsoft.com>**20060124131121
1423 Patch originally from Dinko Tenev <dinko.tenev@gmail.com>, modified
1424 to add log message by me.
1425]
1426[[project @ 2006-01-19 14:47:15 by ross]
1427ross**20060119144715
1428 backport warning avoidance from Haddock
1429]
1430[[project @ 2006-01-18 11:45:47 by malcolm]
1431malcolm**20060118114547
1432 Fix import of Ix for nhc98.
1433]
1434[[project @ 2006-01-17 09:38:38 by ross]
1435ross**20060117093838
1436 add Ix instance for GeneralCategory.
1437]
1438[TAG Initial conversion from CVS complete
1439John Goerzen <jgoerzen@complete.org>**20060112154126]
1440Patch bundle hash:
1441c844772a478df61cd30e85907fbf5d2e3fcee84e