Ticket #974: unzipEithers.patch

File unzipEithers.patch, 36.7 KB (added by guest, 7 years ago)

patch to add unzipEithers, lefts, and rights.

Line 
1
2New patches:
3
4[Adding unzipEithers, lefts, and rights.
5Russell O'Connor <roconnor@theorem.ca>**20061101122447] {
6hunk ./Data/Either.hs 18
7-   either      -- :: (a -> c) -> (b -> c) -> Either a b -> c
8+   either,     -- :: (a -> c) -> (b -> c) -> Either a b -> c
9+   lefts,      -- :: [Either a b] -> [a]
10+   rights,     -- :: [Either a b] -> [b]
11+   unzipEithers,       -- :: [Either a b] -> ([a],[b])
12hunk ./Data/Either.hs 24
13+{-
14+-- just for testing
15+import Test.QuickCheck
16+-}
17+
18hunk ./Data/Either.hs 52
19+-- | Extracts from a list of 'Either' all the 'Left' elements
20+-- All the 'Left' elements are extracted in order.
21+
22+lefts   :: [Either a b] -> [a]
23+lefts x = [a | Left a <- x]
24+
25+-- | Extracts from a list of 'Either' all the 'Right' elements
26+-- All the 'Right' elements are extracted in order.
27+
28+rights   :: [Either a b] -> [b]
29+rights x = [a | Right a <- x]
30+
31+-- | Partitions a list of 'Either' into two lists
32+-- All the 'Left' elements are extracted, in order, to the first
33+-- component of the output.  Similarly the 'Right' elements are extracted
34+-- to the second component of the output.
35+
36+unzipEithers :: [Either a b] -> ([a],[b])
37+unzipEithers = foldr (either left right) ([],[])
38+ where
39+  left  a (l, r) = (a:l, r)
40+  right a (l, r) = (l, a:r)
41+
42+{-
43+{--------------------------------------------------------------------
44+  Testing
45+--------------------------------------------------------------------}
46+prop_unzipEithers :: [Either Int Int] -> Bool
47+prop_unzipEithers x =
48+  unzipEithers x == (lefts x, rights x)
49+-}
50+
51}
52
53Context:
54
55[Add intercalate and split to Data.List
56Josef Svenningsson <josef.svenningsson@gmail.com>**20061024172357]
57[Export pseq from Control.Parallel, and use it in Control.Parallel.Strategies
58Simon Marlow <simonmar@microsoft.com>**20061027150141]
59[`par` should be infixr 0
60Simon Marlow <simonmar@microsoft.com>**20061027130800
61 Alas, I didn't spot this due to lack of testing, and the symptom is
62 that an expression like x `par` y `seq z will have exactly the wrong
63 parallelism properties.  The workaround is to add parantheses.
64 
65 I think we could push this to the 6.6 branch.
66]
67[fix example in comment
68Ross Paterson <ross@soi.city.ac.uk>**20061023163925]
69[Use the new Any type for dynamics (GHC only)
70simonpj@microsoft**20061019160408]
71[add Data.Sequence to nhc98 build
72Malcolm.Wallace@cs.york.ac.uk**20061012135200]
73[Remove Data.FiniteMap, add Control.Applicative, Data.Traversable, and
74Malcolm.Wallace@cs.york.ac.uk**20061012095605
75 Data.Foldable to the nhc98 build.
76]
77[STM invariants
78tharris@microsoft.com**20061007123253]
79[Inline shift in GHC's Bits instances for {Int,Word}{,8,16,32,64}
80Samuel Bronson <naesten@gmail.com>**20061009020906]
81[Don't create GHC.Prim when bootstrapping; we can't, and we don't need it
82Ian Lynagh <igloo@earth.li>**20061004165355]
83[Data.ByteString: fix lazyness of take, drop & splitAt
84Don Stewart <dons@cse.unsw.edu.au>**20061005011703
85 
86 ByteString.Lazy's take, drop and splitAt were too strict when demanding
87 a byte string. Spotted by Einar Karttunen. Thanks to him and to Bertram
88 Felgenhauer for explaining the problem and the fix.
89 
90]
91[Fix syntax error that prevents building Haddock documentation on Windows
92brianlsmith@gmail.com**20060917013530]
93[Hugs only: unbreak typeRepKey
94Ross Paterson <ross@soi.city.ac.uk>**20060929102743]
95[make hGetBufNonBlocking do something on Windows w/ -threaded
96Simon Marlow <simonmar@microsoft.com>**20060927145811
97 hGetBufNonBlocking will behave the same as hGetBuf on Windows now, which
98 is better than just crashing (which it did previously).
99]
100[add typeRepKey :: TypeRep -> IO Int
101Simon Marlow <simonmar@microsoft.com>**20060927100342
102 See feature request #880
103]
104[fix header comment
105Ross Paterson <ross@soi.city.ac.uk>**20060926135843]
106[Add strict versions of insertWith and insertWithKey (Data.Map)
107jeanphilippe.bernardy@gmail.com**20060910162443]
108[doc tweaks, including more precise equations for evaluate
109Ross Paterson <ross@soi.city.ac.uk>**20060910115259]
110[Sync Data.ByteString with stable branch
111Don Stewart <dons@cse.unsw.edu.au>**20060909050111
112 
113 This patch:
114     * hides the LPS constructor (its in .Base if you need it)
115     * adds functions to convert between strict and lazy bytestrings
116     * and adds readInteger
117 
118]
119[Typeable1 instances for STM and TVar
120Ross Paterson <ross@soi.city.ac.uk>**20060904231425]
121[remove obsolete Hugs stuff
122Ross Paterson <ross@soi.city.ac.uk>**20060904223944]
123[Cleaner isInfixOf suggestion from Ross Paterson
124John Goerzen <jgoerzen@complete.org>**20060901143654]
125[New function isInfixOf that searches a list for a given sublist
126John Goerzen <jgoerzen@complete.org>**20060831151556
127 
128 Example:
129 
130 isInfixOf "Haskell" "I really like Haskell." -> True
131 isInfixOf "Ial" "I really like Haskell." -> False
132 
133 This function was first implemented in MissingH as MissingH.List.contains
134]
135[Better doc on Data.Map.lookup: explain what the monad is for
136jeanphilippe.bernardy@gmail.com**20060903133440]
137[fix hDuplicateTo on Windows
138Simon Marlow <simonmar@microsoft.com>**20060901150016
139 deja vu - I'm sure I remember fixing this before...
140]
141[Improve documentation of atomically
142simonpj@microsoft**20060714120207]
143[Add missing method genRange for StdGen (fixes #794)
144simonpj@microsoft**20060707151901
145 
146        MERGE TO STABLE
147 
148 Trac #794 reports (correctly) that the implementation of StdGen
149 only returns numbers in the range (0..something) rather than
150 (minBound, maxBound), which is what StdGen's genRange claims.
151 
152 This commit fixes the problem, by implementing genRange for StdGen
153 (previously it just used the default method).
154 
155 
156]
157[mark nhc98 import hack
158Ross Paterson <ross@soi.city.ac.uk>**20060831125219]
159[remove some outdated comments
160Simon Marlow <simonmar@microsoft.com>**20060831104200]
161[import Control.Arrow.ArrowZero to help nhc98's type checker
162Malcolm.Wallace@cs.york.ac.uk**20060831101105]
163[remove Text.Regex(.Posix) from nhc98 build
164Malcolm.Wallace@cs.york.ac.uk**20060831101016]
165[add Data.Foldable.{msum,asum}, plus tweaks to comments
166Ross Paterson <ross@soi.city.ac.uk>**20060830163521]
167[fix doc typo
168Ross Paterson <ross@soi.city.ac.uk>**20060830134123]
169[add Data.Foldable.{for_,forM_} and Data.Traversable.{for,forM}
170Ross Paterson <ross@soi.city.ac.uk>**20060830133805
171 
172 generalizing Control.Monad.{forM_,forM}
173]
174[Make length a good consumer
175simonpj@microsoft*-20060508142726
176 
177 Make length into a good consumer.  Fixes Trac bug #707.
178 
179 (Before length simply didn't use foldr.)
180 
181]
182[Add Control.Monad.forM and forM_
183Don Stewart <dons@cse.unsw.edu.au>**20060824081118
184 
185 flip mapM_ is more and more common, I find. Several suggestions have
186 been made to add this, as foreach or something similar. This patch
187 does just that:
188 
189     forM  :: (Monad m) => [a] -> (a -> m b) -> m [b]
190     forM_ :: (Monad m) => [a] -> (a -> m b) -> m ()
191 
192 So we can write:
193     
194     Prelude Control.Monad> forM_ [1..4] $ \x -> print x
195     1
196     2
197     3
198     4
199 
200]
201[Hide internal module from haddock in Data.ByteString
202Don Stewart <dons@cse.unsw.edu.au>**20060828011515]
203[add advice on avoiding import ambiguities
204Ross Paterson <ross@soi.city.ac.uk>**20060827170407]
205[expand advice on importing these modules
206Ross Paterson <ross@soi.city.ac.uk>**20060827164044]
207[add Haddock marker
208Ross Paterson <ross@soi.city.ac.uk>**20060827115140]
209[Clarify how one hides Prelude.catch
210Don Stewart <dons@cse.unsw.edu.au>**20060826124346
211 
212 User feedback indicated that an example was required, of how to hide
213 Prelude.catch, so add such an example to the docs
214 
215]
216[Workaround for OSes that don't have intmax_t and uintmax_t
217Ian Lynagh <igloo@earth.li>**20060825134936
218 OpenBSD (and possibly others) do not have intmax_t and uintmax_t types:
219     http://www.mail-archive.com/haskell-prime@haskell.org/msg01548.html
220 so substitute (unsigned) long long if we have them, otherwise
221 (unsigned) long.
222 
223]
224[add docs for par
225Simon Marlow <simonmar@microsoft.com>**20060825110610]
226[document minimal complete definition for Bits
227Ross Paterson <ross@soi.city.ac.uk>**20060824140504]
228[C regex library bits have moved to the regex-posix package
229Simon Marlow <simonmar@microsoft.com>**20060824132311]
230[Add shared Typeable support (ghc only)
231Esa Ilari Vuokko <ei@vuokko.info>**20060823003126]
232[this should have been removed with the previous patch
233Simon Marlow <simonmar@microsoft.com>**20060824121223]
234[remove Text.Regx & Text.Regex.Posix
235Simon Marlow <simonmar@microsoft.com>**20060824094615
236 These are subsumed by the new regex-base, regex-posix and regex-compat
237 packages.
238]
239[explicitly tag Data.ByteString rules with the FPS prefix.
240Don Stewart <dons@cse.unsw.edu.au>**20060824041326]
241[Add spec rules for sections in Data.ByteString
242Don Stewart <dons@cse.unsw.edu.au>**20060824012611]
243[Sync Data.ByteString with current stable branch, 0.7
244Don Stewart <dons@cse.unsw.edu.au>**20060823143338]
245[add notes about why copyFile doesn't remove the target
246Simon Marlow <simonmar@microsoft.com>**20060823095059]
247[copyFile: try removing the target file before opening it for writing
248Simon Marlow <simonmar@microsoft.com>*-20060822121909]
249[copyFile: try removing the target file before opening it for writing
250Simon Marlow <simonmar@microsoft.com>**20060822121909]
251[add alternative functors and extra instances
252Ross Paterson <ross@soi.city.ac.uk>**20060821152151
253 
254 * Alternative class, for functors with a monoid
255 * instances for Const
256 * instances for arrows
257]
258[generate Haddock docs on all platforms
259Simon Marlow <simonmar@microsoft.com>**20060821131612]
260[remove extra comma from import
261Ross Paterson <ross@soi.city.ac.uk>**20060819173954]
262[fix docs for withC(A)StringLen
263Ross Paterson <ross@soi.city.ac.uk>**20060818170328]
264[use Haskell'98 compliant indentation in do blocks
265Malcolm.Wallace@cs.york.ac.uk**20060818130810]
266[use correct names of IOArray operations for nhc98
267Malcolm.Wallace@cs.york.ac.uk**20060818130714]
268[add mapMaybe and mapEither, plus WithKey variants
269Ross Paterson <ross@soi.city.ac.uk>**20060817235041]
270[remove Text.Html from nhc98 build
271Malcolm.Wallace@cs.york.ac.uk**20060817135502]
272[eliminate more HOST_OS tests
273Ross Paterson <ross@soi.city.ac.uk>**20060815190609]
274[Hugs only: disable unused process primitives
275Ross Paterson <ross@soi.city.ac.uk>**20060813184435
276 
277 These were the cause of Hugs bug #30, I think, and weren't used by Hugs anyway.
278]
279[markup fix to Data.HashTable
280Ross Paterson <ross@soi.city.ac.uk>**20060812103835]
281[revert removal of ghcconfig.h from package.conf.in
282Ross Paterson <ross@soi.city.ac.uk>**20060812082702
283 
284 as it's preprocessed with -undef (pointed out by Esa Ilari Vuokko)
285]
286[fix Data.HashTable for non-GHC
287Ross Paterson <ross@soi.city.ac.uk>**20060811231521]
288[remove deprecated 'withObject'
289Simon Marlow <simonmar@microsoft.com>**20060811152350]
290[Jan-Willem Maessen's improved implementation of Data.HashTable
291Simon Marlow <simonmar@microsoft.com>**20060811151024
292 Rather than incrementally enlarging the hash table, this version
293 just does it in one go when the table gets too full.
294]
295[Warning police: Make some prototypes from the RTS known
296sven.panne@aedion.de**20060811144629]
297[Warning police: Removed useless catch-all clause
298sven.panne@aedion.de**20060811142208]
299[reduce dependency on ghcconfig.h
300Ross Paterson <ross@soi.city.ac.uk>**20060811124030
301 
302 The only remaining use is in cbits/dirUtils.h, which tests solaris2_HOST_OS
303 
304 (Also System.Info uses ghcplatform.h and several modules import MachDeps.h
305 to get SIZEOF_* and ALIGNMENT_* from ghcautoconf.h)
306]
307[(non-GHC only) track MArray interface change
308Ross Paterson <ross@soi.city.ac.uk>**20060810182902]
309[move Text.Html to a separate package
310Simon Marlow <simonmar@microsoft.com>**20060810113017]
311[bump version to 2.0
312Simon Marlow <simonmar@microsoft.com>**20060810112833]
313[Remove deprecated Data.FiniteMap and Data.Set interfaces
314Simon Marlow <simonmar@microsoft.com>**20060809153810]
315[move altzone test from ghc to base package
316Ross Paterson <ross@soi.city.ac.uk>**20060809124259]
317[remove unnecessary #include "ghcconfig.h"
318Ross Paterson <ross@soi.city.ac.uk>**20060809123812]
319[Change the API of MArray to allow resizable arrays
320Simon Marlow <simonmar@microsoft.com>**20060809100548
321 See #704
322 
323 The MArray class doesn't currently allow a mutable array to change its
324 size, because of the pure function
325 
326   bounds :: (HasBounds a, Ix i) => a i e -> (i,i)
327 
328 This patch removes the HasBounds class, and adds
329 
330   getBounds :: (MArray a e m, Ix i) => a i e -> m (i,i)
331 
332 to the MArray class, and
333 
334   bounds :: (IArray a e, Ix i) => a i e -> (i,i)
335 
336 to the IArray class.
337 
338 The reason that bounds had to be incorporated into the IArray class is
339 because I couldn't make DiffArray work without doing this.  DiffArray
340 acts as a layer converting an MArray into an IArray, and there was no
341 way (that I could find) to define an instance of HasBounds for
342 DiffArray.
343]
344[deprecate this module.
345Simon Marlow <simonmar@microsoft.com>**20060808100708]
346[add traceShow (see #474)
347Simon Marlow <simonmar@microsoft.com>**20060807155545]
348[remove spurious 'extern "C" {'
349Simon Marlow <simonmar@microsoft.com>**20060724160258]
350[Fix unsafeIndex for large ranges
351Simon Marlow <simonmar@microsoft.com>**20060721100225]
352[disambiguate uses of foldr for nhc98 to compile without errors
353Malcolm.Wallace@cs.york.ac.uk**20060711161614]
354[make Control.Monad.Instances compilable by nhc98
355Malcolm.Wallace@cs.york.ac.uk**20060711160941]
356[breakpointCond
357Lemmih <lemmih@gmail.com>**20060708055528]
358[UNDO: Merge "unrecognized long opt" fix from 6.4.2
359Simon Marlow <simonmar@microsoft.com>**20060705142537
360 This patch undid the previous patch, "RequireOrder: do not collect
361 unrecognised options after a non-opt".  I asked Sven to revert it, but
362 didn't get an answer.
363 
364 See bug #473.
365]
366[Avoid strictness in accumulator for unpackFoldr
367Don Stewart <dons@cse.unsw.edu.au>**20060703091806
368 
369 The seq on the accumulator for unpackFoldr will break in the presence of
370 head/build rewrite rules. The empty list case will be forced, producing
371 an exception. This is a known issue with seq and rewrite rules that we
372 just stumbled on to.
373 
374]
375[Disable unpack/build fusion
376Don Stewart <dons@cse.unsw.edu.au>**20060702083913
377 
378 unpack/build on bytestrings seems to trigger a bug when interacting with
379 head/build fusion in GHC.List. The bytestring001 testcase catches it.
380 
381 I'll investigate further, but best to disable this for now (its not
382 often used anyway).
383 
384 Note that with -frules-off or ghc 6.4.2 things are fine. It seems to
385 have emerged with the recent rules changes.
386 
387]
388[Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head
389Don Stewart <dons@cse.unsw.edu.au>**20060701084345
390 
391 This patch imports the Data.ByteString.Lazy module, and its helpers,
392 providing a ByteString implemented as a lazy list of strict cache-sized
393 chunks. This type allows the usual lazy operations to be written on
394 bytestrings, including lazy IO, with much improved space and time over
395 the [Char] equivalents.
396 
397]
398[Wibble in docs for new ForeignPtr functionsn
399Don Stewart <dons@cse.unsw.edu.au>**20060609075924]
400[comments for Applicative and Traversable
401Ross Paterson <ross@soi.city.ac.uk>**20060622170436]
402[default to NoBuffering on Windows for a read/write text file
403Simon Marlow <simonmar@microsoft.com>**20060622144446
404 Fixes (works around) #679
405]
406[remove dead code
407Simon Marlow <simonmar@microsoft.com>**20060622144433]
408[clarify and expand docs
409Simon Marlow <simonmar@microsoft.com>**20060622112911]
410[Add minView and maxView to Map and Set
411jeanphilippe.bernardy@gmail.com**20060616180121]
412[add signature for registerDelay
413Ross Paterson <ross@soi.city.ac.uk>**20060614114456]
414[a few doc comments
415Ross Paterson <ross@soi.city.ac.uk>**20060613142704]
416[Optimised foreign pointer representation, for heap-allocated objects
417Don Stewart <dons@cse.unsw.edu.au>**20060608015011]
418[Add the inline function, and many comments
419simonpj@microsoft.com**20060605115814
420 
421 This commit adds the 'inline' function described in the
422 related patch in the compiler.
423 
424 I've also added comments about the 'lazy' function.
425 
426]
427[small intro to exceptions
428Ross Paterson <ross@soi.city.ac.uk>**20060525111604]
429[export breakpoint
430Simon Marlow <simonmar@microsoft.com>**20060525090456]
431[Merge in changes from fps head. Highlights:
432Don Stewart <dons@cse.unsw.edu.au>**20060525065012
433 
434     Wed May 24 15:49:38 EST 2006  sjanssen@cse.unl.edu
435       * instance Monoid ByteString
436 
437     Wed May 24 15:04:04 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
438       * Rearange export lists for the .Char8 modules
439 
440     Wed May 24 14:59:56 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
441       * Implement mapAccumL and reimplement mapIndexed using loopU
442 
443     Wed May 24 14:47:32 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
444       * Change the implementation of the unfoldr(N) functions.
445       Use a more compact implementation for unfoldrN and change it's behaviour
446       to only return Just in the case that it actually 'overflowed' the N, so
447       the boundary case of unfolding exactly N gives Nothing.
448       Implement unfoldr and Lazy.unfoldr in terms of unfoldrN. Use fibonacci
449       growth for the chunk size in unfoldr
450 
451     Wed May 24 08:32:29 EST 2006  sjanssen@cse.unl.edu
452       * Add unfoldr to ByteString and .Char8
453       A preliminary implementation of unfoldr.
454 
455     Wed May 24 01:39:41 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
456       * Reorder the export lists to better match the Data.List api
457 
458     Tue May 23 14:04:32 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
459       * pack{Byte,Char} -> singleton. As per fptools convention
460 
461     Tue May 23 14:00:51 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
462       * elemIndexLast -> elemIndexEnd
463 
464     Tue May 23 13:57:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
465       * In the search for a more orthogonal api, we kill breakFirst/breakLast,
466         which were of dubious value
467 
468     Tue May 23 12:24:09 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
469       * Abolish elems. It's name implied it was unpack, but its type didn't. it made no sense
470 
471     Tue May 23 10:42:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
472       * Minor doc tidyup. Use haddock markup better.
473 
474     Tue May 23 11:00:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
475       * Simplify the join() implementation. Spotted by Duncan.
476 
477]
478[add a way to ask the IO manager thread to exit
479Simon Marlow <simonmar@microsoft.com>**20060524121823]
480[Sync with FPS head, including the following patches:
481Don Stewart <dons@cse.unsw.edu.au>**20060520030436
482         
483     Thu May 18 15:45:46 EST 2006  sjanssen@cse.unl.edu
484       * Export unsafeTake and unsafeDrop
485 
486     Fri May 19 11:53:08 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
487       * Add foldl1'
488 
489     Fri May 19 13:41:24 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
490       * Add fuseable scanl, scanl1 + properties
491 
492     Fri May 19 18:20:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
493       * Spotted another chance to use unsafeTake,Drop (in groupBy)
494 
495     Thu May 18 09:24:25 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
496       * More effecient findIndexOrEnd based on the impl of findIndex
497 
498     Thu May 18 09:22:49 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
499       * Eliminate special case in findIndex since it's handled anyway.
500 
501     Thu May 18 09:19:08 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
502       * Add unsafeTake and unsafeDrop
503       These versions assume the n is in the bounds of the bytestring, saving
504       two comparison tests. Then use them in varous places where we think this
505       holds. These cases need double checking (and there are a few remaining
506       internal uses of take / drop that might be possible to convert).
507       Not exported for the moment.
508 
509     Tue May 16 23:15:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
510       * Handle n < 0 in drop and splitAt. Spotted by QC.
511 
512     Tue May 16 22:46:22 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
513       * Handle n <= 0 cases for unfoldr and replicate. Spotted by QC
514 
515     Tue May 16 21:34:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
516       * mapF -> map', filterF -> filter'
517 
518]
519[haddock fix
520Ross Paterson <ross@soi.city.ac.uk>**20060518154723]
521[simplify indexing in Data.Sequence
522Ross Paterson <ross@soi.city.ac.uk>**20060518154316]
523[Move Eq, Ord, Show instances for ThreadId to GHC.Conc
524Simon Marlow <simonmar@microsoft.com>**20060518113339
525 Eliminates orphans.
526]
527[Better error handling in the IO manager thread
528Simon Marlow <simonmar@microsoft.com>**20060518113303
529 In particular, handle EBADF just like rts/posix/Select.c, by waking up
530 all the waiting threads.  Other errors are thrown, instead of just
531 being ignored.
532]
533[#define _REENTRANT 1  (needed to get the right errno on some OSs)
534Simon Marlow <simonmar@microsoft.com>**20060518104151
535 Part 2 of the fix for threaded RTS problems on Solaris and possibly
536 *BSD (Part 1 was the same change in ghc/includes/Rts.h).
537]
538[copyCString* should be in IO. Spotted by Tomasz Zielonka
539Don Stewart <dons@cse.unsw.edu.au>**20060518012154]
540[add import Prelude to get dependencies right for Data/Fixed.hs
541Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20060517222044
542 Hopefully this fixes parallel builds.
543]
544[Fix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF -> map', filter' while we're here
545Don Stewart <dons@cse.unsw.edu.au>**20060517020150]
546[Use our own realloc. Thus reduction functions (like filter) allocate on the Haskell heap. Makes around 10% difference.
547Don Stewart <dons@cse.unsw.edu.au>**20060513051736]
548[Last two CInt fixes for 64 bit, and bracket writeFile while we're here
549Don Stewart <dons@cse.unsw.edu.au>**20060512050750]
550[Some small optimisations, generalise the type of unfold
551Don Stewart <dons@cse.unsw.edu.au>**20060510043309
552 
553     Tue May  9 22:36:29 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
554       * Surely the error function should not be inlined.
555 
556     Tue May  9 22:35:53 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
557       * Reorder memory writes for better cache locality.
558 
559     Tue May  9 23:28:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
560       * Generalise the type of unfoldrN
561       
562       The type of unfoldrN was overly constrained:
563       unfoldrN :: Int -> (Word8 -> Maybe (Word8, Word8)) -> Word8 -> ByteString
564       
565       if we compare that to unfoldr:
566       unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
567       
568       So we can generalise unfoldrN to this type:
569       unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> ByteString
570       
571       and something similar for the .Char8 version. If people really do want to
572       use it a lot with Word8/Char then perhaps we should add a specialise pragma.
573 
574     Wed May 10 13:26:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
575       * Add foldl', and thus a fusion rule for length . {map,filter,fold},
576       that avoids creating an array at all if the end of the pipeline is a 'length' reduction
577 
578 **END OF DESCRIPTION***
579 
580 Place the long patch description above the ***END OF DESCRIPTION*** marker.
581 The first line of this file will be the patch name.
582 
583 
584 This patch contains the following changes:
585 
586 M ./Data/ByteString.hs -8 +38
587 M ./Data/ByteString/Char8.hs -6 +12
588]
589[portable implementation of WordPtr/IntPtr for non-GHC
590Ross Paterson <ross@soi.city.ac.uk>**20060510001826
591 
592 plus much tweaking of imports to avoid cycles
593]
594[add WordPtr and IntPtr types to Foreign.Ptr, with associated conversions
595Simon Marlow <simonmar@microsoft.com>**20060509092606
596 
597 As suggested by John Meacham. 
598 
599 I had to move the Show instance for Ptr into GHC.ForeignPtr to avoid
600 recursive dependencies.
601]
602[add CIntPtr, CUIntPtr, CIntMax, CUIntMax types
603Simon Marlow <simonmar@microsoft.com>**20060509092427]
604[add GHC.Dynamic
605Simon Marlow <simonmar@microsoft.com>**20060509082739]
606[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
607Don Stewart <dons@cse.unsw.edu.au>**20060509023425]
608[Make length a good consumer
609simonpj@microsoft**20060508142726
610 
611 Make length into a good consumer.  Fixes Trac bug #707.
612 
613 (Before length simply didn't use foldr.)
614 
615]
616[Trim imports
617simonpj@microsoft**20060508142557]
618[Make unsafePerformIO lazy
619simonpj@microsoft**20060508142507
620 
621 The stricteness analyser used to have a HACK which ensured that NOINLNE things
622 were not strictness-analysed.  The reason was unsafePerformIO. Left to itself,
623 the strictness analyser would discover this strictness for unsafePerformIO:
624        unsafePerformIO:  C(U(AV))
625 But then consider this sub-expression
626        unsafePerformIO (\s -> let r = f x in
627                               case writeIORef v r s of (# s1, _ #) ->
628                               (# s1, r #)
629 The strictness analyser will now find that r is sure to be eval'd,
630 and may then hoist it out.  This makes tests/lib/should_run/memo002
631 deadlock.
632 
633 Solving this by making all NOINLINE things have no strictness info is overkill.
634 In particular, it's overkill for runST, which is perfectly respectable.
635 Consider
636        f x = runST (return x)
637 This should be strict in x.
638 
639 So the new plan is to define unsafePerformIO using the 'lazy' combinator:
640 
641        unsafePerformIO (IO m) = lazy (case m realWorld# of (# _, r #) -> r)
642 
643 Remember, 'lazy' is a wired-in identity-function Id, of type a->a, which is
644 magically NON-STRICT, and is inlined after strictness analysis.  So
645 unsafePerformIO will look non-strict, and that's what we want.
646 
647]
648[Sync with FPS head.
649Don Stewart <dons@cse.unsw.edu.au>**20060508122322
650 
651 Mon May  8 10:40:14 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
652   * Fix all uses for Int that should be CInt or CSize in ffi imports.
653   Spotted by Igloo, dcoutts
654 
655 Mon May  8 16:09:41 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
656   * Import nicer loop/loop fusion rule from ghc-ndp
657 
658 Mon May  8 17:36:07 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
659   * Fix stack leak in split on > 60M strings
660 
661 Mon May  8 17:50:13 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
662   * Try same fix for stack overflow in elemIndices
663 
664]
665[Fix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan and Ian
666Don Stewart <dons@cse.unsw.edu.au>**20060508010311]
667[Fixed import list syntax
668Sven Panne <sven.panne@aedion.de>**20060507155008]
669[Faster filterF, filterNotByte
670dons@cse.unsw.edu.au**20060507042301]
671[Much faster find, findIndex. Hint from sjanssen
672dons@cse.unsw.edu.au**20060507033048]
673[Merge "unrecognized long opt" fix from 6.4.2
674Sven Panne <sven.panne@aedion.de>**20060506110519]
675[
676dons@cse.unsw.edu.au**20060506061029
677 Sat May  6 13:01:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
678   * Do loopU realloc on the Haskell heap. And add a really tough stress test
679 
680 Sat May  6 12:28:58 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
681   * Use simple, 3x faster concat. Plus QC properties. Suggested by sjanssen and dcoutts
682 
683 Sat May  6 15:59:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
684   * dcoutt's packByte bug squashed
685   
686   With inlinePerformIO, ghc head was compiling:
687   
688    packByte 255 `compare` packByte 127
689   
690   into roughly
691   
692    case mallocByteString 2 of
693        ForeignPtr f internals ->
694             case writeWord8OffAddr# f 0 255 of _ ->
695             case writeWord8OffAddr# f 0 127 of _ ->
696             case eqAddr# f f of
697                    False -> case compare (GHC.Prim.plusAddr# f 0)
698                                          (GHC.Prim.plusAddr# f 0)
699   
700   which is rather stunning. unsafePerformIO seems to prevent whatever
701   magic inlining was leading to this. Only affected the head.
702   
703]
704[Add array fusion versions of map, filter and foldl
705dons@cse.unsw.edu.au**20060505060858
706 
707 This patch adds fusable map, filter and foldl, using the array fusion
708 code for unlifted, flat arrays, from the Data Parallel Haskell branch,
709 after kind help from Roman Leshchinskiy,
710 
711 Pipelines of maps, filters and folds should now need to walk the
712 bytestring once only, and intermediate bytestrings won't be constructed.
713 
714]
715[fix for non-GHC
716Ross Paterson <ross@soi.city.ac.uk>**20060504093044]
717[use bracket in appendFile (like writeFile)
718Ross Paterson <ross@soi.city.ac.uk>**20060504091528]
719[writeFile: close the file on error
720Simon Marlow <simonmar@microsoft.com>**20060504084505
721 Suggested by Ross Paterson, via Neil Mitchell
722 
723]
724[Sync with FPS head
725dons@cse.unsw.edu.au**20060503105259
726 
727 This patch brings Data.ByteString into sync with the FPS head.
728 The most significant of which is the new Haskell counting sort.
729 
730 Changes:
731 
732 Sun Apr 30 18:16:29 EST 2006  sjanssen@cse.unl.edu
733   * Fix foldr1 in Data.ByteString and Data.ByteString.Char8
734 
735 Mon May  1 11:51:16 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
736   * Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell
737 
738 Mon May  1 16:42:04 EST 2006  sjanssen@cse.unl.edu
739   * Fix groupBy to match Data.List.groupBy.
740 
741 Wed May  3 15:01:07 EST 2006  sjanssen@cse.unl.edu
742   * Migrate to counting sort.
743   
744   Data.ByteString.sort used C's qsort(), which is O(n log n).  The new algorithm
745   is O(n), and is faster for strings larger than approximately thirty bytes.  We
746   also reduce our dependency on cbits!
747 
748]
749[improve performance of Integer->String conversion
750Simon Marlow <simonmar@microsoft.com>**20060503113306
751 See
752  http://www.haskell.org//pipermail/libraries/2006-April/005227.html
753 
754 Submitted by: bertram.felgenhauer@googlemail.com
755 
756 
757]
758[inline withMVar, modifyMVar, modifyMVar_
759Simon Marlow <simonmar@microsoft.com>**20060503111152]
760[Fix string truncating in hGetLine -- it was a pasto from Simon's code
761Simon Marlow <simonmar@microsoft.com>**20060503103504
762 (from Don Stewart)
763]
764[Merge in Data.ByteString head. Fixes ByteString+cbits in hugs
765Don Stewart <dons@cse.unsw.edu.au>**20060429040733]
766[Import Data.ByteString from fps 0.5.
767Don Stewart <dons@cse.unsw.edu.au>**20060428130718
768 Fast, packed byte vectors, providing a better PackedString.
769 
770]
771[fix previous patch
772Ross Paterson <ross@soi.city.ac.uk>**20060501154847]
773[fixes for non-GHC
774Ross Paterson <ross@soi.city.ac.uk>**20060501144322]
775[fix imports for mingw32 && !GHC
776Ross Paterson <ross@soi.city.ac.uk>**20060427163248]
777[RequireOrder: do not collect unrecognised options after a non-opt
778Simon Marlow <simonmar@microsoft.com>**20060426121110
779 The documentation for RequireOrder says "no option processing after
780 first non-option", so it doesn't seem right that we should process the
781 rest of the arguments to collect the unrecognised ones.  Presumably
782 the client wants to know about the unrecognised options up to the
783 first non-option, and will be using a different option parser for the
784 rest of the command line.
785 
786 eg. before:
787 
788 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
789 ([],["bar","--foo"],["--foo"],[])
790 
791 after:
792 
793 Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
794 ([],["bar","--foo"],[],[])
795]
796[fix for Haddock 0.7
797Ashley Yakeley <ashley@semantic.org>**20060426072521]
798[add Data.Fixed module
799Ashley Yakeley <ashley@semantic.org>**20060425071853]
800[add instances
801Ross Paterson <ross@soi.city.ac.uk>**20060424102146]
802[add superclasses to Applicative and Traversable
803Ross Paterson <ross@soi.city.ac.uk>**20060411144734
804 
805 Functor is now a superclass of Applicative, and Functor and Foldable
806 are now superclasses of Traversable.  The new hierarchy makes clear the
807 inclusions between the classes, but means more work in defining instances.
808 Default definitions are provided to help.
809]
810[add Functor and Monad instances for Prelude types
811Ross Paterson <ross@soi.city.ac.uk>**20060410111443]
812[GHC.Base.breakpoint
813Lemmih <lemmih@gmail.com>**20060407125827]
814[Track the GHC source tree reorganisation
815Simon Marlow <simonmar@microsoft.com>**20060407041631]
816[in the show instance for Exception, print the type of dynamic exceptions
817Simon Marlow <simonmar@microsoft.com>**20060406112444
818 Unfortunately this requires some recursve module hackery to get at
819 the show instance for Typeable.
820]
821[implement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC
822Simon Marlow <simonmar@microsoft.com>**20060405155448]
823[add  forkOnIO :: Int -> IO () -> IO ThreadId
824Simon Marlow <simonmar@microsoft.com>**20060327135018]
825[Rework previous: not a gcc bug after all
826Simon Marlow <simonmar@microsoft.com>**20060323161229
827 It turns out that we were relying on behaviour that is undefined in C,
828 and undefined behaviour in C means "the compiler can do whatever the
829 hell it likes with your entire program".  So avoid that.
830]
831[work around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show
832Simon Marlow <simonmar@microsoft.com>**20060323134514
833 See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824
834]
835[commit mysteriously missing parts of "runIOFastExit" patch
836Simon Marlow <simonmar@microsoft.com>**20060321101535]
837[add runIOFastExit :: IO a -> IO a
838Simon Marlow <simonmar@microsoft.com>**20060320124333
839 Similar to runIO, but calls stg_exit() directly to exit, rather than
840 shutdownHaskellAndExit().  Needed for running GHCi in the test suite.
841]
842[Fix a broken invariant
843Simon Marlow <simonmar@microsoft.com>**20060316134151
844 Patch from #694,  for the problem "empty is an identity for <> and $$" is
845 currently broken by eg. isEmpty (empty<>empty)"
846]
847[Add unsafeSTToIO :: ST s a -> IO a
848Simon Marlow <simonmar@microsoft.com>**20060315160232
849 Implementation for Hugs is missing, but should be easy.  We need this
850 for the forthcoming nested data parallelism implementation.
851]
852[Added 'alter'
853jeanphilippe.bernardy@gmail.com**20060315143539
854 Added 'alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a' to IntMap and Map
855 This addresses ticket #665
856]
857[deprecate FunctorM in favour of Foldable and Traversable
858Ross Paterson <ross@soi.city.ac.uk>**20060315092942
859 as discussed on the libraries list.
860]
861[Simplify Eq, Ord, and Show instances for UArray
862Simon Marlow <simonmar@microsoft.com>**20060313142701
863 The Eq, Ord, and Show instances of UArray were written out longhand
864 with one instance per element type.  It is possible to condense these
865 into a single instance for each class, at the expense of using more
866 extensions (non-std context on instance declaration).
867 
868 Suggestion by: Frederik Eaton <frederik@ofb.net>
869 
870]
871[Oops typo in intSet notMember
872jeanphilippe.bernardy@gmail.com**20060311224713]
873[IntMap lookup now returns monad instead of Maybe.
874jeanphilippe.bernardy@gmail.com**20060311224502]
875[Added notMember to Data.IntSet and Data.IntMap
876jeanphilippe.bernardy@gmail.com**20060311085221]
877[add Data.Set.notMember and Data.Map.notMember
878John Meacham <john@repetae.net>**20060309191806]
879[addToClockTime: handle picoseconds properly
880Simon Marlow <simonmar@microsoft.com>**20060310114532
881 fixes #588
882]
883[make head/build rule apply to all types, not just Bool.
884John Meacham <john@repetae.net>**20060303045753]
885[Avoid overflow when normalising clock times
886Ian Lynagh <igloo@earth.li>**20060210144638]
887[Years have 365 days, not 30*365
888Ian Lynagh <igloo@earth.li>**20060210142853]
889[declare blkcmp() static
890Simon Marlow <simonmar@microsoft.com>**20060223134317]
891[typo in comment in Foldable class
892Ross Paterson <ross@soi.city.ac.uk>**20060209004901]
893[simplify fmap
894Ross Paterson <ross@soi.city.ac.uk>**20060206095048]
895[update ref in comment
896Ross Paterson <ross@soi.city.ac.uk>**20060206095139]
897[Give -foverlapping-instances to Data.Typeable
898simonpj@microsoft**20060206133439
899 
900 For some time, GHC has made -fallow-overlapping-instances "sticky":
901 any instance in a module compiled with -fallow-overlapping-instances
902 can overlap when imported, regardless of whether the importing module
903 allows overlap.  (If there is an overlap, both instances must come from
904 modules thus compiled.)
905 
906 Instances in Data.Typeable might well want to be overlapped, so this
907 commit adds the flag to Data.Typeable (with an explanatory comment)
908 
909 
910]
911[Add -fno-bang-patterns to modules using both bang and glasgow-exts
912simonpj@microsoft.com**20060203175759]
913[When splitting a bucket, keep the contents in the same order
914Simon Marlow <simonmar@microsoft.com>**20060201130427
915 To retain the property that multiple inserts shadow each other
916 (see ticket #661, test hash001)
917]
918[add foldr/build optimisation for take and replicate
919Simon Marlow <simonmar@microsoft.com>**20060126164603
920 This allows take to be deforested, and improves performance of
921 replicate and replicateM/replicateM_.  We have a separate problem that
922 means expressions involving [n..m] aren't being completely optimised
923 because eftIntFB isn't being inlined but otherwise the results look
924 good. 
925 
926 Sadly this has invalidated a number of the nofib benchmarks which were
927 erroneously using take to duplicate work in a misguided attempt to
928 lengthen their runtimes (ToDo).
929]
930[Generate PrimopWrappers.hs with Haddock docs
931Simon Marlow <simonmar@microsoft.com>**20060124131121
932 Patch originally from Dinko Tenev <dinko.tenev@gmail.com>, modified
933 to add log message by me.
934]
935[[project @ 2006-01-19 14:47:15 by ross]
936ross**20060119144715
937 backport warning avoidance from Haddock
938]
939[[project @ 2006-01-18 11:45:47 by malcolm]
940malcolm**20060118114547
941 Fix import of Ix for nhc98.
942]
943[[project @ 2006-01-17 09:38:38 by ross]
944ross**20060117093838
945 add Ix instance for GeneralCategory.
946]
947[TAG Initial conversion from CVS complete
948John Goerzen <jgoerzen@complete.org>**20060112154126]
949Patch bundle hash:
950177647ce6feb4eeca4204668fcfc805ede0bca04