1 --!!! ds025 -- overloaded assoc -- AbsBinds
5 ehead xs loc | null xs = error ("4"++loc)
9 = if (null res) then error ("1"++loc++"2"++(show key))
11 where res = [ val | (key',val) <- lst, key==key']
13 assocMaybe :: (Eq a) => a -> [(a,b)] -> Maybe b
15 = if (null res) then Nothing else (Just (head res))
16 where res = [ val | (key',val) <- lst, key==key']
18 data Maybe a = Just a | Nothing deriving ()