-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedHelp most welcomeHelp most welcome
Description
:altis like:orexcept any regex child makes it transforming:catis like:tupleexcept any regex child makes it transforming- leave all others as transforming
Relevant examples:
(let [s [:cat :keyword [:alt [:vector :any] [:+ :int]]]
v [:k 1 2 3]
roundtrip #(->> % (m/parse s) (m/unparse s))]
(list v (roundtrip v)))
;; => ([:k 1 2 3] [:k [1 2 3]])
(def Hiccup ; (leaf node)
[:cat :keyword [:? [:maybe [:map-of :keyword :any]]] [:* string?]])
(m/parse Hiccup [:div "edge" "case"])
;; => [:div nil ["edge" "case"]]
(let [v [:div "edge" "case"]]
(= v (->> v (m/parse Hiccup) (m/unparse Hiccup))))
;; => false
(map (m/parser [:cat :int [:? [:maybe :int]] :int])
[[1 2 3]
[1 3]
[1 nil 3]])
;; => ([1 2 3] [1 nil 3] [1 nil 3])
(m/parse [:cat :int [:cat :int]]
[1 2])
;; => [1 [2]]
(m/parse [:and
[:orn [:v vector?] [:l list?]]
[:cat :keyword [:* :any]]]
[:x])
;; => Execution error (ExceptionInfo) at malli.core/-exception (core.cljc:203).
;; :malli.core/and-schema-multiple-transforming-parsersExtracted from: https://clojurians.slack.com/archives/CLDK6MFMK/p1760419966575209
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedHelp most welcomeHelp most welcome
Type
Projects
Status
Not right now