Improve newtype deriving
authorsimonpj@microsoft.com <unknown>
Sun, 2 Apr 2006 21:59:11 +0000 (21:59 +0000)
committersimonpj@microsoft.com <unknown>
Sun, 2 Apr 2006 21:59:11 +0000 (21:59 +0000)
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.


No differences found