Fork me on GitHub
#clojure
<
2020-06-28
>
tcrawley13:06:51

FYI: a deploy token is now required to deploy to Clojars. See https://groups.google.com/d/msg/clojure/UXx3ko0Ne-w/VnJA4eu6AQAJ for details. Thanks!

clojars 3
rutledgepaulv13:06:48

Generated a token and updated my repository auth config then deployed an artifact. Works great, thanks for making things more secure!

tcrawley15:06:28

My pleasure!

seancorfield18:06:28

I've been using tokens for deploying several libs for a while now -- I was pleasantly surprised at how seamless the transition was!

Drew Verlee19:06:56

I'm reading through clojure the essential reference and it claims that (range 10) is a reducible collection. That a reducible collection is anything that implements the coll-fold protocol. How do i check this? hmm maybe it has a mistake and its CollFold?

(satisfies? clojure.core.reducers/coll-fold (range 10))
;; 1. Unhandled java.lang.NullPointerException
;; (No message)

(satisfies? clojure.core.reducers/CollFold (range 10))
;; => true

seancorfield19:06:31

@drewverlee this is fresh in my mind because I just implemented CollFold for plan in next.jdbc 🙂

Drew Verlee19:06:09

Thanks. so i don't misquote. the book claims: > A "reducible" collection is a collection that provides reduce with a custom implementation. If the collection implements the coll-fold protocol, reduce delegates the iteration to the collection itself instead of using the generic mechanism. For example, (range 10) is a reducible (sequential) collection. r/map inc) (range 10 is also reducible collection although it does not exhibit other typical properties of a collection. Generically, isn't reduce just a subtype of fold? Left fold? I guess the specific context is more important, what's the disquisition in clojure?

hiredman19:06:12

The specific protocol CollFold is part of the reducers library, and implements a kind of parallel reduce

hiredman19:06:26

It takes advantage of the internal tree like structure of many of clojures immutable collections (vectors and maps) to do a divide and conquer parallel reduce

hiredman19:06:32

It isn't used a ton because reducers are largely superceded by transducers, the parallel reduce operation being the one thing you don't get with the transducer additions

hiredman19:06:04

coll-fold is definitely not a the name of the protocol

hiredman19:06:53

The protocol is CollFold and coll-fold is the only protocol function that is part of that protocol

Drew Verlee19:06:42

I see so CollReduce and CollFold overlaps with transdeucers in providing a seperation of concerns. But CollFold has parallelism and transdecuers are lazy?

hiredman19:06:02

Reducers are sort of an early iteration of the same idea as transducers: defining transformations of collections by transforming a function used to reduce the collection

💯 3
hiredman19:06:54

Transducers do this in a very direct style without introducing wrapping of collections

hiredman19:06:06

Reducers did introduce wrapping

hiredman19:06:07

As part of the work on reducers and transducers clojure grew some abstractions for collections that know how to reduce themselves

hiredman19:06:58

CollFold is more connected to those new specialized versions of reduce, then it is to the transformations of reducing functions

hiredman19:06:37

If something satisfied CollFold it knows how to reduce itself in parallel

Drew Verlee19:06:21

I see. That's similar to what the book is claiming to. Thanks for the clarification.