@@ -131,6 +131,11 @@ distance x y =
131131
132132-- TO REPORT
133133
134+namingError :: String -> String -> Report.Report
135+namingError pre post =
136+ Report.simple "NAMING ERROR" pre post
137+
138+
134139toReport :: Error -> Report.Report
135140toReport err =
136141 case err of
@@ -139,22 +144,22 @@ toReport err =
139144 in
140145 case problem of
141146 Ambiguous ->
142− Report.simple
147+ namingError
143148 ("This usage of " ++ var ++ " is ambiguous.")
144149 (maybeYouWant suggestions)
145150
146151 UnknownQualifier qualifier ->
147− Report.simple
152+ namingError
148153 ("Cannot find " ++ var ++ ", qualifier '" ++ qualifier ++ "' is not in scope.")
149154 (maybeYouWant suggestions)
150155
151156 QualifiedUnknown qualifier ->
152− Report.simple
157+ namingError
153158 ("Cannot find " ++ var ++ ", module '" ++ qualifier ++ "' does not expose that value.")
154159 (maybeYouWant suggestions)
155160
156161 ExposedUnknown ->
157− Report.simple
162+ namingError
158163 ("Cannot find " ++ var)
159164 (maybeYouWant suggestions)
160165
@@ -169,7 +174,7 @@ toReport err =
169174 argMismatchReport "Type" var expected actual
170175
171176 SelfRecursive name tvars tipe ->
172− Report.simple "This type alias is recursive, forming an infinite type!" $
177+ Report.simple "ALIAS PROBLEM" "This type alias is recursive, forming an infinite type!" $
173178 "Type aliases are just names for more fundamental types, so I go through\n"
174179 ++ "and expand them all to know the real underlying type. The problem is that\n"
175180 ++ "when I expand a recursive type alias, it keeps getting bigger and bigger.\n"
@@ -180,7 +185,7 @@ toReport err =
180185 ++ "like List which are recursive, but do not get expanded into infinite types."
181186
182187 MutuallyRecursive aliases ->
183− Report.simple "This type alias is part of a mutually recursive set of type aliases." $
188+ Report.simple "ALIAS PROBLEM" "This type alias is part of a mutually recursive set of type aliases." $
184189 "The following type aliases all depend on each other in some way:\n"
185190 ++ concatMap showName aliases ++ "\n\n"
186191 ++ "The problem is that when you try to expand any of these type aliases, they\n"
@@ -195,17 +200,17 @@ toReport err =
195200 in
196201 case importError of
197202 ModuleNotFound suggestions ->
198− Report.simple
203+ namingError
199204 ("Could not find a module named '" ++ moduleName ++ "'")
200205 (maybeYouWant (map Module.nameToString suggestions))
201206
202207 ValueNotFound value suggestions ->
203− Report.simple
208+ namingError
204209 ("Module '" ++ moduleName ++ "' does not expose '" ++ value ++ "'")
205210 (maybeYouWant suggestions)
206211
207212 Export name suggestions ->
208− Report.simple
213+ namingError
209214 ("Could not export '" ++ name ++ "' which is not defined in this module.")
210215 (maybeYouWant suggestions)
211216
@@ -225,7 +230,7 @@ toReport err =
225230 ++ "Ints, Floats, Bools, Strings, Maybes, Lists, Arrays, Tuples,\n"
226231 ++ "Json.Values, and concrete records."
227232 in
228− Report.simple preHint postHint
233+ Report.simple "PORT ERROR" preHint postHint
229234
230235
231236argMismatchReport :: String -> Var.Canonical -> Int -> Int -> Report.Report
@@ -239,7 +244,7 @@ argMismatchReport kind var expected actual =
239244 postHint =
240245 "Expecting " ++ show expected ++ ", but got " ++ show actual ++ "."
241246 in
242− Report.Report Nothing preHint postHint
247+ Report.simple "ARGUMENT" preHint postHint
243248
244249
245250maybeYouWant :: [String] -> String