 (ns mediakeys.hotkeys
     (:use [mediakeys.file :only [DEFAULT_KEYS save-keys!]]
-           clojure.core.async))
+          [clojure.core.async :only [chan go-loop <! pipe put!]]))
 
 (import [com.tulskiy.keymaster.common Provider HotKeyListener])
 (import [javax.swing KeyStroke])

        (go-loop []
            (let [value (<! channel)]
                (when not-nil? value
                    (go-loop [unflattened (f value)]
                        (let [inner-value (<! unflattened)]
                            (when (not-nil? inner-value)
                                (>! return inner-value)
                                (recur unflattened))))
                    (recur))))
        return))

(def new-provider!
    (let [provider (atom nil)]
        (fn yosup [ ]
            (when @provider
                (doto @provider
                    (.reset)

            @provider)))

(def new-keys!
    (let [keys (atom DEFAULT_KEYS)]
        (fn ([] @keys)
            ([key-update]
                (swap! keys #(merge % key-update))))))

(defn register-keys [^Provider provider keys]
    (let [return (chan)]
