Fork me on GitHub
#meander
<
2020-07-25
>
noprompt08:07:34

[meander/epsilon "0.0.479"]
This release fixes the regression pointed out recently.

đź‘Ť 3
noprompt18:07:14

Do upgrade folks.

JAtkins19:07:01

So, I got another question -- is there any way to force some type of grouping?

(m/search [{:a :whatever :b [{:n 1} {:n 2} {:n 1}]}
             {:a :goes :b [{:n 1} {:n 2} {:n 4}]}
             {:a :here :b [{:n 2} {:n 2} {:n 3}]}]
    (m/scan {:a ?a :b (m/scan {:n !n})})
    {:a ?a :n !n})

;; => currently returns

({:a :whatever, :n [1]}
 {:a :whatever, :n [2]}
 {:a :whatever, :n [1]}
 {:a :goes, :n [1]}
 {:a :goes, :n [2]}
 {:a :goes, :n [4]}
 {:a :here, :n [2]}
 {:a :here, :n [2]}
 {:a :here, :n [3]})

;; => what I'm going for

[{:a :whatever :b [1 2 1]}
 {:a :goes :b [1 2 4]}
 {:a :here :b [2 2 3]}]

JAtkins19:07:14

Is there any way to reach this grouping?

JAtkins20:07:34

m/gather is really close - just found it

noprompt20:07:37

Not yet. At the moment the recommendation is to use group-by — cool, if gather helps you accomplish what you’re after, by all means, use that. If you really need group-by use that. The plan is to have a primitive for this called a “fold” which is essentially a variable that uses a reduction when it binds.

noprompt20:07:34

Folds will allow computing min or max, grouping, etc.

JAtkins20:07:18

I'll use group-by for now. Thanks for the tip!

noprompt20:07:23

These are in the works. I’ve had to take a bit of time away from focusing on how they will work because epsilon has required a lot of my attention lately.

noprompt20:07:25

Sure thing!