meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
noprompt 2020-07-25T08:35:34.254800Z

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

đź‘Ť 1
noprompt 2020-07-25T18:36:14.255300Z

Do upgrade folks.

JAtkins 2020-07-25T19:59:01.256600Z

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]}]

JAtkins 2020-07-25T19:59:14.257Z

Is there any way to reach this grouping?

JAtkins 2020-07-25T20:04:34.258600Z

m/gather is really close - just found it

noprompt 2020-07-25T20:06:37.260200Z

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.

JAtkins 2020-07-25T20:07:31.261100Z

Gacha

noprompt 2020-07-25T20:07:34.261300Z

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

JAtkins 2020-07-25T20:08:18.262700Z

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

noprompt 2020-07-25T20:08:23.262900Z

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.

noprompt 2020-07-25T20:08:25.263100Z

Sure thing!