The soundex algorithm maps several spellings of a name to a 4 character term. (hopefully mapping all different transcriptions to the same term) The steps as described in Introduction to information retrieval are:  Keep first Letter for the rest:Change any of 'A', 'E', 'I', 'O', 'U', 'H', 'W', 'Y' to zeroChange all other characters to 1-6, see belowremove consecutive doublesremove all zeros, right pad with 0s, keep first 3I implemented a working solution, but can it be implemented more readable?import Data.Charsoundex :: String -> Stringsoundex []      = []soundex (n:ame) = result  where     compr  = map (compress . toUpper) ame    noDoub = remDoubles compr    noZero = filter (/='0') noDoub    result = n: take 3 (noZero++000)remDoubles :: String -> StringremDoubles []       = []remDoubles (a:[])   = [a]remDoubles (a:b:bs) | a==b      = remDoubles   (b:bs)                    | otherwise = a:remDoubles (b:bs)compress :: Char -> Charcompress char | char `elem` AEIOUHWY = '0'              | char `elem` BFPV     = '1'              | char `elem` CGJKQSXZ = '2'              | char `elem` DT       = '3'              | char `elem` L        = '4'              | char `elem` MN       = '5'              | char `elem` R        = '6'              | otherwise              = char
soundex implementation
algorithm;strings;haskell