Skip to content

Unexpected behavior using group-by and post-combine together #10

Description

@kasperlanger

I was hoping to extend the group-by example with a (post-combine inc) like this

(->> (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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions