This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-16
Channels
- # beginners (11)
- # boot (21)
- # cider (12)
- # clara (6)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (62)
- # clojure (137)
- # clojure-austin (5)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-russia (46)
- # clojure-spec (21)
- # clojure-uk (79)
- # clojurescript (56)
- # clr (1)
- # core-typed (1)
- # css (1)
- # cursive (3)
- # datomic (35)
- # docker (2)
- # emacs (20)
- # garden (3)
- # hoplon (8)
- # incanter (3)
- # jobs (12)
- # mount (5)
- # nginx (1)
- # off-topic (71)
- # om (8)
- # om-next (6)
- # onyx (4)
- # perun (3)
- # proton (2)
- # protorepl (5)
- # re-frame (35)
- # reagent (38)
- # ring (5)
- # ring-swagger (12)
- # rum (35)
- # spacemacs (2)
- # specter (5)
- # test-check (6)
- # yada (52)
I want to write a generator that zipmaps values in coll-a to values in coll-b, but with the restriction that each entry in coll-a will be present in keys of the resulting map. Is this possible?
I've got something like this
(let [a [1 2 3]
b [:foo :bar]]
(gen/fmap (partial apply zipmap)
(gen/tuple
(gen/shuffle a)
(gen/return (cycle b)))))
how about (let [a [1 2 3], b [:foo :bar]] (gen/let [vals (gen/vector (gen/elements b) (count a))] (zipmap a vals)))
@danstone
Thats great - thanks @gfredericks