Commit 1cd4955c authored by Philipp Meyer's avatar Philipp Meyer

Better error message when key is not found

parent fca63fa5
......@@ -16,7 +16,7 @@ type ModelI = Model Integer
type ModelB = Model Bool
mVal :: Model a -> String -> a
mVal m x = getMap m M.! x
mVal m x = M.findWithDefault (error ("key not found: " ++ x)) x (getMap m)
mValues :: Model a -> [a]
mValues m = M.elems $ getMap m
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment