{"action":"created","issue":{"url":"https://api.github.com/repos/aphyr/tesser/issues/10","labels_url":"https://api.github.com/repos/aphyr/tesser/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/aphyr/tesser/issues/10/comments","events_url":"https://api.github.com/repos/aphyr/tesser/issues/10/events","html_url":"https://github.com/aphyr/tesser/issues/10","id":101066502,"number":10,"title":"Unexpected behavior using group-by and post-combine together","user":{"login":"kasperlanger","id":227208,"avatar_url":"https://avatars.githubusercontent.com/u/227208?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperlanger","html_url":"https://github.com/kasperlanger","followers_url":"https://api.github.com/users/kasperlanger/followers","following_url":"https://api.github.com/users/kasperlanger/following{/other_user}","gists_url":"https://api.github.com/users/kasperlanger/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperlanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperlanger/subscriptions","organizations_url":"https://api.github.com/users/kasperlanger/orgs","repos_url":"https://api.github.com/users/kasperlanger/repos","events_url":"https://api.github.com/users/kasperlanger/events{/privacy}","received_events_url":"https://api.github.com/users/kasperlanger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-14T17:57:13Z","updated_at":"2015-08-15T07:46:54Z","closed_at":null,"body":"I was hoping to extend the `group-by` example with a `(post-combine inc)` like this\r\n\r\n```\r\n(->> (t/group-by :type)\r\n     (t/map :mass)\r\n     (t/max)\r\n     (t/post-combine inc)\r\n     (t/tesser [[{:name :electron, :type :lepton, :mass 0.51}\r\n                 {:name :muon,     :type :lepton, :mass 105.65}\r\n                 {:name :up,       :type :quark,  :mass 1.5}\r\n                 {:name :down,     :type :quark,  :mass 3.5}]]))\r\n; => {:lepton 106.65, :quark 4.5}\r\n```\r\n\r\nHowever 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."},"comment":{"url":"https://api.github.com/repos/aphyr/tesser/issues/comments/131313725","html_url":"https://github.com/aphyr/tesser/issues/10#issuecomment-131313725","issue_url":"https://api.github.com/repos/aphyr/tesser/issues/10","id":131313725,"user":{"login":"kasperlanger","id":227208,"avatar_url":"https://avatars.githubusercontent.com/u/227208?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperlanger","html_url":"https://github.com/kasperlanger","followers_url":"https://api.github.com/users/kasperlanger/followers","following_url":"https://api.github.com/users/kasperlanger/following{/other_user}","gists_url":"https://api.github.com/users/kasperlanger/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperlanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperlanger/subscriptions","organizations_url":"https://api.github.com/users/kasperlanger/orgs","repos_url":"https://api.github.com/users/kasperlanger/repos","events_url":"https://api.github.com/users/kasperlanger/events{/privacy}","received_events_url":"https://api.github.com/users/kasperlanger/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T07:46:54Z","updated_at":"2015-08-15T07:46:54Z","body":"And another example with post-combine at different stages\r\n```\r\n(->> (t/group-by :type\r\n                 (->> (t/map :mass)\r\n                      (t/max)\r\n                      (t/post-combine inc))\r\n     (t/post-combine #(assoc % :foo :bar)\r\n     (t/tesser [[{:name :electron, :type :lepton, :mass 0.51}\r\n                 {:name :muon,     :type :lepton, :mass 105.65}\r\n                 {:name :up,       :type :quark,  :mass 1.5}\r\n                 {:name :down,     :type :quark,  :mass 3.5}]]))\r\n\r\n; => {:lepton 106.65, :quark 4.5, :foo :bar}\r\n```"}}