Liking cljdoc? Tell your friends :D

hara.data.base.combine


combineclj

(combine)
(combine m)
(combine v1 v2)
(combine v1 v2 sel func)

takes v1 and v2, which can be either values or sets of values and merges them into a new set.

(combine 1 2) => #{1 2}

(combine #{1} 1) => #{1}

(combine #{{:id 1} {:id 2}} #{{:id 1 :val 1} {:id 2 :val 2}} :id merge) => #{{:id 1 :val 1} {:id 2 :val 2}}

takes `v1` and `v2`, which can be either
values or sets of values and merges them into a new set.

(combine 1 2) => #{1 2}

(combine #{1} 1) => #{1}

(combine #{{:id 1} {:id 2}}
         #{{:id 1 :val 1} {:id 2 :val 2}}
         :id merge)
=> #{{:id 1 :val 1} {:id 2 :val 2}}
raw docstring

combine-internalclj

(combine-internal set sel rd)

Combines all elements in a single using sel and func

(combine-internal #{{:id 1} {:id 2} {:id 1 :val 1} {:id 2 :val 2}} :id merge) => #{{:id 1 :val 1} {:id 2 :val 2}}

Combines all elements in a single using sel and func

(combine-internal #{{:id 1} {:id 2} {:id 1 :val 1} {:id 2 :val 2}}
                  :id merge)
=> #{{:id 1 :val 1} {:id 2 :val 2}}
raw docstring

combine-selectclj

(combine-select set val sel)

selects an element out of the set that matches sel when it is applied

(combine-select #{1 2 3} 2 identity) => 2

(combine-select #{{:id 1 :val 2} {:id 2 :val 2}} {:id 1 :val 1} :id) => {:id 1 :val 2}

selects an element out of the set that matches sel when it is applied

(combine-select #{1 2 3} 2 identity)
=> 2

(combine-select #{{:id 1 :val 2} {:id 2 :val 2}} {:id 1 :val 1} :id)
=> {:id 1 :val 2}
raw docstring

combine-setclj

(combine-set s1 s2 sel func)

Returns the combined set of s1 and s2 using sel for item comparison and func as the combine function

(combine-set #{{:id 1 :val 0} {:id 2 :a 0}} #{{:id 1 :val 1} {:id 2 :val 2}} :id merge) => #{{:id 1 :val 1} {:id 2 :val 2 :a 0}}

Returns the combined set of `s1` and `s2` using sel for item
comparison and func as the combine function

(combine-set #{{:id 1 :val 0} {:id 2 :a 0}}
             #{{:id 1 :val 1} {:id 2 :val 2}}
             :id merge)
=> #{{:id 1 :val 1} {:id 2 :val 2 :a 0}}
raw docstring

combine-valueclj

(combine-value set val sel func)

returns a single set, sel is used for item comparison while func is used as the combine function

(combine-value #{{:id 1 :a 1} {:id 2 :a 2}} {:id 3 :b 3} :id merge) => #{{:id 1, :a 1} {:id 2, :a 2} {:id 3, :b 3}}

(combine-value #{{:id 1 :a 1} {:id 2 :a 2}} {:id 1 :b 3} :id merge) => #{{:id 1 :a 1 :b 3} {:id 2 :a 2}}

returns a single set, sel is used for item comparison while func
is used as the combine function

(combine-value #{{:id 1 :a 1} {:id 2 :a 2}}
               {:id 3 :b 3}
               :id merge)
=> #{{:id 1, :a 1} {:id 2, :a 2} {:id 3, :b 3}}

(combine-value #{{:id 1 :a 1} {:id 2 :a 2}}
               {:id 1 :b 3}
               :id merge)
=> #{{:id 1 :a 1 :b 3} {:id 2 :a 2}}
raw docstring

decombineclj

(decombine v dv)

takes set or value v and returns a set with elements matching sel removed

(decombine 1 1) => nil

(decombine 1 2) => 1

(decombine #{1} 1) => nil

(decombine #{1 2 3 4} #{1 2}) => #{3 4}

(decombine #{1 2 3 4} even?) => #{1 3}

takes set or value `v` and returns a set with
elements matching sel removed

(decombine 1 1) => nil

(decombine 1 2) => 1

(decombine #{1} 1) => nil

(decombine #{1 2 3 4} #{1 2}) => #{3 4}

(decombine #{1 2 3 4} even?) => #{1 3}
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close