product-profunctors 0.11.0.2 → 0.11.0.3
raw patch · 7 files changed
+23/−19 lines, 7 files
Files
- CHANGELOG.md +4/−0
- Data/Profunctor/Product.hs +2/−1
- Data/Profunctor/Product/Class.hs +0/−7
- Data/Profunctor/Product/Internal/TH.hs +8/−2
- Data/Profunctor/Product/Tuples/TH.hs +5/−5
- README.md +1/−1
- product-profunctors.cabal +3/−3
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.11.0.3++* Support GHC 9.2+ # 0.11.0.2 * Support GHC 9.0
Data/Profunctor/Product.hs view
@@ -1,4 +1,5 @@-{-# LANGUAGE TemplateHaskell #-}+{-# OPTIONS_GHC -Wno-orphans #-}+{-# LANGUAGE TemplateHaskell #-} -- | If @p@ is an instance of 'ProductProfunctor' then @p a a'@ -- represents a sort of process for turning @a@s into @a'@s that can
Data/Profunctor/Product/Class.hs view
@@ -3,13 +3,6 @@ import Data.Profunctor (Profunctor) import qualified Data.Profunctor as Profunctor ---- vv These are redundant imports but they're needeed for Haddock---- links. AIUI Haddock can't link to something you haven't imported.------ https://github.com/haskell/haddock/issues/796-import qualified Control.Applicative-import qualified Data.Profunctor- -- | 'ProductProfunctor' is a generalization of -- 'Control.Applicative.Applicative'. -- It has the usual 'Control.Applicative.Applicative' "output"
Data/Profunctor/Product/Internal/TH.hs view
@@ -77,7 +77,7 @@ x <- newName "x" let body = [ FunD 'N.constructor [simpleClause (NormalB (ConE conName))]- , FunD 'N.field [simpleClause (NormalB (LamE [ConP conName [VarP x]] (VarE x)))] ]+ , FunD 'N.field [simpleClause (NormalB (LamE [conP conName [VarP x]] (VarE x)))] ] i <- instanceD (pure []) [t| $(conT ''N.Newtype) $(conT tyName) |] (map pure body)@@ -336,6 +336,12 @@ #endif es +conP :: Name -> [Pat] -> Pat+conP conname = ConP conname+#if MIN_VERSION_template_haskell(2,18,0)+ []+#endif+ fromTuple :: Name -> (Name, Int) -> Dec fromTuple conName = xTuple patCon retCon where patCon = tupP@@ -343,7 +349,7 @@ toTuple :: Name -> (Name, Int) -> Dec toTuple conName = xTuple patCon retCon- where patCon = ConP conName+ where patCon = conP conName retCon = tupE {-
Data/Profunctor/Product/Tuples/TH.hs view
@@ -34,7 +34,7 @@ chain :: ProductProfunctor p => (t -> p a2 b2) -> (p a1 b1, t) -> p (a1, a2) (b1, b2)-chain rest (a, as) = uncurry (***!) (a, rest as)+chain rest (a, as) = a ***! rest as pTns :: [Int] -> Q [Dec] pTns = fmap concat . mapM pTn@@ -62,7 +62,7 @@ 0 -> [| const empty |] 1 -> [| id |] 2 -> [| uncurry (***!) |]- _ -> varE 'chain `appE` varE (pT (n - 1))+ _ -> [| chain $(varE (pT (n - 1))) |] pT n' = mkName ("pT" ++ show n') tN = mkName ('T':show n) as = [ mkName $ 'a':show i | i <- [0::Int ..] ]@@ -134,7 +134,7 @@ mkTupT vs = foldl appT (tupleT n) (map varT vs) mkPT a b = varT p `appT` varT a `appT` varT b fun = funD nm [ clause [] (normalB bdy) [] ]- bdy = varE 'convert `appE` unflat `appE` unflat `appE` flat `appE` pT+ bdy = [| convert $(unflat) $(unflat) $(flat) $(pT) |] unflat = varE $ mkName unflatNm flat = varE $ mkName flatNm pT = varE $ mkName pTNm@@ -168,12 +168,12 @@ [mkFun] ] where- mkDefs = zipWith (\a b -> default_ p a b) as bs+ mkDefs = zipWith (default_ p) as bs mkTupT = foldl appT (tupleT n) . map varT mkFun = funD 'def [clause [] bdy []] bdy = normalB $ case n of 0 -> varE 'empty- _ -> varE (mkName $ 'p':show n) `appE` tupE (replicate n (varE 'def))+ _ -> varE (mkName $ 'p':show n) `appE` tupE (replicate n [| def |]) p = mkName "p" x = varT (mkName "x") t1 ~~ t2 = [t| $t1 ~ $t2 |]
README.md view
@@ -1,4 +1,4 @@-# product-profunctors [](https://hackage.haskell.org/package/product-profunctors) [](https://github.com/tomjaguarpaw/product-profunctors/actions)+# 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-2021 Tom Ellis-version: 0.11.0.2+version: 0.11.0.3 synopsis: product-profunctors description: Product profunctors and tools for working with them homepage: https://github.com/tomjaguarpaw/product-profunctors@@ -11,8 +11,8 @@ maintainer: Purely Agile category: Control, Category build-type: Simple-cabal-version: >= 1.18-tested-with: GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4, GHC==8.2, GHC==8.0+cabal-version: 1.18+tested-with: GHC==9.2, GHC==9.0, 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