I\'m learning the ropes of QuickCheck >= 2.6 but I don\'t understand what a shrink is. From looking at the type signature shrink looks more like expand! Please illuminate me :)<
A single shrink
is a stepwise reduction in complexity of some Arbitrary
test case (an "immediate shrink"). This might be something like 2 -> 1
or 1:[] -> []
. For more complex types there may be multiple ways to "incrementally shrink" a type so you specify all of them in a list.
For example, trees might be shrunk by removing any one leaf, thus if there are n
leaves then shrink produces a list of length n
.