To bring the intellectual tone down a notch or two from that
"overlapping instances" thread ...

I've just spent spent a few hours tearing my hair out trying to work
out why my code was giving different answers under hugs and under ghc.

Eventually I found that ghc was ignoring fixity declarations in a
where clause (actually I'm not sure if it was ignoring them - but it
certainly isn't doing what I'd expect).

Here's a test case:

Test.hs contains:

main = print val

val = 3 +! 4 *! 2
    where (+!) = (+)
          (*!) = (*)
          infixl 6 +!
          infixl 7 *!

and then:

[mwh21@atrus 15.8]$ runhugs Test.hs 
11
[mwh21@atrus 15.8]$ ghc Test.hs
[mwh21@atrus 15.8]$ ./a.out 
14

Who's wrong here?  Me or ghc?

A (very) cursory scan of the Haskell report comes out in my favour,
but I'm certainly no expert.  This is the first time I've used haskell
for anything "real", so be gentle please!

Cheers,
Michael

PS: This is with a freshly downloaded ghc-4.06-1.i386.rpm

Reply via email to