meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
markaddleman 2021-01-02T16:42:16.112800Z

@tothda Does this do what you want?

(m/rewrite
            db
            {:items [!item ...] :labels ?labels}
            {:items [(m/cata {::item !item ::labels ?labels}) ...]}

            {::item   {:id ?id :labels [!label ...]}
             ::labels ?labels}
            {:id ?id :labels [(m/cata {::lookup-label [!label ?labels]}) ...]}

            {::item {:id ?id :labels []}}
            {:id ?id :labels []}

            {::item {:id ?id}}
            {:id ?id :labels []}

            {::lookup-label [?label (m/scan {:id ?label :name ?name})]}
            ?name)

tothda 2021-01-02T23:19:19.114500Z

@markaddleman Yes! Thank you. I was not aware of (m/cata ...) , and now with this approach I was able to replace a lot of ad-hoc data manipulation code. Amazing!

2