[meander/epsilon "0.0.479"]
This release fixes the regression pointed out recently.Do upgrade folks.
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]}]
Is there any way to reach this grouping?
m/gather is really close - just found it
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.
Gacha
Folds will allow computing min
or max
, grouping, etc.
I'll use group-by for now. Thanks for the tip!
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.
Sure thing!