[Hugs-bugs] module system/libraries bug
hello, i am having the following problem (just tried it with the current cvs version, on linux)
import Array import ST hiding (bounds)
test x = bounds x
ERROR "test.hs":4 - Ambiguous variable occurrence "bounds" *** Could refer to: Data.Array.Base.bounds Hugs.Array.bounds I am not sure why ST is exporting "bounds" at all, but in any case the "hiding" clause of the import should prevent the conflict. a similar thing occurs with "indices", but then adding the "hiding" clause solves the problem. -iavor -- ================================================== | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki | ==================================================
For some reason the class method 'bounds' isn't getting dropped from the effective import list of ST. Until that's been fixed, give Hugs a hand and state the method's class, i.e.: import ST hiding (HasBounds(bounds)) --sigbjorn Iavor S. Diatchki wrote:
hello, i am having the following problem (just tried it with the current cvs version, on linux)
import Array import ST hiding (bounds)
test x = bounds x
ERROR "test.hs":4 - Ambiguous variable occurrence "bounds" *** Could refer to: Data.Array.Base.bounds Hugs.Array.bounds
I am not sure why ST is exporting "bounds" at all, but in any case the "hiding" clause of the import should prevent the conflict. a similar thing occurs with "indices", but then adding the "hiding" clause solves the problem.
-iavor
On Wed, Feb 04, 2004 at 10:32:56AM -0800, Iavor S. Diatchki wrote:
i am having the following problem (just tried it with the current cvs version, on linux)
import Array import ST hiding (bounds)
test x = bounds x
ERROR "test.hs":4 - Ambiguous variable occurrence "bounds" *** Could refer to: Data.Array.Base.bounds Hugs.Array.bounds
I am not sure why ST is exporting "bounds" at all, but in any case the "hiding" clause of the import should prevent the conflict. a similar thing occurs with "indices", but then adding the "hiding" clause solves the problem.
Regarding the libraries part: the compatibility libraries in {Hugs}/oldlib approximate the old interfaces by importing and re-exporting hierarchical modules. This is often imperfect, as here (there's a re-export of Data.Array.ST, which re-exports Data.Array.MArray, which has a new version of bounds). But it would be too costly to maintain the exact old interface -- people are encouraged to migrate to the hierarchical libraries. Sooner or later, the old library interface will disappear from both Hugs and GHC.
participants (3)
-
Iavor S. Diatchki -
Ross Paterson -
Sigbjorn Finne