From: simonpj@microsoft.com Date: Sun, 2 Apr 2006 21:59:11 +0000 (+0000) Subject: Improve newtype deriving X-Git-Tag: Before_FC_branch_merge~556 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=aa2c486e51caa0386aaff0d1b866a60316500b41;hp=aa2c486e51caa0386aaff0d1b866a60316500b41;p=ghc-hetmet.git Improve newtype deriving Ross Paterson pointed out a useful generalisation of GHC's newtype-deriving mechanism. This implements it. The idea is to allow newtype Wrap m a = Wrap (m a) deriving (Monad, Eq) where the representation type doesn't start with a type constructor. Actually GHC already *did* implement this, but the eta-ok check in TcDeriv missed a case, so there was a lurking bug. This patches fixes the documentation too. drvrun019 tests. ---