[Haskell-cafe] QuickCheck

rodrigo.bonifacio rodrigo.bonifacio at uol.com.br
Mon Mar 17 09:37:59 EDT 2008


Hi all,

Is it possible to define a limit for the size of children list bellow? 

I've tried:

children <- resize (10 (listGen featureGenNormal))

But it didn't work.

Thanks a lot,

Rodrigo.


> 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.
> 

-----------------------------------
Rodrigo Bonifácio de Almeida
Universidade Católica de Brasília
 - Grupo de Engenharia de Software
 - JavaComBr (www.ucb.br/java)



More information about the Haskell-Cafe mailing list