test :: Int -> Either String Stringtest x = do y <- case M.lookup x testMap of Nothing -> throwError "not in map" Just z -> return z return y