Closed expez closed 8 years ago
You can do (s/conditional odd? s/Int)
, or better (s/constrained s/Int odd?)
(as described in the Readme). FWIW (both Int odd?)
was not valid, you would have to do (s/both s/Int (s/pred odd?))
before so the new ways work more naturally with predicates. For two constraints you could just use two layers of constrained
, or compose them together into a single predicate (s/constrained s/Int (fn pos-odd? [x] (and (pos? x) (odd? x))))
Also, can you please post questions on the mailing list (see the README) rather than as github issues in the future? Thanks!
Thanks, that makes sense!
Also, can you please post questions on the mailing list (see the README) rather than as github issues in the future? Thanks!
Will do!
How do you rewrite
(both Int odd?)
usingconditional
in a way that makes sense? I've been usingpred
to express these but I don't think that's intended. What about something that'sint?
,odd?
andplus?
? Granted such schemas are rare, but there doesn't seem to be any good way to expressevery
.