Skip to content

hiding does not follow haskell report

Email: mdg@wanadoo.fr

As understand hiding from the Haskell report, it should
hide only the unqualified name and not the qualified name,
e.g., hide head but not Prelude.head (or List.head).  This
is not the case with ghc 6.0.1:

mdg@mdglt:/bug-2111> cat Main.hs 
module Main where

import Prelude hiding (head)

main = do print (Prelude.head [0..])
          head

head = print "head"

mdg@mdglt:/bug-2112> ghc --version        
The Glorious Glasgow Haskell Compilation System,
version 6.0.1

mdg@mdglt:/bug-2113> ghc -fglasgow-exts -o Main --make Main
Chasing modules from: Main
Compiling Main             ( Main.hs, ./Main.o )

Main.hs:5: Variable not in scope: `Prelude.head'

mdg@mdglt:/bug-2114> ghc -o Main --make Main               
Chasing modules from: Main
Compiling Main             ( Main.hs, ./Main.o )

Main.hs:5: Variable not in scope: `Prelude.head'
mdg@mdglt:/bug-2115> runhugs Main
0
"head"

as expected.
Trac metadata
Trac field Value
Version 6.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information