Ticket #2048: splitWith.patch

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

darcs patch

Line 
1
2New patches:
3
4[Add split and splitWith to Data.List
5Twan van Laarhoven <twanvl@gmail.com>**20080116225312] {
6hunk ./Data/List.hs 103
7+   -- Breaking into many substrings
8+   , split             -- :: Eq a => a -> [a] -> [[a]]
9+   , splitWith         -- :: (a -> Char) -> [a] -> [[a]]
10+
11hunk ./Data/List.hs 737
12+-- | Break a list into pieces separated by the argument,
13+-- consuming the delimiter. I.e.
14+--
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==)
20+
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
30+
31}
32
33Context:
34
35[Data.List.sort: force elements from start to end.
36Bertram Felgenhauer <int-e@gmx.de>**20071121101458
37 this prevents a stack overflow on  sort (take 10^6 [1..])
38]
39[Fix comment on GHC.Ptr.minusPtr
40simonpj@microsoft.com**20080109114736]
41[Remove redundant imports of GHC.Err
42simonpj@microsoft.com**20080104091314
43 
44 GHC.Base SOURCE-imports GHC.Err, and re-exports 'error'.  So
45 other modules need only import GHC.Base.
46 
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.
51 
52]
53[Tuple tycons have parens around their names
54simonpj@microsoft**20071220171812
55 
56 The name of the pair TyCon, in the Typeable instance,
57 should be "(,)" not ",".
58 
59 Don't merge to 6.8; it's a minor API change.
60 
61]
62[Add groupWith, sortWith, the, to support generalised list comprehensions
63simonpj@microsoft.com**20071220111929
64 
65   This the base-library patch to support the main compiler patch
66      Implement generalised list comprehensions
67   
68   It just adds three functions to GHC.Exts.
69 
70]
71[Add GHC.Prim to exposedModules in the Haddock 0.x hook
72David Waern <david.waern@gmail.com>*-20071209173931
73 
74 Please merge to the stable branch
75]
76[Add GHC.Prim to exposedModules in the Haddock 0.x hook
77David Waern <david.waern@gmail.com>**20071209173931
78 
79 Please merge to the stable branch
80]
81[Simplify the GHC.Prim hack in base.cabal/Setup.hs
82Ian Lynagh <igloo@earth.li>**20071202215758]
83[Implement 'openTempFile' for nhc98.
84Malcolm.Wallace@cs.york.ac.uk**20071207133335]
85[docs: describe the changes to forkIO, and document forkOnIO
86Simon Marlow <simonmar@microsoft.com>**20071205091423]
87[doc only: use realToFrac instead of fromRational.toRational
88Simon Marlow <simonmar@microsoft.com>**20071205091334]
89[Add singletonP to GHC.PArr
90Roman Leshchinskiy <rl@cse.unsw.edu.au>**20071205220859]
91[FIX #1621: bug in Windows code for getCPUTime
92Simon Marlow <simonmar@microsoft.com>**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.
95]
96[protect console handler against concurrent access (#1922)
97Simon Marlow <simonmar@microsoft.com>**20071204153940]
98[protect against concurrent access to the signal handlers (#1922)
99Simon Marlow <simonmar@microsoft.com>**20071204110817]
100[restore fdToHandle' to avoid breaking clients (#1109)
101Simon Marlow <simonmar@microsoft.com>**20071130135122
102 
103]
104[note about how to convert CTime (aka EpochTime) to UTCTime
105Simon Marlow <simonmar@microsoft.com>**20071130101648]
106[Fix some URLs
107Ian Lynagh <igloo@earth.li>**20071126214213]
108[Fix some links in haddock docs
109Ian Lynagh <igloo@earth.li>**20071126184428]
110[Don't try to make haddock links to the mtl package as we don't depend on it
111Ian Lynagh <igloo@earth.li>**20071126170631]
112[Escape some special characters in haddock docs
113Ian Lynagh <igloo@earth.li>**20071126163443]
114[FIX BUILD: maybeUpdateFile: ignore failures when removing the target
115Simon Marlow <simonmar@microsoft.com>**20071123092219]
116[FIX #1753
117Simon Marlow <simonmar@microsoft.com>**20071122094207
118 hClose should close the Handle and unlock the file even if calling
119 close() fails for some reason.
120]
121[remove lockFile.h from install-includes
122Simon Marlow <simonmar@microsoft.com>**20071121102248]
123[oops, we forgot to export traceShow
124Simon Marlow <simonmar@microsoft.com>**20071121094300]
125[Fix compilation with GHC 6.2.x
126Simon Marlow <simonmar@microsoft.com>**20071121084341]
127[Move file locking into the RTS, fixing #629, #1109
128Simon Marlow <simonmar@microsoft.com>**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).
135 
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).
141]
142[Only overwrite GHC/Prim.hs and GHC/Primopwrappers.hs if they change
143Simon Marlow <simonmar@microsoft.com>**20071120102042
144 This avoids make doing unnecessary work after 'setup makefile'.
145]
146[fix comment
147Simon Marlow <simonmar@microsoft.com>**20071116091227]
148[Fix ` characters in elem's haddock docs
149Ian Lynagh <igloo@earth.li>**20071110173052]
150[Filter out GHC.Prim also for the Haddock step
151David Waern <david.waern@gmail.com>**20071109000806
152 Please merge to the GHC 6.8.2 branch
153]
154[Add module of special magic GHC desugaring helper functions
155Simon Marlow <simonmar@microsoft.com>**20071102160054
156 Currently containing only one such helper: (>>>) for arrow desugaring
157]
158[add Control.Category to the nhc98 build
159Malcolm.Wallace@cs.york.ac.uk**20071030120459]
160[fix nhc98 build: need a qualified Prelude import
161Malcolm.Wallace@cs.york.ac.uk**20071030120410]
162[Fix performance regression: re-instate -funbox-strict-fields
163Simon Marlow <simonmar@microsoft.com>**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!
169 
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.
173]
174[FIX BUILD: Haddock 1.x fails to parse (Prelude..)
175Simon Marlow <simonmar@microsoft.com>**20071029131921]
176[new Control.Category, ghc ticket #1773
177Ashley Yakeley <ashley@semantic.org>**20071029022526]
178[new Control.Compositor module
179Ashley Yakeley <ashley@semantic.org>**20071013074851
180 
181 The Compositor class is a superclass of Arrow.
182]
183[Fix doc building with Haddock 0.9
184Simon Marlow <simonmar@microsoft.com>**20071024090947
185 I was using a recent build here, which is more tolerant.
186]
187[FIX #1258: document that openTempFile is secure(ish)
188Simon Marlow <simonmar@microsoft.com>**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.
191]
192[Clean up .cabal file a bit
193Duncan Coutts <duncan@haskell.org>**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)
197]
198[base in 6.8 and head branch should be version 3.0
199Don Stewart <dons@galois.com>**20071007150408]
200[FIX #1652: openTempFile should accept an empty string for the directory
201Simon Marlow <simonmar@microsoft.com>**20071018122345]
202[clean up duplicate code
203Simon Marlow <simonmar@microsoft.com>**20071017141311]
204[expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733)
205Simon Marlow <simonmar@microsoft.com>**20071009132042]
206[typo
207Simon Marlow <simonmar@microsoft.com>**20070917130703]
208[put extra-tmp-files field in the right place
209Simon Marlow <simonmar@microsoft.com>**20070914140812]
210[Add more entries to boring file
211Ian Lynagh <igloo@earth.li>**20070913210500]
212[Add a boring file
213Ian Lynagh <igloo@earth.li>**20070913204641]
214[TAG 2007-09-13
215Ian Lynagh <igloo@earth.li>**20070913215720]
216Patch bundle hash:
217a893748312577bccfa707a1be006cb6d81a7316a