
10 May
2009
10 May
'09
9:59 p.m.
2009/5/11 applebiz89
I know to use show and putStrLn but I just don't know how to put them into the function correctly
Well I hope we're not doing your homework for you but... As putStrLn is in the IO monad, listFilms should at least have a signature like this: listFilms :: [Film] -> IO () Now you know you want to call putStrLn on each item in the list. That means you want to join a bunch of functions return IO (). That sounds like a job for sequence_: listFilms films = sequence_ $ map (putStrLn.show) films Or the same thing more verbosely: listFilms [] = return () listFilms (film:films) = do putStrLn (show film) listFilms films Hope that helps, Alex