Ticket #979: on.patch

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