@hackage deriving-compat0.2.1
Backports of GHC deriving extensions
Installation
Tested Compilers
Dependencies (7)
- base >=4.3 && <4.9
- containers >=0.1 && <0.6
- ghc-boot-th
- ghc-prim
- template-haskell >=2.5 && <2.12
- transformers >=0.4 && <0.5 Show all…
Dependents (34)
@hackage/swarm, @hackage/prologue, @hackage/commonmark-initial, @hackage/pandoc-symreg, @hackage/aws-arn, @hackage/jsonnet, Show all…
Package Flags
base-49
(on by default)
Use base-4.9 or later.
new-functor-classes
(on by default)
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.
deriving-compat
Provides Template Haskell functions that mimic deriving extensions that were introduced or modified in recent versions of GHC. Currently, the following extensions are covered:
DeriveFoldableDeriveFunctorDeriveTraversable
The following changes have been backported:
- In GHC 8.0,
DeriveFoldablewas changed to allow folding over data types with existential constraints. - In GHC 8.0,
DeriveFoldableandDeriveTraversablewere changed so as not to generate superfluousmemptyorpureexpressions in generated code. As a result, this allows derivingTraversableinstances for datatypes with unlifted argument types. - In GHC 8.0, deriving
Showwas 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 derivingGenericinstances, and modified in GHC 7.6 to allow derivation ofGeneric1instances. UseGenerics.Deriving.THfromgeneric-derivingto deriveGeneric(1)using Template Haskell.DeriveLift, which was introduced in GHC 8.0 for derivingLiftinstances. UseLanguage.Haskell.TH.Liftfromth-liftto deriveLiftusing Template Haskell.