Code doesn't compile correctly when using :optimizations :advanced.
Now using :optimizations :whitespace.

; original code
(defn ^:export apply-fun [fun-token arg]
  (let [f (t/payload fun-token)
        retval (f fun-token arg)]
    (if (string? retval)
      [(t/token :error (str retval " – " (:fun-name (meta f))))]
      retval)))

; :optimizations :whitespace
termcat.rules.bind.apply_fun = function apply_fun(fun_token, arg) {
  var f = termcat.term.payload.call(null, fun_token);
  var retval = f.call(null, fun_token, arg);
  if (typeof retval === "string") {
    return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [termcat.term.token.call(null, new cljs.core.Keyword(null, "error", "error", 1110689146), [cljs.core.str(retval), cljs.core.str(" \u2013 "), cljs.core.str((new cljs.core.Keyword(null, "fun-name", "fun-name", 2344786315)).cljs$core$IFn$_invoke$arity$1(cljs.core.meta.call(null, f)))].join(""))], null);
  } else {
    return retval;
  }
};
goog.exportSymbol("termcat.rules.bind.apply_fun", termcat.rules.bind.apply_fun);

; :optimizations :advanced
function Nl(a, b) {
  var c = Y(a), e = c.a ? c.a(a, b) : c.call(null, a, b);
  return "string" === typeof e ? new R(null, 1, 5, S, [Z.a(Wg, [r(e), r(" \u2013 "), r(Ii.b(Uc(c)))].join(""))], null) : e;
}
fa("termcat.rules.bind.apply_fun", Nl);

; Fix for :optimizations :advanced
function Nl(a, b) {
  var c = Y(a), e = c.call(null, a, b); ; !!!
  return "string" === typeof e ? new R(null, 1, 5, S, [Z.a(Wg, [r(e), r(" \u2013 "), r(Ii.b(Uc(c)))].join(""))], null) : e;
}
fa("termcat.rules.bind.apply_fun", Nl);