This can't work, but there's a good reason why.
Think of state machine testing as automatic writing a test programs, where each Var a Symbolic
as a binding in the program.
So imagine I was testing a little buffer, with operations create :: Size -> Buf
, put :: Buf -> Int -> IO ()
and get :: Buf -> IO Int
.
I could hand roll a unit test.
test :: TestT IO ()
test = do
buf <- create 3
put buf 5
put buf 10
put buf 20
retrieved <- get buf
retrieved === Just 5
with appropriate commands, hedgehog could also generate this exact test as
test :: TestT IO ()
test = do
Var 1 = create 3
Var 2 = put (Var 1) 5
Var 3 = put (Var 1) 10
Var 4 = put (Var 1) 20
Var 5 = get (Var 1)
Var 5 === Just 5
So each execution is given a variable name.
When you way you want something like this:
splitNames :: Var [UUID] v -> [Var UUID v]
What you're asking for is essentially each return from the execution list to be given its own variable name. The rest of the program could then use those variable names. The best way I can think to show this is:
test :: TestT IO ()
test = do
Var 1 = returnSomeNumberOfItems
Var 2 = Var 1 ! 0
Var 3 = Var 1 ! 1
Now the issue here is that we just don't know how long the list returned by returnSomeNumberOfItems
is; we haven't run it yet; there's no way to do this safely.