Name collisions

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Hi all

I think this is a hugs bug, but the logic behind the rules in this sort
of case is a bit lost on me.



> module A (foo) where

> foo :: Int
> foo = 5



> module B (foo) where

> import A

> foo :: Int
> foo = 4



ghci says:

B.lhs:2:
    Ambiguous occurrence `foo'
    It could refer to either `A.foo', imported from A at B.lhs:4
                                        (defined at A.lhs:5)
                          or `B.foo', defined at B.lhs:7


hugs (CVS) says:

Hugs session for:
/home/igloo/local/hugs/lib/hugs/libraries/Hugs/Prelude.hs
/home/igloo/local/hugs/lib/hugs/libraries/Prelude.hs
A.lhs
B.lhs
Type :? for help
B> foo
4
B> 

ghci allows it if foo is not in the export list or there is no export
list.


Thanks
Ian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.