 
   )
 
-;; 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 FilterMap [nodes fun])
 (defrecord Index [nodes key-ixes])
 (defrecord Lookup [nodes index-node key-ixes val-ixes])
 

  ;; [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]

        (aset node->update! node
              (condp = (type flow)
                Union (union-update!)
                FilterMap (filter-map-update! (:fun flow))
                Index (index-update! (:key-ixes flow))
                Lookup (lookup-update! (:index-node flow) (:key-ixes flow) (:val-ixes flow))))))
    (FlowState. node->state node->out-nodes node->facts node->update!)))
