         (let [reader (fn [str] (BufferedReader. (StringReader. str)))
               free   (with-out-str (pprint (lookup/lookup constr-lkp :free)))
               bound  (with-out-str (pprint (lookup/lookup constr-lkp :bound)))]
-          (failure (Exception. (str "no solution. Gave up after " i " steps"
-                                    "\nsatisfying\n"
-                                    (apply str (interpose "\n"
-                                                          (for [line (line-seq (reader free))] (str "  " line))))
-                                    "\nfrom\n"
-                                    (apply str (interpose "\n"
-                                                          (for [line (line-seq (reader bound))] (str "  " line))))))))))))
+          (exc/failure (Exception. (str "no solution. Gave up after " i " steps"
+                                        "\nsatisfying\n"
+                                        (apply str (interpose "\n"
+                                                              (for [line (line-seq (reader free))] (str "  " line))))
+                                        "\nfrom\n"
+                                        (apply str (interpose "\n"
+                                                              (for [line (line-seq (reader bound))] (str "  " line))))))))))))

              ;; continue matching
              (recur (concat (branch-constr constr-lkp first-open) rest-open) result))))))))

(defrecord SearchPlanCell [^Cost cost-calculator ^Weight weight-calculator ops constr-lkp free-count non-past-op-bindings])

(defrecord SearchPlanColumn [ordered-cells cells-by-free])


(ns sre.plan.compiler
  "Cost-based search plan compiler related functions, types etc."
  (:require [cats.core :as m]
            [cats.monad
             [exception :as exc]
             [maybe :as maybe]]
            [clojure
             [pprint :refer :all]
             [set :refer :all]]
