[Haskell-cafe] QuickCheck

Yitzchak Gale gale at sefer.org
Mon Mar 17 06:30:26 EDT 2008

Sebastian Sylvan:
>> featureGenNormal = do
>>     id <- stringGen
>>     name <- stringGen
>>     featuretype <- arbitrary
>>     grouptype <- arbitrary
>>     children <- arbitrary
>>     properties <- listGen stringGen
>>     return (Feature id name featuretype grouptype children properties)

Ryan Ingram wrote:
>  Also, you can shorten this significantly with liftM or ap (from Control.Monad):

True, but in this case I like being able to see meaningful
names for each parameter of the constructor.

More information about the Haskell-Cafe mailing list