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

Bartosz Witkowski bartosz.witkowski at like-a-boss.net
Wed Jun 26 02:10:55 AEST 2019


Hi Peter, Julian,

Just throwing it out there but I implemented a zipper data structure
in mercury some time ago if you're interested:
  https://gist.github.com/bartosz-witkowski/8154124

Kind Regards,
Bartosz Witkowski

On Tue, Jun 25, 2019 at 3:49 PM Peter Wang <novalazy at gmail.com> wrote:

> 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
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20190625/969ee1ba/attachment.html>


More information about the users mailing list