This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-28
Channels
- # adventofcode (2)
- # bangalore-clj (3)
- # beginners (171)
- # boot (28)
- # chestnut (3)
- # cljs-dev (20)
- # cljsjs (5)
- # clojure (280)
- # clojure-austin (1)
- # clojure-czech (1)
- # clojure-dev (9)
- # clojure-dusseldorf (2)
- # clojure-greece (20)
- # clojure-italy (6)
- # clojure-poland (16)
- # clojure-russia (7)
- # clojure-serbia (4)
- # clojure-sg (1)
- # clojure-spec (18)
- # clojure-uk (153)
- # clojurescript (57)
- # core-async (9)
- # cursive (21)
- # data-science (29)
- # datomic (18)
- # dirac (8)
- # docker (6)
- # duct (1)
- # emacs (50)
- # fulcro (15)
- # hoplon (56)
- # klipse (3)
- # leiningen (14)
- # lumo (1)
- # off-topic (5)
- # onyx (13)
- # other-languages (14)
- # pedestal (1)
- # perun (5)
- # planck (17)
- # re-frame (10)
- # reagent (2)
- # ring (1)
- # spacemacs (51)
- # sql (14)
- # test-check (16)
- # testing (1)
- # unrepl (93)
I'm creating a look up hash map from a vector of records where the keys will be strings based on what I want to look up. Anyone seen an example of how to spec this? I can't think of how to do it with s/keys
[{:a "foo" :b "shiny"} {:a "bar" :b "dull"}]
=>
{"foo" {:a "foo" :b "shiny"}
"bar" {:a "bar" :b "dull"}}
taken from https://clojure.org/guides/spec if you ctrl+f map-of
is there any library that can "unroll" a spec so i can display a given spec with all its component specs in a single data structure?
might be some interesting stuff in this project https://github.com/jpmonettas/inspectable
hmm the spec browser is neat but does that lib allow you to just get the whole spec as data?
(walk/postwalk
(fn [v]
(if (keyword? v)
(or (some-> v s/get-spec s/form)
v)
v))
(s/form ::my-coll))
here’s an idea, maybe not a good onethere is a spec visitor on spec-tools: https://github.com/metosin/spec-tools/blob/master/README.md#spec-visitors