Ilya Beylin wrote:
>
> Dear stg-hugs team,
>
> The standard prelude in stg hugs 991125 exports IO
> as datatype
>
> > -- Non-standard exports
> > IO(..), IOResult(..), Addr, StablePtr,
>
> but defines it as a type abbreviation:
>
> > type IO a = ST RealWorld a
>
> This means that an instanciation like
>
> > instance Blah (IO a) where ...
>
> is not allowed in stdhugs, and there is no obvious way to correct it
> (because neither ST nor RealWorld is exported from the prelude)
>
> The Haskell 98 report clearly says that IO is a datatype (in section 6.1.7 and
> the subject index) and can be a class instance. Ghc, hbc, and the old hugs
> seem to support this view.
>
> What is the reason for the deviation?
You are totally correct. Its plain wrong in the November 99 STG Hugs
release. I spent quite a bit of time cleaning up the Prelude
for STG Hugs a couple of weeks ago, specifically motivated
(read annoyed) by this problem. What is also a problem with the
November 99 release is the namespace pollution caused by the Prelude
exporting its primitives. This problem has also been fixed.
Both these fixes required nontrivial changes to Hugs internals,
and that is why we never fixed it in time for Nov99.
In our credit however, November 99 STG Hugs was a thrillseekers
release, with known problems like this. If you need a stable
version right now, then Classic Hugs is the way to go.
So the problem will go away with the next release, because
its been fixed already. And we are working hard on the next
release of STG Hugs...
Andy Gill
--
Principal Project Scientist, Pacific Software Research Center
Department of Computer Science and Engineering
Oregon Graduate Institute of Science & Technology
phone +1 503 748 7451 http://www.cse.ogi.edu/~andy