product-isomorphic 0.0.3.3 → 0.0.3.4
raw patch · 2 files changed
+15/−9 lines, 2 filesdep ~th-data-compatPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: th-data-compat
API changes (from Hackage documentation)
+ Data.Functor.ProductIsomorphic.Class: infixl 3 |||
+ Data.Functor.ProductIsomorphic.Class: infixl 4 |*|
Files
product-isomorphic.cabal view
@@ -1,5 +1,5 @@ name: product-isomorphic-version: 0.0.3.3+version: 0.0.3.4 synopsis: Weaken applicative functor on products description: Weaken applicative functor which allows only product construction. Product constructions and deconstructions@@ -9,12 +9,19 @@ license-file: LICENSE author: Kei Hibino maintainer: ex8k.hibino@gmail.com-copyright: Copyright (c) 2017 Kei Hibino+copyright: Copyright (c) 2017-2023 Kei Hibino category: Data build-type: Simple -- extra-source-files: cabal-version: >=1.10-tested-with: GHC == 8.4.1, GHC == 8.4.2, GHC == 8.4.3+tested-with: GHC == 9.6.2+ , GHC == 9.4.6+ , GHC == 9.2.8+ , GHC == 9.0.2+ , GHC == 8.10.1+ , GHC == 8.8.1, GHC == 8.8.2, GHC == 8.8.3+ , GHC == 8.6.1, GHC == 8.6.2, GHC == 8.6.3, GHC == 8.6.4, GHC == 8.6.5+ , GHC == 8.4.1, GHC == 8.4.2, GHC == 8.4.3, GHC == 8.4.4 , GHC == 8.2.1, GHC == 8.2.2 , GHC == 8.0.1, GHC == 8.0.2 , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3@@ -38,7 +45,7 @@ build-depends: base >=4.5 && <5 , template-haskell- , th-data-compat+ , th-data-compat >= 0.1.3 if impl(ghc == 7.4.*) build-depends: ghc-prim == 0.2.* hs-source-dirs: src
src/Data/Functor/ProductIsomorphic/TH/Internal.hs view
@@ -21,8 +21,8 @@ import Language.Haskell.TH (Q, Name, tupleTypeName, Info (..), reify, TypeQ, arrowT, appT, conT, varT,- Dec, ExpQ, conE, Con (..), TyVarBndr (..), nameBase,)-import Language.Haskell.TH.Compat.Data (unDataD, unNewtypeD)+ Dec, ExpQ, conE, Con (..), nameBase,)+import Language.Haskell.TH.Compat.Data (unDataD, unNewtypeD, unTyVarBndr) import Data.List (foldl') import Data.Functor.ProductIsomorphic.Unsafe (ProductConstructor (..))@@ -37,15 +37,14 @@ <|> do (_cxt, tcn, bs, _mk, r , _ds) <- unNewtypeD tcon Just (tcn, bs, r)- let vns = map getTV bs+ let vns = map tyVarName bs case r of NormalC dcn ts -> Just (((buildT tcn vns, vns), conE dcn), (Nothing, [return t | (_, t) <- ts])) RecC dcn vts -> Just (((buildT tcn vns, vns), conE dcn), (Just ns, ts)) where (ns, ts) = unzip [(n, return t) | (n, _, t) <- vts] _ -> Nothing d _ = Nothing- getTV (PlainTV n) = n- getTV (KindedTV n _) = n+ tyVarName = fst . unTyVarBndr buildT tcn vns = foldl' appT (conT tcn) [ varT vn | vn <- vns ] -- | Low-level reify interface for record type name.