It’s idiomatic (at least in core clojure) to push type hinting into metadata. I wrote a little library called structural that extends this idea and allows efficient typed destructuring based on user-supplied type hints to emit faster code than the very general polymorphic clojure defaults.
Accordingly, I would think something like destructuring-case could be written as
(destructuring-case (some-function-call)
[^Boolean a [^String b c] & ^Boolean d]
(println [:first a b c d])
[^Boolean a ^{:type (or String Boolean)} b]
(println [:second a b]))
(destructuring-case (some-function-call)
[^Boolean a [^String b c] & ^Boolean d]
(println [:first a b c d])
[^Boolean a ^{:type [String Boolean]} b] ;;maybe vectors denote or, sets denote and
(println [:second a b]))
During macro expansion time, you can then scrape the tags or other relevant typing information from the meta using &form,
(defmacro example [hinted-form & body]
(let [[hinted-form & body] &form] ;;preserves meta
...some-processing))
orchestra’s defn-spec has one variant of including type/spec information (for matching arg vectors).
gradual does more complicated type signatures.
typespec similar idea.
speck another flavor.
dust is an interesting meld of pattern matching and spec.
This is probably considered open research at this point; at least there is no obvious popular choice or default language construct.