         cat-op))
 
 (defn- flatten-or
-  "Flattens an `or`, whenever possible."
+  "Flattens an `or` inside an `or`, whenever possible."
   [or-op]
   (assoc or-op
     :args (->> (:args or-op)

                          (get-in not-op [:args 0 :value]))})

(defn- flatten-cat
  "Flattens a `cat`, whenever possible."
  [cat-op]
  (assoc cat-op
    :args (->> (:args cat-op)

  "Reduces a `cat`, whenever possible."
  [cat-op]
  (cond (every? #(= :string (:type %)) (:args cat-op))
        ;; This is not general enough. (cat "f" "g" expr [x] "y") could be
        ;; reduced to (cat "fg" expr "xy")
        {:type :string, :value (apply str (map :value (:args cat-op)))}
        (= 1 (count (:args cat-op)))
        (first (:args cat-op))
