packages feed

Craft3e-0.2.0.6: Chapter15/MakeCode.hs

-------------------------------------------------------------------------
--                              
--         MakeCode.hs                          
--                              
--         Huffman coding in Haskell.                   
--                              
--         (c) Simon Thompson, 1996-2011.                   
--                          
-------------------------------------------------------------------------

module MakeCode ( codes, codeTable ) where

import Types
import Frequency ( frequency )
import MakeTree  ( makeTree )
import CodeTable ( codeTable )

-- Putting together frequency calculation and tree conversion   

codes :: [Char] -> Tree

codes = makeTree . frequency