This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-07
Channels
- # aleph (3)
- # aws (7)
- # beginners (117)
- # boot (119)
- # cider (2)
- # cljs-dev (3)
- # clojure (193)
- # clojure-austin (1)
- # clojure-dusseldorf (4)
- # clojure-finland (5)
- # clojure-france (5)
- # clojure-italy (7)
- # clojure-portugal (1)
- # clojure-russia (204)
- # clojure-serbia (5)
- # clojure-spec (31)
- # clojure-uk (64)
- # clojurescript (288)
- # community-development (9)
- # core-async (54)
- # cursive (8)
- # datascript (18)
- # datomic (26)
- # dirac (8)
- # emacs (26)
- # figwheel (1)
- # hoplon (16)
- # jobs (2)
- # jobs-discuss (4)
- # juxt (1)
- # lein-figwheel (4)
- # leiningen (14)
- # london-clojurians (2)
- # lumo (17)
- # off-topic (44)
- # om (63)
- # om-next (2)
- # onyx (26)
- # perun (14)
- # planck (5)
- # portland-or (34)
- # proton (2)
- # protorepl (8)
- # quil (1)
- # re-frame (6)
- # reagent (16)
- # remote-jobs (4)
- # ring (7)
- # ring-swagger (10)
- # rum (1)
- # untangled (2)
@mattly http://blog.muhuk.com/2015/10/01/who_in_their_right_mind_would_use_monads_in_clojure.html#.WJorvhIrLUI
I’ll add this wonderful little series of short posts: http://www.clojure.net/2012/02/02/Monads-in-Clojure/
@bill yeah I gave the talk on cats a few months back https://github.com/funcool/cats
that http://muhuk.com link is 404ing
@mattly Google cached: http://webcache.googleusercontent.com/search?q=cache:_ngeoQGUtOMJ:blog.muhuk.com/2015/10/01/who_in_their_right_mind_would_use_monads_in_clojure.html+&cd=1&hl=en&ct=clnk&gl=us#.WJotGRIrLUI
the code /comments are here: https://github.com/mattly/pdxclj-cats-promesa/blob/master/src/preso.clj
I use "maybe math" as an example at the beginning because I've ended up having to implement some variant of that in pretty much every language I've ever worked in
@mattly looking more closely at your code example…
https://clojurians.slack.com/files/mattly/F410FHD6V/mount_patterns__old_and_new.clj
I see what you did there. All dependency on state is encapsulated in a defstate
. Code in defstate
can call functions so long as they reference no variables def’d outside the fn. (was gonna say “pure” fns but um, this is Clojure)
a lot of the documentation / writeups for mount encourage you to put the behavior in the start/stop clauses of defstate
once I realized that was a bad idea and stopped doing it, it became a lot easier to manage
So back to Mount vs. Component: the point about Mount defining a bunch of singletons is apt. My fave example of that is an app that needs to read from one PostgreSQL db and write to another one. In Component, I’d just have two (differently-configured) instances of my db component and I’d be off to the races. In Mount this won’t work because you configure the database namespace once (to talk to the database) and you’re stuck. My take is that this is what Yurt is for. Yurt uses Boot Pods to provide separate isolated worlds. Communication between these Pods looks like it’d be cumbersome.