clojure-hackos.utils.helpers
Assorted useful functions
ordered?
(ordered? coll)
(ordered? pred coll)
Returns the logical result of applying the given pred
function to the arithmetic difference between every pair of elements in coll
. When called without a predicate, returns true
if all elements are in ascending sequence (ignoring duplicates).
This function is meant to be wrapped, e.g.,
(defn descending? [c] (ordered? neg? c))
(descending? [2 -1 -6 -8 -10 -13 -17])
;; => true