Fork me on GitHub
#malli
<
2022-01-02
>
ikitommi15:01:56

Updating the README: pulling out malli function schemas from normal clojure functions:

(require '[malli.destructure :as md])

(def infer (comp :schema md/parse))

(defn kikka
  ([a] [a])
  ([a b & cs] [a b cs]))

(->> #'kikka
     meta
     :arglists
     (map infer)
     (map (fn [s] [:=> s :any]))
     (into [:function]))
;[:function
; [:=> [:cat :any] :any] 
; [:=> [:cat :any :any [:* :any]]

👏 1
ikitommi15:01:38

could add a helper to enable that with malli.dev so that one could auto-infer all/interesting Vars at dev-team to get pretty runtime errors + clj-kondo mappings for free too.

ikitommi18:01:05

merged. Before jumping into the-next-thing-I-need, I’ll try to address all PRs. Really good stuff there 🙇

🎉 3
Ben Sless18:01:14

Regarding the string char ranges, @U02AH3D0HEV had a great idea for putting it in a lookup array, great perf

🙏 1
Ben Sless18:01:26

Also experimented with emitting a datomic(like) schema from schema