haskell - Using filter on an item in a list? -
i trying filter item in list , print them line line. here's code: data car = car string [string] int [string] testdatabase :: [car] testdatabase = [car"casino royale" ["daniel craig"] 2006 ["garry", "dave", "zoe", "kevin", "emma"],car"blade runner" ["harrison ford", "rutger hauer"] 1982 ["dave", "zoe", "amy", "bill", "ian", "kevin", "emma", "sam", "megan"]] formatcarrow (car b c d) = show ++ " | " ++ concat [i ++ ", " | <- init b] ++ last b ++ " | " ++ show c ++ " | " ++ concat [j ++ ", " | j <- init d] ++ last d displayfilmsbyyear :: string -> io [()] displayfilmsbyyear chosenyear = mapm (putstrln.formatfilmrow) [putstrln(filter ((== chosenyear).y)) | (w x y z) <- testdatabase] -- code not working think why isnt work