Fork me on GitHub

would appreciate any suggestions on simplifying or otherwise improving this rewrite, first time really trying to do anything with cata and memory variables:

Jimmy Miller04:01:12

Overall things look pretty good. Are there any things you are running into trouble with? A couple things I’d change from my quick glance. 1. Instead of (m/app merge map1 (m/cata !record)) you can do {:my-keys :my-vals & (m/cata !record)} 2. Sprinkle in some (m/some). Meander doesn’t actually check that keys exist in maps by default.

(m/rewrite {:a 2}
  {:record _ :as !record}
  [!record ...])

;; => [{:a 2}]

(m/rewrite {:a 2}
  {:record (m/some) :as !record}
  [!record ...])
;; =>  nil
If there is anything that isn’t working how you expect, definitely let us know and we can help.


thanks, the merge was making my eye twitch a little:slightly_smiling_face: - as best I can tell it's working correctly at the moment, although it took longer than I care to admit to get to this point. I mostly wanted to make sure I wasn't overly complicating anything or doing something boneheaded (like you pointed out with some )


I think missing m/some may have been why I couldn't get the {:spf}pattern variants to work as memory variables instead of using cata when I tried previously.


Also adding some uncovered an issue where some providers are sending fields in a different order than the schema specifies and I was just silently ignoring some of the data, so thanks again.