meander

igrishaev 2023-05-16T08:50:13.582659Z

Can anyone help me with meander? Imagine I want the first form to become the second:

igrishaev 2023-05-16T08:51:11.024459Z

{:tags [{:name "AAA"} {:name "BBB"}]}
->
{:tags ["AAA" "BBB"]}
here is what I have in my code:
(matcher
 {:pattern    '{:tags [{:name ?tag} ...]}
  :expression '{:tags [!tags]}})
But sometimes, I'm getting an exception saying "Non-exhaustive pattern match" or something

igrishaev 2023-05-16T08:56:08.771429Z

Let me correct myself:

:tags  [{:name !tags} ...]
:tags  !tags
Sometimes, it leads to => ExceptionInfo: non exhaustive pattern match {}

igrishaev 2023-05-16T09:04:56.770119Z

turned out, the exception pops up when the tags field is missing or nil. How can I correct the pattern so the nil tags produce either nil or an empty vector?

igrishaev 2023-05-16T09:10:00.047559Z

phew, it should have been (m/or nil [{:name !tags} ...])