I want to write a function that displays the whole contents of a list. But im not sure how to do so. I have displayed my datatype of which i want to print...and at the bottom is the function that I want to print the list with.
Thanks in advance.
- data type
type Title = String
type Director = String
type Year = Int
type Fan = String
data Film = Film Title Director Year [Fan] deriving Show
-- List of films
testDatabase :: [Film]
testDatabase = [(Film "Casino Royale" "Martin Campbell" 2006 ["Garry", "Dave", "Zoe"]) ]
--list of films
listFilms :: [Film] -> [Film]
listFilms (film@(Film title director year fans) : films) = putStrLn . show