[m-rev.] for review: list_util and map_util

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jun 13 16:57:18 AEST 2003

On 13-Jun-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> During a conversation with Fergus, we agreed that it would be a good idea
> to move predicates and functions in list.m and map.m that are used by the
> compiler but are not all that generally useful to new modules. I therefore
> propose to set up two new modules, list_util.m and map_util.m, and I propose
> that their initial contents be the following:

Where would these new modules reside?

> map_util:
> :- pred lower_bound_search((map.map(K, V)), K, K, V).
> :- pred upper_bound_search((map.map(K, V)), K, K, V).
> :- pred remove_smallest((map.map(K, V)), K, V, (map.map(K, V))).

These operations currently take O(log N) time, but if they were
implemented in a different module without access to the representation
details of maps, they would have to take O(N) time, I think.
So I think it is probably better to leave these, even if they are not
very commonly used.

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-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