
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. Mind you, it's probably no help to you because we must support Hugs and nhc here S | -----Original Message----- | From: libraries-admin@haskell.org [mailto:libraries-admin@haskell.org] On Behalf Of Iavor Diatchki | Sent: 04 June 2003 21:16 | To: Iavor Diatchki | Cc: Ross Paterson; libraries@haskell.org | Subject: Re: monad transformer library | | hello, | | Iavor Diatchki wrote: | >> Use of type synonyms, like | >> | >> type Reader r = R.ReaderT r Identity | >> | >> is more economical, but will lead to more complex error messages. | > | > this is a good point and i will change that, unless anyone objects? | | i am having 2nd thoughts about that. using newtypes will require an | alwful lot of "fake" instances making the libarary about 2 times bigger. | i tried to make a few errors and the error messages did not seem much | worse with the "type" -- what happens is that "missing instances" are | reported for the Identity monad, rather than the "Reader" monad. | this seems reasonable as methods usually just search for the first layer | that implements a given "feature", until they hit the "base case". using | newtype changes the base case from Identity to Reader, which in some | case i think is perhaps more confusing. any thoughts? | | bye | iavor | | _______________________________________________ | Libraries mailing list | Libraries@haskell.org | http://www.haskell.org/mailman/listinfo/libraries