[mercury-users] Strange mode of univ.m:univ_to_type/2

Mark Brown mark at csse.unimelb.edu.au
Sun Nov 26 01:15:09 AEDT 2006

On 25-Nov-2006, Jrg Roman Rudnick <joerg.rudnick at t-online.de> wrote:
> Hi,
> The third mode of univ.m:univ_to_type/2 looks strange, doesn't it?

It is the same as type_to_univ/2, except with the arguments reversed.

>     :- pred univ_to_type(univ, T).
>     :- mode univ_to_type(in, out) is semidet.
>     :- mode univ_to_type(out, in) is det.
> =>   :- mode univ_to_type(uo, di) is det.    <=====
> I suppose you meant: ":- mode univ_to_type(di, uo) is det."

No, that won't work.  The forward mode of univ_to_type is semidet, and a
unique version is therefore not useful.


mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list