This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-06
Channels
- # adventofcode (106)
- # aleph (1)
- # announcements (1)
- # asami (14)
- # babashka (120)
- # beginners (54)
- # calva (106)
- # chlorine-clover (33)
- # clj-kondo (5)
- # cljdoc (3)
- # cljs-dev (3)
- # clojure (92)
- # clojure-android (1)
- # clojure-australia (2)
- # clojure-europe (24)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-uk (16)
- # clojuredesign-podcast (1)
- # clojurescript (29)
- # code-reviews (58)
- # conjure (16)
- # core-logic (4)
- # cursive (9)
- # datalevin (2)
- # graphql (20)
- # gratitude (7)
- # jackdaw (11)
- # java (9)
- # jobs (2)
- # lsp (23)
- # minecraft (1)
- # missionary (28)
- # off-topic (5)
- # polylith (5)
- # react (1)
- # reagent (12)
- # releases (1)
- # remote-jobs (4)
- # reveal (7)
- # shadow-cljs (8)
- # slack-help (1)
- # tools-deps (11)
- # vim (6)
regarding the attempt/absolve pattern, this is where it comes from https://youtu.be/CIPGZzbPpeg?t=787
This is cool, compare
(defn absolver [s f]
(fn [t] (try (s (t)) (catch Throwable e (f e)))))
And
From uKanren
(define (disj g1 g2) (lambda (s/c) (mplus (g1 s/c) (g2 s/c))))
Where mplus is
(define (mplus $1 $2)
(cond
((null? $1) $2)
((procedure? $1) (lambda () (mplus $2 ($1))))
(else (cons (car $1) (mplus (cdr $1) $2)))))
It's fun to read, concise and yet builds everything up gradually without heading off into the deep theory which underlies the correctness in the implementation
Regarding Clojure core interfaces which I brought up on Saturday, the idea was that if Flow implemented IReduce it wouldn't even have to block. To begin with you could just return what Reduce does now. The idea is to support the interface
I don't understand how it is possible to get clojure.core/reduce
working on flows without blocking the thread at some point
Just like https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L634 It doesn't have to be a function , it could be defined by a channel
I don't see anything about the semantics of reduce which require it to be blocking in the calling thread
so what you're suggesting is if you pass a flow to clojure.core/reduce
, it does what m/reduce
does and returns a task ?
my rationale is as follows - we can say map
is a private case of reduce?
But map
is defined for every functor and its definition is that it keeps context
Yes, but because Clojure is dynamic it was easy to add a transducer arity and call it a day