[Haskell-cafe] Re: Coarbitrary

Nils Anders Danielsson nad at cs.chalmers.se
Thu Oct 27 14:53:09 EDT 2005


On Thu, 27 Oct 2005, Shae Matijs Erisson <shae at ScannedInAvian.com> wrote:

> Joel Reymont <joelr1 at gmail.com> writes:
>
>> I could not understand how to define this for arbitraries of my
>> choosing and Shae seems to have defined coarbitrary = error "Not
>> implemented" :-).
>
> Coarbitrary is for generator transformers, see section 3.3 on page 5 of
> the original paper http://www.md.chalmers.se/~koen/Papers/quick.ps

You need coarbitrary for Word32 if you want to generate arbitrary
functions of type Word32 -> <something>.

As you will see in the QuickCheck paper Coarbitrary instances can
(often) be defined mechanically. I think QuickCheck 2 includes default
coarbitrary methods implemented using generic classes
(http://haskell.org/ghc/docs/latest/html/users_guide/generic-classes.html).

-- 
/NAD



More information about the Haskell-Cafe mailing list