deriving weirdness on newtypes

Simon Peyton-Jones simonpj@microsoft.com
Tue, 8 Oct 2002 13:48:43 +0100


|     newtype Foo =3D Foo Int deriving (Num)
|     instance Show Foo where { show =3D undefined }
|=20
| then, the value of 'show (Foo 5)' is undefined, but the value of 'show
| (5::Foo)' is "5".  definately *WRONG*.

You're right.   This is all a bit more complicated than I (or John H)
thought.  Thinking cap on.  But don't hold your breath.

Simon