Fork me on GitHub
#malli
<
2021-09-20
>
ikitommi16:09:19

(assert
  (= (m/form [:=> [:cat :int] :int])
     (m/form {:type :=>
              :input {:type :cat
                      :children [{:type :int}]}
              :output {:type :int}}))
  "malli supports both hiccup & map syntax")

👍 6
eskos07:09:42

Is this unified in the sense that all hiccup gets internally turned into maps and then whatnot or two separate paths? Just trying to think onwards whether this could actually be a cause of sneaky conversion bugs in the long run…

eskos07:09:05

(I haven’t looked into malli internals in ages so judging a single commit diff doesn’t answer that to me)

ikitommi05:09:16

there is just one path, currently the map-syntax (the new ast) is transformed into properties children and thus, the old code path is used.

👍 2
ikitommi05:09:42

I’ll most likely reverse that, so the default path is the AST, just a hiccup->ast converter is just mechanical.

ikitommi05:09:10

why? the ast-path is much faster (with maps), as there is no parsing needed. if real life projects, seen 10x diffrence, 100ms vs 1sec to load all the hundreds of schemas in a slow device.

ikitommi05:09:14

also, the example was broken, the conversion was nor recursive, fixed inline.