a = [-3, 5, 3, -1, -6, -2] prod = foldr (*) 1 (filter (\x -> x < 0) a) len = length $ filter (\x -> x < 0) a main = do print prod print len
Standard input is empty
36 4
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!