From 135489ddc77c6e1b686c0ebf00dee95b218681ed Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Fri, 16 May 2014 19:41:34 +0200 Subject: Provide deprecated backward compatible implementation to 'equalP' --- libraries/template-haskell/Language/Haskell/TH.hs | 2 +- libraries/template-haskell/Language/Haskell/TH/Lib.hs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'libraries') 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 -- cgit v1.2.1