tagged 0.8.11 → 0.9
raw patch · 3 files changed
+7/−104 lines, 3 filesdep −template-haskellPVP ok
version bump matches the API change (PVP)
Dependencies removed: template-haskell
API changes (from Hackage documentation)
- Data.Proxy.TH: pr :: QuasiQuoter
- Data.Proxy.TH: pr1 :: QuasiQuoter
Files
- CHANGELOG.markdown +6/−0
- src/Data/Proxy/TH.hs +0/−90
- tagged.cabal +1/−14
CHANGELOG.markdown view
@@ -1,3 +1,9 @@+0.9 [2026.09.28]+----------------+* Remove `Data.Proxy.TH`, as its functionality has been subsumed+ by using `Proxy` with `TypeApplications` syntax. This completes the+ deprecation cycle that was introduced in `tagged-0.8.10`.+ 0.8.11 [2026.09.28] ------------------- * Include `Data` and `Generic` instances for `Tagged` when building with
− src/Data/Proxy/TH.hs
@@ -1,90 +0,0 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE TemplateHaskellQuotes #-}-#ifndef MIN_VERSION_template_haskell-#define MIN_VERSION_template_haskell(x,y,z) 1-#endif--- template-haskell is only safe since GHC-8.2-#if __GLASGOW_HASKELL__ >= 802-{-# LANGUAGE Safe #-}-#else-{-# LANGUAGE Trustworthy #-}-#endif-module Data.Proxy.TH- ( pr- , pr1- ) where--import Data.Char-import Data.Proxy (Proxy(..))-import Language.Haskell.TH-import Language.Haskell.TH.Quote--proxy_d, proxy_tc :: Name-proxy_d = 'Proxy-proxy_tc = ''Proxy--proxyTypeQ :: TypeQ -> TypeQ-proxyTypeQ t = appT (conT proxy_tc) t--proxyExpQ :: TypeQ -> ExpQ-proxyExpQ t = sigE (conE proxy_d) (proxyTypeQ t)--proxyPatQ :: TypeQ -> PatQ-proxyPatQ t = sigP (conP proxy_d []) (proxyTypeQ t)---- | A proxy value quasiquoter. @[pr|T|]@ will splice an expression--- @Proxy::Proxy T@, while @[pr|A,B,C|]@ will splice in a value of--- @Proxy :: Proxy [A,B,C]@.---- TODO: parse a richer syntax for the types involved here so we can include spaces, applications, etc.-{-# DEPRECATED- pr- [ "'pr' will be removed in the next release. Use 'Proxy' with @TypeApplications@ instead. "- , "Instead of using @[pr|T|]@, use @Proxy \\@T@ instead. "- , "Instead of using @[pr|A,B,C|]@, use @Proxy \\@[A,B,C]@ instead. "- ] #-}-pr :: QuasiQuoter-pr = QuasiQuoter (mkProxy proxyExpQ) (mkProxy proxyPatQ) (mkProxy proxyTypeQ) undefined where- mkProxy :: (TypeQ -> r) -> String -> r- mkProxy p s = case ts of- [h@(t:_)]- | isUpper t -> p $ conT $ mkName h- | otherwise -> p $ varT $ mkName h- _ -> p $ mkList <$> cons- where- ts = map strip $ splitOn ',' s- cons = mapM (conT . mkName) ts- mkList = foldr (AppT . AppT PromotedConsT) PromotedNilT---- | Like 'pr', but takes a single type, which is used to produce a--- 'Proxy' for a single-element list containing only that type. This--- is useful for passing a single type to a function that wants a list--- of types.---- TODO: parse a richer syntax for the types involved here so we can include spaces, applications, etc.-{-# DEPRECATED- pr1- [ "'pr1' will be removed in the next release. Use 'Proxy' with @TypeApplications@ instead. "- , "Instead of using @[pr1|T|]@, use @Proxy \\@'[T]@ instead. "- ] #-}-pr1 :: QuasiQuoter-pr1 = QuasiQuoter (mkProxy proxyExpQ) (mkProxy proxyPatQ) (mkProxy proxyTypeQ) undefined where- sing x = AppT (AppT PromotedConsT x) PromotedNilT- mkProxy p s = case s of- t:_- | isUpper t -> p (fmap sing (conT $ mkName s))- | otherwise -> p (fmap sing (varT $ mkName s))- _ -> error "Empty string passed to pr1"---- | Split on a delimiter.-splitOn :: Eq a => a -> [a] -> [[a]]-splitOn d = go where- go [] = []- go xs = case t of- [] -> [h]- (_:t') -> h : go t'- where (h,t) = break (== d) xs---- | Remove white space from both ends of a 'String'.-strip :: String -> String-strip = takeWhile (not . isSpace) . dropWhile isSpace
tagged.cabal view
@@ -1,5 +1,5 @@ name: tagged-version: 0.8.11+version: 0.9 license: BSD3 license-file: LICENSE author: Edward A. Kmett@@ -42,14 +42,6 @@ default: True manual: True -flag template-haskell- description:- You can disable the use of the `template-haskell` package using `-f-template-haskell`.- .- Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.- default: True- manual: True- library default-language: Haskell98 other-extensions: CPP@@ -67,8 +59,3 @@ if flag(deepseq) build-depends: deepseq >= 1.1 && < 1.6-- if flag(template-haskell) && impl(ghc)- build-depends: template-haskell >= 2.11 && < 2.26- exposed-modules:- Data.Proxy.TH