classP recently deleted from TH.Lib

Gabor Greif ggreif at gmail.com
Wed May 14 21:40:20 UTC 2014


Alrighty, this is what I have now. If you think this is ok, I'll go on
re-implementing equalP too and commit. Then we can bikeshed about the
deprecation message :-)

diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
index 49baa96..08235ba 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs
@@ -526,6 +526,13 @@ sigT t k
 equalityT :: TypeQ
 equalityT = return EqualityT

+{-# DEPRECATED classP "Constraint constructors are just type
constructors, frob this code as 'constraintT'." #-}
+classP :: Name -> [Q Type] -> Q Pred
+classP cla tys
+  = do
+      tysl <- sequence tys
+      return (foldl AppT (ConT cla) tysl)
+
 promotedT :: Name -> TypeQ
 promotedT = return . PromotedT


Cheers,

    Gabor


On 5/14/14, Gregory Collins <greg at gregorycollins.net> wrote:
> On Mon, May 12, 2014 at 4:58 PM, Richard Eisenberg
> <eir at cis.upenn.edu>wrote:
>
>> We could, of course, just leave the functions there with new
>> implementations, but that feels like it could accumulate legacy functions
>> over time.
>
>
> I think the ultimate goal of removing the function was not unwise of you,
> but the right thing to do here would be to write a reimplementation, mark
> it as {-# DEPRECATED #-}, and give a timetable for its future removal. This
> gives users time to adjust and minimizes breakage.
>
> G
> --
> Gregory Collins <greg at gregorycollins.net>
>


More information about the ghc-devs mailing list