Public Vars

Back

seq-to-map-for-destructuring (clj)

(source)

function

(seq-to-map-for-destructuring s)
Builds a map from a seq as described in https://clojure.org/reference/special_forms#keyword-arguments

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))))

#?@(:cljs [] :default [
cc/seq-to-map-for-destructuring [t/AnySeqable :-> t/Any]
;cc/seq-to-map-for-destructuring (t/All [x] (t/IFn [(t/HSeq [x]) :-> x]
;                                                  ;; could be anything if seq is of count 1
;                                                  [(t/Seq t/Any) :-> t/Any]))
cc/destructure [t/Any :-> t/Any]
])