The text-metrics package

[Tags:benchmark, bsd3, library, test]

Calculate various string metrics efficiently.

[Skip to Readme]


Versions 0.1.0, 0.2.0, 0.3.0
Change log
Dependencies base (>=4.7 && <5.0), containers (>= && <0.6), text (>=0.2 && <1.3), vector (>=0.11 && <0.13) [details]
License BSD3
Author Mark Karpov <>
Maintainer Mark Karpov <>
Category Text, Algorithms
Home page
Bug tracker
Source repository head: git clone
Uploaded Tue Jun 13 10:07:24 UTC 2017 by mrkkrp
Distributions Arch:0.2.0, LTSHaskell:0.2.0, NixOS:0.3.0, Stackage:0.3.0, Tumbleweed:0.2.0
Downloads 737 total (182 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2017-06-13 [all 1 reports]
Hackage Matrix CI




devTurn on development settings.DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for text-metrics

Readme for text-metrics-0.3.0

Text Metrics

License BSD3 Hackage Stackage Nightly Stackage LTS Build Status Coverage Status

The library provides efficient implementations of various strings metric algorithms. It works with strict Text values.

The current version of the package implements:

Comparison with the edit-distance package

There is edit-distance package whose scope overlaps with the scope of this package. The differences are:

  • edit-distance allows to specify costs for every operation when calculating Levenshtein distance (insertion, deletion, substitution, and transposition). This is rarely needed though in real-world applications, IMO.

  • edit-distance only provides Levenshtein distance, text-metrics aims to provide implementations of most string metrics algorithms.

  • edit-distance works on Strings, while text-metrics works on strict Text values.


Although we originally used C for speed, currently all functions are pure Haskell tuned for performance. See this blog post for more info.


Copyright © 2016–2017 Mark Karpov

Distributed under BSD 3 clause license.