Derive Generic

Although it is technically possible to write your own instances of the GenericGeneric typeclass, in practice we nearly always let GHC derive it for us. Since the Haskell Report specifies only a fixed handful of classes that are allowed to go into a deriving clause, this requires a language extension.

Generic can be derived for all but the most exotic datatypes; it does not work with some fancy features like existential quantification or GADTs.

The DeriveGeneric GHC extension first appeared in GHC version 7.2.1.

Join Type Classes for courses and projects to get you started and make you an expert in FP with Haskell.