on master help sign in
Fix typo vetting such that some typos must be detected
e83bdc3Evan Czaplicki
src/Reporting/Error/Helpers.hs+5−3
@@ -152,11 +152,13 @@ vetTypos potentialTypos =
152 (leftCounts, rightCounts) =
152 (leftCounts, rightCounts) =
153 foldr tallyNames (Map.empty, Map.empty) potentialTypos
153 foldr tallyNames (Map.empty, Map.empty) potentialTypos
154
154
155− allUnique :: Map.Map String Int -> Bool
155+ acceptable :: Map.Map String Int -> Bool
156− allUnique counts =
156+ acceptable counts =
157+ not (Map.null counts)
158+ &&
157 Map.foldr (\n unique -> n < 2 && unique) True counts
159 Map.foldr (\n unique -> n < 2 && unique) True counts
158 in
160 in
159− if allUnique leftCounts && allUnique rightCounts then
161+ if acceptable leftCounts && acceptable rightCounts then
160 Just (Map.keysSet leftCounts, Map.keysSet rightCounts)
162 Just (Map.keysSet leftCounts, Map.keysSet rightCounts)
161
163
162 else
164 else