Fork me on GitHub
#malli
<
2021-08-11
>
steveb8n00:08:20

@ikitommi I haven鈥檛 tested but would the new release be likely to improve this perf issue? https://gist.github.com/stevebuik/e63735d99fca94041120f9b0e25b616d

Ben Sless05:08:17

tried it out of curiosity, looks like it was improved

馃憦 3
Karol W贸jcik08:08:46

What is wrong with this schema?

(def logger-pairs-schema
  [:+ [:tuple keyword? string?]])

(defn pairs-conforms!
  {:malli/schema [:=>
                  [:cat [logger-pairs-schema]]
                  nil?
                  ;; [:or [nil? logger-pairs-schema]]
                  ]}
  [pairs]


  )

Karol W贸jcik08:08:49

:malli.core/invalid-schema {:schema [:+ [:tuple #function[clojure.core/keyword?] #function[clojure.core/string?--5427]]]}
I don't understand why this throws an error

Karol W贸jcik08:08:02

This is thrown from the new reported

(ns dev                                 
  (:require                             
   [malli.dev :as dev]                  
   [malli.dev.pretty :as pretty]))      
                                        
(dev/start! {:report (pretty/reporter)})

Ben Sless09:08:33

Try not wrapping logger pairs schema in a vector?

Karol W贸jcik10:08:11

I don't get it.

(m/validate logger-pairs-schema [[:x "something"]]) => true 
@ikitommi isn't it a bug?

ikitommi11:08:08

no, just an extra vector:

(m/schema [:cat [[:+ [:tuple keyword? string?]]]])
; =throws=> :malli.core/invalid-schema 

(m/schema [:cat [:+ [:tuple keyword? string?]]])
; => => [:cat [:+ [:tuple keyword? string?]]]

ikitommi11:08:09

we could make the pretty printer capture schema-creation errors too in dev.

ikitommi11:08:40

same result thou, just more fun with colors 馃寛 !

emccue17:08:08

(mg/generate [:cat string? int?])
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:79).
:malli.core/invalid-schema {:schema :cat}

emccue17:08:16

is there some context i'm missing?

emccue17:08:22

cat doesn't seem to want to be a valid schema

emccue17:08:57

nvm - seem to have had a really old version floating around the classpath