deriving-compat
Version 0.3.2 revision 0 uploaded by ryanglscott.
Package meta
- Synopsis
- Backports of GHC deriving extensions
- Description
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
andDeriveTraversable
were changed so as not to generate superfluousmempty
orpure
expressions in generated code. As a result, this allows derivingTraversable
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.In GHC 8.2, deriving Ord was changed so that it generates concrete
if
-expressions that are not subject toRebindableSyntax
. It was also changed so that derived(<=)
,(>)
, and(>=)
methods are expressed through(<)
, which avoids generating a substantial amount of code.
Note that some recent GHC extensions are not covered by this package:
DeriveGeneric
, which was introducted in GHC 7.2 for derivingGeneric
instances, and modified in GHC 7.6 to allow derivation ofGeneric1
instances. UseGenerics.Deriving.TH
fromgeneric-deriving
to deriveGeneric(1)
using Template Haskell.DeriveLift
, which was introduced in GHC 8.0 for derivingLift
instances. UseLanguage.Haskell.TH.Lift
fromth-lift
to deriveLift
using Template Haskell.
- Author
- Ryan Scott
- Bug reports
- https://github.com/haskell-compat/deriving-compat/issues
- Category
- Compatibility
- Copyright
- (C) 2015-2016 Ryan Scott
- Homepage
- https://github.com/haskell-compat/deriving-compat
- Maintainer
- Ryan Scott <ryan.gl.scott@gmail.com>
- Package URL
- n/a
- Stability
- Experimental