This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-20
Channels
- # announcements (1)
- # asami (6)
- # babashka (21)
- # beginners (19)
- # calva (44)
- # circleci (3)
- # clj-http (3)
- # clj-kondo (44)
- # clojure (24)
- # clojure-australia (1)
- # clojure-czech (1)
- # clojure-europe (50)
- # clojure-france (5)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-uk (8)
- # clojurescript (161)
- # datomic (4)
- # fulcro (7)
- # graalvm (8)
- # heroku (4)
- # lambdaisland (4)
- # lein-figwheel (5)
- # lsp (48)
- # malli (21)
- # meander (15)
- # off-topic (35)
- # polylith (2)
- # re-frame (21)
- # react (22)
- # reagent (13)
- # reitit (6)
- # remote-jobs (1)
- # reveal (3)
- # ring (3)
- # shadow-cljs (37)
- # testing (2)
- # tools-deps (10)
- # vim (18)
- # vrac (1)
- # xtdb (17)
mawning
Bonjour!
an ex-colleague has asked for a book recommendation regarding an intro into FP. Any suggestions? Not Clojure specific though, I have suggest Eric Normand's book as a started (even though I haven't read it myself).
I ikead “Real World Haskell” if you want to go hard core.
Is SICP too hard? If they are already developers, it should hit some interesting topics, shouldn’t it?
@thomas still it’s a very good introduction into FP I think. SICP of course, too!
If the goal is to do Clojure eventually, I personally wouldn't bother with Haskell since it comes with a lot of baggage that isn't very relevant in Clojure. Conceptually separating side effects from pure functions is very useful, but you will learn those concepts with Clojure as well.
true that.
We are all obviously biased here, but I think that Lisp is really a great teaching language for FP. I agree with the introduction of Software Design for Flexibility, you can concentrate on the context without being “distracted” by a static type system.
Different topic: does somebody know a good library for longest/critical path analysis in clojure? (Or java if that helps)
if you have a DAG of nodes, each with a weight. The longest path is the path along the nodes which give the heighest sum.
critical path is the path where increasing the node weight increases the weight sum of the longest path.
I haven't read them, but O'Reilly has some "generic" functional programming books - Becoming Functional and Functional Thinking. They might be worth looking at (I think they're both jvm-centric; the latter includes at least some Clojure)
I don't know much about Loom (i.e. not enough to recommend it), but this API looks about right https://cljdoc.org/d/aysylu/loom/1.0.2/api/loom.alg-generic#dijkstra-path
We use a Java lib for these kinds of things, it's called jgrapht and very performant
Funnily enough, I tried rewriting an alg moving from loom to jgrapht for performance and it was much worse under jgrapht. I think loom had a particularly good algorithm for doing connected graphs that jgrapht didn't.
I wonder if my DAG size of 60k nodes is off the charts.
I wonder if the calculating the shortest path is even helpful / sufficient to get the critical path
If I remember correctly, both loom and ubergraph have builtin functions for shortest path
Uhhm, [[:a 1] [:b 2] [:c 3]]
=> [[:a :b :c] [1 2 3]]
… how?
[(map first xxx) (map second xxx)]
doesnt sound too tempting
The rule of juxt
: always use it when possible
(juxt #(mapv first %) #(mapv second %))
but this would be double-iterating
maybe doesn’t matter.
you can single-iterate with a reduce but this would be more boilerplate. if you go that way, then you absolutely must use transients as well
that’s the wrong way round