From 92f22c8f5c13c381d323caeffe17b6dab4c2d927 Mon Sep 17 00:00:00 2001 From: bringert Date: Fri, 20 Jan 2006 18:20:02 +0000 Subject: Use right start category names in si command. --- src/GF/Data/Utilities.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/GF/Data') 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 -- cgit v1.2.3