[commit: ghc] master: Allow deriving Typeable for more tycons (92191a3)

Simon Peyton-Jones simonpj at microsoft.com
Wed May 8 11:37:48 CEST 2013


Pedro

Surely should be some user-manual change to go with this?  

Simon

| -----Original Message-----
| From: ghc-commits-bounces at haskell.org [mailto:ghc-commits-
| bounces at haskell.org] On Behalf Of José Pedro Magalhães
| Sent: 07 May 2013 13:27
| To: ghc-commits at haskell.org
| Subject: [commit: ghc] master: Allow deriving Typeable for more tycons
| (92191a3)
| 
| Repository : http://darcs.haskell.org/ghc.git/
| 
| On branch  : master
| 
| https://github.com/ghc/ghc/commit/92191a39a59a036fde4de926e2e322a2c50c84
| cf
| 
| >---------------------------------------------------------------
| 
| commit 92191a39a59a036fde4de926e2e322a2c50c84cf
| Author: Jose Pedro Magalhaes <jpm at cs.ox.ac.uk>
| Date:   Tue May 7 09:16:29 2013 +0100
| 
|     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 7da30d19b..9b82ed6 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
| 
| 
| 
| _______________________________________________
| ghc-commits mailing list
| ghc-commits at haskell.org
| http://www.haskell.org/mailman/listinfo/ghc-commits



More information about the ghc-devs mailing list