BSD-3-Clause licensed by Ryan Scott
Maintained by Ryan Scott
This version can be pinned in stack with:deriving-compat-0.2.2@sha256:4a1a18c9e7435c2db80d195d294383123c46b4ed2734d0b93b130365bc8a0696,6158

Module documentation for 0.2.2

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.
  • 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 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.2

  • Fixed a bug in Text.Show.Deriving’s treatment of unlifted types

0.2.1

  • Added Text.Show.Deriving, which allows deriving Show, Show1, and Show2 with TH.

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