product-profunctors 0.11.0.1 → 0.11.0.2
raw patch · 6 files changed
+25/−18 lines, 6 filesdep +th-abstraction
Dependencies added: th-abstraction
Files
- CHANGELOG.md +4/−0
- Data/Profunctor/Product/Internal/TH.hs +8/−7
- Data/Profunctor/Product/Tuples/TH.hs +6/−5
- LICENSE +1/−1
- README.md +1/−1
- product-profunctors.cabal +5/−4
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.11.0.2++* Support GHC 9.0+ # 0.11.0.0 * Added `makeAdaptorAndInstanceInferrable` which has better inference
Data/Profunctor/Product/Internal/TH.hs view
@@ -9,7 +9,7 @@ import Data.Profunctor.Product.Default (Default, def) import qualified Data.Profunctor.Product.Newtype as N import Language.Haskell.TH (Dec(DataD, SigD, FunD, InstanceD, NewtypeD),- mkName, newName, nameBase, TyVarBndr(PlainTV, KindedTV),+ mkName, newName, nameBase, Con(RecC, NormalC), Clause(Clause), Type(VarT, ForallT, AppT, ConT),@@ -18,6 +18,8 @@ Pat(TupP, VarP, ConP), Name, Info(TyConI), reify, conE, appT, conT, varE, varP, instanceD, Overlap(Incoherent), Pred)+import Language.Haskell.TH.Datatype.TyVarBndr (TyVarBndr_, TyVarBndrSpec,+ plainTVSpecified, tvName) import Control.Monad ((<=<)) import Control.Applicative (pure, liftA2, (<$>), (<*>)) @@ -119,9 +121,8 @@ } dataDecStuffOfInfo _ = Left "That doesn't look like a data or newtype declaration to me" -varNameOfBinder :: TyVarBndr -> Name-varNameOfBinder (PlainTV n) = n-varNameOfBinder (KindedTV n _) = n+varNameOfBinder :: TyVarBndr_ flag -> Name+varNameOfBinder = tvName conStuffOfConstructor :: Con -> Either Error (Name, ConTysFields) conStuffOfConstructor = \case@@ -205,7 +206,7 @@ after = [t| $pType $(pArg "0") $(pArg "1") |] - scope = concat [ [PlainTV p]+ scope = concat [ [plainTVSpecified p] , map (mkTyVarsuffix "0") tyVars , map (mkTyVarsuffix "1") tyVars ] @@ -372,8 +373,8 @@ varPS :: String -> Pat varPS = VarP . mkName -mkTyVarsuffix :: String -> String -> TyVarBndr-mkTyVarsuffix s = PlainTV . mkName . (++s)+mkTyVarsuffix :: String -> String -> TyVarBndrSpec+mkTyVarsuffix s = plainTVSpecified . mkName . (++s) mkTySuffix :: String -> String -> Type mkTySuffix s = varTS . (++s)
Data/Profunctor/Product/Tuples/TH.hs view
@@ -10,6 +10,7 @@ ) where import Language.Haskell.TH+import Language.Haskell.TH.Datatype.TyVarBndr import Data.Profunctor (Profunctor (dimap)) import Data.Profunctor.Product.Class (ProductProfunctor, (***!), empty)@@ -23,7 +24,7 @@ mkT n = tySynD (tyName n) tyVars tyDef where tyName n' = mkName ('T':show n')- tyVars = map PlainTV . take n $ allNames+ tyVars = map plainTV . take n $ allNames tyDef = case n of 0 -> tupleT 0 1 -> varT (head allNames)@@ -48,7 +49,7 @@ pTn n = sequence [sig, fun] where p = mkName "p"- sig = sigD (pT n) (forallT (map PlainTV $ p : take n as ++ take n bs)+ sig = sigD (pT n) (forallT (map plainTVSpecified $ p : take n as ++ take n bs) (sequence [productProfunctor p]) (arrowT `appT` mkLeftTy `appT` mkRightTy) )@@ -73,7 +74,7 @@ mkFlattenN :: Int -> Q [Dec] mkFlattenN n = sequence [sig, fun] where- sig = sigD nm (forallT (map PlainTV names) (pure []) $ arrowT `appT` unflatT names `appT` flatT names)+ sig = sigD nm (forallT (map plainTVSpecified names) (pure []) $ arrowT `appT` unflatT names `appT` flatT names) fun = funD nm [ clause [mkTupPat names] (normalB bdy) [] ] bdy = mkFlatExp names unflatT [] = tupleT 0@@ -97,7 +98,7 @@ mkUnflattenN :: Int -> Q [Dec] mkUnflattenN n = sequence [sig, fun] where- sig = sigD nm (forallT (map PlainTV names) (pure []) $ arrowT `appT` flatT names `appT` unflatT names)+ sig = sigD nm (forallT (map plainTVSpecified names) (pure []) $ arrowT `appT` flatT names `appT` unflatT names) fun = funD nm [ clause [mkTupPat names] (normalB bdy) [] ] bdy = mkUnflatExp names unflatT [] = tupleT 0@@ -121,7 +122,7 @@ pN :: Int -> Q [Dec] pN n = sequence [sig, fun] where- sig = sigD nm (forallT (map PlainTV $ p : as ++ bs)+ sig = sigD nm (forallT (map plainTVSpecified $ p : as ++ bs) (sequence [productProfunctor p]) (arrowT `appT` mkLeftTy `appT` mkRightTy) )
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2013, Karamaan Group LLC; 2014-2018 Purely Agile Limited; 2019-2020 Tom Ellis+Copyright (c) 2013, Karamaan Group LLC; 2014-2018 Purely Agile Limited; 2019-2021 Tom Ellis All rights reserved.
README.md view
@@ -1,4 +1,4 @@-# product-profunctors [](https://hackage.haskell.org/package/product-profunctors) [](https://travis-ci.org/tomjaguarpaw/product-profunctors)+# product-profunctors [](https://hackage.haskell.org/package/product-profunctors) [](https://github.com/tomjaguarpaw/product-profunctors/actions) ## Backup maintainers
product-profunctors.cabal view
@@ -1,6 +1,6 @@ name: product-profunctors-copyright: Copyright (c) 2013, Karamaan Group LLC; 2014-2018 Purely Agile Limited; 2019-2020 Tom Ellis-version: 0.11.0.1+copyright: Copyright (c) 2013, Karamaan Group LLC; 2014-2018 Purely Agile Limited; 2019-2021 Tom Ellis+version: 0.11.0.2 synopsis: product-profunctors description: Product profunctors and tools for working with them homepage: https://github.com/tomjaguarpaw/product-profunctors@@ -12,7 +12,7 @@ category: Control, Category build-type: Simple cabal-version: >= 1.18-tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2+tested-with: GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4, GHC==8.2, GHC==8.0 extra-doc-files: README.md CHANGELOG.md@@ -24,11 +24,12 @@ library default-language: Haskell2010 build-depends: base >= 4.5 && < 5- , profunctors >= 5 && < 5.6+ , profunctors >= 5 && < 5.7 , bifunctors >= 5.4 && < 6.0 , contravariant >= 0.4 && < 1.6 , tagged >= 0.0 && < 1 , template-haskell+ , th-abstraction >= 0.4 exposed-modules: Data.Profunctor.Product, Data.Profunctor.Product.Adaptor Data.Profunctor.Product.Default,