   (write-exemplar "set_mixed" "A ten element set with mixed values" (set vector-mixed))
   (write-exemplar "set_mixed" "Two sets nested inside an outter set"
     (set [(set vector-simple) (set vector-mixed)]))
-  
+
 
   (def map-simple {:a 1 :b 2 :c 3})
   (def map-mixed {:a 1 :b "a string" :c true})
   (def map-nested {:simple map-simple, :mixed map-mixed})
-  
+
   (write-exemplar "map_simple" "A simple map" map-simple)
   (write-exemplar "map_mixed" "A mixed map" map-mixed)
   (write-exemplar "map_nested" "A nested map" map-nested)

(ns exemplar
  (:require [transit.read :as r]
            [transit.write :as w]
            [clojure.java.io :as io]))

;; Generate a set of increasingly complex transit files.
;; Output checked into the transit repo under simple-examples.

(import [java.io File FileOutputStream ByteArrayInputStream ByteArrayOutputStream OutputStreamWriter])

(defn range-centered-on 
  ([n] (range-centered-on n 5))
  ([n m] (vec (range (- n m) (+ n m 1)))))
  
(defn vmap [f s]
  (vec (map f s)))


  (write-exemplar "one_keyword" "A single keyword" :hello)
  (write-exemplar "one_symbol" "A single symbol" 'hello)
  (write-exemplar "one_date" "A single date" (java.util.Date. 946728000000))

  (def vector-simple  [1 2 3])
  (def vector-mixed  [0 1 2.0 true false "five" :six 'seven "~eight" nil])
  (def vector-nested [vector-simple vector-mixed])

  (write-exemplar "vector_simple" "A simple vector" vector-simple)
  (write-exemplar "vector_empty" "An empty vector" [])
  (write-exemplar "vector_mixed" "A ten element vector with mixed values" vector-mixed)
  (write-exemplar "vector_nested" "Two vectors nested inside of an outter vector" vector-nested)

  (def small-strings  ["" "a" "ab" "abc" "abcd" "abcde" "abcdef"])

  (write-exemplar "small_strings" "A vector of small strings" small-strings)

  (write-exemplar "strings_tilde" "A vector of strings starting with ~" (vmap #(str "~" %) small-strings))

  (write-exemplar "strings_hash" "A vector of strings starting with #" (vmap #(str "#" %) small-strings))

  (write-exemplar "strings_hat" "A vector of strings starting with ^" (vmap #(str "^" %) small-strings))

  (write-exemplar "small_ints" "A vector of eleven small integers" (range-centered-on 0))

  (write-exemplar "ints", "vector of ints" (vec (range 128)))

  (def powers-two
       [1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
        32768 65536 131072 262144 524288 1048576 2097152 4194304
