GeneralizedNewtypeDeriving: "deriving ALL"
|Reported by:||clinton||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
I've found I've wanted to do:
newtype X1 = X1 ( X ) deriving ( ALL ); newtype X2 = X2 ( X ) deriving ( ALL );
When I want X1, X2 to behave like X, but I might later want to add them to different instances, i.e.
class Silly a
- a -> a
instance Silly X1 where
double x = 2 * x
instance Silly X2 where
double x = 3 * x -- Silly double
Currently, it seems to be the only way to do this is to dig into the source of X and find every instance it has. It would be nice to be able to simply to "deriving ALL" to make XN in "newtype XN = XN X" behave exactly the same as X.