-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio.randomseed.utils.map.html
More file actions
55 lines (55 loc) · 45.5 KB
/
io.randomseed.utils.map.html
File metadata and controls
55 lines (55 loc) · 45.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.map documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Random:utils</span> <span class="project-version">2.0.11</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-5"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-6 branch"><a href="io.randomseed.utils.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-6 branch"><a href="io.randomseed.utils.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-6 branch"><a href="io.randomseed.utils.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-6"><a href="io.randomseed.utils.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.auth.locking.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>locking</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.auth.pwd.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.auth.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree" style="top: -300px;"><span class="top" style="height: 309px;"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.crypto.codecs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>codecs</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.db.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.db.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-6 branch"><a href="io.randomseed.utils.db.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-6"><a href="io.randomseed.utils.db.types.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.utils.identity.proto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>proto</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.identity.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.log.logback.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logback</span></div></a></li><li class="depth-4 branch current"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.qe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>qe</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-existing"><div class="inner"><span>assoc-existing</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-if"><div class="inner"><span>assoc-if</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-if-key"><div class="inner"><span>assoc-if-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-if-not"><div class="inner"><span>assoc-if-not</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-if-not-key"><div class="inner"><span>assoc-if-not-key</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-assoc-missing"><div class="inner"><span>assoc-missing</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-dissoc-if"><div class="inner"><span>dissoc-if</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-dissoc-in"><div class="inner"><span>dissoc-in</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-duplicate-keys"><div class="inner"><span>duplicate-keys</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-invert-in-sets"><div class="inner"><span>invert-in-sets</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-lazy"><div class="inner"><span>lazy</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-lazy-get"><div class="inner"><span>lazy-get</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-lazy.3F"><div class="inner"><span>lazy?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-keys"><div class="inner"><span>map-keys</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-keys-and-vals"><div class="inner"><span>map-keys-and-vals</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-keys-by-v"><div class="inner"><span>map-keys-by-v</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-of-sets-invert"><div class="inner"><span>map-of-sets-invert</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-of-vectors-invert-flatten"><div class="inner"><span>map-of-vectors-invert-flatten</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-vals"><div class="inner"><span>map-vals</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-vals-by-k"><div class="inner"><span>map-vals-by-k</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-vals-by-kv"><div class="inner"><span>map-vals-by-kv</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-values"><div class="inner"><span>map-values</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-values-with-path"><div class="inner"><span>map-values-with-path</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-map-values-with-rpath"><div class="inner"><span>map-values-with-rpath</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-merge-lazy"><div class="inner"><span>merge-lazy</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-nil-existing-keys"><div class="inner"><span>nil-existing-keys</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-nil-keys"><div class="inner"><span>nil-keys</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-or-map"><div class="inner"><span>or-map</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-qassoc"><div class="inner"><span>qassoc</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-qassoc*"><div class="inner"><span>qassoc*</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-qupdate"><div class="inner"><span>qupdate</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-remove-empty-values"><div class="inner"><span>remove-empty-values</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-remove-except"><div class="inner"><span>remove-except</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-remove-if-value"><div class="inner"><span>remove-if-value</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-remove-if-value-in"><div class="inner"><span>remove-if-value-in</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-remove-if-value-not-in"><div class="inner"><span>remove-if-value-not-in</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-select-keys-lazy"><div class="inner"><span>select-keys-lazy</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-to-lazy"><div class="inner"><span>to-lazy</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-bytes-to-strings"><div class="inner"><span>update-bytes-to-strings</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-existing"><div class="inner"><span>update-existing</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-if"><div class="inner"><span>update-if</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-if-not"><div class="inner"><span>update-if-not</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-missing"><div class="inner"><span>update-missing</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-to-bytes"><div class="inner"><span>update-to-bytes</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-values"><div class="inner"><span>update-values</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-values-or-seqs"><div class="inner"><span>update-values-or-seqs</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-values-or-seqs-recur"><div class="inner"><span>update-values-or-seqs-recur</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.map.html#var-update-values-recur"><div class="inner"><span>update-values-recur</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.map</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Random utils, map utilities.</p>
</div></div><div class="public anchor" id="var-assoc-existing"><h3>assoc-existing</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(assoc-existing)</code><code>(assoc-existing coll)</code><code>(assoc-existing coll k val)</code><code>(assoc-existing coll k val & more)</code></div><div class="doc"><div class="markdown"><p>Associates keys and values only if keys exist in a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L119">view source</a></div></div><div class="public anchor" id="var-assoc-if"><h3>assoc-if</h3><h4 class="type">macro</h4><div class="usage"><code>(assoc-if coll pred k val)</code><code>(assoc-if coll pred k val & pairs)</code></div><div class="doc"><div class="markdown"><p>Associates <code>k</code> with <code>val</code> (and optional further pairs) in <code>coll</code> only when <code>pred</code> is truthy. Returns <code>coll</code> unchanged otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L222">view source</a></div></div><div class="public anchor" id="var-assoc-if-key"><h3>assoc-if-key</h3><h4 class="type">macro</h4><div class="usage"><code>(assoc-if-key coll k pred val)</code></div><div class="doc"><div class="markdown"><p>Associates <code>k</code> with <code>val</code> in <code>coll</code> only when the current value at <code>k</code> satisfies predicate <code>pred</code>. Returns <code>coll</code> unchanged otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L250">view source</a></div></div><div class="public anchor" id="var-assoc-if-not"><h3>assoc-if-not</h3><h4 class="type">macro</h4><div class="usage"><code>(assoc-if-not coll pred k val)</code><code>(assoc-if-not coll pred k val & pairs)</code></div><div class="doc"><div class="markdown"><p>Associates <code>k</code> with <code>val</code> (and optional further pairs) in <code>coll</code> only when <code>pred</code> is falsy. Returns <code>coll</code> unchanged otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L236">view source</a></div></div><div class="public anchor" id="var-assoc-if-not-key"><h3>assoc-if-not-key</h3><h4 class="type">macro</h4><div class="usage"><code>(assoc-if-not-key coll k pred val)</code></div><div class="doc"><div class="markdown"><p>Associates <code>k</code> with <code>val</code> in <code>coll</code> only when the current value at <code>k</code> does NOT satisfy predicate <code>pred</code>. Returns <code>coll</code> unchanged otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L260">view source</a></div></div><div class="public anchor" id="var-assoc-missing"><h3>assoc-missing</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(assoc-missing)</code><code>(assoc-missing coll)</code><code>(assoc-missing coll k val)</code><code>(assoc-missing coll k val & more)</code></div><div class="doc"><div class="markdown"><p>Associates keys and values only if keys do not yet exist in a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L107">view source</a></div></div><div class="public anchor" id="var-dissoc-if"><h3>dissoc-if</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(dissoc-if m k pred)</code></div><div class="doc"><div class="markdown"><p>Removes key <code>k</code> from map <code>m</code> when the value at <code>k</code> satisfies predicate <code>pred</code>. Returns <code>m</code> unchanged otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L270">view source</a></div></div><div class="public anchor" id="var-dissoc-in"><h3>dissoc-in</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(dissoc-in m [k & ks])</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.core/assoc-in</code> but removes entries. Leaves empty maps.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L642">view source</a></div></div><div class="public anchor" id="var-duplicate-keys"><h3>duplicate-keys</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(duplicate-keys map kmap)</code></div><div class="doc"><div class="markdown"><p>Returns a map <code>map</code> with the keys present in <code>kmap</code> duplicated under new names according to the values in <code>kmap</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L652">view source</a></div></div><div class="public anchor" id="var-invert-in-sets"><h3>invert-in-sets</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(invert-in-sets m)</code><code>(invert-in-sets m dst)</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.set/map-invert</code> but preserves all possible values in sets.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L454">view source</a></div></div><div class="public anchor" id="var-lazy"><h3>lazy</h3><h4 class="type">macro</h4><div class="usage"><code>(lazy)</code><code>(lazy m)</code></div><div class="doc"><div class="markdown"><p>Creates a lazy map from a literal map. All values are unrealized.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L686">view source</a></div></div><div class="public anchor" id="var-lazy-get"><h3>lazy-get</h3><h4 class="type">macro</h4><div class="usage"><code>(lazy-get m k exp)</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.core/get</code> but the default value is an expression that is going to be evaluated only if the associative structure does not contain the given key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L17">view source</a></div></div><div class="public anchor" id="var-lazy.3F"><h3>lazy?</h3><div class="usage"><code>(lazy? m)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given argument is a lazy map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L700">view source</a></div></div><div class="public anchor" id="var-map-keys"><h3>map-keys</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-keys f m)</code><code>(map-keys f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L400">view source</a></div></div><div class="public anchor" id="var-map-keys-and-vals"><h3>map-keys-and-vals</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-keys-and-vals f m)</code><code>(map-keys-and-vals f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function and values also updated by results of the same function. The function should return a sequential collection of 2 elements: first containing a new value of a key and second containing a new value of a transformed value associated with that key. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L419">view source</a></div></div><div class="public anchor" id="var-map-keys-by-v"><h3>map-keys-by-v</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-keys-by-v f m)</code><code>(map-keys-by-v f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with key names generated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using and empty map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L381">view source</a></div></div><div class="public anchor" id="var-map-of-sets-invert"><h3>map-of-sets-invert</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-of-sets-invert m)</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.set/map-invert</code> but for map of sets (as values) to preserve all possible values (as keys of newly created map).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L442">view source</a></div></div><div class="public anchor" id="var-map-of-vectors-invert-flatten"><h3>map-of-vectors-invert-flatten</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-of-vectors-invert-flatten m)</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.set/map-invert</code> but for map of vectors (as values). Duplicated keys are replaced.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L465">view source</a></div></div><div class="public anchor" id="var-map-vals"><h3>map-vals</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-vals f m)</code><code>(map-vals f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L361">view source</a></div></div><div class="public anchor" id="var-map-vals-by-k"><h3>map-vals-by-k</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-vals-by-k f m)</code><code>(map-vals-by-k f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L321">view source</a></div></div><div class="public anchor" id="var-map-vals-by-kv"><h3>map-vals-by-kv</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-vals-by-kv f m)</code><code>(map-vals-by-kv f m dst)</code></div><div class="doc"><div class="markdown"><p>For each key and value of the given map m calls a function passed as the first argument (passing successive keys and values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L341">view source</a></div></div><div class="public anchor" id="var-map-values"><h3>map-values</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-values f coll)</code></div><div class="doc"><div class="markdown"><p>Recursively transforms values of a map coll using function f. The function should take a value and return new value.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L475">view source</a></div></div><div class="public anchor" id="var-map-values-with-path"><h3>map-values-with-path</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-values-with-path f coll)</code></div><div class="doc"><div class="markdown"><p>Recursively transforms values of a map coll using function f. The function should take a value and a sequence of visited keys (stored in a vector), and return a new value.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L506">view source</a></div></div><div class="public anchor" id="var-map-values-with-rpath"><h3>map-values-with-rpath</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(map-values-with-rpath f coll)</code></div><div class="doc"><div class="markdown"><p>Recursively transforms values of a map coll using function f. The function should take a value and a sequence of visited keys in reverse order (stored in a persistent list), and return a new value.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L498">view source</a></div></div><div class="public anchor" id="var-merge-lazy"><h3>merge-lazy</h3><div class="usage"><code>(merge-lazy m1 m2)</code></div><div class="doc"><div class="markdown"><p>Merges two lazy maps.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L720">view source</a></div></div><div class="public anchor" id="var-nil-existing-keys"><h3>nil-existing-keys</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(nil-existing-keys m keys)</code></div><div class="doc"><div class="markdown"><p>Sets the values of given <code>keys</code> to <code>nil</code> in map <code>m</code>, but only for keys that already exist in the map. Returns <code>nil</code> when <code>m</code> is <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L676">view source</a></div></div><div class="public anchor" id="var-nil-keys"><h3>nil-keys</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(nil-keys m keys)</code></div><div class="doc"><div class="markdown"><p>Sets the values of all given <code>keys</code> to <code>nil</code> in map <code>m</code>, adding keys that did not exist. Returns <code>nil</code> when <code>m</code> is <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L666">view source</a></div></div><div class="public anchor" id="var-or-map"><h3>or-map</h3><div class="usage"><code>(or-map m)</code></div><div class="doc"><div class="markdown"><p>Returns an empty map if the argument is <code>nil</code>. Otherwise returns its argument.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L25">view source</a></div></div><div class="public anchor" id="var-qassoc"><h3>qassoc</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(qassoc mp)</code><code>(qassoc mp a b)</code><code>(qassoc mp a b c d)</code><code>(qassoc mp a b c d e f)</code><code>(qassoc mp a b c d e f g h)</code><code>(qassoc mp a b c d e f g h i j)</code><code>(qassoc mp a b c d e f g h i j k l)</code><code>(qassoc mp a b c d e f g h i j k l m n)</code><code>(qassoc mp a b c d e f g h i j k l m n o p)</code><code>(qassoc mp a b c d e f g h i j k l m n o p q r)</code><code>(qassoc mp a b c d e f g h i j k l m n o p q r & pairs)</code></div><div class="doc"><div class="markdown"><p>Faster version of <code>assoc</code> with some of the checks and conversions disabled. Associates key <code>a</code> with value <code>b</code> in <code>mp</code>. If <code>mp</code> is <code>nil</code> it creates a new map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L44">view source</a></div></div><div class="public anchor" id="var-qassoc*"><h3>qassoc*</h3><h4 class="type">macro</h4><div class="usage"><code>(qassoc* mp & kvs)</code></div><div class="doc"><div class="markdown"><p>Macro that expands into a chain of <code>.assoc</code> calls on <code>mp</code> for the given key–value pairs <code>kvs</code>. Expects an even number of key–value arguments.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L30">view source</a></div></div><div class="public anchor" id="var-qupdate"><h3>qupdate</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(qupdate m k f)</code><code>(qupdate m k f x)</code><code>(qupdate m k f x y)</code><code>(qupdate m k f x y z)</code><code>(qupdate m k f x y z c)</code><code>(qupdate m k f x y z c v)</code><code>(qupdate m k f x y z c v a)</code><code>(qupdate m k f x y z c v a b)</code><code>(qupdate m k f x y z c v a b & more)</code></div><div class="doc"><div class="markdown"><p>Similar to <code>clojure.core/update</code>, updates a value in an associative structure, where <code>k</code> is a key and <code>f</code> is a function which will take the old value and any supplied args and return the new value, and returns a new structure. Uses <code>qassoc</code> instead of <code>clojure.core/assoc</code> internally.</p>
<p>If the key does not exist, <code>nil</code> is passed as the old value.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L80">view source</a></div></div><div class="public anchor" id="var-remove-empty-values"><h3>remove-empty-values</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(remove-empty-values m)</code></div><div class="doc"><div class="markdown"><p>Removes all entries from map <code>m</code> whose values are <code>nil</code> or empty (in the <code>seq</code> sense).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L314">view source</a></div></div><div class="public anchor" id="var-remove-except"><h3>remove-except</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(remove-except m keyseq)</code></div><div class="doc"><div class="markdown"><p>Returns a map containing only the keys from <code>keyseq</code>. Equivalent to <code>select-keys</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L308">view source</a></div></div><div class="public anchor" id="var-remove-if-value"><h3>remove-if-value</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(remove-if-value m pred)</code></div><div class="doc"><div class="markdown"><p>Removes all entries from map <code>m</code> whose values satisfy predicate <code>pred</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L278">view source</a></div></div><div class="public anchor" id="var-remove-if-value-in"><h3>remove-if-value-in</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(remove-if-value-in m vals)</code></div><div class="doc"><div class="markdown"><p>Removes all entries from map <code>m</code> whose values are contained in the collection <code>vals</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L288">view source</a></div></div><div class="public anchor" id="var-remove-if-value-not-in"><h3>remove-if-value-not-in</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(remove-if-value-not-in m vals)</code></div><div class="doc"><div class="markdown"><p>Removes all entries from map <code>m</code> whose values are NOT contained in the collection <code>vals</code>. When <code>vals</code> is <code>nil</code>, returns an empty map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L297">view source</a></div></div><div class="public anchor" id="var-select-keys-lazy"><h3>select-keys-lazy</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(select-keys-lazy m keyseq)</code></div><div class="doc"><div class="markdown"><p>Like <code>clojure.core/select-keys</code> but preserves unrealized values as they are.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L705">view source</a></div></div><div class="public anchor" id="var-to-lazy"><h3>to-lazy</h3><div class="usage"><code>(to-lazy)</code><code>(to-lazy m)</code></div><div class="doc"><div class="markdown"><p>Converts the given map to a lazy map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L693">view source</a></div></div><div class="public anchor" id="var-update-bytes-to-strings"><h3>update-bytes-to-strings</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-bytes-to-strings coll k)</code><code>(update-bytes-to-strings coll k & keys)</code></div><div class="doc"><div class="markdown"><p>Converts the value(s) at the given key(s) in <code>coll</code> from byte arrays to strings using <code>bytes-to-string</code>, skipping values that are not byte arrays.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L213">view source</a></div></div><div class="public anchor" id="var-update-existing"><h3>update-existing</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-existing coll k fun)</code><code>(update-existing coll k fun & more)</code></div><div class="doc"><div class="markdown"><p>Updates the given key <code>k</code> of <code>coll</code> by calling a function <code>fun</code> and passing optional arguments specified as additional arguments. Will not perform any update if the given key does not exist within the collection. Returns updated collection.</p>
<p>If <code>fun</code> is not a function it will be made one by using <code>constantly</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L131">view source</a></div></div><div class="public anchor" id="var-update-if"><h3>update-if</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-if coll k pred fun)</code><code>(update-if coll k pred fun & more)</code></div><div class="doc"><div class="markdown"><p>Updates the value at key <code>k</code> in <code>coll</code> by applying <code>fun</code> (with optional extra args) only when the current value satisfies predicate <code>pred</code>. If <code>k</code> is absent or <code>pred</code> returns false, <code>coll</code> is returned unchanged.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L164">view source</a></div></div><div class="public anchor" id="var-update-if-not"><h3>update-if-not</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-if-not coll k pred fun)</code><code>(update-if-not coll k pred fun & more)</code></div><div class="doc"><div class="markdown"><p>Updates the value at key <code>k</code> in <code>coll</code> by applying <code>fun</code> (with optional extra args) only when the current value does NOT satisfy predicate <code>pred</code>. If <code>k</code> is absent or <code>pred</code> returns true, <code>coll</code> is returned unchanged.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L184">view source</a></div></div><div class="public anchor" id="var-update-missing"><h3>update-missing</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-missing coll k fun)</code><code>(update-missing coll k fun & more)</code></div><div class="doc"><div class="markdown"><p>Updates the given key <code>k</code> of <code>coll</code> by calling a function <code>fun</code> and passing optional arguments specified as additional arguments. Will not perform any update if the given key exists within the collection, therefore the function will always receive <code>nil</code> as its argument. Returns updated collection.</p>
<p>If <code>fun</code> is not a function it will be made one by using <code>constantly</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L147">view source</a></div></div><div class="public anchor" id="var-update-to-bytes"><h3>update-to-bytes</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-to-bytes coll k)</code><code>(update-to-bytes coll k & keys)</code></div><div class="doc"><div class="markdown"><p>Converts the value(s) at the given key(s) in <code>coll</code> to byte arrays using <code>normalize-to-bytes</code>, skipping values that are already byte arrays.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L204">view source</a></div></div><div class="public anchor" id="var-update-values"><h3>update-values</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-values map vmap)</code><code>(update-values map vmap create-keys?)</code><code>(update-values map vmap create-keys? remove-key-mark)</code></div><div class="doc"><div class="markdown"><p>Returns a map with its values identified with keys from vmap updated with the associated functions from vmap.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L514">view source</a></div></div><div class="public anchor" id="var-update-values-or-seqs"><h3>update-values-or-seqs</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-values-or-seqs map vmap)</code><code>(update-values-or-seqs map vmap create-keys?)</code></div><div class="doc"><div class="markdown"><p>Returns the map with its values identified with keys from <code>vmap</code> updated with the associated functions from <code>vmap</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L593">view source</a></div></div><div class="public anchor" id="var-update-values-or-seqs-recur"><h3>update-values-or-seqs-recur</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-values-or-seqs-recur map vmap)</code><code>(update-values-or-seqs-recur map vmap create-keys?)</code></div><div class="doc"><div class="markdown"><p>Returns a map with its values identified with keys from <code>vmap</code> recursively updated with the associated functions from <code>vmap</code>. Shape is not reflected, second map (<code>vmap</code>) should be flat, searching for keys is recursive, including nested vectors.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L613">view source</a></div></div><div class="public anchor" id="var-update-values-recur"><h3>update-values-recur</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(update-values-recur map vmap)</code><code>(update-values-recur map vmap create-keys?)</code></div><div class="doc"><div class="markdown"><p>Returns the map with its values identified with keys from vmap recursively updated with the associated functions from vmap. Shape is not reflected, second map (vmap) should be flat, searching for keys is recursive, including nested vectors.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/2.0.11/modules/core/src/io/randomseed/utils/map.clj#L559">view source</a></div></div></div></body></html>