@hackage deriving-compat0.2
Backports of GHC deriving extensions
Installation
Tested Compilers
Dependencies (4)
- base >=4.3 && <5
- containers >=0.1 && <0.6
- ghc-prim
- template-haskell >=2.5 && <2.12 Show all…
Dependents (34)
@hackage/swarm, @hackage/prologue, @hackage/commonmark-initial, @hackage/pandoc-symreg, @hackage/aws-arn, @hackage/jsonnet, Show all…
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.
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.