diff options
author | Gabor Greif <ggreif@gmail.com> | 2014-05-16 19:41:34 +0200 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2014-05-19 19:54:08 +0200 |
commit | 135489ddc77c6e1b686c0ebf00dee95b218681ed (patch) | |
tree | bae23ed3ee09012422a766bc17138c2430a249d8 /libraries | |
parent | 4117551f8822ff76501f9f96186dbd39dda26f1d (diff) | |
download | haskell-135489ddc77c6e1b686c0ebf00dee95b218681ed.tar.gz |
Provide deprecated backward compatible implementation to 'equalP'
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH.hs | 2 | ||||
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Lib.hs | 9 |
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 |