[m-users.] Efficient circular lists in pure Mercury?

Peter Wang novalazy at gmail.com
Tue Jun 25 23:49:10 AEST 2019


On Tue, 25 Jun 2019 00:28:59 -0500, jfondren at minimaltype.com wrote:
> 
> 1. Do you recommend some other way to implement circular lists, or a
> data structure suitable for this task?

Hi,

I think the standard solution would be a pair of lists. One list
represents, in reverse, the elements before the "current" element.
The other list represents the current and subsequent elements.

https://en.wikipedia.org/wiki/Zipper_(data_structure)

Peter


More information about the users mailing list