Fork me on GitHub
#malli
<
2021-08-19
>
ikitommi05:08:06

an inline/hidden :and would be my first guess, something like:

[:* [:and [:repeat {:min 2, :max 2} :int] [:fn (fn [[x y]] (= x y))]]]

ikitommi05:08:37

:and is already weird, as the first thing is used in utilities. I guess this is the reason why Schema named it constrained. One Schema + constraints. Not “all the schmas”

Ben Sless13:08:52

was hoping to avoid fn

ikitommi13:08:39

I think it’s the same thing as key-relations for maps, but… sequence relations instead.

ikitommi13:08:22

malli + meander here could look like:

[:* 
 [:and 
  [:repeat {:min 2, :max 2} :int] 
  [:relations 
   '[?min ?max] 
   '[:= ?min ?max]]

ikitommi13:08:19

and maps:

[:and
 [:map
  [:min :int]
  [:max :int]]
 [:relations 
  '{:min ?min, :max ?max} 
  '[:> ?min ?max]]]

Ben Sless13:08:15

with catn it's exactly the same

kenny15:08:55

Malli often prefixes function names with -. Often this implies a private or internal function, yet lots of - functions are used and encouraged. What is the meaning behind the - prefix in the Malli codebase?

emccue15:08:38

"read the docs"/"experts only"

kenny15:08:45

I've read the docs several times and missed that section each time 🙂 Thanks. fwiw, those functions do not seem like "experts only." They have been critical to our use of Malli.

👍 3