Prerequisites that are hard to come by creating random test cases are often a bad idea in QuickCheck. Instead, you should use generators to create test cases that automatically satisfy the precondition.
For example, in this case, you can use forAll to generate a second list with the same length as the first list:
prop_zip' (xs :: [a]) = forAll (vectorOf (length xs) arbitrary) $ \ (ys :: [a]) -> unzip (zip xs ys) == (xs, ys)
(I also use ScopedTypeVariables here to determine the type of the second list. You might want to change this to suit your specific needs.)
source share