11

RWH 书籍说要获得 ByteString 支持,我需要添加:

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

但是我的带有 QuickCheck 2.4.1.1 的 GHC 7.2 告诉我:

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

任何指针?

4

1 回答 1

10

coarbitraryCoAbritary在 QC 2.0 中已移至其自己的类型类,因此只需删除coarbitrary.

另请参阅最新文档

于 2011-11-13T18:52:35.113 回答