I need to recurse through two lists in a function and I can't see a way to do it.
siteRating6OrHigher :: [Film] -> [String]
siteRating6OrHigher [] = []
siteRating6OrHigher ((Film title _ _ ((_, rating):ratings)):restOfFilms)
| rating >= 6 = [title] ++ siteRating6OrHigher restOfFilms
| otherwise = siteRating6OrHigher restOfFilms
My data is formatted: testDatabase = [Film "Blade Runner" "Ridley Scott" 1982 [("Amy",6), ("Bill",9), ("Ian",7), ("Kevin",9), ("Emma",4), ("Sam",5), ("Megan",4)], etc
So currently I am recursing through the 'restOfFilms' but i also need to recurse through the list of ratings that are in the Film type. Is there a way to do this so it recurses through each set of ratings for each film?
Thanks
data structure:
data Film = Film String String Int [(String, Int)]
deriving (Eq,Ord,Show,Read)