Deriving mechanisms in GHC