-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support :fn args #6
Comments
what about using metas for that? (ds/defn ^::ds/fn (fn [{:keys [args ret]}] (> ret (first args)))
increment :- int?
[x :- int?]
(inc x)) or even use a conditions-map syntax: (ds/defn increment :- int? [x :- int?]
{:fn (fn [{:keys [args ret]}] (> ret (first args)))}
(inc x)) |
(Great job on the lib BTW! =)) |
I think using metas is a good idea. Orchestra does the same: ; :fn specs can be specified using the fn's meta map.
(defn-spec my-abs number?
{:fn #(= (:ret %) (-> % :args :n))}
[n number?]
(Math/abs n)) @danielcompton I am really missing this feature as it forces me to duplicate fn specs with |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
No description provided.
The text was updated successfully, but these errors were encountered: