BSD-3-Clause licensed by Ryan Scott
Maintained by Ryan Scott

Module documentation for 0.2

This version can be pinned in stack with:deriving-compat-0.2@sha256:8410c0591147732eaa2e32ad32d67c54090d56715d971ec3d01f9ddda2b20c79,4232

deriving-compat

Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build

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.

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 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 th-lift to derive Lift using Template Haskell.

Changes

0.2

  • Added support for GHC 8.0
  • Added Data.Functor.Deriving and Data.Traversable.Deriving, which allow deriving Functor and Traversable with TH.
  • Added Data.Deriving, which reexports all other modules

0.1

  • Initial commit