
27 Oct
2005
27 Oct
'05
6:06 p.m.
This requires {-# OPTIONS_GHC -fallow-undecidable-instances #-} but since I'm using -fglasgow-exts in a lot of places I'm wondering if adding undecidable instances would be a bad habit. I guess not... not until I shoot myself in the foot :-). Any explanation of undecidable instances, the good and the bad? Joel On Oct 27, 2005, at 6:49 PM, Bryn Keller wrote:
How about this?
class ArbitraryDefault a where {}
instance (Integral a, Bounded a, ArbitraryDefault a) => Arbitrary a where arbitrary = arbitraryBound coarbitrary a = error "Not implemented"
instance ArbitraryDefault Word16 instance ArbitraryDefault Word32 instance ArbitraryDefault Word64