wiki:DerivingInstances

Deriving instances

All about the deriving keyword.

Status

Use Keyword = deriving (or deriving-perf for performance-related tickets) to ensure that a ticket ends up on these lists.

Open Tickets:

#1544
Derived Read instances for recursive datatypes with infix constructors are too inefficient
#3205
Generalized isomorphic deriving
#5041
Incorrect Read deriving for MagicHash constructors
#5642
Deriving Generic of a big type takes a long time and lots of space
#7258
Compiling DynFlags is jolly slow
#8128
Standalone deriving fails for GADTs due to inaccessible code
#8263
allow duplicate deriving / standalone deriving
#8731
long compilation time for module with large data type and partial record selectors
#8740
Deriving instance conditionally compiles
#8827
Inferring Safe mode with GeneralizedNewtypeDeriving is wrong
#9112
support for deriving Vector/MVector instances
#9450
GHC instantiates Data instances before checking hs-boot files
#9522
SPECIALISE pragmas for derived instances
#9557
Deriving instances is slow
#9669
Long compile time/high memory usage for modules with many deriving clauses
#9790
Produce coercion rules for derived Functor instances
#10607
Auto derive from top to bottom
#10980
Deriving Read instance from datatype with N fields leads to N^2 code size growth
#12457
Deriving should be (more closely) integrated with other metaprogramming methods
#12639
Inconsistent treatment of FlexibleInstances and MPTCs with standard vs. flexible deriving
#12860
GeneralizedNewtypeDeriving + MultiParamTypeClasses sends typechecker into an infinite loop
#13154
Standalone-derived anyclass instances aren't as permissive as empty instances
#13280
Consider deriving more Foldable methods
#13324
Allow PartialTypeSignatures in the instance context of a standalone deriving declaration
#13327
Figure out how to make sense of Data instances for poly-kinded datatypes
#13403
Derive instances (Applicative, Monad, ...) for structures lifted over functors
#13465
Foldable deriving treatment of tuples is too surprising
#13731
DeriveFunctor and friends don't understand type families
#13748
Variables pretty-printed from -ddump-deriv are not scoped properly
#13957
Allow deriving multiparameter type classes with representationally equal arguments
#14030
Implement the "Derive Lift instances for data types in template-haskell" proposal
#14070
Allow ‘unsafe’ deriving strategy, deriving code with ‘unsafeCoerce’
#14331
Overzealous free-floating kind check causes deriving clause to be rejected
#14332
Deriving clauses can have forall types

Closed Tickets:

#1356
"derive instance" panics ghc-6.7.20070404
#1830
Automatic derivation of Lift
#2733
Newtype deriving over phantom types broke between GHC 6.6.1 and GHC 6.8.1
#2734
Newtype deriving over phantom types broke between GHC 6.6.1 and GHC 6.8.1
#3368
Deriving Foldable doesn't work
#3422
No match in record selector Var.tcTyVarDetails
#4019
deriving Ord can produce incorrect and inefficient instances
#4028
Derived Data instance requires Data instances for unused type parameters
#4235
deriving Enum fails for data instances
#4309
Painfully large errors with silly GADT instances
#4528
stand-alone deriving sometimes fails for GADTs
#4529
Deriving Data does not work for attached code
#4530
Deriving Data for existentially quantified types
#4815
Instance constraints should be used when deriving on associated data types
#4896
Deriving Data does not work for attached code
#5007
"deriving" seems to ignore class context for a type family
#7199
Standalone deriving Show at GHCi prompt causes divergence when printing
#7401
Can't derive instance for Eq when datatype has no constructor, while it is trivial do do so.
#7436
Derived Foldable and Traversable instances become extremely inefficient due to eta-expansion
#7742
StandaloneDeriving on Read fails for GADTs
#8631
Need ImpredicativeTypes for GeneralizedNewtypeDeriving?
#9444
-ddump-deriv doesn't dump failed newtype-deriving
#9630
compile-time performance regression (probably due to Generics)
#9850
Template Haskell does not seem to support StandaloneDeriving
#10361
DeriveAnyClass does not fill in associated type defaults
#10447
DeriveFoldable rejects instances with constraints in last argument of data type
#10524
PolyKinds doesn't interact well with DeriveFunctor
#10561
"deriving (Functor)" on a polykinded type produces ill-kinded instance
#10577
Use empty cases where appropriate when deriving instances for empty types
#10598
DeriveAnyClass and GND don't work well together
#10835
Regression in standalone Data deriving for phantom types
#10858
Smaller generated Ord instances
#10938
DeriveAnyClass + deriving Bifunctor causes GHC panic
#11174
Traversable can't be derived for datatypes with unboxed arguments
#11396
deriving Ix with custom ifThenElse causes "Bad call to tagToEnum#"
#11509
Incorrect error message in StandaloneDeriving: "The data constructors of <typeclass> are not all in scope"
#11837
GHC fails to unify kinds when deriving polykinded typeclass instance for polykinded newtype
#12047
Users Guide: GeneralizedNewtypeDeriving derives “instance Num Int => Num Dollars”
#12080
RebindableSyntax breaks deriving Ord
#12234
'deriving Eq' on recursive datatype makes ghc eat a lot of CPU and RAM
#12399
DeriveFunctor fail
#12438
DeriveDataTypeable - deriving instance Data (Mu (Const ()))
#12439
DeriveDataTypeable - deriving Data for several type constructor applications
#12616
type synonyms confuse generalized newtype deriving role checking
#12688
derived Show instances aren't protected from RebindableSyntax+OverloadedStrings
#12768
8.0.2 derives invalid code when class method is constrained by itself
#12814
Should GND infer an instance context when deriving method-free classes?
#13056
Deriving Foldable causes GHC to take a long time (GHC 8.0 ONLY)
#13117
Derived functor instance for void types handles errors badly
#13175
Documenting what can be derived 'out of the box' by GHC's "deriving"
#13218
<$ is bad in derived functor instances
#13263
cant derive functor on function newtype with unboxed tuple result
#13272
DeriveAnyClass regression involving a rigid type variable
#13314
StandaloneDeriving and DeriveAnyClass don't work together
#13328
Foldable, Functor, and Traversable deriving handle phantom types badly
#13759
Strange error message for deriving Data
#14094
DeriveAnyClass doesn't warn about unimplemented type families
#14339
GHC 8.2.1 regression when combining GND with TypeError (solveDerivEqns: probable loop)
#14357
Document deriving strategies fully
#14364
Reduce repetition in derived Read instances
#14365
Panic with (bogus?) deriving in hs-boot: newTyConEtadArity
#14462
deriving on associated data types fails to find constraints

Last modified 4 months ago Last modified on Aug 1, 2017 4:23:02 PM