[Hugs-bugs] module system/libraries bug
Ross Paterson
ross at soi.city.ac.uk
Wed Feb 4 23:51:48 EST 2004
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.
More information about the Hugs-Bugs
mailing list