Created
January 2, 2013 16:57
-
-
Save anonymous/4436066 to your computer and use it in GitHub Desktop.
Clojure version of flip function in Haskell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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