Fix ghc warnings

This commit is contained in:
2024-12-14 11:49:14 +01:00
parent 7cc43b607d
commit b0303fa23d
14 changed files with 51 additions and 36 deletions

View File

@ -1,7 +1,8 @@
import Data.List (transpose, sort, group)
import Data.List (transpose, sort, group, uncons)
import Data.Maybe (fromJust)
similarityScore :: [Int] -> [Int] -> Int
similarityScore xs ys = let elemsY = [ (head y, length y) | y <- (group . sort) ys ]
similarityScore xs ys = let elemsY = [ (fst . fromJust $ uncons y, length y) | y <- (group . sort) ys ]
in sum [ x * snd y | x <- xs, y <- elemsY, x == fst y ]
main = do