summaryrefslogtreecommitdiff
path: root/src/GF/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Data')
-rw-r--r--src/GF/Data/Utilities.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs
index a5ceb08d2..aaadad1fe 100644
--- a/src/GF/Data/Utilities.hs
+++ b/src/GF/Data/Utilities.hs
@@ -81,8 +81,8 @@ unionAll = nub . concat
-- | Like 'lookup', but fails if the argument is not found,
-- instead of returning Nothing.
-lookup' :: Eq a => a -> [(a,b)] -> b
-lookup' x = fromJust . lookup x
+lookup' :: (Show a, Eq a) => a -> [(a,b)] -> b
+lookup' x = fromMaybe (error $ "Not found: " ++ show x) . lookup x
-- | Like 'find', but fails if nothing is found.
find' :: (a -> Bool) -> [a] -> a