From 22d4b26f024485091c08fcb6829fea92f16292ad Mon Sep 17 00:00:00 2001 From: Arya Irani <538571+aryairani@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:12:57 -0400 Subject: [PATCH] Update unison-cli/src/Unison/CommandLine/InputPatterns.hs Co-authored-by: Greg Pfeil --- unison-cli/src/Unison/CommandLine/InputPatterns.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unison-cli/src/Unison/CommandLine/InputPatterns.hs b/unison-cli/src/Unison/CommandLine/InputPatterns.hs index b1a6f1541d..a09a6595ca 100644 --- a/unison-cli/src/Unison/CommandLine/InputPatterns.hs +++ b/unison-cli/src/Unison/CommandLine/InputPatterns.hs @@ -345,9 +345,9 @@ wrongStructuredArgument expected actual = wrongArgsLength :: Text -> [a] -> Either (P.Pretty CT.ColorText) b wrongArgsLength expected args = let foundCount = - if null args - then "none" - else fromMaybe (tShow $ length args) $ Numeral.us_cardinal defaultInflection (length args) + case length args of + 0 -> "none" + n -> fromMaybe (tShow n) $ Numeral.us_cardinal defaultInflection n in Left . P.text $ "I expected " <> expected <> ", but received " <> foundCount <> "." patternName :: InputPattern -> P.Pretty P.ColorText