When testing systems where future events depend on the current state (e.g., a sequence of create, update, and delete operations), using gen/bind can often thwart the shrinking process.
A more robust pattern for generating these sequences is to use a generator that takes an initial state and a reduction function. This allows the generator to produce a sequence of events that are valid according to the state produced by the preceding events.
;; Conceptual pattern for a stateful event generator
(defn gen-events
"""Given an init-state and a reduce function for determining the
current state from a sequence of events, together with a function that takes a state and returns a generator of a new event, returns a generator of sequences of events."""
[reduce-func init-state state->event-gen]
...)