@@ -536,10 +536,11 @@ delete = deleteBy (==)
536(\\) : (Eq a) => List a -> List a -> List a
536(\\) : (Eq a) => List a -> List a -> List a
537(\\) = foldl (flip delete)
537(\\) = foldl (flip delete)
539+||| The unionBy function returns the union of two lists by user-supplied equality predicate.
539unionBy : (a -> a -> Bool) -> List a -> List a -> List a
540unionBy : (a -> a -> Bool) -> List a -> List a -> List a
540−unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs
541+unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs
542−||| The union function returns the list union of the two lists. For example,
543+||| Compute the union of two lists according to their `Eq` instance.
544||| ```idris example
545||| ```idris example
545||| union ['d', 'o', 'g'] ['c', 'o', 'w']
546||| union ['d', 'o', 'g'] ['c', 'o', 'w']