Public Vars

Back

update-keys (clj)

(source)

function

(update-keys m f)
m f => {(f k) v ...} Given a map m and a function f of 1-argument, returns a new map whose keys are the result of applying f to the keys of m, mapped to the corresponding values of m. f must return a unique key for each key of m, else the behavior is undefined.

Examples

typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

cc/update-keys (t/All [k k' v] [(t/Nilable (t/Associative k v)) [k :-> k'] :-> (t/Map k' v)])
cc/update-vals (t/All [k v v'] [(t/Nilable (t/Associative k v)) [v :-> v'] :-> (t/Map k v')])
babashka/sci.configs
(ns sci.configs.clojure-1-11
  (:require [sci.core :as sci]
            [sci.impl.utils :refer [clojure-core-ns]]
            [clojure.core :as c]))

(def ^:private clojure-core-namespace-extras-1-11
  {'abs (sci/copy-var c/abs clojure-core-ns)
   'NaN? (sci/copy-var c/NaN? clojure-core-ns)
   'infinite? (sci/copy-var c/infinite? clojure-core-ns)
   'parse-double (sci/copy-var c/parse-double clojure-core-ns)
   'parse-long (sci/copy-var c/parse-long clojure-core-ns)
   'parse-boolean (sci/copy-var c/parse-boolean clojure-core-ns)
   'parse-uuid (sci/copy-var c/parse-uuid clojure-core-ns)
   'random-uuid (sci/copy-var c/random-uuid clojure-core-ns)
   'update-keys (sci/copy-var c/update-keys clojure-core-ns)
   'update-vals (sci/copy-var c/update-vals clojure-core-ns)
   'iteration (sci/copy-var c/iteration clojure-core-ns)})