I'm a bit confused by malli.core/unparse. I'm finding that literal data equal to the result of malli.core/parse cannot be unparsed. Is that intentional?
(def int-or-string [:orn [:int :int] [:str :string]])
(malli.core/parse int-or-string 1) ;; -> [:int 1]
(malli.core/unparse int-or-string [:int 1]) ;=> :malli.core/invalid
(->> 1
(malli.core/parse int-or-string)
(malli.core/unparse int-or-string)) ;; => 1unfortunately that's not a vector, it's a malli tagged value
(malli.core/unparse int-or-string (malli.impl.util/-tagged :int 1))
;; => 1oh, it's actually not a tagged value, it's a MapEntry!
(class (malli.core/parse int-or-string 1))
;; => clojure.lang.MapEntryregardless, I think vectors of size 2 should work. could you submit an issue?
ah, -tagged just returns a MapEntry
the impl of the orn unparser expects a -tagged
https://github.com/metosin/malli/blob/0680cdde7ac476e0dc2350ff6dc0bed3b5f4b50f/src/malli/core.cljc#L874