Question: Define a function sumFstorSnds :: [(Integer, Integer)] -> Bool -> Integer which adds up either every first component in a list of tuples if the
Define a function
sumFstorSnds :: [(Integer, Integer)] -> Bool -> Integer
which adds up either every first component in a list of tuples if the second input is True or adds up every second component in a list of tuples if the second input is False
For example, sumFstorSnds [(1, 10), (2, 20)] True 3 and sumFstorSnds [(1, 10), (2, 20)] False = 30
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
