Bulat Ziganshin wrote:
Hello Andrew,

I see. So build a table of codes and bitmasks and test against that...

decodeSymbol = do
  n <- returnNextNBits MaxBits  -- this operation doesn't forward input pointer!
  symbol <- table1 ! n
  bits   <- table2 ! symbol
  skipNBits bits
  return symbol

I see.

While we're on the subject... am I the first person to notice that Haskell doesn't appear to have much support for fiddling with streams of bits?

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to