 (deftraced data->jsth [pattern] [pattern]
   (cond
    (or (number? pattern) (string? pattern)) pattern
+   (symbol? pattern) pattern ;; passed from inputs
    (keyword? pattern) `(new (cljs.core.Keyword ~(namespace pattern) ~(name pattern) ~(str (namespace pattern) (if (namespace pattern) "/" "") (name pattern)) ~(hash pattern)))
    (vector? pattern) `(cljs.core.PersistentVector.fromArray
                        ~(vec (map data->jsth pattern))

        failure `(return nil)]
    (js/Function (jsth/munge input-sym) (jsth/statement->string `(do ~success ~failure)))))

(comment
  (match :a :a :ok)


  (match {:a 0 :b [1 2]}
         {:c _} :bad
         ^z {:b [x y]} [x y z])

  ((constructor 1 []))

  ((constructor "foo" []))

  ((constructor 'a '[a]) :ok)

  ((constructor '[a a] '[a]) :ok)

  ((constructor '{:a a :b b} '[a b]) :A :B)
  )
