What algorithm does GHC use for fuzzy string matching when suggesting other variables in scope?

Consider

ghci> windspeed = 10
ghci> windseed
<interactive>:2:1: error: [GHC-88464]
    Variable not in scope: windseed
    Suggested fix: Perhaps use ‘windspeed’ (line 1)

What strategy is GHC using for determining the suggested fix? Is there a suggested best practice for implementing this sort of thing?

1 Like

It seems that the answer is the fuzzyLookup function in this module

4 Likes