Search code examples
haskellxmonad

Why derive Typeable for this type


In xmonad source code, I find:

data Resize     = Shrink | Expand   deriving Typeable

I can't figure out why this needs to derive from Typeable

I saw a famous blog post by Chrisdone which explains the various usages of Typeable. But I can't find any of the scenarios in xmonad source code.

Any hint?


Solution

  • It's a remnant of older versions of GHC. Nowadays Typeable is derived for all types automatically and deriving Typeable does nothing but is allowed for backwards compatibility.