Hi all,

I would appreciate it if someone can point me in the right direction with the 
following problem.

I'm deliberately implementing a naive Queues packages that uses finite lists as 
the underlying representation. I've already read through Hughes' paper and the 
article in The Fun of Programming, but I'm still having some difficulties. 
Specifically:

1. I have a newtype Queue a = Queue [a] and I want to generate Queues of random 
Integers that are also of random size. How do I do this in QuickCheck? I guess 
that  I need to write a generator and then make my "Queue a" concrete type an 
instance of Arbitrary? How?

2. If I wanted to specify/constrain the ranges of random Integers generated, 
how would I do this?

3. If I wanted to specify/constrain the Queue sizes how would I do this?

On a separate issue, I also see that QuickCheck 2 has some features not 
discussed anywhere. For example "Coarbitrary" and "shrink" are a bit of a 
mystery to me.

Any code examples for any of the above questions would help greatly.

I've been stuck on this problem for hours. :)

Cheers,

Mark


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to