
16 Nov
2010
16 Nov
'10
1:52 p.m.
On 16 November 2010 18:40, Russ Abbott
why isn't
instance Show Test
interpreted to mean
data Test = Test deriving (Show)
* -- Russ *
One of them is declaring an instance, the other is asking the compiler derive an instance declaration for you. I don't know why the empty one is interpreted to be an instance deriving. Maybe because in such a case there would be no way to declare an empty instance? In addition, there is yet another similar syntax. See stand-alone derivinghttp://haskell.org/ghc/docs/6.12.2/html/users_guide/deriving.html . Ozgur