monad transformer library
Ross Paterson
ross@soi.city.ac.uk
Fri, 6 Jun 2003 10:19:40 +0100
On Fri, Jun 06, 2003 at 09:14:18AM +0100, Simon Peyton-Jones wrote:
> You do know that in GHC (though not Hugs) you can say
>
> newtype Foo = MkFoo Baz deriving( Monad, MyClass, This, That )
>
> That is, deriving works for arbitrary classes for newtypes, just using
> the instance
> for the representation type. This greatly alleviates the pain you refer
> to. It's documented in the GHC user manual.
I recall that you came across a glitch with the specification of this
feature -- is that all sorted out now?
> Mind you, it's probably no help to you because we must support Hugs and
> nhc here
Precisely, though Nhc is already ruled out by the multi-parameter type
classes and functional dependencies used in both old and new versions
of the monad libraries.