[mercury-users] unique any inst?

Chris King colanderman at gmail.com
Thu Oct 20 13:48:22 AEDT 2011


Hi, I'm wondering if it is currently possible, or even theoretically
sound, to have an inst of "unique any".  My use case is a solver type
where one can create a new solver value from some existing one which
is subsequently removed from the constraint store for memory reasons.
In other words I am looking to export a function of mode:

:- func next(unique_any >> dead) = (free >> unique_any).

Using a weakly-keyed map for the constraint store would achieve the
same effect w/r/t memory usage, but such a thing is not theoretically
sound in Mercury, and anyway I would like to enforce these "garbage
collecting" semantics to prevent memory leaks.  Thoughts?

Thanks,
Chris
--------------------------------------------------------------------------
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