+cond_enumOrProduct :: Condition
+cond_enumOrProduct = cond_isEnumeration `orCond`
+ (cond_isProduct `andCond` cond_noUnliftedArgs)
+
+cond_noUnliftedArgs :: Condition
+-- For some classes (eg Eq, Ord) we allow unlifted arg types
+-- by generating specilaised code. For others (eg Data) we don't.
+cond_noUnliftedArgs (_, tc)
+ | null bad_cons = Nothing
+ | otherwise = Just why
+ where
+ bad_cons = [ con | con <- tyConDataCons tc
+ , any isUnLiftedType (dataConOrigArgTys con) ]
+ why = ptext (sLit "Constructor") <+> quotes (ppr (head bad_cons))
+ <+> ptext (sLit "has arguments of unlifted type")
+