every-bit-counts-0.1: A functional pearl on encoding and decoding using question-and-answer strategies

Huffman

type Set a = [a]Source

type PQ a = [(Int, a)]Source

addItem :: Int -> a -> PQ a -> PQ aSource

updPQ :: Eq a => PQ a -> a -> PQ aSource

huff :: Eq a => PQ (Set a, Game a) -> Game aSource

huffGame :: Eq a => PQ a -> Game aSource

charHuffGame :: Game CharSource

sHuffGame :: PQ Char -> Game [Char]Source

dHuffGame :: PQ Char -> Game [Char]Source

vecHuffGame :: Nat -> PQ Char -> Game [Char]Source

lengthHuffGame :: PQ Char -> Game (Nat, [Char])Source

prodPQ :: PQ a -> PQ b -> PQ (a, b)Source