This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-02
Channels
- # beginners (118)
- # boot (73)
- # cider (2)
- # cljs-dev (65)
- # cljsrn (18)
- # clojure (49)
- # clojure-argentina (4)
- # clojure-italy (19)
- # clojure-portugal (1)
- # clojure-russia (1)
- # clojure-spec (34)
- # clojure-uk (102)
- # clojurescript (202)
- # code-reviews (3)
- # core-async (5)
- # cursive (11)
- # datomic (25)
- # emacs (1)
- # graphql (22)
- # hoplon (6)
- # keechma (59)
- # leiningen (10)
- # luminus (31)
- # lumo (78)
- # off-topic (141)
- # om (32)
- # om-next (2)
- # onyx (6)
- # parinfer (55)
- # pedestal (3)
- # protorepl (3)
- # re-frame (8)
- # reagent (8)
- # ring-swagger (1)
- # rum (20)
- # specter (1)
- # sql (5)
- # test-check (11)
- # vim (13)
- # yada (7)
@cddr depends what kind of distribution you want
the easy dumb way to do it is to generate a sequence of numbers and then append (- n sum)
to them
also depends on what kind of numbers you mean
This is related to my question over in #clojure-spec about a having relations between a top-level amount, and children that should add up to that amount https://clojurians.slack.com/archives/C1B1BB2Q3/p1501686285791508
would it be weird to not generate the top-level amount?
generate just the children, then set the top-level to the sum?
Yeah that was my first thought too. But then I thought I needed to solve this type of problem anyway but looking back at my code I can't remember why now 🙂
In the actual example there are a few more relationships between the top-level and the children
a very useful tactic as generating something related to what you want, and using gen/fmap
to transform it
i.e., generate the information, then use fmap
to get it into the right format