deriving-compat 0.3.5 → 0.3.6
raw patch · 32 files changed
+67/−38 lines, 32 filesdep ~deriving-compatdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: deriving-compat, template-haskell
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- LICENSE +1/−1
- deriving-compat.cabal +5/−5
- src/Data/Bounded/Deriving.hs +1/−1
- src/Data/Bounded/Deriving/Internal.hs +1/−1
- src/Data/Deriving.hs +8/−1
- src/Data/Deriving/Internal.hs +18/−1
- src/Data/Enum/Deriving.hs +1/−1
- src/Data/Enum/Deriving/Internal.hs +1/−1
- src/Data/Eq/Deriving.hs +1/−1
- src/Data/Eq/Deriving/Internal.hs +1/−1
- src/Data/Foldable/Deriving.hs +1/−1
- src/Data/Functor/Deriving.hs +1/−1
- src/Data/Functor/Deriving/Internal.hs +4/−3
- src/Data/Ix/Deriving.hs +1/−1
- src/Data/Ix/Deriving/Internal.hs +1/−1
- src/Data/Ord/Deriving.hs +1/−1
- src/Data/Ord/Deriving/Internal.hs +1/−1
- src/Data/Traversable/Deriving.hs +1/−1
- src/Text/Read/Deriving.hs +1/−1
- src/Text/Read/Deriving/Internal.hs +1/−1
- src/Text/Show/Deriving.hs +1/−1
- src/Text/Show/Deriving/Internal.hs +2/−2
- tests/BoundedEnumIxSpec.hs +1/−1
- tests/EqSpec.hs +1/−1
- tests/FunctorSpec.hs +1/−1
- tests/GH6Spec.hs +1/−1
- tests/OrdSpec.hs +1/−1
- tests/ReadSpec.hs +1/−1
- tests/ShowSpec.hs +1/−1
- tests/Types/EqOrd.hs +1/−1
- tests/Types/ReadShow.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+### 0.3.6 [2017.04.10]+* Make `deriveTraversable` use `liftA2` in derived implementations of `traverse` when possible, now that `liftA2` is a class method of `Applicative` (as of GHC 8.2)+* Make `deriveShow` use `showCommaSpace`, a change introduced in GHC 8.2+ ### 0.3.5 [2016.12.12] * Fix bug in which derived `Ord` instances for datatypes with many constructors would fail to typecheck
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2015-2016, Ryan Scott+Copyright (c) 2015-2017, Ryan Scott All rights reserved.
deriving-compat.cabal view
@@ -1,5 +1,5 @@ name: deriving-compat-version: 0.3.5+version: 0.3.6 synopsis: Backports of GHC deriving extensions description: Provides Template Haskell functions that mimic deriving extensions that were introduced or modified in recent versions@@ -54,7 +54,7 @@ author: Ryan Scott maintainer: Ryan Scott <ryan.gl.scott@gmail.com> stability: Experimental-copyright: (C) 2015-2016 Ryan Scott+copyright: (C) 2015-2017 Ryan Scott category: Compatibility build-type: Simple extra-source-files: CHANGELOG.md, README.md@@ -121,7 +121,7 @@ build-depends: base >= 4.3 && < 4.9 if flag(template-haskell-2-11)- build-depends: template-haskell >= 2.11 && < 2.12+ build-depends: template-haskell >= 2.11 && < 2.13 , ghc-boot-th else build-depends: template-haskell >= 2.5 && < 2.11@@ -152,11 +152,11 @@ Types.ReadShow build-depends: base-compat >= 0.8.1 && < 1 , base-orphans >= 0.5 && < 1- , deriving-compat == 0.3.5+ , deriving-compat , hspec >= 1.8 , QuickCheck >= 2 && < 3 , tagged >= 0.7 && < 1- , template-haskell >= 2.5 && < 2.12+ , template-haskell >= 2.5 && < 2.13 if flag(base-4-9) build-depends: base >= 4.9 && < 5
src/Data/Bounded/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Bounded.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Bounded/Deriving/Internal.hs view
@@ -2,7 +2,7 @@ {-| Module: Data.Bounded.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell@@ -67,6 +67,13 @@ that are not subject to @RebindableSyntax@. It was also changed so that derived @('<=')@, @('>')@, and @('>=')@ methods are expressed through @('<')@, which avoids generating a substantial amount of code.++* In GHC 8.2, deriving 'Traversable' was changed so that it uses 'liftA2' to implement+ 'traverse' whenever possible. This was done since 'liftA2' was also made a class+ method of 'Applicative', so sometimes using 'liftA2' produces more efficient code.++* In GHC 8.2, deriving 'Show' was changed so that it uses an explicit @showCommaSpace@+ method, instead of repeating the code @showString \", \"@ in several places. -} {- $derive
src/Data/Deriving/Internal.hs view
@@ -13,7 +13,7 @@ {-| Module: Data.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell@@ -2070,6 +2070,9 @@ apValName :: Name apValName = mkNameG_v "base" "GHC.Base" "<*>" +liftA2ValName :: Name+liftA2ValName = mkNameG_v "base" "GHC.Base" "liftA2"+ mappendValName :: Name mappendValName = mkNameG_v "base" "GHC.Base" "mappend" @@ -2082,6 +2085,9 @@ apValName :: Name apValName = mkNameG_v "base" "Control.Applicative" "<*>" +liftA2ValName :: Name+liftA2ValName = mkNameG_v "base" "Control.Applicative" "liftA2"+ mappendValName :: Name mappendValName = mkNameG_v "base" "Data.Monoid" "mappend" @@ -2292,4 +2298,15 @@ unApplyValName :: Name unApplyValName = mkNameG_v derivingCompatPackageKey "Data.Deriving.Internal" "unApply" # endif+#endif++#if MIN_VERSION_base(4,10,0)+showCommaSpaceValName :: Name+showCommaSpaceValName = mkNameG_v "base" "GHC.Show" "showCommaSpace"+#else+showCommaSpace :: ShowS+showCommaSpace = showString ", "++showCommaSpaceValName :: Name+showCommaSpaceValName = mkNameG_v derivingCompatPackageKey "Data.Deriving.Internal" "showCommaSpace" #endif
src/Data/Enum/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Enum.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Enum/Deriving/Internal.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Enum.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Eq/Deriving.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} {-| Module: Data.Eq.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Eq/Deriving/Internal.hs view
@@ -3,7 +3,7 @@ {-| Module: Data.Eq.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Foldable/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Foldable.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Functor/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Functor.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Functor/Deriving/Internal.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE GADTs #-} {-| Module: Data.Functor.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell@@ -470,7 +470,8 @@ let go :: [Exp] -> Exp go [] = VarE pureValName `AppE` conExp- go (e:es) = foldl' (\e1 e2 -> InfixE (Just e1) (VarE apValName) (Just e2))- (VarE fmapValName `AppE` conExp `AppE` e) es+ go [e] = VarE fmapValName `AppE` conExp `AppE` e+ go (e1:e2:es) = foldl' (\se1 se2 -> InfixE (Just se1) (VarE apValName) (Just se2))+ (VarE liftA2ValName `AppE` conExp `AppE` e1 `AppE` e2) es return . go . rights $ ess
src/Data/Ix/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Ix.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Ix/Deriving/Internal.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Ix.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Ord/Deriving.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} {-| Module: Data.Ord.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Ord/Deriving/Internal.hs view
@@ -3,7 +3,7 @@ {-| Module: Data.Ord.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Data/Traversable/Deriving.hs view
@@ -1,6 +1,6 @@ {-| Module: Data.Traversable.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Text/Read/Deriving.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} {-| Module: Text.Read.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Text/Read/Deriving/Internal.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE GADTs #-} {-| Module: Text.Read.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Text/Show/Deriving.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} {-| Module: Text.Show.Deriving-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
src/Text/Show/Deriving/Internal.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE GADTs #-} {-| Module: Text.Show.Deriving.Internal-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell@@ -394,7 +394,7 @@ (showString argNameBase) "" in [ varE showStringValName `appE` stringE (infixRec ++ " = ") , makeShowForArg 0 sClass opts conName tvMap argTy arg- , varE showStringValName `appE` stringE ", "+ , varE showCommaSpaceValName ] ) (zip3 ts argTys args)
tests/BoundedEnumIxSpec.hs view
@@ -12,7 +12,7 @@ {-| Module: BoundedEnumSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/EqSpec.hs view
@@ -1,6 +1,6 @@ {-| Module: EqSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/FunctorSpec.hs view
@@ -17,7 +17,7 @@ {-| Module: FunctorSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/GH6Spec.hs view
@@ -2,7 +2,7 @@ {-| Module: GH6Spec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/OrdSpec.hs view
@@ -2,7 +2,7 @@ {-| Module: OrdSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/ReadSpec.hs view
@@ -6,7 +6,7 @@ {-| Module: ReadSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/ShowSpec.hs view
@@ -8,7 +8,7 @@ {-| Module: ShowSpec-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/Types/EqOrd.hs view
@@ -8,7 +8,7 @@ {-| Module: Types.EqOrd-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell
tests/Types/ReadShow.hs view
@@ -8,7 +8,7 @@ {-| Module: Types.ReadShow-Copyright: (C) 2015-2016 Ryan Scott+Copyright: (C) 2015-2017 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Portability: Template Haskell