From: Jose Pedro Magalhaes Date: Mon, 9 May 2011 09:02:42 +0000 (+0200) Subject: Deprecate -XGenerics. X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=cb698570b2b8ff5da58f0a49f3444b0664425b49;hp=811746d7b3462b62aa233a17e778c1de1d0817dd Deprecate -XGenerics. --- diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index ea10993..873b846 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -343,8 +343,8 @@ data ExtensionFlag | Opt_DeriveTraversable | Opt_DeriveFoldable | Opt_DeriveGeneric -- Allow deriving Generic/1 - | Opt_DefaultSignatures -- Allow extra signatures for defmeths - | Opt_Generics -- Generic deriving mechanism + | Opt_DefaultSignatures -- Allow extra signatures for defmeths + | Opt_Generics -- Old generic classes, now deprecated | Opt_TypeSynonymInstances | Opt_FlexibleContexts @@ -1640,7 +1640,8 @@ xFlags = [ ( "ParallelArrays", Opt_ParallelArrays, nop ), ( "TemplateHaskell", Opt_TemplateHaskell, checkTemplateHaskellOk ), ( "QuasiQuotes", Opt_QuasiQuotes, nop ), - ( "Generics", Opt_Generics, nop ), + ( "Generics", Opt_Generics, + \ _ -> deprecate "it does nothing; look into -XDefaultSignatures and -XDeriveGeneric for generic programming support." ), ( "ImplicitPrelude", Opt_ImplicitPrelude, nop ), ( "RecordWildCards", Opt_RecordWildCards, nop ), ( "NamedFieldPuns", Opt_RecordPuns, nop ), @@ -1749,9 +1750,6 @@ impliedFlags , (Opt_RecordWildCards, turnOn, Opt_DisambiguateRecordFields) , (Opt_ParallelArrays, turnOn, Opt_ParallelListComp) - -- The new behavior of the XGenerics flag is just to turn on these two flags - , (Opt_Generics, turnOn, Opt_DefaultSignatures) - , (Opt_Generics, turnOn, Opt_DeriveGeneric) ] optLevelFlags :: [([Int], DynFlag)] diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index ffd7bac..4d80631 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -940,8 +940,7 @@ sideConditions mtheta cls | cls_key == traversableClassKey = Just (checkFlag Opt_DeriveTraversable `andCond` cond_functorOK False) | cls_key == genClassKey = Just (cond_RepresentableOk `andCond` - (checkFlag Opt_DeriveGeneric `orCond` - checkFlag Opt_Generics)) + checkFlag Opt_DeriveGeneric) | otherwise = Nothing where cls_key = getUnique cls