@@ -794,9 +794,32 @@ toReport source err =
795 unused = map fst unusedVars
795 unused = map fst unusedVars
796 unbound = map fst unboundVars
796 unbound = map fst unboundVars
797− var name = "`" <> H.nameToDoc name <> "`"
797+
798− isOrAre vars = if length vars == 1 then "is" else "are"
798+ theseAreUsed =
799− itOrThem vars = if length vars == 1 then "it" else "them"
799+ case unbound of
801+ ["Type","variable",H.dullyellow ("`" <> H.nameToDoc x <> "`"),"appears"
802+ ,"in","the","definition,","but","I","do","not","see","it","declared."
806+ ["Type","variables"]
807+ ++ H.commaSep "and" H.dullyellow (map H.nameToDoc unbound)
808+ ++ ["are","used","in","the","definition,","but","I","do","not","see","them","declared."]
813+ ["Likewise,","type","variable"
814+ ,H.dullyellow ("`" <> H.nameToDoc x <> "`")
815+ ,"is","delared,","but","not","used."
819+ ["Likewise,","type","variables"]
820+ ++ H.commaSep "and" H.dullyellow (map H.nameToDoc unused)
821+ ++ ["are","delared,","but","not","used."]
801 Report.Report "TYPE VARIABLE PROBLEMS" aliasRegion [] $
824 Report.Report "TYPE VARIABLE PROBLEMS" aliasRegion [] $
802 Report.toCodeSnippet source aliasRegion Nothing
825 Report.toCodeSnippet source aliasRegion Nothing
@@ -805,12 +828,7 @@ toReport source err =
805 "Type alias `" <> N.toString typeName <> "` has some type variable problems."
828 "Type alias `" <> N.toString typeName <> "` has some type variable problems."
808− [ H.fillSep $
831+ [ H.fillSep $ theseAreUsed ++ butTheseAreUnused
809− ["The","definition","uses"]
810− ++ H.commaSep "and" H.dullyellow (map var unbound)
811− ++ ["but","I","do","not","see",itOrThem unbound,"declared.","Likewise,"]
812− ++ H.commaSep "and" H.dullyellow (map var unused)
813− ++ [isOrAre unused,"delared,","but","not","used!"]
814 , H.reflow $
832 , H.reflow $
815 "My guess is that a definition like this will work better:"
833 "My guess is that a definition like this will work better:"
816 , H.indent 4 $ H.hsep $
834 , H.indent 4 $ H.hsep $