@@ -37,15 +37,14 @@ isElem x (y :: xs) with (decEq x y)
37 mkNo f g Here = f Refl
37 mkNo f g Here = f Refl
38 mkNo f g (There x) = g x
38 mkNo f g (There x) = g x
40+||| The intersectBy function returns the intersect of two lists by user-supplied equality predicate.
40intersectBy : (a -> a -> Bool) -> List a -> List a -> List a
41intersectBy : (a -> a -> Bool) -> List a -> List a -> List a
41−intersectBy _ [] _ = []
42−intersectBy _ _ [] = []
43intersectBy eq xs ys = [x | x <- xs, any (eq x) ys]
42intersectBy eq xs ys = [x | x <- xs, any (eq x) ys]
45−||| The intersect ∩ function returns the list intersect of the two lists. For example,
44+||| Compute the intersection of two lists according to their `Eq` instance.
47||| ```idris example
46||| ```idris example
48−||| intersect [1,2,3,4] [2,4,6,8]
47+||| intersect [1, 2, 3, 4] [2, 4, 6, 8]
51intersect : (Eq a) => List a -> List a -> List a
50intersect : (Eq a) => List a -> List a -> List a