meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
pithyless 2020-06-22T12:11:05.450800Z

Is there an idiomatic way in meander to match the ex-message and ex-data parts of an exception (not in try/catch, just as some data that's embedded in a map)?

noprompt 2020-06-22T16:27:46.451400Z

Like

(m/app ex-data {:error/type ?error-type})
kinda thing?

pithyless 2020-06-22T20:57:08.451600Z

yeah, so I guess something like this is appropriate?

(m/and (m/app ex-message "Some Error")
       (m/app ex-data {:some :data}))

noprompt 2020-06-22T23:19:35.451800Z

(m/defsyntax ex [message data]
  `(m/and (m/app ex-message ~message)
          (m/app ex-data ~data)))

noprompt 2020-06-22T23:19:46.452Z

(If its common enough to warrant.)