Eq a => [a] -> [a] -> [a]

(\\) :: Eq a => [a] -> [a] -> [a]
base Data.List
The \\ function is list difference ((non-associative). In the result of xs \\ ys, the first occurrence of each element of ys in turn (if any) has been removed from xs. Thus > (xs ++ ys) \\ xs == ys. It is a special case of deleteFirstsBy, which allows the programmer to supply their own equality test.
intersect :: Eq a => [a] -> [a] -> [a]
base Data.List
The intersect function takes the list intersection of two lists. For example, > [1,2,3,4] `intersect` [2,4,6,8] == [2,4] If the first list contains duplicates, so will the result. > [1,2,2,3,4] `intersect` [6,4,4,2] == [2,2,4] It is a special case of intersectBy, which allows the programmer to supply their own equality test.
union :: Eq a => [a] -> [a] -> [a]
base Data.List
The union function returns the list union of the two lists. For example, > "dog" `union` "cow" == "dogcw" Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of unionBy, which allows the programmer to supply their own equality test.
(++) :: [a] -> [a] -> [a]
base Prelude, base Data.List
Append two lists, i.e., > [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] > [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...] If the first list is not finite, the result is the first list.
stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]
base Data.List
The stripPrefix function drops the given prefix from a list. It returns Nothing if the list did not start with the prefix given, or Just the list after the prefix, if it does. > stripPrefix "foo" "foobar" == Just "bar" > stripPrefix "foo" "foo" == Just "" > stripPrefix "foo" "barfoo" == Nothing > stripPrefix "foo" "barfoobaz" == Nothing
delete :: Eq a => a -> [a] -> [a]
base Data.List
delete x removes the first occurrence of x from its list argument. For example, > delete 'a' "banana" == "bnana" It is a special case of deleteBy, which allows the programmer to supply their own equality test.
deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
base Data.List
The deleteFirstsBy function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed.
intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
base Data.List
The intersectBy function is the non-overloaded version of intersect.
unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
base Data.List
The unionBy function is the non-overloaded version of union.
mergeIO :: [a] -> [a] -> IO [a]
base Control.Concurrent
intercalate :: [a] -> [[a]] -> [a]
base Data.List
intercalate xs xss is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.
(<|>) :: Alternative f => f a -> f a -> f a
base Control.Applicative
mplus :: MonadPlus m => m a -> m a -> m a
base Control.Monad
replace :: Eq a => a -> a -> [a] -> [a]
cgi Network.CGI.Protocol
Replaces all instances of a value in a list by another value.
intersperse :: a -> [a] -> [a]
base Data.List
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example, > intersperse ',' "abcde" == "a,b,c,d,e"
(</>) :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
A nice alias for combine.
combine :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Combine two paths, if the second path isAbsolute, then it returns the second. > Valid x => combine (takeDirectory x) (takeFileName x) `equalFilePath` x > Posix: combine "/" "test" == "/test" > Posix: combine "home" "bob" == "home/bob" > Windows: combine "home" "bob" == "home\\bob" > Windows: combine "home" "/bob" == "/bob"
joinDrive :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Join a drive and the rest of the path. > uncurry joinDrive (splitDrive x) == x > Windows: joinDrive "C:" "foo" == "C:foo" > Windows: joinDrive "C:\\" "bar" == "C:\\bar" > Windows: joinDrive "\\\\share" "foo" == "\\\\share\\foo" > Windows: joinDrive "/:" "foo" == "/:\\foo"
makeRelative :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Contract a filename, based on a relative path. There is no corresponding makeAbsolute function, instead use System.Directory.canonicalizePath which has the same effect. > Valid y => equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y </> makeRelative y x) x > makeRelative x x == "." > null y || equalFilePath (makeRelative x (x </> y)) y || null (takeFileName x) > Windows: makeRelative "C:\\Home" "c:\\home\\bob" == "bob" > Windows: makeRelative "C:\\Home" "c:/home/bob" == "bob" > Windows: makeRelative "C:\\Home" "D:\\Home\\Bob" == "D:\\Home\\Bob" > Windows: makeRelative "C:\\Home" "C:Home\\Bob" == "C:Home\\Bob" > Windows: makeRelative "/Home" "/home/bob" == "bob" > Posix: makeRelative "/Home" "/home/bob" == "/home/bob" > Posix: makeRelative "/home/" "/home/bob/foo/bar" == "bob/foo/bar" > Posix: makeRelative "/fred" "bob" == "bob" > Posix: makeRelative "/file/test" "/file/test/fred" == "fred" > Posix: makeRelative "/file/test" "/file/test/fred/" == "fred/" > Posix: makeRelative "some/path" "some/path/a/b/c" == "a/b/c"
elemIndices :: Eq a => a -> [a] -> [Int]
base Data.List
The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.

Show more results