Created
November 17, 2017 13:33
-
-
Save titonbarua/79ba4fe3f8e556cfdf4111c8d6b2b901 to your computer and use it in GitHub Desktop.
Cascaded map+filter operations to transform a sequence of data in clojure
This file contains 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
(filter | |
;; The filtering function. | |
(fn [x] (<= 0 x 100)) | |
;; The sequence to be filtered. | |
(map | |
;; The mapping function. | |
(fn [x] (* x 3)) | |
;; The sequence to be mapped. | |
(filter | |
;; The filtering function. | |
odd? | |
;; The sequence to be filtered. | |
(range -100 100)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment