Ticket #2048: splitWith.patch

File splitWith.patch, 8.6 KB (added by twanvl, 7 years ago)

darcs patch

2New patches:
4[Add split and splitWith to Data.List
5Twan van Laarhoven <[email protected]>**20080116225312] {
6hunk ./Data/List.hs 103
7+   -- Breaking into many substrings
8+   , split             -- :: Eq a => a -> [a] -> [[a]]
9+   , splitWith         -- :: (a -> Char) -> [a] -> [[a]]
11hunk ./Data/List.hs 737
12+-- | Break a list into pieces separated by the argument,
13+-- consuming the delimiter. I.e.
15+-- > split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
16+-- > split 'a'  "aXaXaXa"    == ["","X","X","X",""]
17+-- > split 'x'  "x"          == ["",""]
18+split                   :: Eq a => a -> [a] -> [[a]]
19+split x                 =  splitWith (x==)
21+-- | Splits a 'list into components delimited by separators,
22+-- where the predicate returns True for a separator element.
23+-- The resulting components do not contain the separators.
24+-- Two adjacent separators result in an empty component in the output.
25+splitWith               :: (a -> Bool) -> [a] -> [[a]]
26+splitWith p xs          =  ys : case zs of
27+                                  []   -> []
28+                                  _:ws -> splitWith p ws
29+                           where (ys,zs) = break p xs
35[Data.List.sort: force elements from start to end.
36Bertram Felgenhauer <[email protected]>**20071121101458
37 this prevents a stack overflow on  sort (take 10^6 [1..])
39[Fix comment on GHC.Ptr.minusPtr
40[email protected]**20080109114736]
41[Remove redundant imports of GHC.Err
42[email protected]**20080104091314
44 GHC.Base SOURCE-imports GHC.Err, and re-exports 'error'.  So
45 other modules need only import GHC.Base.
47 This doesn't change the fact that these other modules are all compiled
48 before GHC.Err, so they are all part of the module loop that starts with
49 GHC.Base and finishes with GHC.Err.  But it does reduce the occurrence
50 of those SOURCE imports.
53[Tuple tycons have parens around their names
56 The name of the pair TyCon, in the Typeable instance,
57 should be "(,)" not ",".
59 Don't merge to 6.8; it's a minor API change.
62[Add groupWith, sortWith, the, to support generalised list comprehensions
63[email protected]**20071220111929
65   This the base-library patch to support the main compiler patch
66      Implement generalised list comprehensions
68   It just adds three functions to GHC.Exts.
71[Add GHC.Prim to exposedModules in the Haddock 0.x hook
72David Waern <[email protected]>*-20071209173931
74 Please merge to the stable branch
76[Add GHC.Prim to exposedModules in the Haddock 0.x hook
77David Waern <[email protected]>**20071209173931
79 Please merge to the stable branch
81[Simplify the GHC.Prim hack in base.cabal/Setup.hs
82Ian Lynagh <[email protected]>**20071202215758]
83[Implement 'openTempFile' for nhc98.
84[email protected]**20071207133335]
85[docs: describe the changes to forkIO, and document forkOnIO
86Simon Marlow <[email protected]>**20071205091423]
87[doc only: use realToFrac instead of fromRational.toRational
88Simon Marlow <[email protected]>**20071205091334]
89[Add singletonP to GHC.PArr
90Roman Leshchinskiy <[email protected]>**20071205220859]
91[FIX #1621: bug in Windows code for getCPUTime
92Simon Marlow <[email protected]>**20071205120118
93 We were reading the components of FILETIME as CLong, when they should
94 be unsigned.  Word32 seems to be the correct type here.
96[protect console handler against concurrent access (#1922)
97Simon Marlow <[email protected]>**20071204153940]
98[protect against concurrent access to the signal handlers (#1922)
99Simon Marlow <[email protected]>**20071204110817]
100[restore fdToHandle' to avoid breaking clients (#1109)
101Simon Marlow <[email protected]>**20071130135122
104[note about how to convert CTime (aka EpochTime) to UTCTime
105Simon Marlow <[email protected]>**20071130101648]
106[Fix some URLs
107Ian Lynagh <[email protected]>**20071126214213]
108[Fix some links in haddock docs
109Ian Lynagh <[email protected]>**20071126184428]
110[Don't try to make haddock links to the mtl package as we don't depend on it
111Ian Lynagh <[email protected]>**20071126170631]
112[Escape some special characters in haddock docs
113Ian Lynagh <[email protected]>**20071126163443]
114[FIX BUILD: maybeUpdateFile: ignore failures when removing the target
115Simon Marlow <[email protected]>**20071123092219]
116[FIX #1753
117Simon Marlow <[email protected]>**20071122094207
118 hClose should close the Handle and unlock the file even if calling
119 close() fails for some reason.
121[remove lockFile.h from install-includes
122Simon Marlow <[email protected]>**20071121102248]
123[oops, we forgot to export traceShow
124Simon Marlow <[email protected]>**20071121094300]
125[Fix compilation with GHC 6.2.x
126Simon Marlow <[email protected]>**20071121084341]
127[Move file locking into the RTS, fixing #629, #1109
128Simon Marlow <[email protected]>**20071120121053
129 File locking (of the Haskell 98 variety) was previously done using a
130 static table with linear search, which had two problems: the array had
131 a fixed size and was sometimes too small (#1109), and performance of
132 lockFile/unlockFile was suboptimal due to the linear search.
133 Also the algorithm failed to count readers as required by Haskell 98
134 (#629).
136 Now it's done using a hash table (provided by the RTS).  Furthermore I
137 avoided the extra fstat() for every open file by passing the dev_t and
138 ino_t into lockFile.  This and the improvements to the locking
139 algorithm result in a healthy 20% or so performance increase for
140 opening/closing files (see openFile008 test).
142[Only overwrite GHC/Prim.hs and GHC/Primopwrappers.hs if they change
143Simon Marlow <[email protected]>**20071120102042
144 This avoids make doing unnecessary work after 'setup makefile'.
146[fix comment
147Simon Marlow <[email protected]>**20071116091227]
148[Fix ` characters in elem's haddock docs
149Ian Lynagh <[email protected]>**20071110173052]
150[Filter out GHC.Prim also for the Haddock step
151David Waern <[email protected]>**20071109000806
152 Please merge to the GHC 6.8.2 branch
154[Add module of special magic GHC desugaring helper functions
155Simon Marlow <[email protected]>**20071102160054
156 Currently containing only one such helper: (>>>) for arrow desugaring
158[add Control.Category to the nhc98 build
159[email protected]**20071030120459]
160[fix nhc98 build: need a qualified Prelude import
161[email protected]**20071030120410]
162[Fix performance regression: re-instate -funbox-strict-fields
163Simon Marlow <[email protected]>**20071029150730
164 Yikes!  While investigating the increase in code size with GHC 6.8
165 relative to 6.6, I noticed that in the transition to Cabal for the
166 libraries we lost -funbox-strict-fields, which is more or less
167 depended on by the IO library for performance.  I'm astonished that we
168 didn't notice this earlier!
170 To reduce the chances of this happening again, I put
171 -funbox-strict-fields in the OPTIONS_GHC pragma of the modules that
172 need it.  {-# UNPACK #-} pragmas would be better, though.
174[FIX BUILD: Haddock 1.x fails to parse (Prelude..)
175Simon Marlow <[email protected]>**20071029131921]
176[new Control.Category, ghc ticket #1773
177Ashley Yakeley <[email protected]>**20071029022526]
178[new Control.Compositor module
179Ashley Yakeley <[email protected]>**20071013074851
181 The Compositor class is a superclass of Arrow.
183[Fix doc building with Haddock 0.9
184Simon Marlow <[email protected]>**20071024090947
185 I was using a recent build here, which is more tolerant.
187[FIX #1258: document that openTempFile is secure(ish)
188Simon Marlow <[email protected]>**20071023130928
189 Also change the mode from 0666 to 0600, which seems like a more
190 sensible value and matches what C's mkstemp() does.
192[Clean up .cabal file a bit
193Duncan Coutts <[email protected]>**20071022132708
194 specify build-type and cabal-version >= 1.2
195 put extra-tmp-files in the right place
196 use os(windows) rather than os(mingw32)
198[base in 6.8 and head branch should be version 3.0
199Don Stewart <[email protected]>**20071007150408]
200[FIX #1652: openTempFile should accept an empty string for the directory
201Simon Marlow <[email protected]>**20071018122345]
202[clean up duplicate code
203Simon Marlow <[email protected]>**20071017141311]
204[expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733)
205Simon Marlow <[email protected]>**20071009132042]
207Simon Marlow <[email protected]>**20070917130703]
208[put extra-tmp-files field in the right place
209Simon Marlow <[email protected]>**20070914140812]
210[Add more entries to boring file
211Ian Lynagh <[email protected]>**20070913210500]
212[Add a boring file
213Ian Lynagh <[email protected]>**20070913204641]
214[TAG 2007-09-13
215Ian Lynagh <[email protected]>**20070913215720]
216Patch bundle hash: