Hi Any comments and/or criticisms would be most appreciated: --count the occurrences of char in string countC :: Char -> [Char] -> Int countC x xs = sum [1 | c <- xs, c == x]
--count occurrences of chars in string countCS :: [Char] -> [(Char, Int)] countCS xs = [(x, (countC x xs)) | x <- [' '..'z'], (countC x xs) > 0] Can anyone come up with a better alternative? Thanks, Paul _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe