This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-28
Channels
- # announcements (1)
- # beginners (128)
- # calva (15)
- # cider (1)
- # clerk (4)
- # clj-kondo (10)
- # clojure-berlin (5)
- # clojure-denmark (2)
- # clojure-europe (59)
- # clojure-nl (2)
- # clojure-norway (83)
- # clojure-sweden (3)
- # clojure-uk (4)
- # cursive (11)
- # datomic (8)
- # emacs (13)
- # events (1)
- # hyperfiddle (3)
- # juxt (2)
- # malli (13)
- # nrepl (10)
- # off-topic (46)
- # releases (2)
- # reveal (1)
- # rewrite-clj (6)
- # sci (6)
- # scittle (17)
- # shadow-cljs (2)
- # xtdb (2)
- # yamlscript (8)
https://github.com/borkdude/speculative are specs for clojure.core, is anyone aware of a similar project for malli?
Is there a fn in malli for getting the underlying schema from a parametric schema? For example from [:maybe :int]
get :int
and [:vector :string]
get :string
etc.
Children is a vector and you want the first child, so:
(-> [:maybe :int]
(m/children)
(first))
@U051GFP2V it should return :int
Basically to return the underlying schema, might be from a :<
or any other arbitrarily nested 'parametric' (don't know if this is the correct lingo) schema.
I'm trying to understand what you want, what should [:vector [:maybe [:or :string :int]]]
return?
i don't know to be honest. Maybe [:or :string :int]
or [:string :int]
since that'd be the underlying schema of the element, either string or int.