diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-03-10 10:24:28 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-11 08:19:44 -0400 |
commit | c61b9b02925acf248cde1ec0f67730c1a6f6c6e5 (patch) | |
tree | 549a8e1a8ec1635b53928c3bef567084b497a224 | |
parent | 336eac7ef049ba9feab5a948120f0f732e26f773 (diff) | |
download | haskell-c61b9b02925acf248cde1ec0f67730c1a6f6c6e5.tar.gz |
Deepen call stack for isIn
I see quite a few warnings like:
WARNING: file compiler/utils/Util.hs, line 593
Over-long elem in unionLists
But the call stack is uninformative. Better to add HasDebugCallStack
to isIn. Ditto isn'tIn.
-rw-r--r-- | compiler/utils/Util.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index 6eb1390c06..35642f9166 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -577,13 +577,13 @@ only _ = panic "Util: only" -- Debugging/specialising versions of \tr{elem} and \tr{notElem} -isIn, isn'tIn :: Eq a => String -> a -> [a] -> Bool - # if !defined(DEBUG) +isIn, isn'tIn :: Eq a => String -> a -> [a] -> Bool isIn _msg x ys = x `elem` ys isn'tIn _msg x ys = x `notElem` ys # else /* DEBUG */ +isIn, isn'tIn :: (HasDebugCallStack, Eq a) => String -> a -> [a] -> Bool isIn msg x ys = elem100 0 x ys where |