 
 
 (defn set-attributes
-      ([node attributes]
-        (assoc node :attributes attributes)))
+  ([node attributes]
+   (assoc node :attributes attributes)))
 
 (s/fdef set-attributes
         :args (s/cat :node ::node :attributes ::attributes)
         :ret ::node
         :fn #(= (-> % :ret :attributes)
-                 (-> % :args :attributes)))
+                (-> % :args :attributes)))
 
 
 
 (defn add-child
-      ([node child]
-        (assoc node :children
-          (cljset/union (:children node) #{child}))))
+  ([node child]
+   (assoc node :children (set (conj (:children node) child)))))
 
 (s/fdef add-child
         :args (s/cat :node ::node :child ::node)


(defn remove-child
  ([node child]
    (assoc node :children
           (cljset/union
             #{}
             (cljset/difference (:children node) #{child})))))

(s/fdef remove-child
        :args (s/cat :node ::node :child ::node)

(ns evermind.domain.core
  (:require [clojure.spec.alpha :as s]
            [clojure.spec.gen.alpha :as gen]
            [clojure.set :as cljset]))

(s/def ::node
  (s/keys :req-un []
