This means the shrinker for commands has no context available at all. When we take shrinking serious, this is quite a limitation. I've been trying to workaround this in a million different ways but I get stuck each time.
I propose that we generalize the type to
shrinker :: model Symbolic -> cmd Symbolic -> [cmd Symbolic]
so that the shrinker has the context available. Initially I thought that this would make shrinking more expensive, which is why I didn't go down this route before. But thinking about it more I now realize that this is not actually true: after all, shrinking is always followed by a validation step, so we compute the model anyway for all shrinks.
What this means is that shrinking cannot be the current shrinkList-then-validCommands; instead it must combine the two.
@stevana I will start working on a patch to do this. If you think this is a terrible idea, let me know ASAP, but I think it will make the library more general, without making shrinking more expensive.
At the moment, the type of the shrinker is
This means the shrinker for commands has no context available at all. When we take shrinking serious, this is quite a limitation. I've been trying to workaround this in a million different ways but I get stuck each time.
I propose that we generalize the type to
so that the shrinker has the context available. Initially I thought that this would make shrinking more expensive, which is why I didn't go down this route before. But thinking about it more I now realize that this is not actually true: after all, shrinking is always followed by a validation step, so we compute the model anyway for all shrinks.
What this means is that shrinking cannot be the current
shrinkList
-then-validCommands
; instead it must combine the two.@stevana I will start working on a patch to do this. If you think this is a terrible idea, let me know ASAP, but I think it will make the library more general, without making shrinking more expensive.