split 0.2.1.1 → 0.2.1.2
raw patch · 4 files changed
+19/−2 lines, 4 files
Files
- CHANGES +7/−0
- README +4/−0
- split.cabal +1/−1
- src/Data/List/Split/Internals.hs +7/−1
CHANGES view
@@ -1,3 +1,10 @@+* 0.2.1.2 (28 January 2013)++ - Patch from Daniel Wagner to make splitting lazier when using+ keepDelimsR. Previously nothing was output until encountering a+ delimiter; now it can start outputting a Text chunk before+ reaching a delimiter.+ * 0.2.1.1 (24 September 2012) - Update this CHANGES file with details from the past two releases.
README view
@@ -26,3 +26,7 @@ Once the documentation has been built, you can access it by pointing your browser to dist/doc/html/split/index.html.++Running the tests:++ runhaskell -isrc test/Properties.hs
split.cabal view
@@ -1,5 +1,5 @@ Name: split-Version: 0.2.1.1+Version: 0.2.1.2 Stability: stable Description: A collection of various methods for splitting
src/Data/List/Split/Internals.hs view
@@ -211,7 +211,13 @@ -- | Merge delimiters with adjacent chunks to the left. mergeRight :: SplitList a -> SplitList a mergeRight [] = []-mergeRight ((Text c) : (Delim d) : l) = Text (c++d) : mergeRight l+-- below fanciness is with the goal of laziness: we want to start returning+-- stuff before we've necessarily discovered a delimiter, in case we're+-- processing some infinite list with no delimiter+mergeRight ((Text c) : l) = Text (c++d) : mergeRight lTail+ where (d, lTail) = case l of+ Delim d' : l' -> (d', l')+ _ -> ([], l) mergeRight (c : l) = c : mergeRight l -- | Drop an initial blank chunk according to the given 'EndPolicy'.