
25 Apr
2010
25 Apr
'10
6:40 p.m.
On Mon, Apr 26, 2010 at 06:47:27AM +1000, Ivan Lazar Miljenovic wrote:
My main problem with this is if you want a custom variant of that instance. Let's take FGL graphs for example with instances for QuickCheck's Arbitrary class. Maybe you want arbitrary graphs that are simple, or maybe multiple edges are fine. Even when considering Arbitrary instances for something like String you may wish to have a custom variant that makes sense for what you're testing.
Being able to use different instances in different contexts would be handy, and there have been some proposed extensions to allow this. But in the current state of Haskell, orphan instances are unworkable -- they invariably lead to trouble sooner or later.