(defn schedule-passes
[passes]
(let [passes (calculate-deps passes)]
(when (every? has-deps? (vals passes))
(throw (ex-info "Dependency cycle detected" passes)))
(when (next (filter :compiler (vals passes)))
(throw (ex-info "Only one compiler pass allowed" passes)))
(collapse (schedule* () passes))))