[commit: base] master: Update documentation of intersectBy (5fd5497)
Ian Lynagh
igloo at earth.li
Sun May 27 17:30:08 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5fd54973176b82778af2f74e3a741830198e15ab
>---------------------------------------------------------------
commit 5fd54973176b82778af2f74e3a741830198e15ab
Author: A. Bram Neijt <bneijt at gmail.com>
Date: Sun Apr 22 14:52:00 2012 +0200
Update documentation of intersectBy
Mention which list is the source
of the elements in the resulting list.
>---------------------------------------------------------------
Data/List.hs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Data/List.hs b/Data/List.hs
index 9f5001f..7b06dae 100644
--- a/Data/List.hs
+++ b/Data/List.hs
@@ -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 (==)
More information about the Cvs-libraries
mailing list