Talk:Counting sort (Haskell)

From LiteratePrograms
Jump to: navigation, search

(Although the implementation here is very inefficient. I'm not even sure if it qualifies as a counting sort.)

I don't think it's morally a counting sort, as it mods out the isomorphism between ['a','a','a'] and (3,'a') that is the essence of counting. To count — as opposed to group — I might try to find a solution which made some use of a function like the following:
decode = concatMap (uncurry replicate)
(as used for run length encoding in haskell) Dave 17:23, 25 January 2009 (EST)
hijacker
hijacker
hijacker
hijacker