 (ns workflo.macros.screen.bidi
   (:require [bidi.bidi :as bidi]
+            [bidi.router :as br]
             [workflo.macros.screen :as scr]))
 
 (defn route

   parameterizable URL segments (e.g. :user-id) to their values
   in the URL."
  [url]
  (when-let [result (bidi/match-route (routes) url)]
    {:params (:route-params result)
     :screen (scr/resolve-screen (-> result :handler name symbol))}))

(defn path
  "Returns a URL path for the given screen and the given URL

  []
  ["/" (mapv route (scr/registered-screens))])

(defn match-location
  [location]
  {:screen (scr/resolve-screen (-> location :handler name symbol))
   :params (:route-params location)})

(defn match
  "Matches a URL against all screen routes. Returns a
   {:params <route params> :screen <screen>} map, where :screen
