On Monday, June 11, 2001, at 06:02 AM, Peter Padawitz wrote:
Using the type definition:
data Term a = T a [Term a]
I run the precomplied Hugs version on a Mac and another one under Sun OS. The first accepts the instance definition:
instance Show (Term String) where ..
The second reports
syntax error in instance head (variable expected)
and accepts if I write:
instance Show a => Show (Term a) where ..
Why do the systems react differently???
Best regards,
Peter
Hi Peter, Your first instance declaration above isn't strictly Haskell 98 code, Hugs needs the -98 flag in order to accept this form of instances. Type hugs -98 on your Sun machine and the example will compile just fine. Somewhat unfortunately, the Mac version runs in -98 mode by default because of the contents of the supplied file "Hugs Preferences" in the Hugs root folder. You can edit this file to suit your own preferences; still, you were right in expecting the default configuration to be the same on all platforms. Thanks for bringing this inconsistency to my attention. It will be fixed in the forthcoming release. All the best, Johan