[mercury-users] list.merge is not tail recursive

Michael Day mikeday at yeslogic.com
Fri Jan 22 11:20:18 AEDT 2010


Hi Ralph,

> A better solution for a large list is to convert it to an array, sort
> the array, then convert back to a list.

Yes, or build the list up in sorted order in the first place rather than 
sorting it at the end, which is what we are doing now.

But the standard library should still be fixed! It will run slightly 
faster with the tail recursive optimisation presumably, as well as not 
segfaulting on lists with 500k elements.

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