Hi,

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 latest version of) 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.

and in section 5.3 says

    The effect of multiple import declarations is strictly cumulative...

Regards,
Thomas Hallgren


_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to