Huffman coding: Difference between revisions

m
→‎{{header|Haskell}}: ( restoring point-free pattern of freq )
m (→‎{{header|Haskell}}: ( Generalising map to fmap (<$>) for marginally more readability ))
m (→‎{{header|Haskell}}: ( restoring point-free pattern of freq ))
Line 2,726:
:: Ord a
=> [a] -> [(Int, a)]
freq c = ((length &&& head) <$>) . group (sort. c)sort</lang>
{{out}}
<lang haskell>*Main> test "this is an example for huffman encoding"
9,655

edits