-- Write code which calculates a fantasy football team's total points from a list of paired outcome types and values. The top-level function must have the type declaration count_points :: [(Outcome,Int)] -> Int. Assume this datatype definition: data Outcome = Goal | Assist | CleanSheet | SentOff. Note that a goal is worth 3 points, a clean sheet is worth 2 points, an assist is worth 1 point and a sending off is worth -3 points. data Outcome = Goal | CleanSheet | Assist | SentOff deriving Eq countPoints :: [(Outcome,Int)] -> Int countPoints [] = 0 countPoints ((x,n):xs) | x == Goal = (n*3) + countPoints xs | x == Assist = (n*1) + countPoints xs | x == CleanSheet = (n*2) + countPoints xs | x == SentOff = (n*(-3)) + countPoints xs -- Write code which takes in a string and determines whether the string is exclusively composed of vowels. The top-level function must have the type declaration areVowels :: String -> Bool areVowels :: String -> Bool areVowels [] = True areVowels (x:xs) | x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u' = areVowels xs | x == 'A' || x == 'E' || x == 'I' || x == 'O' || x == 'U' = areVowels xs | otherwise = False -- Write code which, given two lists of integers which are not necessarily of the same length, returns a list of products of their elements whose length is that of the longest list. The products are computed multiplying the first element of list1 with the first element of list2, the second element of list1 with the second element of list2, etc. until there are no more elements remaining in the shortest list. To preserve the length of the longest input list, insert at the tail of the output list as many 0s as there are extra elements in the longest list. The top-level function must have the type declaration multiplyLists :: [Int] -> [Int] -> [Int] multiplyLists :: [Int] -> [Int] -> [Int] multiplyLists [] [] = [] multiplyLists (x:xs) [] = 0 : multiplyLists xs [] multiplyLists [] (y:ys) = 0 : multiplyLists [] ys multiplyLists (x:xs) (y:ys) = x*y : multiplyLists xs ys