Some kinds of operations on specs are currently hard to implement as there is no uniform way to find what "child" specs are being composed by a spec. Examples:
* Dependency analysis
* Deep describe (show all specs used by a top-level spec)
* Detection of missing or invalid spec names
For example, given:
(s/def ::user-id int?)
(s/def ::user (s/keys :req [::userid])) ;; note misspelling
(s/valid? ::user {::userid "Jim"}) ;; => true but expect false
And the means to determine the "child" specs of ::user, a linter could check whether all of the keys in s/keys are specs that have been defined.
*Workarounds:*
1. {{form}} can be used to get the original spec form, but that must then be further interpreted (and is missing the original lexical environment in which it was created). Example attempt:
https://gist.github.com/ericnormand/6cfe6809beeeea3246679e904372cca0
2. Spec form specs (CLJ-2112) are not available yet, but could be used to get a parsed representation of specs, which would still require some processing but would at least have known forms.
*Proposed:*
Add a mechanism to get the "child" specs a spec is composed of. Each spec implementation could then choose how to implement this in the appropriate way.