on master help sign in
Fix "need N more arguments" error message

Say "1 more argument", not "1 more1 argument".

commitda3755abe598e646ca016903f3e41f5a49eab4cb authorspikefoo <spikefoo@users.noreply.github.com> dateSun 8 Jan 2017, 15:57 (10 years ago) parentf82095c
2 files changed+7−2
src/Reporting/Error/Type.hs+1−1 src/Reporting/Helpers.hs+6−1
src/Reporting/Error/Type.hs+1−1
@@ -774,7 +774,7 @@ reasonToStringHelp reason =
774774
775775 MissingArgs num ->
776776 go $
777− "It looks like a function needs " <> i2t num <> " more" <> Help.args num <> "."
777+ "It looks like a function needs " <> Help.moreArgs num <> "."
778778
779779 BadVar (Just Comparable) _ ->
780780 go "Only ints, floats, chars, strings, lists, and tuples are comparable."
src/Reporting/Helpers.hs+6−1
@@ -7,7 +7,7 @@ module Reporting.Helpers
77 , hsep, indent, parens, sep, text, underline, vcat
88 -- custom helpers
99 , i2t
10− , functionName, args
10+ , functionName, args, moreArgs
1111 , toHint, hintLink, stack, reflowParagraph
1212 , commaSep, capitalize, ordinalize, drawCycle
1313 , findPotentialTypos, findTypoPairs, vetTypos
@@ -72,6 +72,11 @@ args n =
7272 i2t n <> if n == 1 then " argument" else " arguments"
7373
7474
75+moreArgs :: Int -> Text
76+moreArgs n =
77+ i2t n <> " more" <> if n == 1 then " argument" else " arguments"
78+
79+
7580
7681-- HINTS
7782