HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleoptparse-applicative-0.18.1.0Haskell98

Options.Applicative.Help.Levenshtein

  • 1 value
valueeditDistance :: Eq a => [a] -> [a] -> Int
#

Calculate the Damerau-Levenshtein edit distance between two lists (strings).

This is modified from https://wiki.haskell.org/Edit_distance and is originally from Lloyd Allison's paper "Lazy Dynamic-Programming can be Eager"

It's been changed though from Levenshtein to Damerau-Levenshtein, which treats transposition of adjacent characters as one change instead of two.

Complexity O(|a|*(1 + editDistance a b))