Commit 5a3489f0 authored by A. Bram Neijt's avatar A. Bram Neijt Committed by Ian Lynagh

Update documentation of intersectBy

Mention which list is the source
of the elements in the resulting list.
parent 93ac54f2
......@@ -416,7 +416,8 @@ unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs
-- > [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.
-- supply their own equality test. If the element is found in both the first
-- and the second list, the element from the first list will be used.
intersect :: (Eq a) => [a] -> [a] -> [a]
intersect = intersectBy (==)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment