    :var var
    :pattern pattern})
 
+(def match-any
+  {:type :match/any})
+
+(defn match-value [value]
+  {:type :match/value
+   :value value})
+
+(defn match-vector [& values]
+  {:type :match/vec
+   :value (into [] values)})
+
+(defn match-map [& keys&values]
+  {:type :match/map
+   :value (into {} (map vec (partition 2 keys&values)))})
+
 ;; examples
 
 (def example-a

        (throw (MatchFailure.))))))

(defn run-match-pattern [program pattern input actions vars]
  (cond
   (= (:type pattern) :match/bind) (do (aset vars (:var pattern) input)
                                    (run-match-pattern program (:pattern pattern) input actions vars))
   (:type pattern) (check (run-node program pattern [input] actions))
   (or (number? pattern) (string? pattern)) (check (= pattern input))
   (or (nil? pattern) (sequential? pattern)) (if-let [[first-pattern & rest-pattern] (seq pattern)]
                                             (do (check (and (sequential? input) (seq input)))
                                               (let [[first-input & rest-input] input]
                                                 (run-match-pattern program first-pattern first-input actions vars)
                                                 (run-match-pattern program rest-pattern rest-input actions vars)))
                                             (check (empty? input)))
   (map? pattern) (do (check (map? input))
                   (doseq [[key val] pattern]
                     (check (contains? input key))
                     (run-match-pattern program val (get input key) actions vars)))
   :otherwise (assert false)))

;; ast



(defn run-pipe [program node inputs actions]
  (prn node inputs)
  (assert (= :pipe (:type node)))
  (let [vars #js {}]
    (doseq [[id value] (map vector (:inputs node) inputs)]
      (aset vars id value))
