[Haskell-cafe] General function to count list elements?

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Apr 18 11:08:29 EDT 2009


Hello michael,

Saturday, April 18, 2009, 6:56:20 PM, you wrote:

> Is there a general function to count list elements. I'm trying this

you should add Eq restriction to type declaration since "==" operation
belomngs to Eq class and your function may work only with types
supporting comparision:

count :: (Eq a) => a -> [a] -> Int

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list