I'm using FsCheck to make a generator to create fake database records. Depending upon the field in question it uses chooseFromList, or generators for ints, floats, etc.
However, one troublesome field is a primary key field that must be sequential. I.e. put 1 in the first record generated, 2 in the second record generated, etc. After I generate a passel of records, I'll use them to impersonate a database table in my software under test.
Every solution my FORTRAN-brain dreams up seems evil, impure, and procedural. But I believe this is a problem that smarter FsCheck users than I have engaged. Could this be a use-case for functors or monads...