do you want to recursively dedupe or just one pass?
you can use partition
and mapcat
(def r (range 1 10))
(->> r (partition 2 2)
(mapcat (fn [[a b]] ;;apply haversine here
(if ( < a 5) [a b] [b]))))
but if [a b c d]
are all close , this will generate [a c]
or similar, not [a]