[m-users.] problem with unique modes

Mark Brown mark at mercurylang.org
Mon Jun 22 21:05:12 AEST 2015

On Fri, Jun 19, 2015 at 5:45 PM, Matthias G├╝demann
<matthias.guedemann at googlemail.com> wrote:
> Hi Mark,
>> Please read Julien's remarks made at the time. The inst
>> `bound(mk_pair(unique, ground))' does not make sense, and ought to be
>> rejected before mode analysis starts.
> I had read it and got the impression that this would not be very
> difficult and completely separate from nested unique modes.

I wouldn't say that. But in any case the program is not much of a
motivating example for supported nested uniqueness. At least, I don't
see the motivation.

Before nested modes, what I'd like to see is 'ui' supported in a way
that's usable. It wouldn't require full alias tracking so far as I can
see; you just need to ask the programmer to avoid some var-var
unifications, and have the compiler avoid introducing them.

The motivating example for this is the array module, which still
contains the comment:

% XXX the current Mercury compiler doesn't support `ui' modes,
% so to work-around that problem, we currently don't use
% unique modes in this module.

> I'd like to understand the problem with nested unique modes. When
> reading through the archives, this was a recurring topic and Ralph
> Becket mentioned that
>  "We do have a workable analysis sketched out, but just don't have the
>   resources to fix this particular problem at the moment."
> Is this information available somewhere?

David Overton's thesis is a good source of information, and is
possibly what Ralph was referring to. It's available on the papers


More information about the users mailing list