Currently when generating a Fun Char .., we need both Perturb Char and Function Char: the Perturb is necessary to generate the original random function, and Function is necessary to then reify this function. The strange thing is that when we then shrink the reified function, we might end up Perturbing at a different type (in this case, Int, because the Function instance for Char is defined in terms of the Function instance for Int.
This is confusing and annoying; for example, it might be beneficial to improve the Perturb instance for Char so that common characters get a shorter Focus; but that's not possible, since the instance for Char is only used for the initial value of the function, not during shrinking, so we're not actually getting much benefit.
Currently when generating a
Fun Char ..
, we need bothPerturb Char
andFunction Char
: thePerturb
is necessary to generate the original random function, andFunction
is necessary to then reify this function. The strange thing is that when we then shrink the reified function, we might end upPerturb
ing at a different type (in this case,Int
, because theFunction
instance forChar
is defined in terms of theFunction
instance forInt
.This is confusing and annoying; for example, it might be beneficial to improve the
Perturb
instance forChar
so that common characters get a shorterFocus
; but that's not possible, since the instance forChar
is only used for the initial value of the function, not during shrinking, so we're not actually getting much benefit.