Deriving `Typeable` has no effect [GHC-90584]

Flag: -Wderiving-typeable

This warning occurs when trying to derive an instance of the Typeable class. Deriving Typeable is not necessary as all types automatically derive Typeable.

Examples

Deriving ‘Typeable’ has no effect

Error Message

Main.hs:9:12: warning: [-Wderiving-typeable] [GHC-90584]
    • Deriving ‘Typeable’ has no effect: all types now auto-derive Typeable
    • In the data declaration for ‘Foo’
  |
9 |   deriving Typeable
  |            ^^^^^^^^
Main.hs
Before
{-# OPTIONS_GHC -Wderiving-typeable #-}
module Example where

import Data.Typeable

data Foo = Foo Int | Bar Char
  deriving Typeable
After
{-# OPTIONS_GHC -Wderiving-typeable #-}
module Example where

import Data.Typeable

data Foo = Foo Int | Bar Char