-sameNoOfArgs :: MatchGroup Name -> Bool
-sameNoOfArgs (MatchGroup matches _)
- = isSingleton (nub (map args_in_match matches))
+checkArgs :: Name -> MatchGroup Name -> TcM ()
+checkArgs fun (MatchGroup (match1:matches) _)
+ | null bad_matches = return ()
+ | otherwise
+ = failWithTc (vcat [ptext SLIT("Equations for") <+> quotes (ppr fun) <+>
+ ptext SLIT("have different numbers of arguments"),
+ nest 2 (ppr (getLoc match1)),
+ nest 2 (ppr (getLoc (head bad_matches)))])