import ambiguity

Dean Herington <[email protected]>
Newsgroups gmane.comp.lang.haskell.glasgow.bugs,gmane.comp.lang.haskell.hugs.bugs
Organization Dept. of Computer Science, UNC-CH
Message-ID <[email protected]>
With the program:

import Exception
main = let catch = Prelude.catch in catch (print "ok") print

hugs 98 version 20021021 gives:

__   __ __  __  ____   ___
_________________________________________
||   || ||  || ||  || ||__      Hugs 98: Based on the Haskell 98
standard
||___|| ||__|| ||__||  __||     Copyright (c) 1994-2002
||---||         ___||           World Wide Web: http://haskell.org/hugs
||   ||                         Report bugs to: [email protected]
||   || Version: 20021021
_________________________________________

Haskell 98 mode: Restart with command line option -98 to enable
extensions

Reading file "/stotts2/epa1/hugs98-Oct2002/rel/lib/hugs/lib/Prelude.hs":

Reading file "ImportAmbiguity.hs":
Reading file
"/stotts2/epa1/hugs98-Oct2002/rel/lib/hugs/lib/exts/Exception.hs":
Reading file "ImportAmbiguity.hs":
Dependency analysis
ERROR "ImportAmbiguity.hs":2 - Ambiguous variable occurrence "catch"
*** Could refer to: Prelude.catch Exception.catch

Exception>


whereas GHC accepts the program.  Which system is right?

By the way, hugs98-Dec2001 gives:

Reading file "ImportAmbiguity.hs":
Reading file
"/stotts2/epa1/hugs98-Dec2001/rel/share/hugs/lib/exts/Exception.hs":
Reading file "ImportAmbiguity.hs":
ERROR "ImportAmbiguity.hs" - Entity "catch" imported from module
"Exception" already defined in module "Prelude"
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.