   ;; [y] is connected to [z]
   ;; + [x] is connected to [z]
 
-  ;; TODO use filter-map in here to get the right shape
   (->
    (->
     (->FlowState #js [(transient #{}) nil nil (transient {}) (transient {}) nil nil]


  )

;; EXPRS

(defn expr->fun [expr]
  (if (fn? expr)
    expr ;; only used for testing
    (assert false "No expr compiler yet")))

;; FLOWS

(defrecord Union [nodes])
(defrecord FilterMap [nodes expr])
(defrecord Index [nodes key-ixes])
(defrecord Lookup [nodes index-node key-ixes val-ixes])


  (:require-macros [aurora.macros :refer [console-time set!! conj!! disj!! assoc!! apush apush* avec]]
                   [aurora.language :refer [deffact]]))

;; TODO facts and plans need to be serializable

;; FACTS

(defn- hash-array [array]
  (if (> (alength array) 0)
