               (recur (rest map-seq) (+ i 2))))))
       (write-list writer map-list))))
 
-(defn seq-write-handler [writer name cljs-seq]
-  "Writes out a purely sequential ClojureScript type
-
-  writer (FressianWriter) - Fressian Writer for the record
-  cljs-seq (ISeq) - ClojureScript sequence to be written"
-  (do
-    (write-tag writer name 1)
-    (write-list writer cljs-seq)))
+(def list-write-handler
+  {"list"
+   (fn [writer cljs-seq]
+     (do
+      (write-tag writer "list" 1)
+      (write-list writer cljs-seq)))})
+
+(def vector-write-handler
+  {"vector"
+   (fn [writer cljs-seq]
+     (do
+      (write-tag writer "vector" 1)
+      (write-list writer cljs-seq)))})
+
+(def set-write-handler
+  {"set"
+   (fn [writer cljs-seq]
+     (do
+      (write-tag writer "set" 1)
+      (write-list writer cljs-seq)))})
 ;;ClojureScript base writers
 (def clojure-write-handlers
   {Keyword

        (write-object writer (namespace k) true)
        (write-object writer (name k) true)))}

   PersistentHashMap
   {"map" map-write-handler}

   PersistentArrayMap
   {"map" map-write-handler}

   PersistentHashSet
   {"set"
    (fn [writer s]
      (seq-write-handler writer "set" s))}

   PersistentVector
   {"vector"
    (fn [writer v]
      (seq-write-handler writer "vector" v))}})

(defn create-writer [& {:keys [handlers]}]
  "Creates a fressian writer

   "set"
   (fn [reader tag component-count]
     (cljs.core/PersistentHashSet.fromArray (read-object reader)))
   "list"
   (fn [reader tag component-count]
     (into '() (reverse (read-object reader))))
   "vector"
   (fn [reader tag component-count]
     (cljs.core/PersistentVector.fromArray (read-object reader)))})
