Hugs for Macs different from Hugs for Suns ??
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 --- Peter Padawitz Informatik 5 University of Dortmund D-44221 Dortmund Germany phone +49-231-755-5108 fax +49-231-755-4851 or -5802 secretary +49-231-755-5801 email peter.padawitz@udo.edu
At 15:02 +0200 2001/06/11, Peter Padawitz wrote:
I run the precomplied Hugs version on a Mac and another one under Sun OS. ... Why do the systems react differently???
The only reason I can think of is that you use different Hugs _kernel_ versions. If you use the Hugs4Mac that Pablo and I made, you can check the Hugs version by starting the program and then open the Apple menu MacHugs item. The latest version I and Pablo released publicly is based on the Hugs February 2000 kernel, even though I made one not yet publicly released based on the February 2001 kernel. Hans Aberg
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
participants (3)
-
Hans Aberg -
Johan Nordlander -
Peter Padawitz