 	joins (derive-joins (rest new-indeces) lhs-fk-keys lhs join-fn)]
     [new-indeces (fn [_] (on-upserts joined-model joins))]))
 
+(defn- lhs-delete [old-indeces lhs-pk-key lhs-fk-keys lhs join-fn joined-model]
+  (let [new-indeces (lhs-dissoc old-indeces lhs-pk-key lhs-fk-keys lhs)
+	joins (derive-joins (rest new-indeces) lhs-fk-keys lhs join-fn)]
+    [new-indeces (fn [_] (on-deletes joined-model joins))]))
+
 ;;; TODO
-(defn- lhs-delete [old-indeces i ks v join-fn])
 (defn- lhs-upserts [old-indeces i ks vs join-fn])
 (defn- lhs-deletes [old-indeces i ks vs join-fn])
 

   View
   ;; singleton changes
   (on-upsert [_ upsertion] ((swap*! indeces lhs-upsert lhs-pk-key lhs-fk-keys upsertion join-fn joined-model) []) nil) ;TODO - pass in views to notifier
   (on-delete [_ deletion]  (swap! indeces lhs-delete lhs-fk-keys deletion join-fn) nil)
   ;; batch changes
   (on-upserts [_ upsertions] (swap! indeces lhs-upserts lhs-fk-keys upsertions join-fn) nil)
   (on-deletes [_ deletions]  (swap! indeces lhs-deletes lhs-fk-keys deletions join-fn) nil)))

      (first indeces)
      lhs-fk-keys))))

(defn- dissoc-in [seq [k1 k2] _]
  (assoc seq k1 (dissoc (seq k1) k2)))

(defn- lhs-dissoc [indeces lhs-pk-key lhs-fk-keys lhs]
  "associate a new lhs with existing index"
  (assoc
   indeces
   0
   (let [lhs-pk (lhs-pk-key lhs)]
     (mapv
      (fn [lhs-index lhs-fk-key] (dissoc-in lhs-index [(lhs-fk-key lhs) lhs-pk] lhs))
      (first indeces)
      lhs-fk-keys))))

(deftest test-lhs-access
  (let [before [[{}]]
	after  [[{String {3 "xxx"}}]]]
    (is (= after (lhs-assoc before count [type] "xxx")))
    (is (= '("xxx") (lhses-get (first after) 0 String)))
    (is (= [[{String {}}]] (lhs-dissoc after count [type] "xxx")))
    ))

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