summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2011-01-26 17:10:30 +0000
committersimonpj@microsoft.com <unknown>2011-01-26 17:10:30 +0000
commit4dc71b4bbff15526bb6a10e2e45cf2723168b543 (patch)
tree70122946399247f85e2744ff309c17bc05fe459c /compiler
parent001b9a4d8b5e3f120c419c6f6fa3dd67b1d6cd9e (diff)
downloadhaskell-4dc71b4bbff15526bb6a10e2e45cf2723168b543.tar.gz
Bleat a bit more informatively in unionLists
Diffstat (limited to 'compiler')
-rw-r--r--compiler/utils/ListSetOps.lhs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/utils/ListSetOps.lhs b/compiler/utils/ListSetOps.lhs
index f5e0eae9a0..83334fbb28 100644
--- a/compiler/utils/ListSetOps.lhs
+++ b/compiler/utils/ListSetOps.lhs
@@ -19,6 +19,8 @@ module ListSetOps (
) where
+#include "HsVersions.h"
+
import Outputable
import Unique
import UniqFM
@@ -41,9 +43,11 @@ insertList :: Eq a => a -> [a] -> [a]
insertList x xs | isIn "insert" x xs = xs
| otherwise = x : xs
-unionLists :: (Eq a) => [a] -> [a] -> [a]
+unionLists :: (Outputable a, Eq a) => [a] -> [a] -> [a]
-- Assumes that the arguments contain no duplicates
-unionLists xs ys = [x | x <- xs, isn'tIn "unionLists" x ys] ++ ys
+unionLists xs ys
+ = WARN(length xs > 100 || length ys > 100, ppr xs $$ ppr ys)
+ [x | x <- xs, isn'tIn "unionLists" x ys] ++ ys
minusList :: (Eq a) => [a] -> [a] -> [a]
-- Everything in the first list that is not in the second list: