Closed AWinterman closed 3 months ago
you can compose the sequence with :and
+ :fn
like:
(mg/sample [:and [:vector {:gen/min 4, :gen/max 4} [:int {:min 0}]] [:fn (partial apply <)]])
;([1 1919 1267759024631 2123746214464]
; [1647168068 21396962994 1791026298764950 12656959539819441]
; [6 29 47 56]
; [705 1072 11424 3783976]
; [348 7180 48608 625266]
; [1 3 49 710]
; [0 1 2 27]
; [2 32 37 457]
; [3053 119063 324145657 529195926540]
; [1 2308 2561 3373])
I'm wondering if I can represent a sequence of maps with a non-decreasing value.
For example:
I can't quite see how i'd do this except through a :fn field in the parent schema. Is that the way?