nubank / matcher-combinators

Library for creating matcher combinator to compare nested data structures
Other
468 stars 23 forks source link

Add `seq-of`, `all-of`, and `any-of` combinators #191

Closed philomates closed 1 year ago

philomates commented 1 year ago

addresses https://github.com/nubank/matcher-combinators/issues/149

an example of the difference between the new seq-of matcher and @dchelimsky 's temporary workaround (defn seq-of [matcher] (fn [coll] (and (seq coll) (every? (partial matcher-combinators.standalone/match? matcher) coll)))) 20221214_13h57m17s_grim

not sure if this additional expressiveness is opening a can of worms in terms of the complexity available to users. It has been asked for before though in https://github.com/nubank/matcher-combinators/issues/18 and https://github.com/nubank/matcher-combinators/issues/149 and a few times during in-person chats

dchelimsky commented 1 year ago

OK - this with the other 2 make for a solid release. I'll merge this and release all of this by tomorrow - maybe today.

dchelimsky commented 1 year ago

Released in 3.8.0: https://clojars.org/nubank/matcher-combinators