-scoreLetterSet :: WordSet -> LetterSet -> Int
-scoreLetterSet wordSets letterSet = bonus + (sum $ fmap scoreAWord (S.toList scoringWords))
- where scoringWords = wordSets ! letterSet
- scoreAWord w = if length w == 4 then 1 else length w
+-- scoreLetterSet :: WordSet -> LetterSet -> Int
+-- scoreLetterSet wordSets letterSet = bonus + (sum $ fmap scoreAWord (S.toList scoringWords))
+-- where scoringWords = wordSets ! letterSet
+-- scoreAWord w = if length w == 4 then 1 else length w
+-- bonus = if (S.size letterSet) == 7 then (S.size scoringWords) * 7 else 0
+scoreLetterSet :: LetterSet -> S.Set String -> Int
+-- scoreLetterSet letterSet scoringWords = bonus + (sum $ fmap scoreAWord (S.toAscList scoringWords))
+scoreLetterSet letterSet scoringWords = bonus + (S.foldr' (\w t -> t + scoreAWord w) 0 scoringWords)
+ where scoreAWord w
+ | length w == 4 = 1
+ | otherwise = length w