This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-20
Channels
- # announcements (10)
- # aws (4)
- # babashka (71)
- # beginners (30)
- # calva (61)
- # cherry (1)
- # cider (16)
- # clj-kondo (3)
- # clj-on-windows (4)
- # cljsrn (1)
- # clojure (28)
- # clojure-austin (2)
- # clojure-bay-area (1)
- # clojure-europe (45)
- # clojure-hungary (1)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-sweden (14)
- # clojure-uk (11)
- # clojurescript (39)
- # core-async (3)
- # core-typed (11)
- # datomic (68)
- # fulcro (7)
- # keechma (1)
- # lsp (29)
- # malli (5)
- # off-topic (57)
- # other-languages (13)
- # pathom (4)
- # rdf (7)
- # reagent (7)
- # reitit (6)
- # releases (1)
- # schema (8)
- # shadow-cljs (86)
- # sql (22)
- # squint (1)
- # vim (8)
- # xtdb (12)
try to answer both here:
• if you you a regex schema inside a regex schema, it get’s inlined, so you can create a “flat” list using those
• non-regex schemas just take one slot in the regex schema, so:
◦ [:orn [:s :string] [:bs [:+ :boolean]]
is “a string or 1+ booleans” taking 1 slot
◦ [:altn [:s :string] [:bs [:+ :boolean]]
is the same but if used inside a regex schema, the :+
get’s inlined
◦ you can’t inline a :ref
in the regex schema
◦ wrapping any schema into :schema
makes it “normal schema” and thus, it takes just one slot in the regex (`:ref` and regex schemas)
I see, thank you 🙂
when I'm using malli in a terminal like setting, I kind of want the pretty explain output reversed from how it is seen on a webpage: https://github.com/valyagolev/malli/blob/c7c22a8fefd3a8491a35e1e320ab620791c4500c/src/malli/dev/pretty.cljc#L37-L40
since the bottom is closest to what I'm looking at, and the top stuff I might have to scroll up to see. luckily I'm able to call this whole defmethod
myself, but maybe it's common enough that other people would find it useful to have a function in that namespace to set explain to "console" mode?
console-mode sound good. Also, color themes (none/light/dark/custom) + html-emitting mode (for react error boundaries etc). How different would the :console
mode be from the normal? All mm-methods should be different? just the one? some amount of config can be done via adding configuration options to the printer
(it’s backed by a map), but if it’s totally different (the html-mode could be), then another mm & ns might be better.
I'm currently just rearranging the blocks (and removing the "more info" block):
(defmethod v/-format ::m/explain
...
(-block "Schema:"
(-block "Value:"
(-block "Errors:"
only other thing I might change is the amount of whitespace. there's like 3 blank lines after the error, I might reduce to 1 line. mayyybe remove blank lines after the Schema:
, Value:
, Errors:
section titles and content, but that could make it less readableconsole-mode sound good. Also, color themes (none/light/dark/custom) + html-emitting mode (for react error boundaries etc). How different would the :console
mode be from the normal? All mm-methods should be different? just the one? some amount of config can be done via adding configuration options to the printer
(it’s backed by a map), but if it’s totally different (the html-mode could be), then another mm & ns might be better.