On Tue, Dec 04, 2007 at 03:36:20PM +0100, Steffen Mazanek wrote: > Hello, > > I want to quickcheck a property on a datatype representing > programs (=[Stmt]) and need to define a specific instance > > instance Arbitrary [Stmt] > > (mainly to restrict the size of the list). > > In quickcheck an instance Arbitrary of lists is already defined. > Which parameters do I have to give ghc such that it accepts > such an instance? In hugs -98 +o is enough. I have > tried -XOverlappingInstances, -XFlexibleInstances and also > -XIncoherentInstances, however I still got an overlapping > instances error for this declaration.
You shouldn't use lists if you need to have special instance behavior - lists are for perfectly ordinary sequences of things. If a program is just a bunch of unrelated statements, then use [], otherwise use a custom (new)type. Stefan
signature.asc
Description: Digital signature
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
