 (def t (make-huffman-tree m))
 
 (defn tests []
-  ;; TODO - Symetric testings with test.checks
   (prn (encode-with t [:a :b :c :d :e]))
   (prn (second (encode [:a :b :c :d :e])))
   (prn (decode t [0 0 0 0 0 1 0 1 1 0 1 1]))

(defn is-node? [node] (= (first node) ::node))

(defn leaf-val [node] {:pre (is-leaf? node)} (second node))
(defn lhs-node [node] {:pre (is-node? node)} (nth node 1))
(defn rhs-node [node] {:pre (is-node? node)} (nth node 2))
;; TODO
;; Better use of data abstraction: return children as "(rest node)"
;; It would allow to use the (nth children input) as decoding
;; !!! Make the distinction between the need for get/set and absence of std data structure


;; -----------------------------------------------------------

;; Decoding
;; -----------------------------------------------------------

(defn- huffman-xf
  "Transducer step function to decode a huffman stream of values"
  [huffman-tree] ;; TODO - Try to replace this by a prefix tree - or search in map?
