     (= 1 (first bits)) (recur rhs (rest bits))
     ))
 
-(defn ^:private decode-bits
+(defn decode
+  "Encode a stream of values with the huffman tree provided as first parameter"
   [huffman-tree inputs]
   (loop [bits inputs
          result []]

  (get-bits-impl huffman-tree []))

(defn tree->encoder
  "Build a decoder with memoization"
  [huffman-tree]
  (memoize #(get-bits huffman-tree %)))


  ;; TODO - Symetric testings with test.checks
  (prn (encode-with (tree->encoder t) [:a :b]))
  (prn (encode [:a :b]))
  (prn (decode t [0 1 0 0 1 1]))
  )


