Play with syntax

This commit is contained in:
2023-12-04 19:05:20 +01:00
parent e746e22b0b
commit 53cad097f8
15 changed files with 27 additions and 26 deletions

View File

@@ -13,7 +13,7 @@ updateNCopies 0 card otherCards = otherCards
updateNCopies n card (c: t) = c {nCopies = nCopies card + nCopies c}: updateNCopies (n - 1) card t
updateCopies :: Card -> [Card] -> [Card]
updateCopies card otherCards = let nWinningNumbers = getNWinningNumbers (winningNumbers card) (numbers card)
updateCopies card otherCards = let nWinningNumbers = getNWinningNumbers (winningNumbers card) $ numbers card
in updateNCopies nWinningNumbers card otherCards
updateAllCopies :: [Card] -> [Card]
@@ -21,4 +21,4 @@ updateAllCopies [] = []
updateAllCopies (c: t) = c: updateAllCopies (updateCopies c t)
getNCopies :: [Card] -> [Int]
getNCopies cards = map nCopies (updateAllCopies cards)
getNCopies cards = map nCopies $ updateAllCopies cards