Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save flengyel/1446286 to your computer and use it in GitHub Desktop.
Save flengyel/1446286 to your computer and use it in GitHub Desktop.
;; flengyel's solution to Function Composition
;; https://4clojure.com/problem/58
;; comp is disallowed. The composition has function type
(fn comb [f & fs]
(fn [x & xs] (let [arglist (conj xs x)]
(if (nil? fs)
(apply f arglist)
(f (apply (apply comb fs) arglist))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment