File: deriving-compat.cabal

package info (click to toggle)
haskell-deriving-compat 0.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 492 kB
  • sloc: haskell: 6,121; makefile: 5
file content (218 lines) | stat: -rw-r--r-- 9,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name:                deriving-compat
version:             0.6.6
synopsis:            Backports of GHC deriving extensions
description:         @deriving-compat@ provides Template Haskell functions that
                     mimic @deriving@ extensions that were introduced or modified
                     in recent versions of GHC. Currently, the following
                     typeclasses/extensions are covered:
                     .
                     * Deriving @Bounded@
                     .
                     * Deriving @Enum@
                     .
                     * Deriving @Ix@
                     .
                     * Deriving @Eq@
                     .
                     * Deriving @Ord@
                     .
                     * Deriving @Read@
                     .
                     * Deriving @Show@
                     .
                     * @DeriveFoldable@
                     .
                     * @DeriveFunctor@
                     .
                     * @DeriveTraversable@
                     .
                     * @GeneralizedNewtypeDeriving@ (with GHC 8.2 or later)
                     .
                     * @DerivingVia@ (with GHC 8.2 or later)
                     .
                     See the "Data.Deriving" module for a full list of backported changes.
                     .
                     In addition, @deriving-compat@ also provides some additional
                     @deriving@ functionality that has not yet been merged into
                     upstream GHC. Aside from the GHC @deriving@ extensions
                     mentioned above, @deriving-compat@ also permits deriving
                     instances of classes in the @Data.Functor.Classes@ module,
                     covering the @Eq1@, @Eq2@, @Ord1@, @Ord2@, @Read1@,
                     @Read2@, @Show1@, and @Show2@ classes. This extra
                     functionality is outside of the main scope of
                     @deriving-compat@, as it does not backport extensions that
                     exist in today's GHC. Nevertheless, the underlying Template
                     Haskell machinery needed to derive @Eq@ and friends
                     extends very naturally to @Eq1@ and friends, so this extra
                     functionality is included in @deriving-compat@ as a
                     convenience.
                     .
                     Note that some recent GHC typeclasses/extensions are not covered by this package:
                     .
                     * @DeriveDataTypeable@
                     .
                     * @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.
                     .
                     * The @Bifunctor@ typeclass, which was introduced in GHC 7.10,
                       as well as the @Bifoldable@ and @Bitraversable@ typeclasses, which
                       were introduced in GHC 8.2. Use @Data.Bifunctor.TH@ from
                       @<http://hackage.haskell.org/package/bifunctors bifunctors>@
                       to derive these typeclasses 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-2017 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.2
                   , GHC == 8.2.2
                   , GHC == 8.4.4
                   , GHC == 8.6.5
                   , GHC == 8.8.4
                   , GHC == 8.10.7
                   , GHC == 9.0.2
                   , GHC == 9.2.8
                   , GHC == 9.4.8
                   , GHC == 9.6.4
                   , GHC == 9.8.2
                   , GHC == 9.10.1
cabal-version:       >=1.10

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

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

flag template-haskell-2-11
  description:         Use template-haskell-2.11.0.0 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.Deriving.Internal

                       Data.Bounded.Deriving
                       Data.Bounded.Deriving.Internal
                       Data.Deriving.Via
                       Data.Deriving.Via.Internal
                       Data.Enum.Deriving
                       Data.Enum.Deriving.Internal
                       Data.Eq.Deriving
                       Data.Eq.Deriving.Internal
                       Data.Foldable.Deriving
                       Data.Functor.Deriving.Internal
                       Data.Functor.Deriving
                       Data.Ix.Deriving
                       Data.Ix.Deriving.Internal
                       Data.Ord.Deriving
                       Data.Ord.Deriving.Internal
                       Data.Traversable.Deriving
                       Text.Read.Deriving
                       Text.Read.Deriving.Internal
                       Text.Show.Deriving
                       Text.Show.Deriving.Internal
  build-depends:       containers          >= 0.1   && < 0.8
                     , ghc-prim
                     , th-abstraction      >= 0.4   && < 0.8

  if flag(base-4-9)
    build-depends:     base                >= 4.9   && < 5
    cpp-options:       "-DNEW_FUNCTOR_CLASSES"
  else
    build-depends:     base                >= 4.3   && < 4.9
                     , semigroups          >= 0.6   && < 0.21

  if flag(template-haskell-2-11)
    build-depends:     template-haskell    >= 2.11  && < 2.23
                     , ghc-boot-th
  else
    build-depends:     template-haskell    >= 2.5   && < 2.11

  if flag(new-functor-classes)
    build-depends:     transformers        (>= 0.2  && < 0.4) || (>= 0.5 && < 0.7)
                     , 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:       BoundedEnumIxSpec
                       DerivingViaSpec
                       EqSpec
                       FunctorSpec
                       OrdSpec
                       ReadSpec
                       ShowSpec
                       GH6Spec
                       GH24Spec
                       GH27Spec
                       GH31Spec

                       Types.EqOrd
                       Types.ReadShow
  build-depends:       base-compat         >= 0.8.1  && < 1
                     , base-orphans        >= 0.5    && < 1
                     , deriving-compat
                     , hspec               >= 1.8
                     , QuickCheck          >= 2      && < 3
                     , tagged              >= 0.7    && < 1
                     , template-haskell    >= 2.5    && < 2.23
                     , void                >= 0.5.10 && < 1
  build-tool-depends:  hspec-discover:hspec-discover >= 1.8

  if flag(base-4-9)
    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 && < 0.7)
                     , 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 -threaded -rtsopts
  if impl(ghc >= 8.6)
    ghc-options:       -Wno-star-is-type
  if impl(ghc >= 9.0)
    ghc-options:       -fenable-th-splice-warnings