[mercury-users] partially instantiated data structures

Thomas Conway conway at cs.mu.OZ.AU
Mon Jul 19 14:23:56 AEST 1999


On Fri, Jul 16, 1999 at 12:50:03PM EST, Fergus Henderson wrote:
> (In fact the Mercury solution in such cases is quite likely just as
> efficient as the Prolog solution, despite the copying, because of the
> efficiency advantages of Mercury's compile-time mode analysis.
> But using partially instantiated data structures in this way is
> a little more elegant.)

More elegant? You'd have to use custom modes everywhere, which would
mean you couldn't pass a list of goals with incomplete annotations
to foldl or map, etc, not to mention the fact that writing the
custom modes will be more work and require more intellectual
effort to grok than using ground modes.

This sort of thing is what I had in mind when I asked what one would
use nonground data structures for.  I suspect that in most cases the
approach using ground structures will be easier to write, read and
maintain, and be only marginally less efficient.

Thomas
-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list