Thomas Hallgren says: | The following program was accepted by previous versions of | GHC, but is not in GHC 5.02 | | module HidingBug where | import Prelude hiding (lookup) | | lookup env x = Prelude.lookup x env | | Instead, you get the error message | | HidingBug.hs:4: Variable not in scope: `Prelude.lookup' | | This behaviour does not seem to agree with the | Haskell 98 Report, which in section 5.6.1 says | | The Prelude module is imported automatically into all modules as if | by the statement `import Prelude', if and only if it is not imported | with an explicit import declaration. This provision for explicit | import allows values defined in the Prelude to be hidden from the | unqualified name space. The Prelude module is always available as a | qualified import: an implicit `import qualified Prelude ' is part of | every module and names prefixed by `Prelude.' can always be used to | refer to entities in the Prelude. An(other) excellent point. This didn't happen on purpose, but it did happen for a reason. In the current Report draft, the idea is that a hiding clause hides both qualified and unqualified names import Foo hiding( f ) hides Foo.f as well as unqualified f. I think we all agreed that is a good change. But we (ahem, I) forgot to propagate that change to the sections about the Prelude. It's really odd to say import Prelude hiding( map ) does *not* hide Prelule.map, after all. In GHC we didn't implement this inconsistency, hence the original message. I therefore PROPOSE to replace the current text with: The Prelude module is imported automatically into all modules as if by the statement `import Prelude', if and only if it is not imported with an explicit import declaration. This provision for explicit import allows values defined in the Prelude to be selectively imported, just like any other module. The fact that this makes the Report behave like GHC is purely coincidental :-) Seriously, comments anyone? Simon