packages feed

deriving-compat-0.2.1: deriving-compat.cabal

name:                deriving-compat
version:             0.2.1
synopsis:            Backports of GHC deriving extensions
description:         Provides Template Haskell functions that mimic deriving
                     extensions that were introduced or modified in recent versions
                     of GHC. Currently, the following extensions are covered:
                     .
                     * @DeriveFoldable@
                     .
                     * @DeriveFunctor@
                     .
                     * @DeriveTraversable@
                     .
                     The following changes have been backported:
                     .
                     * In GHC 8.0, @DeriveFoldable@ was changed to allow folding
                       over data types with existential constraints.
                     .
                     * In GHC 8.0, @DeriveFoldable@ and @DeriveTraversable@ were
                       changed so as not to generate superfluous @mempty@ or @pure@
                       expressions in generated code. As a result, this allows
                       deriving @Traversable@ instances for datatypes with unlifted
                       argument types.
                     .
                     * In GHC 8.0, deriving @Show@ was changed so that constructor fields
                       with unlifted types are no longer shown with parentheses, and
                       the output of showing an unlifted type is suffixed with the same
                       number of hash signs as the corresponding primitive literals.
                     .
                     Note that some recent GHC extensions are not covered by this package:
                     .
                     * @DeriveGeneric@, which was introducted in GHC 7.2 for deriving
                       @Generic@ instances, and modified in GHC 7.6 to allow derivation
                       of @Generic1@ instances. Use @Generics.Deriving.TH@ from
                       @<http://hackage.haskell.org/package/generic-deriving generic-deriving>@
                       to derive @Generic(1)@ using Template Haskell.
                     .
                     * @DeriveLift@, which was introduced in GHC 8.0 for deriving
                       @Lift@ instances. Use @Language.Haskell.TH.Lift@ from
                       @<http://hackage.haskell.org/package/th-lift th-lift>@
                       to derive @Lift@ using Template Haskell.
homepage:            https://github.com/haskell-compat/deriving-compat
bug-reports:         https://github.com/haskell-compat/deriving-compat/issues
license:             BSD3
license-file:        LICENSE
author:              Ryan Scott
maintainer:          Ryan Scott <ryan.gl.scott@gmail.com>
stability:           Experimental
copyright:           (C) 2015-2016 Ryan Scott
category:            Compatibility
build-type:          Simple
extra-source-files:  CHANGELOG.md, README.md
tested-with:         GHC == 7.0.4
                   , GHC == 7.2.2
                   , GHC == 7.4.2
                   , GHC == 7.6.3
                   , GHC == 7.8.4
                   , GHC == 7.10.3
                   , GHC == 8.0.1
cabal-version:       >=1.10

source-repository head
  type:                git
  location:            https://github.com/haskell-compat/deriving-compat

flag base-49
  description:         Use base-4.9 or later.
  default:             True

flag new-functor-classes
  description:         Use a version of transformers or transformers-compat with a
                       modern-style Data.Functor.Classes module. This flag cannot be
                       used when building with transformers-0.4, since it comes with
                       a different version of Data.Functor.Classes.
  default:             True

library
  exposed-modules:     Data.Deriving

                       Data.Foldable.Deriving
                       Data.Functor.Deriving
                       Data.Traversable.Deriving
                       Text.Show.Deriving
  other-modules:       Data.Deriving.Internal
                       Data.Functor.Deriving.Internal
                       Text.Show.Deriving.Internal
                       Paths_deriving_compat
  build-depends:       containers          >= 0.1 && < 0.6
                     , ghc-prim
                     , template-haskell    >= 2.5 && < 2.12

  if flag(base-49)
    build-depends:     base                >= 4.9 && < 5
                     , ghc-boot-th
    cpp-options:       "-DNEW_FUNCTOR_CLASSES"
  else
    build-depends:     base                >= 4.3 && < 4.9

  if flag(new-functor-classes)
    build-depends:     transformers        (>= 0.2 && < 0.4) || >= 0.5
                     , transformers-compat >= 0.5
    cpp-options:       "-DNEW_FUNCTOR_CLASSES"
  else
    build-depends:     transformers        == 0.4.*

  hs-source-dirs:      src
  default-language:    Haskell2010
  ghc-options:         -Wall

test-suite spec
  type:                exitcode-stdio-1.0
  main-is:             Spec.hs
  other-modules:       FunctorSpec
                       ShowSpec
  build-depends:       base-compat         >= 0.8.1 && < 1
                     , base-orphans        >= 0.5   && < 1
                     , deriving-compat     == 0.2.1
                     , hspec               >= 1.8
                     , QuickCheck          >= 2     && < 3

  if flag(base-49)
    build-depends:     base                >= 4.9 && < 5
    cpp-options:       "-DNEW_FUNCTOR_CLASSES"
  else
    build-depends:     base                >= 4.3 && < 4.9

  if flag(new-functor-classes)
    build-depends:     transformers        (>= 0.2 && < 0.4) || >= 0.5
                     , transformers-compat >= 0.5
    cpp-options:       "-DNEW_FUNCTOR_CLASSES"
  else
    build-depends:     transformers        == 0.4.*

  hs-source-dirs:      tests
  default-language:    Haskell2010
  ghc-options:         -Wall