Haskell 98 Report possible errors, part one

Simon Peyton-Jones simonpj@microsoft.com
Mon, 23 Jul 2001 06:09:55 -0700


Folks

Marcin is right about this.  It is inconsistent as it stands.=20
I propose to delete the sentence "The Preldue module
is always available as a qualified import..." in the first=20
para of 5.6.1.

The situation will then be:
  if you don't import Prelude explicitly, you implicitly get
	import Prelude
  if you do import Prelude explicitly, you get no implicit imports

Nice and simple

Simon

| 5.6.1. "an implicit `import qualified Prelude' is part of=20
| every module and names prefixed by `Prelude.' can always be=20
| used to refer to entities in the Prelude". So what happens in=20
| the following?
|=20
|     module Test (null) where
|     import Prelude hiding (null)
|     null :: Int
|     null =3D 0
|=20
|     module Test2 where
|     import Test as Prelude
|     import Prelude hiding (null)
|     x :: Int
|     x =3D Prelude.null
|=20
| ghc allows that, it dosen't seem to implement the qualified=20
| part of the implicit Prelude import. The report is=20
| contradictory: adding `import qualified Prelude' makes=20
| Prelude.null ambiguous, and thus names prefixed by `Prelude.'=20
| can't always be used to refer to entities in the Prelude.