@@ -23,6 +23,7 @@ import qualified Elm.Name as N
23import qualified Reporting.Annotation as A
23import qualified Reporting.Annotation as A
24import qualified Reporting.Doc as D
24import qualified Reporting.Doc as D
25import Reporting.Doc ( Doc, (<+>), (<>) )
25import Reporting.Doc ( Doc, (<+>), (<>) )
26+import qualified Reporting.Render.Type.Localizer as L
@@ -177,29 +178,29 @@ collectSrcArgs tipe =
177-- CANONICAL TYPE TO DOC
178-- CANONICAL TYPE TO DOC
180−canToDoc :: Context -> Can.Type -> Doc
181+canToDoc :: L.Localizer -> Context -> Can.Type -> Doc
181−canToDoc context tipe =
182+canToDoc localizer context tipe =
182 case tipe of
183 case tipe of
183 Can.TLambda arg1 result ->
184 Can.TLambda arg1 result ->
185 (arg2, rest) = collectArgs result
186 (arg2, rest) = collectArgs result
187 lambda context
188 lambda context
188− (canToDoc Func arg1)
189+ (canToDoc localizer Func arg1)
189− (canToDoc Func arg2)
190+ (canToDoc localizer Func arg2)
190− (map (canToDoc Func) rest)
191+ (map (canToDoc localizer Func) rest)
192 Can.TVar name ->
193 Can.TVar name ->
193 D.fromName name
194 D.fromName name
195 Can.TType (ModuleName.Canonical _ home) name args ->
196 Can.TType (ModuleName.Canonical _ home) name args ->
196 apply context
197 apply context
197− (D.fromName home <> "." <> D.fromName name)
198+ (L.toDoc localizer home name)
198− (map (canToDoc App) args)
199+ (map (canToDoc localizer App) args)
200 Can.TRecord fields ext ->
201 Can.TRecord fields ext ->
202− (map entryToDocs (Map.toList fields))
203+ (map (entryToDocs localizer) (Map.toList fields))
203 (fmap D.fromName ext)
204 (fmap D.fromName ext)
205 Can.TUnit ->
206 Can.TUnit ->
@@ -207,19 +208,19 @@ canToDoc context tipe =
208 Can.TTuple a b maybeC ->
209 Can.TTuple a b maybeC ->
210− (canToDoc None a)
211+ (canToDoc localizer None a)
211− (canToDoc None b)
212+ (canToDoc localizer None b)
212− (map (canToDoc None) (Maybe.maybeToList maybeC))
213+ (map (canToDoc localizer None) (Maybe.maybeToList maybeC))
214 Can.TAlias (ModuleName.Canonical _ home) name args _ ->
215 Can.TAlias (ModuleName.Canonical _ home) name args _ ->
215 apply context
216 apply context
216− (D.fromName home <> "." <> D.fromName name)
217+ (L.toDoc localizer home name)
217− (map (canToDoc App . snd) args)
218+ (map (canToDoc localizer App . snd) args)
220−entryToDocs :: (N.Name, Can.Type) -> (Doc, Doc)
221+entryToDocs :: L.Localizer -> (N.Name, Can.Type) -> (Doc, Doc)
221−entryToDocs (name, tipe) =
222+entryToDocs localizer (name, tipe) =
222− (D.fromName name, canToDoc None tipe)
223+ (D.fromName name, canToDoc localizer None tipe)
225collectArgs :: Can.Type -> (Can.Type, [Can.Type])
226collectArgs :: Can.Type -> (Can.Type, [Can.Type])