Fork me on GitHub
#malli
<
2021-03-30
>
Adam Helins07:03:40

Is there a way of generating sorted maps using :map-of ? Spec allows that and it is indeed very useful when working with sorted colls.

nilern14:03:47

I don't think there is any support for sorted colls specifically

Adam Helins19:03:13

Interesting, i can't find anything, no issue, nothing in the codebase...

nilern08:04:31

It never comes up in input validation and our DbC story is not really there yet. Whereas Spec was basically created for DbC and third party tools are needed for most other things.

Adam Helins13:03:58

Hmmm, took me a while to realise that was a source of error and I cannot seem to find how to merge such maps:

[:merge
 [:map [:a :int]]
 [:and
  [:map [:b int]]
  [:fn some-pred]]]
The problem is that the second map is enclosed by [:and] , and Malli doesn't seem to understand that it is ultimately a map, meaning that :merge does not behave like it is merging 2 maps. How can I merge them while keeping that custom predicate?

Adam Helins19:03:31

Excellent, once again @U055NJ5CC saves the day

ikitommi13:03:27

shipped in 0.4.0 now

👍 3