X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Flib%2Frequired%2FList.hs;h=40d115386547c3c398a01358be9eeb485024e124;hp=c89357bb90ac4adce7e89aed065e205c36e9983d;hb=5eb1c77c795f92ed0f4c8023847e9d4be1a4fd0d;hpb=f7ecf7234c224489be8a5e63fced903b655d92ee diff --git a/ghc/lib/required/List.hs b/ghc/lib/required/List.hs index c89357b..40d1153 100644 --- a/ghc/lib/required/List.hs +++ b/ghc/lib/required/List.hs @@ -18,11 +18,11 @@ delete = deleteBy (==) deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] deleteBy eq x [] = [] -deleteBy eq x (y:ys) = if x `eq` y then ys else deleteBy eq x ys +deleteBy eq x (y:ys) = if x `eq` y then ys else y : deleteBy eq x ys -- 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. This (xs ++ ys) \\ xs == ys. +-- has been removed from xs. Thus, (xs ++ ys) \\ xs == ys. (\\) :: (Eq a) => [a] -> [a] -> [a] (\\) = foldl (flip delete)