[Haskell-cafe] Classes in type declarations in Hugs
simonpj at microsoft.com
Mon Dec 6 05:15:19 EST 2004
| This is where I find ghc's newtype deriving to be incredibly useful.
| newtype CPError a = CPError (Either Error a)
| now CPError is a monad and an instance of MonadError and you are free
| override or inherit more interesting instances at will without
| conflicting with the basic types for Either :)
Aha! I've always wondered whether anyone uses this feature, which I
implemented at John Hughes's suggestion. I'd be interested to know if
you are alone, or whether others do so too.
More information about the Haskell-Cafe