on master help sign in
Fix typo vetting such that some typos must be detected
commite83bdc38f419e5512e2a560db7e34a04bc265914 authorEvan Czaplicki <info@elm-lang.org> dateThu 22 Oct 2015, 14:55 (11 years ago) parent8ad4c70
1 file changed+5−3
src/Reporting/Error/Helpers.hs+5−3
src/Reporting/Error/Helpers.hs+5−3
@@ -152,11 +152,13 @@ vetTypos potentialTypos =
152152 (leftCounts, rightCounts) =
153153 foldr tallyNames (Map.empty, Map.empty) potentialTypos
154154
155− allUnique :: Map.Map String Int -> Bool
156− allUnique counts =
155+ acceptable :: Map.Map String Int -> Bool
156+ acceptable counts =
157+ not (Map.null counts)
158+ &&
157159 Map.foldr (\n unique -> n < 2 && unique) True counts
158160 in
159− if allUnique leftCounts && allUnique rightCounts then
161+ if acceptable leftCounts && acceptable rightCounts then
160162 Just (Map.keysSet leftCounts, Map.keysSet rightCounts)
161163
162164 else