typeof :: Name -> Map.Map Name (Type,a) -> Type
typeof name table = case Map.lookup name table of 
                      Nothing -> error ("error: typeof " ++ name)
                      Just a -> fst a
typeof :: Name -> Map.Map Name (Type,a) -> Type
typeof name table = case Map.lookup name table of 
                      Nothing -> error ("error: typeof " ++ name)
                      Just a -> fst a
typeof name table = case Map.lookup name table of 
                      Nothing -> error ("error: typeof " ++ name)
                      Just a -> fst a