From 92191a39a59a036fde4de926e2e322a2c50c84cf Mon Sep 17 00:00:00 2001 From: Jose Pedro Magalhaes Date: Tue, 7 May 2013 09:16:29 +0100 Subject: [PATCH] Allow deriving Typeable for more tycons --- compiler/typecheck/TcDeriv.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 7da30d19b156..9b82ed6b3a6a 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -683,7 +683,8 @@ mkEqnHelp :: CtOrigin -> [TyVar] -> Class -> [Type] -> Type mkEqnHelp orig tvs cls cls_tys tc_app mtheta | Just (tycon, tc_args) <- tcSplitTyConApp_maybe tc_app - , isAlgTyCon tycon -- Check for functions, primitive types etc + , className cls == typeableClassName || isAlgTyCon tycon + -- Avoid functions, primitive types, etc, unless it's Typeable = mk_alg_eqn tycon tc_args | otherwise = failWithTc (derivingThingErr False cls cls_tys tc_app