[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:22:35 UTC 2010


The following commit has been merged in the master branch:
commit f269806f3bd8f40b1835c5be2d208cfe3396878d
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Jan 7 15:16:17 2008 +0100

    Mark contains for deprecation

diff --git a/src/Data/List/Utils.hs b/src/Data/List/Utils.hs
index 8b25a16..0b6647f 100644
--- a/src/Data/List/Utils.hs
+++ b/src/Data/List/Utils.hs
@@ -59,7 +59,7 @@ module Data.List.Utils(-- * Merging
                      -- sub,
                     ) where
 import Data.List(intersperse, concat, isPrefixOf, isSuffixOf, elemIndices,
-                elemIndex, elemIndices, tails, find, findIndex)
+                elemIndex, elemIndices, tails, find, findIndex, isInfixOf)
 import Control.Monad.State(State, get, put)
 import Data.Maybe(isJust)
 
@@ -227,6 +227,7 @@ Examples:
 genericJoin :: Show a => String -> [a] -> String
 genericJoin delim l = join delim (map show l)
 
+{-# DEPRECATED contains: Use Data.List.isInfixOf, will be removed in MissingH 1.1.0 #-}
 {- | Returns true if the given parameter is a sublist of the given list;
 false otherwise.
 
@@ -234,10 +235,14 @@ Example:
 
 > contains "Haskell" "I really like Haskell." -> True
 > contains "Haskell" "OCaml is great." -> False
+
+This function was submitted to GHC and was applied as
+'Data.List.isInfixOf'.  This function therefore is deprecated and will
+be removed in future versions.
 -}
 
 contains :: Eq a => [a] -> [a] -> Bool
-contains substr str = isJust $ find (isPrefixOf substr) (tails str)
+contains = isInfixOf
 
 -- above function submitted to GHC as Data.List.isInfixOf on 8/31/2006
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list