Your property requires three inputs: a function, an element and a list. The problem is that QuickCheck does not know how to deal with functions in general.
One of the things QuickCheck needs to work, is the ability to write failing test cases to the console. For this, it needs values it can turn into a String
--anything in the Show
class. Since functions are not in Show
, it can't use them for inputs. That's where your error message comes from.
In general, using randomly generated functions for testing is going to be pretty tricky. I'd just write some concrete functions instead and let QuickCheck randomly generate the starting value and the list of elements.