Type Declaration For List of Num

I'm new to Haskell and I have no idea what I'm doing wrong here. The following code generates an error. numOfPos :: Num a => [a] -> Int numOfPos xs = length [x | x <- xs, x > 0] The code just returns the number of positive elements in ...
more »

| haskell   2017-03-20 23:03 (1) Answers