summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2014-05-16 19:41:34 +0200
committerGabor Greif <ggreif@gmail.com>2014-05-19 19:54:08 +0200
commit135489ddc77c6e1b686c0ebf00dee95b218681ed (patch)
treebae23ed3ee09012422a766bc17138c2430a249d8 /libraries
parent4117551f8822ff76501f9f96186dbd39dda26f1d (diff)
downloadhaskell-135489ddc77c6e1b686c0ebf00dee95b218681ed.tar.gz
Provide deprecated backward compatible implementation to 'equalP'
Diffstat (limited to 'libraries')
-rw-r--r--libraries/template-haskell/Language/Haskell/TH.hs2
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Lib.hs9
2 files changed, 10 insertions, 1 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index 916f101f29..5852145336 100644
--- a/libraries/template-haskell/Language/Haskell/TH.hs
+++ b/libraries/template-haskell/Language/Haskell/TH.hs
@@ -112,7 +112,7 @@ module Language.Haskell.TH(
-- **** Strictness
isStrict, notStrict, strictType, varStrictType,
-- **** Class Contexts
- cxt, classP, normalC, recC, infixC, forallC,
+ cxt, classP, equalP, normalC, recC, infixC, forallC,
-- *** Kinds
varK, conK, tupleK, arrowK, listK, appK, starK, constraintK,
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
index 08235ba2c8..345f16b33c 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
@@ -533,6 +533,15 @@ classP cla tys
tysl <- sequence tys
return (foldl AppT (ConT cla) tysl)
+{-# DEPRECATED equalP "Constraint constructors are just type constructors, frob this code as 'equalT'." #-}
+equalP :: TypeQ -> TypeQ -> PredQ
+equalP tleft tright
+ = do
+ tleft1 <- tleft
+ tright1 <- tright
+ eqT <- equalityT
+ return (foldl AppT eqT [tleft1, tright1])
+
promotedT :: Name -> TypeQ
promotedT = return . PromotedT