| The program that didn't work with hugs (hugs98 septemeber, -98 or +98
| doesn't matter) but worked with ghc was this:
|
| newtype Show (f (Fix f)) => Fix f = In (f (Fix f))
| deriving Show
|
| newtype Nat = MkNat (Fix Maybe)
| deriving Show
Ok, this is a different program to the one I tried because it includes
the Nat definition; your previous message mentioned only Fix, so I left
out Nat. The behavior of this program with Hugs surprises me not; I
wouldn't expect it to work. The behavior of ghc is a mystery, however.
And in fact on my machine, with the very latest ghc 4.045, the example
doesn't work, delivering an error instead:
No instance for `Show (f (Fix f))'
When deriving classes for `Fix'
This seems like the correct behavior to me and I don't know why you are
seeing different results. If you can get it to compile, have you tried
actually using the derived show functions? Do they work?
| So this means that there are actually undecidable stuff in the haskell
| language, right?
If Haskell allowed definitions like the above, then you would be correct.
But it doesn't: with my interpretation of the report, those definitions
are not legal in Haskell 98, and so a Haskell system should reject them.
... which is precisely what happens in my experiments with Hugs and ghc!
All the best,
Mark