Liking cljdoc? Tell your friends :D

hara.data


assoc-in-newclj

(assoc-in-new m ks v)

only assoc-in if the value in the original map is nil

(assoc-in-new {} [:a :b] 2) => {:a {:b 2}}

(assoc-in-new {:a {:b 1}} [:a :b] 2) => {:a {:b 1}}

only assoc-in if the value in the original map is nil

(assoc-in-new {} [:a :b] 2)
=> {:a {:b 2}}

(assoc-in-new {:a {:b 1}} [:a :b] 2)
=> {:a {:b 1}}
raw docstring

assoc-in-nnilclj

(assoc-in-nnil m arr v)

assoc-in a nested key/value pair to a map only on non-nil values

(assoc-in-nnil {} [:a :b] 1) => {:a {:b 1}}

(assoc-in-nnil {} [:a :b] nil) => {}

assoc-in a nested key/value pair to a map only on non-nil values

(assoc-in-nnil {} [:a :b] 1)
=> {:a {:b 1}}

(assoc-in-nnil {} [:a :b] nil)
=> {}
raw docstring

assoc-newclj

(assoc-new m k v)
(assoc-new m k v & more)

only assoc if the value in the original map is nil

(assoc-new {:a 1} :b 2) => {:a 1 :b 2}

(assoc-new {:a 1} :a 2 :b 2) => {:a 1 :b 2}

only assoc if the value in the original map is nil

(assoc-new {:a 1} :b 2)
=> {:a 1 :b 2}

(assoc-new {:a 1} :a 2 :b 2)
=> {:a 1 :b 2}
raw docstring

assoc-nnilclj

(assoc-nnil m k v)
(assoc-nnil m k v & more)

assoc key/value pairs to the map only on non-nil values

(assoc-nnil {} :a 1) => {:a 1}

(assoc-nnil {} :a 1 :b nil) => {:a 1}

assoc key/value pairs to the map only on non-nil values

(assoc-nnil {} :a 1)
=> {:a 1}

(assoc-nnil {} :a 1 :b nil)
=> {:a 1}
raw docstring

assocsclj

(assocs m k v)
(assocs m k v sel func)

Similar to assoc but conditions of association is specified through sel (default: identity) and well as merging specified through func (default: combine). (assocs {:a #{1}} :a #{2 3 4}) => {:a #{1 2 3 4}}

(assocs {:a {:id 1}} :a {:id 1 :val 1} :id merge) => {:a {:val 1, :id 1}}

(assocs {:a #{{:id 1 :val 2} {:id 1 :val 3}}} :a {:id 1 :val 4} :id merges) => {:a #{{:id 1 :val #{2 3 4}}}}

Similar to `assoc` but conditions of association is specified
through `sel` (default: `identity`) and well as merging specified
through `func` (default: `combine`).
(assocs {:a #{1}} :a #{2 3 4})
=> {:a #{1 2 3 4}}

(assocs {:a {:id 1}} :a {:id 1 :val 1} :id merge)
=> {:a {:val 1, :id 1}}

(assocs {:a #{{:id 1 :val 2}
              {:id 1 :val 3}}} :a {:id 1 :val 4} :id merges)
=> {:a #{{:id 1 :val #{2 3 4}}}}
raw docstring

changedclj

(changed new old)

Outputs what has changed between the two maps

(changed {:a {:b {:c 3 :d 4}}} {:a {:b {:c 3}}}) => {:a {:b {:d 4}}}

Outputs what has changed between the two maps

(changed {:a {:b {:c 3 :d 4}}}
         {:a {:b {:c 3}}})
=> {:a {:b {:d 4}}}
raw docstring

clean-nestedclj

(clean-nested m)

Returns a associative with nils and empty hash-maps removed.

(clean-nested {:a {:b {:c {}}}}) => {}

(clean-nested {:a {:b {:c {} :d 1 :e nil}}}) => {:a {:b {:d 1}}}

Returns a associative with nils and empty hash-maps removed.

(clean-nested {:a {:b {:c {}}}})
=> {}

(clean-nested {:a {:b {:c {} :d 1 :e nil}}})
=> {:a {:b {:d 1}}}
raw docstring

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

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

diffclj

(diff m1 m2)
(diff m1 m2 reversible)

Finds the difference between two maps

(diff {:a 2} {:a 1}) => {:+ {} :- {} :> {[:a] 2}}

(diff {:a {:b 1 :d 3}} {:a {:c 2 :d 4}} true) => {:+ {[:a :b] 1} :- {[:a :c] 2} :> {[:a :d] 3} :< {[:a :d] 4}}

Finds the difference between two maps

(diff {:a 2} {:a 1})
=> {:+ {} :- {} :> {[:a] 2}}

(diff {:a {:b 1 :d 3}} {:a {:c 2 :d 4}} true)
=> {:+ {[:a :b] 1}
    :- {[:a :c] 2}
    :> {[:a :d] 3}
    :< {[:a :d] 4}}
raw docstring

dissoc-inclj

(dissoc-in m [k & ks])
(dissoc-in m [k & ks] keep)

disassociates keys from a nested map. Setting keep to true will not remove a empty map after dissoc

(dissoc-in {:a {:b 10 :c 20}} [:a :b]) => {:a {:c 20}}

(dissoc-in {:a {:b 10}} [:a :b]) => {}

(dissoc-in {:a {:b 10}} [:a :b] true) => {:a {}}

disassociates keys from a nested map. Setting `keep` to `true` will
not remove a empty map after dissoc

(dissoc-in {:a {:b 10 :c 20}} [:a :b])
=> {:a {:c 20}}

(dissoc-in {:a {:b 10}} [:a :b])
=> {}

(dissoc-in {:a {:b 10}} [:a :b] true)
=> {:a {}}
raw docstring

dissoc-nestedclj

(dissoc-nested m ks)

Returns m without all nested keys in ks.

(dissoc-nested {:a {:b 1 :c {:b 1}}} [:b]) => {:a {:c {}}}

Returns `m` without all nested keys in `ks`.

(dissoc-nested {:a {:b 1 :c {:b 1}}} [:b])
=> {:a {:c {}}}
raw docstring

dissocsclj

(dissocs m k)

Similar to dissoc but allows dissassociation of sets of values from a map.

(dissocs {:a 1} :a) => {}

(dissocs {:a #{1 2}} [:a #{0 1}]) => {:a #{2}}

(dissocs {:a #{1 2}} [:a #{1 2}]) => {}

Similar to `dissoc` but allows dissassociation of sets of values from a map.

(dissocs {:a 1} :a)
=> {}

(dissocs {:a #{1 2}} [:a #{0 1}])
=> {:a #{2}}

(dissocs {:a #{1 2}} [:a #{1 2}])
=> {}
raw docstring

dissocs-inclj

(dissocs-in m [k & ks :as all-ks])

Similiar to dissoc-in but can move through sets.

(dissocs-in {:a #{{:b 1 :c 1} {:b 2 :c 2}}} [:a :b]) => {:a #{{:c 1} {:c 2}}}

(dissocs-in {:a #{{:b #{1 2 3} :c 1} {:b #{1 2 3} :c 2}}} [[:a [:c 1]] [:b 1]]) => {:a #{{:b #{2 3} :c 1} {:b #{1 2 3} :c 2}}}

Similiar to `dissoc-in` but can move through sets.

(dissocs-in {:a #{{:b 1 :c 1} {:b 2 :c 2}}}
            [:a :b])
=> {:a #{{:c 1} {:c 2}}}

(dissocs-in {:a #{{:b #{1 2 3} :c 1}
                  {:b #{1 2 3} :c 2}}}
            [[:a [:c 1]] [:b 1]])
=> {:a #{{:b #{2 3} :c 1} {:b #{1 2 3} :c 2}}}
raw docstring

element-ofclj

(element-of pred coll)

finds the element within an array

(element-of keyword? [1 2 :hello 4]) => :hello

finds the element within an array

(element-of keyword? [1 2 :hello 4])
=> :hello
raw docstring

filter-keysclj

(filter-keys pred m)

filters map based upon map keys

(filter-keys even? {0 :a 1 :b 2 :c}) => {0 :a, 2 :c}

filters map based upon map keys

(filter-keys even? {0 :a 1 :b 2 :c})
=> {0 :a, 2 :c}
raw docstring

filter-valsclj

(filter-vals pred m)

filters map based upon map values

(filter-vals even? {:a 1 :b 2 :c 3}) => {:b 2}

filters map based upon map values

(filter-vals even? {:a 1 :b 2 :c 3})
=> {:b 2}
raw docstring

flatten-allclj

(flatten-all x)

flattens all elements the collection

(flatten-all [1 2 #{3 {4 5}}]) => [1 2 3 4 5]

flattens all elements the collection

(flatten-all [1 2 #{3 {4 5}}])
=> [1 2 3 4 5]
raw docstring

getsclj

(gets m k)

Returns the associated values either specified by a key or a key and predicate pair.

(gets {:a 1} :a) => 1

(gets {:a #{0 1}} [:a zero?]) => #{0}

(gets {:a #{{:b 1} {}}} [:a :b]) => #{{:b 1}}

Returns the associated values either specified by a key or a key and predicate pair.

(gets {:a 1} :a) => 1

(gets {:a #{0 1}} [:a zero?]) => #{0}

(gets {:a #{{:b 1} {}}} [:a :b]) => #{{:b 1}}
raw docstring

gets-inclj

(gets-in m ks)

Similar in style to get-in with operations on sets. returns a set of values.

(gets-in {:a 1} [:a]) => #{1}

(gets-in {:a 1} [:b]) => #{}

(gets-in {:a #{{:b 1} {:b 2}}} [:a :b]) => #{1 2}

Similar in style to `get-in` with operations on sets. returns a set of values.

(gets-in {:a 1} [:a]) => #{1}

(gets-in {:a 1} [:b]) => #{}

(gets-in {:a #{{:b 1} {:b 2}}} [:a :b]) => #{1 2}
raw docstring

index-ofclj

(index-of pred coll)

finds the index of the first matching element in an array

(index-of even? [1 2 3 4]) => 1

(index-of keyword? [1 2 :hello 4]) => 2

finds the index of the first matching element in an array

(index-of even? [1 2 3 4]) => 1

(index-of keyword? [1 2 :hello 4]) => 2
raw docstring

into-nnilclj

(into-nnil to from)

like into but filters nil values for both key/value pairs and sequences

(into-nnil [] [1 nil 2 3]) => [1 2 3]

(into-nnil {:a 1} {:b nil :c 2}) => {:a 1 :c 2}

like into but filters nil values for both key/value pairs
and sequences

(into-nnil [] [1 nil 2 3])
=> [1 2 3]

(into-nnil {:a 1} {:b nil :c 2})
=> {:a 1 :c 2}
raw docstring

key-pathsclj

(key-paths m)
(key-paths m max)
(key-paths m max arr)

The set of all paths in a map, governed by a max level of nesting

(key-paths {:a {:b 1} :c {:d 1}}) => (contains [[:c :d] [:a :b]] :in-any-order)

(key-paths {:a {:b 1} :c {:d 1}} 1) => (contains [[:c] [:a]] :in-any-order)

The set of all paths in a map, governed by a max level of nesting

(key-paths {:a {:b 1} :c {:d 1}})
=> (contains [[:c :d] [:a :b]] :in-any-order)

(key-paths {:a {:b 1} :c {:d 1}} 1)
=> (contains [[:c] [:a]] :in-any-order)
raw docstring

keys-nestedclj

(keys-nested m)

The set of all nested keys in a map

(keys-nested {:a {:b 1 :c {:d 1}}}) => #{:a :b :c :d}

The set of all nested keys in a map

(keys-nested {:a {:b 1 :c {:d 1}}})
=> #{:a :b :c :d}
raw docstring

map-entriesclj

(map-entries f m)

manipulates a map given the function

(map-entries (fn [[k v]] [(keyword (str v)) (name k)]) {:a 1 :b 2 :c 3}) => {:1 "a", :2 "b", :3 "c"}

manipulates a map given the function

(map-entries (fn [[k v]]
               [(keyword (str v)) (name k)])
             {:a 1 :b 2 :c 3})
=> {:1 "a", :2 "b", :3 "c"}
raw docstring

map-keysclj

(map-keys f m)

changes the keys of a map

(map-keys inc {0 :a 1 :b 2 :c}) => {1 :a, 2 :b, 3 :c}

changes the keys of a map

(map-keys inc {0 :a 1 :b 2 :c})
=> {1 :a, 2 :b, 3 :c}
raw docstring

map-valsclj

(map-vals f m)

changes the values of a map

(map-vals inc {:a 1 :b 2 :c 3}) => {:a 2, :b 3, :c 4}

changes the values of a map

(map-vals inc {:a 1 :b 2 :c 3})
=> {:a 2, :b 3, :c 4}
raw docstring

merge-nestedclj

(merge-nested)
(merge-nested m)
(merge-nested m1 m2)
(merge-nested m1 m2 & ms)

Merges nested values from left to right.

(merge-nested {:a {:b {:c 3}}} {:a {:b 3}}) => {:a {:b 3}}

(merge-nested {:a {:b {:c 1 :d 2}}} {:a {:b {:c 3}}}) => {:a {:b {:c 3 :d 2}}}

Merges nested values from left to right.

(merge-nested {:a {:b {:c 3}}} {:a {:b 3}})
=> {:a {:b 3}}

(merge-nested {:a {:b {:c 1 :d 2}}}
              {:a {:b {:c 3}}})
=> {:a {:b {:c 3 :d 2}}}
raw docstring

merge-newclj

(merge-new)
(merge-new m)
(merge-new m1 m2)
(merge-new m1 m2 & more)

only merge if the value in the original map is nil

(merge-new {:a 1} {:b 2}) => {:a 1 :b 2}

(merge-new {:a 1} {:a 2}) => {:a 1}

only merge if the value in the original map is nil

(merge-new {:a 1} {:b 2})
=> {:a 1 :b 2}

(merge-new {:a 1} {:a 2})
=> {:a 1}
raw docstring

merge-new-nestedclj

(merge-new-nested)
(merge-new-nested m)
(merge-new-nested m1 m2)
(merge-new-nested m1 m2 & more)

Merges nested values from left to right, provided the merged value does not exist

(merge-new-nested {:a {:b 2}} {:a {:c 2}}) => {:a {:b 2 :c 2}}

(merge-new-nested {:b {:c :old}} {:b {:c :new}}) => {:b {:c :old}}

Merges nested values from left to right, provided the merged value does not exist

(merge-new-nested {:a {:b 2}} {:a {:c 2}})
=> {:a {:b 2 :c 2}}

(merge-new-nested {:b {:c :old}} {:b {:c :new}})
=> {:b {:c :old}}
raw docstring

merge-nnilclj

(merge-nnil)
(merge-nnil m)
(merge-nnil m1 m2)
(merge-nnil m1 m2 & more)

merges key/value pairs into a single map only if the value exists

(merge-nnil {:a nil :b 1}) => {:b 1}

(merge-nnil {:a 1} {:b nil :c 2}) => {:a 1 :c 2}

(merge-nnil {:a 1} {:b nil} {:c 2}) => {:a 1 :c 2}

merges key/value pairs into a single map only if the value exists

(merge-nnil {:a nil :b 1})
=> {:b 1}

(merge-nnil {:a 1} {:b nil :c 2})
=> {:a 1 :c 2}

(merge-nnil {:a 1} {:b nil} {:c 2})
=> {:a 1 :c 2}
raw docstring

mergesclj

(merges m1 m2)
(merges m1 m2 sel)
(merges m1 m2 sel func)

Like merge but works across sets and will also combine duplicate key/value pairs together into sets of values.

(merges {:a 1} {:a 2}) => {:a #{1 2}}

(merges {:a #{{:id 1 :val 1}}} {:a {:id 1 :val 2}} :id merges) => {:a #{{:id 1 :val #{1 2}}}}

Like `merge` but works across sets and will also
 combine duplicate key/value pairs together into sets of values.

(merges {:a 1} {:a 2})
=> {:a #{1 2}}

(merges {:a #{{:id 1 :val 1}}}
        {:a {:id 1 :val 2}}
        :id merges)
=> {:a #{{:id 1 :val #{1 2}}}}
raw docstring

merges-nestedclj

(merges-nested)
(merges-nested m)
(merges-nested m1 m2)
(merges-nested m1 m2 sel)
(merges-nested m1 m2 sel func)

Like merges but works on nested maps

(merges-nested {:a {:b 1}} {:a {:b 2}}) => {:a {:b #{1 2}}}

(merges-nested {:a #{{:foo #{{:bar #{{:baz 1}}}}}}} {:a #{{:foo #{{:bar #{{:baz 2}}}}}}} hash-map? merges-nested) => {:a #{{:foo #{{:bar #{{:baz 2}}} {:bar #{{:baz 1}}}}}}}

Like `merges` but works on nested maps

(merges-nested {:a {:b 1}} {:a {:b 2}})
=> {:a {:b #{1 2}}}

(merges-nested {:a #{{:foo #{{:bar #{{:baz 1}}}}}}}
               {:a #{{:foo #{{:bar #{{:baz 2}}}}}}}
               hash-map?
               merges-nested)
=> {:a #{{:foo #{{:bar #{{:baz 2}}}
                 {:bar #{{:baz 1}}}}}}}
raw docstring

patchclj

(patch m diff)

Use the diff to convert one map to another in the forward direction based upon changes between the two.

(let [m1 {:a {:b 1 :d 3}} m2 {:a {:c 2 :d 4}} df (diff m2 m1)] (patch m1 df)) => {:a {:c 2 :d 4}}

Use the diff to convert one map to another in the forward
direction based upon changes between the two.

(let [m1  {:a {:b 1 :d 3}}
      m2  {:a {:c 2 :d 4}}
      df  (diff m2 m1)]
  (patch m1 df))
=> {:a {:c 2 :d 4}}
raw docstring

positionsclj

(positions pred coll)

find positions of elements matching the predicate

(positions even? [5 5 4 4 3 3 2 2]) => [2 3 6 7]

find positions of elements matching the predicate

(positions even? [5 5 4 4 3 3 2 2])
=> [2 3 6 7]
raw docstring

remove-indexclj

(remove-index coll i)
(remove-index coll i n)

removes element at the specified index

(remove-index [:a :b :c :d] 2) => [:a :b :d]

removes element at the specified index

(remove-index [:a :b :c :d] 2)
=> [:a :b :d]
raw docstring

retract-inclj

(retract-in m rels)

reversed the changes by transform-in

(retract-in {:b 2, :c {:d 1}} {[:c :d] [:a]}) => {:a 1 :b 2}

reversed the changes by transform-in

(retract-in {:b 2, :c {:d 1}}
            {[:c :d] [:a]})
=> {:a 1 :b 2}
raw docstring

select-keys-nnilclj

(select-keys-nnil m ks)

selects only the non-nil key/value pairs from a map

(select-keys-nnil {:a 1 :b nil} [:a :b]) => {:a 1}

(select-keys-nnil {:a 1 :b nil :c 2} [:a :b :c]) => {:a 1 :c 2}

selects only the non-nil key/value pairs from a map

(select-keys-nnil {:a 1 :b nil} [:a :b])
=> {:a 1}

(select-keys-nnil {:a 1 :b nil :c 2} [:a :b :c])
=> {:a 1 :c 2}
raw docstring

transform-inclj

(transform-in m rels)

moves values around in a map according to a table

(transform-in {:a 1 :b 2} {[:c :d] [:a]}) => {:b 2, :c {:d 1}}

moves values around in a map according to a table

(transform-in {:a 1 :b 2}
              {[:c :d] [:a]})
=> {:b 2, :c {:d 1}}
raw docstring

transposeclj

(transpose m)

sets the vals and keys and vice-versa

(transpose {:a 1 :b 2 :c 3}) => {1 :a, 2 :b, 3 :c}

sets the vals and keys and vice-versa

(transpose {:a 1 :b 2 :c 3})
=> {1 :a, 2 :b, 3 :c}
raw docstring

uniqueclj

(unique m1 m2)

returns a map of all key/value pairs that differ from a second map

(unique {:a 1} {:a 2}) => {:a 1}

(unique {:a 1 :b 2} {:b 2}) => {:a 1}

(unique {:b 2} {:b 2 :a 1}) => nil

returns a map of all key/value pairs that differ from a second map

(unique {:a 1} {:a 2})
=> {:a 1}

(unique {:a 1 :b 2} {:b 2})
=> {:a 1}

(unique {:b 2} {:b 2 :a 1})
=> nil
raw docstring

unique-nestedclj

(unique-nested m1 m2)

All nested values in m1 that are unique to those in m2.

(unique-nested {:a {:b 1}} {:a {:b 1 :c 1}}) => {}

(unique-nested {:a {:b 1 :c 1}} {:a {:b 1}}) => {:a {:c 1}}

All nested values in `m1` that are unique to those in `m2`.

(unique-nested {:a {:b 1}}
               {:a {:b 1 :c 1}})
=> {}

(unique-nested {:a {:b 1 :c 1}}
               {:a {:b 1}})
=> {:a {:c 1}}
raw docstring

unpatchclj

(unpatch m diff)

Use the diff to convert one map to another in the reverse direction based upon changes between the two.

(let [m1 {:a {:b 1 :d 3}} m2 {:a {:c 2 :d 4}} df (diff m2 m1 true)] (unpatch m2 df)) => {:a {:b 1 :d 3}}

Use the diff to convert one map to another in the reverse
direction based upon changes between the two.

(let [m1  {:a {:b 1 :d 3}}
      m2  {:a {:c 2 :d 4}}
      df  (diff m2 m1 true)]
  (unpatch m2 df))
=> {:a {:b 1 :d 3}}
raw docstring

update-in-nnilclj

(update-in-nnil m arr f & args)

update-in a nested key/value pair only if the value exists

(update-in-nnil {:a {:b 1}} [:a :b] inc) => {:a {:b 2}}

(update-in-nnil {} [:a :b] inc) => {}

update-in a nested key/value pair only if the value exists

(update-in-nnil {:a {:b 1}} [:a :b] inc)
=> {:a {:b 2}}

(update-in-nnil {} [:a :b] inc)
=> {}
raw docstring

update-keys-inclj

(update-keys-in m arr f & args)

updates all keys in a map with given function

(update-keys-in {:x {["a" "b"] 1 ["c" "d"] 2}} [:x] string/joinl) => {:x {"ab" 1 "cd" 2}}

(update-keys-in {:a {:c 1} :b {:d 2}} 2 name) => {:b {"d" 2}, :a {"c" 1}}

updates all keys in a map with given function

(update-keys-in {:x {["a" "b"] 1 ["c" "d"] 2}} [:x] string/joinl)
=> {:x {"ab" 1 "cd" 2}}

(update-keys-in {:a {:c 1} :b {:d 2}} 2 name)
=> {:b {"d" 2}, :a {"c" 1}}
raw docstring

update-vals-inclj

(update-vals-in m arr f & args)

updates all values in a map with given function

(update-vals-in {:a 1 :b 2} [] inc) => {:a 2 :b 3}

(update-vals-in {:a {:c 1} :b 2} [:a] inc) => {:a {:c 2} :b 2}

(update-vals-in {:a {:c 1} :b {:d 2}} 2 inc) => {:a {:c 2} :b {:d 3}}

(update-vals-in {:a 1 :b 2} 1 inc) => {:a 2, :b 3}

updates all values in a map with given function

(update-vals-in {:a 1 :b 2} [] inc)
=> {:a 2 :b 3}

(update-vals-in {:a {:c 1} :b 2} [:a] inc)
=> {:a {:c 2} :b 2}

(update-vals-in {:a {:c 1} :b {:d 2}} 2 inc)
=> {:a {:c 2} :b {:d 3}}

(update-vals-in {:a 1 :b 2} 1 inc)
=> {:a 2, :b 3}
raw docstring

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

× close