Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer specs from associative destructurings #13

Open
vemv opened this issue Feb 28, 2019 · 0 comments
Open

Infer specs from associative destructurings #13

vemv opened this issue Feb 28, 2019 · 0 comments

Comments

@vemv
Copy link
Contributor

vemv commented Feb 28, 2019

Given a (speced/defn [{::foo/keys [bar}]), we could observe that the ::foo/bar spec may exist, and add it to the precondition accordingly, against the bar variable.

Note that destructuring may be arbitrarily nested, which calls for a careful implementation.

  • Remember that destructuring has two forms (vector + associative) and that associative destructuring may be applied upon arbitrary values (e.g. (let [{valid-msgs true invalid-msgs false} (group-by some? msgs)] ..)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant