I want to write a functions which takes the input parameter xs, which represents a list of tuples of the form (a,b,cs) and convert it to a list of tuples (a*b,b+c), for a and b representing whole numbers and all elements c in cs with cs representing a list of numbers.
The result should only include tuples in which the first element of the tuple is bigger but not even than its second element.
[(13,25,[1,12,101]), (5,6,[7,17,27])] -- should be converted to [(325,26),(325,37),(325,126),(30,13)]
Update: After a lot of testing i found this solution but I am not quite sure how to remove the tuples which do not match the requirements from the resulting list:
convert :: [(Int, Int, [Int])] -> [(Int, Int)] convert xs = [(a*b,b+c) | (a,b,cs) <- xs, c <- cs]