Fork me on GitHub
#malli
<
2023-03-29
>
simonacca13:03:27

Hi all, wondering how to check that an object is of a certain type with Malli. This certainly works, but is there a more idiomatic way?

(deftype Car [])
(def schema (malli/-simple-schema {:pred #(-> % type (= Car))}))
(malli/validate schema  (Car. ))

delaguardo14:03:55

[:fn #(instance? Car %)]

👍 2