@@ -15,7 +15,8 @@ module Reporting.Doc
1515 , stack, reflow, commaSep
1616 , toSimpleNote, toSimpleHint, toFancyHint
1717 , link, fancyLink, reflowLink, makeLink
18− , args, moreArgs, ordinalize
18+ , args, moreArgs
19+ , ordinal, intToOrdinal
1920 , cycle
2021 )
2122 where
@@ -32,6 +33,7 @@ import qualified System.Console.ANSI.Types as Ansi
3233import System.IO (Handle)
3334import qualified Text.PrettyPrint.ANSI.Leijen as P
3435
36+import qualified Data.Index as Index
3537import qualified Elm.Compiler.Version as Compiler
3638import qualified Elm.Package as Pkg
3739import qualified Json.Encode as E
@@ -176,8 +178,13 @@ moreArgs n =
176178 show n <> " more" <> if n == 1 then " argument" else " arguments"
177179
178180
179−ordinalize :: Int -> String
180−ordinalize number =
181+ordinal :: Index.ZeroBased -> String
182+ordinal index =
183+ intToOrdinal (Index.toHuman index)
184+
185+
186+intToOrdinal :: Int -> String
187+intToOrdinal number =
181188 let
182189 remainder10 =
183190 number `mod` 10