@@ -2,6 +2,7 @@
2module Reporting.Error.Canonicalize where
2module Reporting.Error.Canonicalize where
4import Control.Arrow (second)
4import Control.Arrow (second)
5+import qualified Data.Char as Char
5import Text.PrettyPrint.ANSI.Leijen (indent, text)
6import Text.PrettyPrint.ANSI.Leijen (indent, text)
7import qualified AST.Module.Name as ModuleName
8import qualified AST.Module.Name as ModuleName
@@ -251,14 +252,18 @@ toReport localizer err =
252argMismatchReport :: String -> Var.Canonical -> Int -> Int -> Report.Report
253argMismatchReport :: String -> Var.Canonical -> Int -> Int -> Report.Report
253argMismatchReport kind var expected actual =
254argMismatchReport kind var expected actual =
254− Report.report
255+ let
255− "ARGUMENT"
256+ numArgs =
257− ( kind ++ " " ++ Var.toString var ++ " has too "
258 ++ (if actual < expected then "few" else "many")
258 ++ (if actual < expected then "few" else "many")
259− ++ " arguments."
259+ ++ " arguments"
262+ (map Char.toUpper numArgs)
264+ ( kind ++ " " ++ Var.toString var ++ " has " ++ numArgs ++ "."
261− (text ("Expecting " ++ show expected ++ ", but got " ++ show actual ++ "."))
266+ (text ("Expecting " ++ show expected ++ ", but got " ++ show actual ++ "."))
264extractSuggestions :: Error -> Maybe [String]
269extractSuggestions :: Error -> Maybe [String]