On 9/10/07, PR Stanley <[EMAIL PROTECTED]> wrote:
> Can anyone come up with a better alternative?

*puts on his pointfree hat*

  import Control.Arrow ((&&&))
  import Data.List (group, sort)

  countCS :: [Char] -> [(Char, Int)] -- Char can be generalised to any Ord
  countCS = map (head &&& length) . group . sort


Stuart
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to