i seem to have a problem with a qualified import of the prelude in hugs nov03, haskell extensions, under windows: Reading file "C:\gisTheoryCodeSept03\lib\Language\Value240.hs": ERROR "C:\gisTheoryCodeSept03\lib\Language\Value240.hs":207 - Ambiguous variable occurrence "quotRem" *** Could refer to: Language.Value240.quotRem Hugs.Prelude.quotRem the relevant code is: instance Ring Float where quotRem a b = (toFloat i, toFloat (b * f)) where ab = a/b i::Int (i,f) = Prelude.properFraction ab rem a b = f where (i,f) = quotRem a b --here is line 240 with the error (*) = (Prelude.*) quot a b = i where (i,f) = quotRem a b div = error "div not implemented for float" mod a b = error "mod not implemented for float" i had a similar error (redefining a class Integral and a complaint in the export list of ambiguit between the local definition and the qualified import). it seems that qualified import of the prelude is not properly handled? unfortunately this is not a small file and i did not manage to isolate the problem quickly in a small example. can you see what is wrong here? the file value240.hs is attached. thank you for your attention andrew Andrew U. Frank Geoinformation E127 phone: +43 1 588 01 12710 TU Vienna secr. +43 1 588 01 12700 Gusshausstrasse 27-29 fax +43 1 588 01 12799 A-1040 Vienna Austria cellular phone +43 676 41925 72 http://www.geoinfo.tuwien.ac.at/persons/frank/frank.html
On Sun, Sep 21, 2003 at 09:16:19PM +0200, Andrew Frank wrote:
i seem to have a problem with a qualified import of the prelude in hugs nov03, haskell extensions, under windows:
Reading file "C:\gisTheoryCodeSept03\lib\Language\Value240.hs": ERROR "C:\gisTheoryCodeSept03\lib\Language\Value240.hs":207 - Ambiguous variable occurrence "quotRem" *** Could refer to: Language.Value240.quotRem Hugs.Prelude.quotRem
There is a bug buried in all this: for import qualified Prelude hiding (Integral) Hugs is erroneously importing the methods of Integral unqualified. This is now fixed in CVS. Possible workarounds are import qualified Prelude or import qualified Prelude hiding (Integral(..))
participants (2)
-
Andrew Frank -
Ross Paterson