Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2013 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4436066 to your computer and use it in GitHub Desktop.
Save anonymous/4436066 to your computer and use it in GitHub Desktop.
Clojure version of flip function in Haskell
(defn flip
"Flips a functions argument list."
[f] (fn [& args] (apply f (reverse args))))
(def my-gt (flip >))
(> 10 9); => true
(my-gt 10 9); => false
(def my-after? (flip after?))
(after? (date-time 1986 10) (date-time 1986 9)); => true
(my-after? (date-time 1986 10) (date-time 1986 9)); => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment