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

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to