[commit: ghc] ghc-8.4: template-haskell: Rip out FamFlavour (cd4d830)
git at git.haskell.org
git at git.haskell.org
Mon Dec 4 21:14:31 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.4
Link : http://ghc.haskell.org/trac/ghc/changeset/cd4d83049143e01ff576b1691765aa71ff7c43cf/ghc
>---------------------------------------------------------------
commit cd4d83049143e01ff576b1691765aa71ff7c43cf
Author: Ben Gamari <ben at smart-cactus.org>
Date: Mon Dec 4 13:50:36 2017 -0500
template-haskell: Rip out FamFlavour
>---------------------------------------------------------------
cd4d83049143e01ff576b1691765aa71ff7c43cf
compiler/prelude/THNames.hs | 12 ------
libraries/ghci/GHCi/TH/Binary.hs | 1 -
libraries/template-haskell/Language/Haskell/TH.hs | 2 +-
.../template-haskell/Language/Haskell/TH/Lib.hs | 3 +-
.../Language/Haskell/TH/Lib/Internal.hs | 48 ----------------------
.../template-haskell/Language/Haskell/TH/Ppr.hs | 5 ---
.../template-haskell/Language/Haskell/TH/Syntax.hs | 3 --
7 files changed, 2 insertions(+), 72 deletions(-)
diff --git a/compiler/prelude/THNames.hs b/compiler/prelude/THNames.hs
index 068f01f..f45b3b5 100644
--- a/compiler/prelude/THNames.hs
+++ b/compiler/prelude/THNames.hs
@@ -137,8 +137,6 @@ templateHaskellNames = [
ruleVarName, typedRuleVarName,
-- FunDep
funDepName,
- -- FamFlavour
- typeFamName, dataFamName,
-- TySynEqn
tySynEqnName,
-- AnnTarget
@@ -517,11 +515,6 @@ typedRuleVarName = libFun (fsLit ("typedRuleVar")) typedRuleVarIdKey
funDepName :: Name
funDepName = libFun (fsLit "funDep") funDepIdKey
--- data FamFlavour = ...
-typeFamName, dataFamName :: Name
-typeFamName = libFun (fsLit "typeFam") typeFamIdKey
-dataFamName = libFun (fsLit "dataFam") dataFamIdKey
-
-- data TySynEqn = ...
tySynEqnName :: Name
tySynEqnName = libFun (fsLit "tySynEqn") tySynEqnIdKey
@@ -1031,11 +1024,6 @@ interruptibleIdKey = mkPreludeMiscIdUnique 432
funDepIdKey :: Unique
funDepIdKey = mkPreludeMiscIdUnique 440
--- data FamFlavour = ...
-typeFamIdKey, dataFamIdKey :: Unique
-typeFamIdKey = mkPreludeMiscIdUnique 450
-dataFamIdKey = mkPreludeMiscIdUnique 451
-
-- data TySynEqn = ...
tySynEqnIdKey :: Unique
tySynEqnIdKey = mkPreludeMiscIdUnique 460
diff --git a/libraries/ghci/GHCi/TH/Binary.hs b/libraries/ghci/GHCi/TH/Binary.hs
index ae6bc9f..58e626c 100644
--- a/libraries/ghci/GHCi/TH/Binary.hs
+++ b/libraries/ghci/GHCi/TH/Binary.hs
@@ -44,7 +44,6 @@ instance Binary TH.Body
instance Binary TH.Match
instance Binary TH.Fixity
instance Binary TH.TySynEqn
-instance Binary TH.FamFlavour
instance Binary TH.FunDep
instance Binary TH.AnnTarget
instance Binary TH.RuleBndr
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index fd5c06f..213c70e 100644
--- a/libraries/template-haskell/Language/Haskell/TH.hs
+++ b/libraries/template-haskell/Language/Haskell/TH.hs
@@ -73,7 +73,7 @@ module Language.Haskell.TH(
SourceUnpackedness(..), SourceStrictness(..), DecidedStrictness(..),
Bang(..), Strict, Foreign(..), Callconv(..), Safety(..), Pragma(..),
Inline(..), RuleMatch(..), Phases(..), RuleBndr(..), AnnTarget(..),
- FunDep(..), FamFlavour(..), TySynEqn(..), TypeFamilyHead(..),
+ FunDep(..), TySynEqn(..), TypeFamilyHead(..),
Fixity(..), FixityDirection(..), defaultFixity, maxPrecedence,
PatSynDir(..), PatSynArgs(..),
-- ** Expressions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
index 9ad36f8..dbf01f1 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
@@ -88,9 +88,8 @@ module Language.Haskell.TH.Lib (
roleAnnotD,
-- **** Type Family / Data Family
dataFamilyD, openTypeFamilyD, closedTypeFamilyD, dataInstD,
- familyNoKindD, familyKindD, closedTypeFamilyNoKindD, closedTypeFamilyKindD,
newtypeInstD, tySynInstD,
- typeFam, dataFam, tySynEqn, injectivityAnn, noSig, kindSig, tyVarSig,
+ tySynEqn, injectivityAnn, noSig, kindSig, tyVarSig,
-- **** Fixity
infixLD, infixRD, infixND,
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs b/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
index d58ce84..4496ecd 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
@@ -12,8 +12,6 @@
-- relegate as many changes as we can to just the Internal module, where it
-- is safe to break things.
-{-# LANGUAGE CPP #-}
-
module Language.Haskell.TH.Lib.Internal where
import Language.Haskell.TH.Syntax hiding (Role, InjectivityAnn)
@@ -529,45 +527,6 @@ closedTypeFamilyD tc tvs result injectivity eqns =
eqns1 <- sequenceA eqns
return (ClosedTypeFamilyD (TypeFamilyHead tc tvs1 result1 injectivity) eqns1)
--- These were deprecated in GHC 8.0 with a plan to remove them in 8.2. If you
--- remove this check please also:
--- 1. remove deprecated functions
--- 2. remove CPP language extension from top of this module
--- 3. remove the FamFlavour data type from Syntax module
--- 4. make sure that all references to FamFlavour are gone from DsMeta,
--- Convert, TcSplice (follows from 3)
-#if __GLASGOW_HASKELL__ >= 804
-#error Remove deprecated familyNoKindD, familyKindD, closedTypeFamilyNoKindD and closedTypeFamilyKindD
-#endif
-
-{-# DEPRECATED familyNoKindD, familyKindD
- "This function will be removed in the next stable release. Use openTypeFamilyD/dataFamilyD instead." #-}
-familyNoKindD :: FamFlavour -> Name -> [TyVarBndr] -> DecQ
-familyNoKindD flav tc tvs =
- case flav of
- TypeFam -> return $ OpenTypeFamilyD (TypeFamilyHead tc tvs NoSig Nothing)
- DataFam -> return $ DataFamilyD tc tvs Nothing
-
-familyKindD :: FamFlavour -> Name -> [TyVarBndr] -> Kind -> DecQ
-familyKindD flav tc tvs k =
- case flav of
- TypeFam ->
- return $ OpenTypeFamilyD (TypeFamilyHead tc tvs (KindSig k) Nothing)
- DataFam -> return $ DataFamilyD tc tvs (Just k)
-
-{-# DEPRECATED closedTypeFamilyNoKindD, closedTypeFamilyKindD
- "This function will be removed in the next stable release. Use closedTypeFamilyD instead." #-}
-closedTypeFamilyNoKindD :: Name -> [TyVarBndr] -> [TySynEqnQ] -> DecQ
-closedTypeFamilyNoKindD tc tvs eqns =
- do eqns1 <- sequence eqns
- return (ClosedTypeFamilyD (TypeFamilyHead tc tvs NoSig Nothing) eqns1)
-
-closedTypeFamilyKindD :: Name -> [TyVarBndr] -> Kind -> [TySynEqnQ] -> DecQ
-closedTypeFamilyKindD tc tvs kind eqns =
- do eqns1 <- sequence eqns
- return (ClosedTypeFamilyD (TypeFamilyHead tc tvs (KindSig kind) Nothing)
- eqns1)
-
roleAnnotD :: Name -> [Role] -> DecQ
roleAnnotD name roles = return $ RoleAnnotD name roles
@@ -874,13 +833,6 @@ funDep :: [Name] -> [Name] -> FunDep
funDep = FunDep
-------------------------------------------------------------------------------
--- * FamFlavour
-
-typeFam, dataFam :: FamFlavour
-typeFam = TypeFam
-dataFam = DataFam
-
--------------------------------------------------------------------------------
-- * RuleBndr
ruleVar :: Name -> RuleBndrQ
ruleVar = return . RuleVar
diff --git a/libraries/template-haskell/Language/Haskell/TH/Ppr.hs b/libraries/template-haskell/Language/Haskell/TH/Ppr.hs
index bbb73b0..278b45e 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Ppr.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Ppr.hs
@@ -466,11 +466,6 @@ instance Ppr FunDep where
ppr_list xs = bar <+> commaSep xs
------------------------------
-instance Ppr FamFlavour where
- ppr DataFam = text "data"
- ppr TypeFam = text "type"
-
-------------------------------
instance Ppr FamilyResultSig where
ppr NoSig = empty
ppr (KindSig k) = dcolon <+> ppr k
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 0541a08..7589619 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -1776,9 +1776,6 @@ data TySynEqn = TySynEqn [Type] Type
data FunDep = FunDep [Name] [Name]
deriving( Show, Eq, Ord, Data, Generic )
-data FamFlavour = TypeFam | DataFam
- deriving( Show, Eq, Ord, Data, Generic )
-
data Foreign = ImportF Callconv Safety String Name Type
| ExportF Callconv String Name Type
deriving( Show, Eq, Ord, Data, Generic )
More information about the ghc-commits
mailing list