Haskell QuickCheck2 using ByteString?
Asked Answered
L

1

11

The RWH books says that to get ByteString support, I need to add:

instance Arbitrary B.ByteString where
    arbitrary   = fmap B.pack arbitrary
    coarbitrary = coarbitrary . B.unpack

But my GHC 7.2 with QuickCheck 2.4.1.1 tells me:

`coarbitrary' is not a (visible) method of class `Arbitrary'

Any pointers?

Loki answered 13/11, 2011 at 18:39 Comment(0)
G
10

coarbitrary has moved to it's own typeclass CoAbritary in QC 2.0, so simply just remove the equation for coarbitrary.

Also see the latest documentation.

Gadson answered 13/11, 2011 at 18:52 Comment(1)
Thanks. I'm afraid the latest API documentation hasn't helped me much. It is all mumbo-jumbo without some higher level context. A lot of other documentation is also out of date. Very curious for what is supposedly a very popular test package.Loki

© 2022 - 2024 — McMap. All rights reserved.