[m-rev.] diff: unique modes for list__reverse

Michael Day mikeday at bigpond.net.au
Mon Oct 15 20:33:55 AEST 2001


> Why? This change will break code which does `list__map(list__reverse, Xs)',
> and has very little benefit at the moment. This sort of change should wait
> until the mode checker handles uniqueness and taking the address of
> predicates with multiple modes properly. Even then, the mode that should
> be added is something like:
>
> :- mode list__reverse(di(uniq_list_skel(I)), out(uniq_list_skel(I))) is det.
>
> :- inst uniq_list_skel(I) == unique(([] ; [I | uniq_list_skel(I)])).

Oh well. It was an attempt at getting unique queues, which requires unique
lists that can be reversed. I completely forgot about the
taking-the-address-of-multiple-moded-predicates issue. It does bring up
two questions I have though...

When will the mode checker handle uniqueness? Is anyone willing to put
down even a tentative estimate? (in years, if necessary...)

Is it possible to have abstract insts and modes? It seems that abstract,
parametric insts would be necessary to store arbitrary higher order stuff
in abstract containers.

Michael

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list