[mercury-users] Destructive list operations

Michael Day mikeday at yeslogic.com
Tue Jan 6 13:31:00 AEDT 2009


Hi Ralph,

> one problem with the current interpretation of the unique modes (di and
> ui) is that the uniqueness goes "all the way down" (i.e., every
> component of every structure in the list is unique), which probably
> isn't what you want.  We have someone working on improved mode analysis
> which hopefully will lead to better support for uniqueness in the future
> - but don't hold your breath.

Right, this tends to break uniqueness for anything but the IO state.

> Regarding your performance concerns, have you considered moving to an
> array or tree based representation or otherwise abstracting away from
> lists?  If your structures really are unique, then some kind of
> extensible array data type might be more appropriate to your needs.

An array is not convenient, as we want to insert things into the middle 
of it, potentially replacing one item with several items. A tree could 
work for that, we haven't tried this option yet.

We have implemented our own list type entirely in C with a last pointer 
at the beginning for constant time appends, and that works, but results 
in overhead converting to and from standard lists if it is not used 
everywhere in the code.

Cheers,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
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