This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-22
Channels
- # aleph (5)
- # announcements (5)
- # babashka (8)
- # beginners (63)
- # biff (43)
- # calva (17)
- # clj-kondo (76)
- # clojure (105)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (40)
- # clojure-uk (4)
- # clojuredesign-podcast (20)
- # clojurescript (35)
- # clr (7)
- # cursive (5)
- # data-science (1)
- # datomic (41)
- # fulcro (14)
- # hyperfiddle (22)
- # malli (12)
- # off-topic (17)
- # re-frame (6)
- # reitit (3)
- # releases (1)
- # ring (2)
- # scittle (1)
- # shadow-cljs (6)
- # specter (3)
- # xtdb (3)
(m/validate
[:schema {:registry {"kikka" :int
:kukka :int
::kakka :int
'kokka :int
`kekka :int}}
[:tuple "kikka" :kukka ::kakka 'kokka `kekka]]
[1 2 3 4 5])
; => true
if you use references, it has type constraints:
((requiring-resolve 'malli.dev/start!))
(m/schema [:ref :kukka])
; =>
-- Schema Error ------------------------------------------------- Thread:1583 --
Invalid Reference
[:ref :kukka]
Reason
Reference should be one of the following
- a qualified keyword, [:ref :user/id]
- a qualified symbol, [:ref 'user/id]
- a string, [:ref "user/id"]
- a Var, [:ref #'user/id]
More information
--------------------------------------------------------------------------------
Execution error (ExceptionInfo) at malli.core/-exception (core.cljc:136).
:malli.core/invalid-ref
@ikitommi Hi,I feel wonderful to read https://www.metosin.fi/blog/transforming-data-with-malli-and-meander and I have a question about what tool was used to get this picture.
thanks! can’t recall, but first thing that the google found, was not a good experience, was throwaway code. Today, I would use https://reactflow.dev/ for that.
Is there a way to make this work? Based on https://github.com/metosin/malli/blob/master/docs/function-schemas.md#function-schemas-1
(=> foo [:=> [:cat :int] :int [:fn (fn [[arg] ret] (= 10 ret))]])
(defn foo [x]
10)
;; errors with Schema has 3 children, expected {:max 2, :min 2}
Seems like tests don't have any test cases for that, so I wonder if the doc just has a issue mentioning a non existing feature
Oh that line was added just last month to the docs
https://github.com/metosin/malli/commit/e34e1fbf6a6bc5b4f136e12b2fe2bd693ea974ea Unreleased
Yeah that feature isn't on 0.14