diff options
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 |