module List (
{-
This list follows the type signatures for the
- standard List interface.
+ standard List interface. -- 8/97
-}
elemIndex, elemIndices,
find, findIndex, findIndices,
delete, deleteBy, (\\), deleteFirstsBy,
union, unionBy,
intersect, intersectBy,
+ intersperse, transpose, partition,
group, groupBy,
inits, tails,
isPrefixOf, isSuffixOf,
- intersperse, transpose, partition,
mapAccumL, mapAccumR,
sort, sortBy,
insertBy,
union = unionBy (==)
unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
-unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) ys xs
+unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs
intersect :: (Eq a) => [a] -> [a] -> [a]
intersect = intersectBy (==)