[m-dev.] Partial instantiation example in the reference manual.

Mark Brown mark at mercurylang.org
Thu Nov 6 12:21:58 AEDT 2014


On Thu, Nov 6, 2014 at 10:40 AM, Julien Fischer <jfischer at opturion.com> wrote:
>
> Hi Paul,
>
> On Tue, 4 Nov 2014, Paul Bone wrote:
>
>>
>> Evan on stackoverflow.com tried the partial instantiation example from the
>> reference manual but found that it didn't work.  I tried the same program
>> and got the same error.  Is this (part of) the known issue with partial
>> instantiation or a seperate bug?  If it is part of the same issue should
>> we
>> use a different example in the reference manual or add a note that this
>> isn't actually supported by the current implementation?

There is already such a note in the first section Evan refers to.

A better example for this section might be to show some instantiation
subtyping, for example a list of non-empty lists. This would
illustrate the tree-like structure of insts, which is what that part
of the reference manual is discussing.

If there is going to be a theoretical example of partial
instantiatedness at all, then perhaps it should be fleshed out a bit
in a separate section to demonstrate more of its practical purpose? If
partial instantiatedness had its own section, it could also be made
clearer that the current implementation does not support it.

>
> The language supports it, but the current implementation doesn't due to a
> lack of support for aliasing in the mode checker.  Section 3 of this
> paper:
>
>     Constraint-based mode analysis of Mercury
>     David Overton, Zoltan Somogyi and Peter Stuckey. PPDP'02, Pittsburgh.
>
> has an explanation of *why* the existing mode checker cannot handle that
> example.

It's also due to problems that delay_partial_inst.m is trying to resolve.

Cheers,
Mark.



More information about the developers mailing list