MarcoSero/Norvigs-Spelling-Corrector — pull request #5 by bazzargh (2014-12-21 00:16:55+00:00)
Title: You don't need a sort to find the top element

Trying this in ghci, 'compare' is already pulled in by prelude. This change is closer to Norvig's python implementation ("return max(candidates, key=NWORDS.get)") but also removes a needless sort - if you just need the maximum, an O(n) single pass is all you need, not an O(n logn) sort.