Fork me on GitHub
Samuel McHugh19:01:21

Hello, I'm trying out Malli and I'm wondering what is the idiomatic approach to spec'ing a finit explicit set of values. Here's an example of a schema which works.

  [:or [:= :foo]
       [:= :bar]
       [:= :baz]]
;=> true
The syntax isn't as compact as I'd expect though. I'd hope something like
  #{:foo :bar :baz}
could work but I haven't seen this in the docs anywhere. Do I have to set up a custom registry for this?


@smchugh230395 try [:enum :foo :bar :baz]. Doc PRs welcome!

Samuel McHugh09:01:41

I will have a look after work today and make a doc PR. Thanks!