(->> (t/group-by :type)
(t/map :mass)
(t/max)
(t/post-combine inc)
(t/tesser [[{:name :electron, :type :lepton, :mass 0.51}
{:name :muon, :type :lepton, :mass 105.65}
{:name :up, :type :quark, :mass 1.5}
{:name :down, :type :quark, :mass 3.5}]]))
; => {:lepton 106.65, :quark 4.5}
However it raises an exception because the post-combine is added to the top of the fold and inc doesn't like to post-combine the group-by result.
I was hoping to extend the
group-byexample with a(post-combine inc)like thisHowever it raises an exception because the post-combine is added to the top of the fold and
incdoesn't like to post-combine the group-by result.