[commit: ghc] master: Provide deprecated backward compatible implementation to 'equalP' (135489d)
git at git.haskell.org
git at git.haskell.org
Mon May 19 20:52:50 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/135489ddc77c6e1b686c0ebf00dee95b218681ed/ghc
>---------------------------------------------------------------
commit 135489ddc77c6e1b686c0ebf00dee95b218681ed
Author: Gabor Greif <ggreif at gmail.com>
Date: Fri May 16 19:41:34 2014 +0200
Provide deprecated backward compatible implementation to 'equalP'
>---------------------------------------------------------------
135489ddc77c6e1b686c0ebf00dee95b218681ed
libraries/template-haskell/Language/Haskell/TH.hs | 2 +-
libraries/template-haskell/Language/Haskell/TH/Lib.hs | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs
index 916f101..5852145 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 08235ba..345f16b 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
More information about the ghc-commits
mailing list