Sort the letters of string in alphabetical order: Difference between revisions

m
m (→‎{{header|Haskell}}: Added a variant which constructs a sorted string from a map of character counts)
Line 192:
--------------------------- TEST -------------------------
main :: IO ()
main = do
let s = "Was the misspelling of alphabetical as alphabitical a joke ?"
print $
M.toList
( charCounts s)
"Was the misspelling of alphabetical as alphabitical a joke ?"
)
>>= uncurry (flip replicate)</lang>
{{Out}}
9,659

edits