Letter frequency: Difference between revisions
→{{header|Haskell}}: Standard operators perhaps now preferable to Control.Arrow ?
(added RPL) |
(→{{header|Haskell}}: Standard operators perhaps now preferable to Control.Arrow ?) |
||
Line 3,608:
=={{header|Haskell}}==
Short version:
<syntaxhighlight lang="haskell">import Data.List (group, sort)
main :: IO ()
main = interact (show .
or, as an alternative to sorting and grouping the whole string, we could use some kind of container as the accumulator for a single fold, for example:
|