quickcheck-higherorder
quickcheck-higherorder copied to clipboard
Bad variable naming for functions with 2 arguments
> quickCheck' $ property' $ \(foo :: Int -> Int -> Int) -> foo 2 1 == foo 1 2
*** Failed! Falsified (after 3 tests and 10 shrinks):
\a0 -> case a0 :: Int of { 1 -> \a0 -> 0 ; _ -> \a0 -> 1 }
The counter example gives both arguments the name a0!
Yeah that's definitely a problem.
That's hard to fix because this is currently using Show, and an instance Show a => Show (Int -> a) gives no way of telling a what names to use.
There are various non-ideal solutions (a different class, overlapping instances); I'll have to think about the trade-offs...
Suggestions welcome!
An unsafePerformIO that updates a global name counter somewhere? :)