Ticket #997: kleisli.patch

File kleisli.patch, 37.8 KB (added by dons, 7 years ago)

Upload patch.

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