-- Write code which takes in a list of paired Ints and returns a list of Ints containing the larger value of each pair. The top-level function must have the type declaration larger :: [(Int,Int)] -> [Int] larger :: [(Int,Int)] -> [Int] larger [] = [] larger ((m,n):xs) | m > n = m : larger xs | otherwise = n : larger xs -- Write code which takes in a list of Ints and returns a pair of lists of Ints where the first list in the pair contains the even numbers and the second the odd numbers. The top-level function must have the type declaration evenOdd :: [Int] -> ([Int],[Int]). evenOdd :: [Int] -> ([Int],[Int]) evenOdd [] = ([],[]) evenOdd list = (groupEven list, groupOdd list) groupEven :: [Int] -> [Int] groupEven [] = [] groupEven (x:xs) | x `mod` 2 == 0 = x : groupEven xs | otherwise = groupEven xs groupOdd :: [Int] -> [Int] groupOdd [] = [] groupOdd (x:xs) | x `mod` 2 /= 0 = x : groupOdd xs | otherwise = groupOdd xs evenOdd' :: [Int] -> ([Int],[Int]) evenOdd' xs = ([x | x <- xs, x `mod` 2 == 0 ],[x | x <- xs, x `mod` 2 /= 0 ])