@@ -43,7 +43,6 @@ data Module =
4343 , _time :: File.Time
4444 , _source :: B.ByteString
4545 , _error :: Error
46− , _localizer :: L.Localizer
4746 }
4847
4948
@@ -55,36 +54,36 @@ data Error
5554 = BadSyntax Syntax.Error
5655 | BadImports (NE.List Import.Error)
5756 | BadNames (OneOrMore.OneOrMore Canonicalize.Error)
58− | BadTypes (NE.List Type.Error)
57+ | BadTypes L.Localizer (NE.List Type.Error)
58+ | BadMains L.Localizer (OneOrMore.OneOrMore Main.Error)
5959 | BadPatterns (NE.List Pattern.Error)
60− | BadMains (OneOrMore.OneOrMore Main.Error)
6160
6261
6362
6463-- TO REPORT
6564
6665
67−toReports :: L.Localizer -> Code.Source -> Error -> NE.List Report.Report
68−toReports localizer source err =
66+toReports :: Code.Source -> Error -> NE.List Report.Report
67+toReports source err =
6968 case err of
7069 BadSyntax syntaxError ->
7170 NE.List (Syntax.toReport source syntaxError) []
7271
7372 BadImports errs ->
74− fmap Import.toReport errs
73+ fmap (Import.toReport source) errs
7574
7675 BadNames errs ->
7776 fmap (Canonicalize.toReport source) (OneOrMore.destruct NE.List errs)
7877
79− BadTypes errs ->
78+ BadTypes localizer errs ->
8079 fmap (Type.toReport source localizer) errs
8180
81+ BadMains localizer errs ->
82+ fmap (Main.toReport localizer source) (OneOrMore.destruct NE.List errs)
83+
8284 BadPatterns errs ->
8385 fmap (Pattern.toReport source) errs
8486
85− BadMains errs ->
86− fmap (Main.toReport localizer source) (OneOrMore.destruct NE.List errs)
87−
8887
8988
9089-- TO DOC
@@ -131,10 +130,10 @@ toSeparator beforeModule afterModule =
131130
132131
133132moduleToDoc :: Module -> D.Doc
134−moduleToDoc (Module _ path _ source err localizer) =
133+moduleToDoc (Module _ path _ source err) =
135134 let
136135 reports =
137− toReports localizer (Code.toSource source) err
136+ toReports (Code.toSource source) err
138137 in
139138 D.vcat $ map (reportToDoc path) (NE.toList reports)
140139
@@ -171,10 +170,10 @@ toJson modules =
171170
172171
173172moduleToJson :: Module -> E.Value
174−moduleToJson (Module name path _ source err localizer) =
173+moduleToJson (Module name path _ source err) =
175174 let
176175 reports =
177− toReports localizer (Code.toSource source) err
176+ toReports (Code.toSource source) err
178177 in
179178 E.object
180179 [ "path" ==> E.string (Utf8.fromChars path)