[mercury-users] some [T] ...

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 18 17:06:10 AEDT 2002


On 18-Nov-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Monday, 18 November 2002:
> 
> > The second and more serious issue is that values of sub-types can't be
> > easily stored in and retrieved from the container types provided by
> > the standard library, since the standard library routines for creating
> > and accessing container types are not polymorphically moded.  The Mercury
> > compiler now supports polymorphic modes, so this issue could be solved
> > by changing the standard library to use polymorphic modes.  However,
> > we have not yet done so, mainly because we have observed that doing so
> > would significantly increase compilation time for programs that use the
> > affected parts of the standard library (i.e. almost all programs).
> 
> Can't we leave the library alone and use it with subtypes if we adopt
> the "implicit polymorphic modes" proposal.  Mark and I discussed this
> and came to the conclusion it was safe if we put big warning signs
> around std_util__make_type and io__read

The "implicit polymorphic modes" proposal would solve most of the problem.
However, implementing that proposal would no doubt have some impact on
compilation time too (hopefully within acceptable limits, but that is
yet to be seen).  Also, I don't think we should do that without making
it properly type-safe.  Warning signs in the documentation may help a
little, but they don't eliminate the underlying problem.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list