From 6bdd5536107c28eb035930eb0e24fa646e90bacf Mon Sep 17 00:00:00 2001 From: wi11-holdsworth <83637728+wi11-holdsworth@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:34:37 +1100 Subject: [PATCH] refactor: use pointwise definition for pairwiseMatches as a more idiomatic solution --- Proj2.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Proj2.hs b/Proj2.hs index b23a8f8..31a5ad5 100644 --- a/Proj2.hs +++ b/Proj2.hs @@ -213,7 +213,7 @@ matches :: (Eq a, Show a) => [a] -> [a] -> Int matches xs ys = maximum permutationMatches where permutationMatches = map (pairwiseMatches xs) (permutations ys) - pairwiseMatches xs ys = length $ filter (uncurry (==)) $ zip xs ys + pairwiseMatches xs = length . filter (uncurry (==)) . zip xs -- outputs a list of all possible chords, where a chord is a list of unique -- pitches. this function happens to generate chords such that the pitches are