Fix combinations

This commit is contained in:
Sijmen 2018-12-02 21:15:38 +01:00
parent 8f030af74c
commit 5d158006b1

View file

@ -14,7 +14,7 @@ dist :: String -> String -> (Int, String)
dist = dist' 0 S.empty
combinations :: [String] -> [(String, String)]
combinations (x:y:xs) = (x, y):(combinations (y:xs))
combinations (x:xs) = map (x,) xs ++ combinations xs
combinations [] = []
distances :: [(String, String)] -> String