
13 Jul
2013
13 Jul
'13
4:56 a.m.
On Sat, 13 Jul 2013 10:10:39 +0200
martin
This requires HashedList to be a new type, right? So far my code only used type synonyms.
Does this mean I have to convert type synonyms into types in order to use QuickCheck?
Does this mean I have to "plan for QuickCheck" when I design my types?
You can still create your own Gen manually and have several generators
for different 'types'.
You will need to use 'forAll' combinator to perform the testing like this:
data A
type ListA = [A]
type OtherListA = [A]
genListA :: Gen ListA
genOtherListA :: Gen OtherListA
checkListA :: ListA -> Property
checkOtherListA :: OtherListA -> Property
prop1 = forAll genListA checkListA
prop2 = forAll genOtherListA checkOtherListA
--
Aleksey Uymanov