[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:04:43 UTC 2010


The following commit has been merged in the master branch:
commit ee8699a23d3e53d0102512385bc7ae9b7bd258bd
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Dec 27 02:00:54 2005 +0100

    Noted in comments a suggestion for spanList

diff --git a/MissingH/List.hs b/MissingH/List.hs
index fc46baf..c480626 100644
--- a/MissingH/List.hs
+++ b/MissingH/List.hs
@@ -111,6 +111,19 @@ list instead of just one element.
 spanList :: ([a] -> Bool) -> [a] -> ([a], [a])
 spanList p xs = (takeWhileList p xs, dropWhileList p xs)
 
+{- Suggestion from Bulat Ziganshin <bulatz at HotPOP.com>:
+(not yet applied due to lack of unit test for this function)
+
+spanList _ [] = ([],[])
+spanList func list@(x:xs) =
+    if func list
+       then (x:ys,zs)
+       else ([],list)
+    where (ys,zs) = spanList func xs
+-}
+
+
+
 {- | Similar to Data.List.break, but performs the test on the entire remaining
 list instead of just one element.
 -}

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list