Fork me on GitHub
#clojure-spec
<
2017-10-18
>
joost-diepenmaat09:10:08

how can I combine two specs like s/or but without the labels so it conforms as a single value?

joost-diepenmaat10:10:17

that’s interesting. thanks @andrewmcveigh

seancorfield17:10:28

@joost-diepenmaat bear in mind that s/nonconforming is undocumented and may disappear. I believe the Clojure/core folks have said the most likely "solution" to this is that they may provide a specific non-conforming version of s/or, rather than exposing general non-conforming machinery... /cc @andrewmcveigh

ikitommi17:10:54

calling s/unform on the conformed value will also remove the branching info.

ikitommi17:10:09

s/nonconforming also stops all conforming, so the conformers on the or branches are not run.

joost-diepenmaat17:10:29

I could possibly use a multi spec. For now I could make it work with a single spec