- Support building with
template-haskell-2.22.*
(GHC 9.10).
- When generating
Show(1)(2)
instances withText.Show.Deriving
using GHC 9.8 or later, data types that have fields of typeInt{8,16,32,64}#
orWord{8,16,32,64}#
will be printed using extended literal syntax, mirroring corresponding changes introduced in GHC 9.8 (see ghc-proposals/ghc-proposals#596).
- Support building with
template-haskell-2.21.*
(GHC 9.8). - The Template Haskell machinery now uses
TemplateHaskellQuotes
when building with GHC 8.0+ instead of manually constructing each Template HaskellName
. A consequence of this is thatderiving-compat
will now build with GHC 9.8, asTemplateHaskellQuotes
abstracts over some internal Template Haskell changes introduced in 9.8.
- Support
th-abstraction-0.5.*
.
- Make the test suite build with GHC 9.6 or later.
- Backport GHC!6955,
which makes derived
Eq
instances check data constructor tags, which can improve runtime performance for data types with nullary constructors. - Allow building the test suite with
transformers-0.6.*
.
- Allow building with
template-haskell-2.18.0.0
(GHC 9.2). - Using
deriveEnum
andderiveIx
on poly-kinded data family instances may now require the use of theTypeInType
extension if using GHC 8.0, 8.2, or 8.4. (On later versions of GHC,TypeInType
's functionality has been folded intoPolyKinds
.) - Support deriving
Eq
,Ord
, andShow
instances for data types with fields of typeInt32#
orWord32#
on GHC 9.2 or later. deriveVia
now instantiates "floating"via
type variables (i.e., type variables mentioned in thevia
type that are not mentioned in the instance context or the first argument toVia
) toAny
in the generated code. As a result,deriveVia
no longer generates code that produces-Wunused-foralls
warnings.
- Allow building with
template-haskell-2.17.0.0
(GHC 9.0).
- Have
deriveFunctor
andderiveFoldable
derive implementations of(<$)
andnull
, which GHC starting doing in 8.2 and 8.4, respectively. - Fix a bug in which
deriveOrd{,1,2}
could generate incorrect code for data types with a combination of nullary and non-nullary constructors. - Fix a bug in which
deriveFunctor
would fail on sufficiently complex uses of rank-n types in constructor fields. - Fix a bug in which
deriveFunctor
and related functions would needlessly reject data types whose last type parameters appear as oversaturated arguments to a type family.
- Allow building with GHC 8.10.
-
Permit
deriveVia
to use "floating"via
type variables, such as thea
in:deriveVia [t| forall a. Show MyInt `Via` Const Int a |]
- Support deriving
Eq
,Ord
, andShow
instances for data types with fields of typeInt8#
,Int16#
,Word8#
, orWord16#
on GHC 8.8 or later.
- Support
th-abstraction-0.3
or later.
- Expose
Internal
modules.
- Fix a bug in which
deriveEnum
/deriveIx
would generate ill-scoped code for certain poly-kinded data types.
- Fix a bug (on GHC 8.7 and above) in which
deriveGND
/deriveVia
would generate ill-scoped code.
- Have
deriveGND
/deriveVia
throw an error if an incorrect number of arguments are supplied to the type class.
-
Backport the changes to
GeneralizedNewtypeDeriving
andDerivingVia
code generation from Trac #15290.As a result, code generated by
deriveGND
orderiveVia
now requires theInstanceSigs
andScopedTypeVariables
language extensions. On the other hand, the generated code no longer requires theImpredicativeTypes
extension (unless any class methods use higher-rank types). -
Allow building with
containers-0.6
andtemplate-haskell-2.14
.
- Fix a bug that caused debug-enabled GHC builds to panic when generating code from this library (see Trac #15270). The fix only affects the library's internals, so no changes are user-facing.
- Backport the fixes for GHC Trac
#14364
and
#14918,
which significantly improve the compliation times of derived
Read
instances.
- Add
Data.Deriving.Via
, which allows emulating the behavior of theGeneralizedNewtypeDeriving
andDerivingVia
extensions. - Test suite fixes for GHC 8.4.
- Incorporate changes from the
EmptyDataDeriving
proposal (which is in GHC as of 8.4):- For derived
Eq
andOrd
instances for empty data types, simply returnTrue
andEQ
, respectively, without inspecting the arguments. - For derived
Read
instances for empty data types, simply returnpfail
(withoutparens
). - For derived
Show
instances for empty data types, inspect the argument (instead oferror
ing). In addition, addshowEmptyCaseBehavior
toShowOptions
, which configures whether derived instances for empty data types should use theEmptyCase
extension (this is disabled by default). - For derived
Functor
andTraversable
instances for empty data types, makefmap
andtraverse
strict in its argument. - For derived
Foldable
instances, do not error on empty data types. Instead, simply return the folded state (forfoldr
) ormempty
(forfoldMap
), without inspecting the arguments. - Add
FFTOptions
(Functor
/Foldable
/Traversable
options) toData.Functor.Deriving
, along with variants of existing functions that takeFFTOptions
as an argument. For now, the only configurable option is whether derived instances for empty data types should use theEmptyCase
extension (this is disabled by default).
- For derived
- Backport the fix to #13328. That is, when deriving
Functor
orTraversable
instances for data types where the last type variable is at phantom role, generatedfmap
/traverse
implementations now usecoerce
for efficiency. - Rename
emptyCaseBehavior
fromData.Functor.Deriving
tofftEmptyCaseBehavior
.
- Make
deriveTraversable
useliftA2
in derived implementations oftraverse
when possible, now thatliftA2
is a class method ofApplicative
(as of GHC 8.2) - Make
deriveShow
useshowCommaSpace
, a change introduced in GHC 8.2
- Fix bug in which derived
Ord
instances for datatypes with many constructors would fail to typecheck
- Fix bug in which infix record selectors weren't shown with parentheses in derived
Show
instances - Fix bug in which record selectors weren't parsed correctly in derived
Read
instances
- Add
Data.Bounded.Deriving
, which allows derivingBounded
with TH. - Add
Data.Enum.Deriving
, which allows derivingEnum
with TH. - Add
Data.Ix.Deriving
, which allows derivingIx
with TH. - Fix bug in which derived
Show
instance would parenthesize the output too eagerly
- Incorporate a fix to GHC Trac #10858, which will be introduced in GHC 8.2
- Fix bug in which derived
Ord
instances accidentally swapped their less-than(-or-equal-to) and greater-than(-or-equal-to) methods - Fix GHC HEAD build
- Allow deriving
Functor
andFoldable
instances for datatypes containing unboxed tuples - Microoptimization in derived instances of higher-order versions of
Eq
,Ord
,Read
, andShow
- Added
Data.Eq.Deriving
, which allows derivingEq
,Eq1
, andEq2
with TH. - Added
Data.Ord.Deriving
, which allows derivingOrd
,Ord1
, andOrd2
with TH. - Added
Data.Read.Deriving
, which allows derivingRead
,Read1
, andEq2
with TH. - Renamed
Text.Show.Deriving.Options
toShowOptions
so as to disambiguate it from the options datatypes in otherderiving-compat
modules.
- Fixed a bug in
Text.Show.Deriving
's treatment of unlifted types
- Added
Text.Show.Deriving
, which allows derivingShow
,Show1
, andShow2
with TH.
- Added support for GHC 8.0
- Added
Data.Functor.Deriving
andData.Traversable.Deriving
, which allow derivingFunctor
andTraversable
with TH. - Added
Data.Deriving
, which reexports all other modules
- Initial commit