clj-commons / clj-commons/ordered

Add ordered set operations?

Open
#70 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
267
Forks
40
Avg merge
14h 2m
Merged PRs (30d)
17

Description

Since, as noted in the `ordered-set` docstring, `clojure.set/union` and other operations in `clojure.set` may reorder elements for efficiency, perhaps it would be useful for `ordered` to include (less efficient?) set operations that preserve order. For example, I needed to preserve order with union, so I am using this definition (which might also be called "union"):
```clojure
(defn multi-conj
"Successively conj each element of ys onto xs."
[xs ys]
(reduce (fn [newxs y] (conj newxs y))
xs ys))
```
(I need it for two-element sets on the right, so efficiency shouldn't be an issue in my case.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.