meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
grounded_sage 2020-01-24T13:25:07.083300Z

(m/rewrite data
  {:Data
   {:EventId ?event-id
    :Event ?event-name
    :Sales {:Overall {:TicketCount ?sales-ticket-count
                      :Amount ?sales-amount}
            :ByCategory [{:Name !names
                          :TicketCount !ticket-counts
                          :Amount !amounts
                          :ByReduction [{:Name !names
                                         :TicketCount !ticket-counts
                                         :Amount !amounts} ...]} ...]}}}

  {:event {:id ?event-id
           :name ?event-name}
   :sales {:overall {:ticket-count ?sales-ticket-count
                     :amount ?sales-amount}
           :by-category [{:name !names
                          :ticket-count !ticket-counts
                          :amount !amounts
                          :by-reduction [{:name !names
                                         :ticket-count !ticket-counts
                                         :amount !amounts} ...]} ...]}})
Hey @jimmy I found something unexpected with the answer you gave me. I actually trimmed down the data too much and there is further list nesting. This results in by-reduction having a list of all reductions attached to just the first category name without returning the other category names as well.

jimmy 2020-01-24T14:34:17.085900Z

I'm going to add this to the cookbook today. You can fix this by doing the following

(m/rewrite data
  {:Data
   {:EventId ?event-id
    :Event ?event-name
    :Sales {:Overall {:TicketCount ?sales-ticket-count
                      :Amount ?sales-amount}
            :ByCategory [{:Name !names
                          :TicketCount !ticket-counts
                          :Amount !amounts
                          :ByReduction [{:Name !names
                                         :TicketCount !ticket-counts
                                         :Amount !amounts} ..!n]} ..!m]}}}

  {:event {:id ?event-id
           :name ?event-name}
   :sales {:overall {:ticket-count ?sales-ticket-count
                     :amount ?sales-amount}
           :by-category [{:name !names
                          :ticket-count !ticket-counts
                          :amount !amounts
                          :by-reduction [{:name !names
                                         :ticket-count !ticket-counts
                                         :amount !amounts} ..!n]} ..!m]}})
I'm on my phone so I didn't get to test this. But it should work.

👍 1
jimmy 2020-01-24T16:45:02.087900Z

Just fyi, there some stuff going on with cljdoc/circleci so the api docs are not working on the latest version. Here is a link to an old version that has all the information. meander isn't the only library affected, looking into it. https://cljdoc.org/d/meander/epsilon/0.0.373/doc/readme

grounded_sage 2020-01-24T16:51:16.088800Z

Thank you for the quick responses @jimmy really appreciate your help.

👍 1
noprompt 2020-01-24T17:24:56.090400Z

> Instead of logic variables, we can capture multiple repeats with logic variables Looks like it should say memory variables instead of logic variables at the end

jimmy 2020-01-24T17:32:16.090700Z

Fixed. Thanks

👍 1
jimmy 2020-01-24T20:47:46.091200Z

Fix the clj-doc issue. Docs should be all good now.