
New patches:

[Add 'subsequences' and 'permutations' to Data.List
Twan van Laarhoven <twanvl@gmail.com>**20071218154950] {
hunk ./Data/List.hs 40
+   
+   , subsequences      -- :: [a] -> [[a]]
+   , permutations      -- :: [a] -> [[a]]
hunk ./Data/List.hs 736
+
+-- | The 'subsequences' function returns the list of all subsequences of the argument.
+--
+-- > subsequences "abc" == ["","c","b","bc","a","ac","ab","abc"]
+subsequences            :: [a] -> [[a]]
+subsequences []         =  [[]]
+subsequences (x:xs)     =  subsequences xs ++ map (x:) (subsequences xs)
+
+-- | The 'permutations' function returns the list of all permutations of the argument.
+--
+-- > permutations "abc" == ["abc","bac","bca","acb","cab","cba"]
+permutations            :: [a] -> [[a]]
+permutations []         =  [[]]
+permutations (x:xs)     =  [zs | ys <- permutations xs, zs <- interleave x ys ]
+  where interleave          :: a -> [a] -> [[a]]
+        interleave x []     =  [[x]]
+        interleave x (y:ys) =  [x:y:ys] ++ map (y:) (interleave x ys)
+
}

['subsequences' is now more lazy and also faster
Twan van Laarhoven <twanvl@gmail.com>**20080102231629] {
hunk ./Data/List.hs 739
--- > subsequences "abc" == ["","c","b","bc","a","ac","ab","abc"]
+-- > subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"]
hunk ./Data/List.hs 741
-subsequences []         =  [[]]
-subsequences (x:xs)     =  subsequences xs ++ map (x:) (subsequences xs)
+subsequences xs         =  [] : nonEmptySubsequences xs
+
+-- | The 'nonEmptySubsequences' function returns the list of all subsequences of the argument,
+--   except for the empty list.
+--
+-- > nonEmptySubsequences "abc" == ["a","b","ab","c","ac","bc","abc"]
+nonEmptySubsequences         :: [a] -> [[a]]
+nonEmptySubsequences []      =  []
+nonEmptySubsequences (x:xs)  =  [x] : foldr f [] (nonEmptySubsequences xs)
+  where f ys r = ys : (x : ys) : r
+
}

['permutations' is now more lazy and also faster
Twan van Laarhoven <twanvl@gmail.com>**20080102231712] {
hunk ./Data/List.hs 755
--- > permutations "abc" == ["abc","bac","bca","acb","cab","cba"]
+-- > permutations "abc" == ["abc","bac","cba","bca","cab","acb"]
hunk ./Data/List.hs 757
-permutations []         =  [[]]
-permutations (x:xs)     =  [zs | ys <- permutations xs, zs <- interleave x ys ]
-  where interleave          :: a -> [a] -> [[a]]
-        interleave x []     =  [[x]]
-        interleave x (y:ys) =  [x:y:ys] ++ map (y:) (interleave x ys)
+permutations xs         =  xs : perms xs []
+  where
+    perms []     is = []
+    perms (t:ts) is = foldr interleave (perms ts (t:is)) (permutations is)
+      where interleave    xs     r = let (_,zs) = interleave' id xs r in zs
+            interleave' f []     r = (ts, r)
+            interleave' f (y:ys) r = let (us,zs) = interleave' (f . (y:)) ys r
+                                     in  (y:us, f (t:y:us) : zs)
}

Context:

[Add GHC.Prim to exposedModules in the Haddock 0.x hook
David Waern <david.waern@gmail.com>*-20071209173931
 
 Please merge to the stable branch
] 
[Add GHC.Prim to exposedModules in the Haddock 0.x hook
David Waern <david.waern@gmail.com>**20071209173931
 
 Please merge to the stable branch
] 
[Simplify the GHC.Prim hack in base.cabal/Setup.hs
Ian Lynagh <igloo@earth.li>**20071202215758] 
[Implement 'openTempFile' for nhc98.
Malcolm.Wallace@cs.york.ac.uk**20071207133335] 
[docs: describe the changes to forkIO, and document forkOnIO
Simon Marlow <simonmar@microsoft.com>**20071205091423] 
[doc only: use realToFrac instead of fromRational.toRational
Simon Marlow <simonmar@microsoft.com>**20071205091334] 
[Add singletonP to GHC.PArr
Roman Leshchinskiy <rl@cse.unsw.edu.au>**20071205220859] 
[FIX #1621: bug in Windows code for getCPUTime
Simon Marlow <simonmar@microsoft.com>**20071205120118
 We were reading the components of FILETIME as CLong, when they should
 be unsigned.  Word32 seems to be the correct type here.
] 
[protect console handler against concurrent access (#1922)
Simon Marlow <simonmar@microsoft.com>**20071204153940] 
[protect against concurrent access to the signal handlers (#1922)
Simon Marlow <simonmar@microsoft.com>**20071204110817] 
[restore fdToHandle' to avoid breaking clients (#1109)
Simon Marlow <simonmar@microsoft.com>**20071130135122
 
] 
[note about how to convert CTime (aka EpochTime) to UTCTime
Simon Marlow <simonmar@microsoft.com>**20071130101648] 
[Fix some URLs
Ian Lynagh <igloo@earth.li>**20071126214213] 
[Fix some links in haddock docs
Ian Lynagh <igloo@earth.li>**20071126184428] 
[Don't try to make haddock links to the mtl package as we don't depend on it
Ian Lynagh <igloo@earth.li>**20071126170631] 
[Escape some special characters in haddock docs
Ian Lynagh <igloo@earth.li>**20071126163443] 
[FIX BUILD: maybeUpdateFile: ignore failures when removing the target
Simon Marlow <simonmar@microsoft.com>**20071123092219] 
[FIX #1753
Simon Marlow <simonmar@microsoft.com>**20071122094207
 hClose should close the Handle and unlock the file even if calling
 close() fails for some reason.
] 
[remove lockFile.h from install-includes
Simon Marlow <simonmar@microsoft.com>**20071121102248] 
[oops, we forgot to export traceShow
Simon Marlow <simonmar@microsoft.com>**20071121094300] 
[Fix compilation with GHC 6.2.x
Simon Marlow <simonmar@microsoft.com>**20071121084341] 
[Move file locking into the RTS, fixing #629, #1109
Simon Marlow <simonmar@microsoft.com>**20071120121053
 File locking (of the Haskell 98 variety) was previously done using a
 static table with linear search, which had two problems: the array had
 a fixed size and was sometimes too small (#1109), and performance of
 lockFile/unlockFile was suboptimal due to the linear search.
 Also the algorithm failed to count readers as required by Haskell 98
 (#629).
 
 Now it's done using a hash table (provided by the RTS).  Furthermore I
 avoided the extra fstat() for every open file by passing the dev_t and
 ino_t into lockFile.  This and the improvements to the locking
 algorithm result in a healthy 20% or so performance increase for
 opening/closing files (see openFile008 test).
] 
[Only overwrite GHC/Prim.hs and GHC/Primopwrappers.hs if they change
Simon Marlow <simonmar@microsoft.com>**20071120102042
 This avoids make doing unnecessary work after 'setup makefile'.
] 
[fix comment
Simon Marlow <simonmar@microsoft.com>**20071116091227] 
[Fix ` characters in elem's haddock docs
Ian Lynagh <igloo@earth.li>**20071110173052] 
[Filter out GHC.Prim also for the Haddock step
David Waern <david.waern@gmail.com>**20071109000806
 Please merge to the GHC 6.8.2 branch
] 
[Add module of special magic GHC desugaring helper functions
Simon Marlow <simonmar@microsoft.com>**20071102160054
 Currently containing only one such helper: (>>>) for arrow desugaring
] 
[add Control.Category to the nhc98 build
Malcolm.Wallace@cs.york.ac.uk**20071030120459] 
[fix nhc98 build: need a qualified Prelude import
Malcolm.Wallace@cs.york.ac.uk**20071030120410] 
[Fix performance regression: re-instate -funbox-strict-fields
Simon Marlow <simonmar@microsoft.com>**20071029150730
 Yikes!  While investigating the increase in code size with GHC 6.8
 relative to 6.6, I noticed that in the transition to Cabal for the
 libraries we lost -funbox-strict-fields, which is more or less
 depended on by the IO library for performance.  I'm astonished that we
 didn't notice this earlier!
 
 To reduce the chances of this happening again, I put
 -funbox-strict-fields in the OPTIONS_GHC pragma of the modules that
 need it.  {-# UNPACK #-} pragmas would be better, though.
] 
[FIX BUILD: Haddock 1.x fails to parse (Prelude..)
Simon Marlow <simonmar@microsoft.com>**20071029131921] 
[new Control.Category, ghc ticket #1773
Ashley Yakeley <ashley@semantic.org>**20071029022526] 
[new Control.Compositor module
Ashley Yakeley <ashley@semantic.org>**20071013074851
 
 The Compositor class is a superclass of Arrow.
] 
[Fix doc building with Haddock 0.9
Simon Marlow <simonmar@microsoft.com>**20071024090947
 I was using a recent build here, which is more tolerant.
] 
[FIX #1258: document that openTempFile is secure(ish)
Simon Marlow <simonmar@microsoft.com>**20071023130928
 Also change the mode from 0666 to 0600, which seems like a more
 sensible value and matches what C's mkstemp() does.
] 
[Clean up .cabal file a bit
Duncan Coutts <duncan@haskell.org>**20071022132708
 specify build-type and cabal-version >= 1.2
 put extra-tmp-files in the right place
 use os(windows) rather than os(mingw32)
] 
[base in 6.8 and head branch should be version 3.0
Don Stewart <dons@galois.com>**20071007150408] 
[FIX #1652: openTempFile should accept an empty string for the directory
Simon Marlow <simonmar@microsoft.com>**20071018122345] 
[clean up duplicate code
Simon Marlow <simonmar@microsoft.com>**20071017141311] 
[expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733)
Simon Marlow <simonmar@microsoft.com>**20071009132042] 
[typo
Simon Marlow <simonmar@microsoft.com>**20070917130703] 
[put extra-tmp-files field in the right place
Simon Marlow <simonmar@microsoft.com>**20070914140812] 
[Add more entries to boring file
Ian Lynagh <igloo@earth.li>**20070913210500] 
[Add a boring file
Ian Lynagh <igloo@earth.li>**20070913204641] 
[TAG 2007-09-13
Ian Lynagh <igloo@earth.li>**20070913215720] 
Patch bundle hash:
82be995391c361eec90d41721bbddcec4c8cce60
