Skip to content

Commit 4d12c2a

Browse files
Add a call stack to (!) (#252)
1 parent d0b78af commit 4d12c2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Data/HashMap/Base.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ import qualified GHC.Exts as Exts
143143

144144
#if MIN_VERSION_base(4,9,0)
145145
import Data.Functor.Classes
146+
import GHC.Stack
146147
#endif
147148

148149
#if MIN_VERSION_hashable(1,2,5)
@@ -649,7 +650,11 @@ lookupDefault def k t = findWithDefault def k t
649650

650651
-- | /O(log n)/ Return the value to which the specified key is mapped.
651652
-- Calls 'error' if this map contains no mapping for the key.
653+
#if MIN_VERSION_base(4,9,0)
654+
(!) :: (Eq k, Hashable k, HasCallStack) => HashMap k v -> k -> v
655+
#else
652656
(!) :: (Eq k, Hashable k) => HashMap k v -> k -> v
657+
#endif
653658
(!) m k = case lookup k m of
654659
Just v -> v
655660
Nothing -> error "Data.HashMap.Base.(!): key not found"

0 commit comments

Comments
 (0)