Generalized newtype deriving 6.6 vs. 6.8

Isaac Dupree isaacdupree at charter.net
Mon Nov 5 10:38:11 EST 2007


Simon Peyton-Jones wrote:
> Well it's debatable. Suppose we have
> 
>   newtype Foo = MkFoo String deriving( Num )
> 
> Do you want to generate
> 
>   instance Num String => Num Foo
> 
> ?

Personally, I think I would like that -- along with a warning message. 
It makes it clearer to me that I can do

newtype Foo a = MkFoo a deriving( Num )

without requiring that Foo can only be instantiated with types in Num.

I'm not sure though.


Isaac


More information about the Glasgow-haskell-users mailing list