[commit: ghc] ghc-generics: Deprecate -XGenerics. (cb69857)
José Pedro Magalhães
jpm at cs.uu.nl
Mon May 9 14:02:39 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-generics
http://hackage.haskell.org/trac/ghc/changeset/cb698570b2b8ff5da58f0a49f3444b0664425b49
>---------------------------------------------------------------
commit cb698570b2b8ff5da58f0a49f3444b0664425b49
Author: Jose Pedro Magalhaes <jpm at cs.uu.nl>
Date: Mon May 9 11:02:42 2011 +0200
Deprecate -XGenerics.
>---------------------------------------------------------------
compiler/main/DynFlags.hs | 10 ++++------
compiler/typecheck/TcDeriv.lhs | 3 +--
2 files changed, 5 insertions(+), 8 deletions(-)
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
More information about the Cvs-ghc
mailing list