Fork me on GitHub
#malli
<
2024-06-28
>
mkvlr08:06:24

https://github.com/borkdude/speculative are specs for clojure.core, is anyone aware of a similar project for malli?

👀 1
mkvlr11:06:10

this this expected (malli.provider/provide {:foo :bar}) ;; => [:vector :keyword]?

Ben Sless11:06:36

The argument is a seq of samples

Ben Sless11:06:27

So provide iterates over the entries

Ben Sless11:06:40

Pass [{,,,} ,,,]

☝️ 1
Nikolas Pafitis23:06:55

Is there a fn in malli for getting the underlying schema from a parametric schema? For example from [:maybe :int] get :int and [:vector :string] get :string etc.

escherize03:06:03

Hmm, what should it do for [:vector [:maybe :int]]?

ikitommi06:06:49

Children is a vector and you want the first child, so:

(-> [:maybe :int]
    (m/children)
    (first))

Nikolas Pafitis11:06:13

@U051GFP2V it should return :int

Nikolas Pafitis11:06:16

Basically to return the underlying schema, might be from a :< or any other arbitrarily nested 'parametric' (don't know if this is the correct lingo) schema.

escherize13:06:42

I'm trying to understand what you want, what should [:vector [:maybe [:or :string :int]]] return?

Nikolas Pafitis16:06:40

i don't know to be honest. Maybe [:or :string :int] or [:string :int] since that'd be the underlying schema of the element, either string or int.