Skip to content

Instantly share code, notes, and snippets.

View rampion's full-sized avatar

Noah Luck Easterly rampion

  • Mercury Technologies
View GitHub Profile
@rampion
rampion / Levenshtein.hs
Created March 22, 2012 13:44 — forked from jberryman/med.hs
an optimized haskell Levenshtein distance, using the vector library
module Main where
import qualified Data.List as L
import qualified Data.Vector.Unboxed.Safe as V
import Control.Monad (replicateM)
import System.Random (randomRIO)
import Criterion.Main
med :: String -> String -> Int
med s1 = V.last . V.ifoldl' scanS1 costs_i . V.fromList