That makes sense, thanks.
To do this as-is, you will either have to provide a leaf generator for
`data` that generates the whole thing in one shot, or use a wrapper
(e.g. `(generators/fmap (fn [d] (update-in d :a #(Math/abs %))))`) to
transform the values . You can find an example of this in the
generators test.
If it's possible, a better approach might be to make your schema more
semantic, like:
(def PositiveDecimal (s/constrained BigDecimal pos?))
(def NegativeDecimal (s/constrained BigDecimal neg?))
(def data {:a PositiveDecimal :b NegativeDecimal}).
Then you might not even need to use custom generators (if the
constraints work as intended), but if desired you can just hang custom
generators on PositiveDecimal and NegativeDecimal, etc. Does that
make sense?
>> > email to
prismatic-plumb...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "Plumbing and Graph: the Clojure utility belt" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
prismatic-plumb...@googlegroups.com.