I am a bit late to this discussion, but do recall using a the rosezipper in HaRe.

And I just took a look and recall doing some experiments with zippers, which are at

https://github.com/alanz/HaRe/tree/98f390b6e9d48537429863ca890aa853afcd7c79/experiments

The actual code I used for the move definition refactoring is at
https://github.com/alanz/HaRe/blob/98f390b6e9d48537429863ca890aa853afcd7c79/src/Language/Haskell/Refact/Refactoring/MoveDef.hs#L355
I added a couple of helper functions too.

I am sure it is all horrible code, I was learning at the time, and it sort of blew my mind.

Alan


On Wed, 22 Jul 2020 at 21:11, Olaf Klinke <olf@aatal-apotheke.de> wrote:
> A direct implementation without using a library is interesting, thank
> you. I
> refrained from doing that, because I thought that Control.Zipper
> would actually
> do this for me. Actually, I was pretty successful with using
> Control.Zipper to
> change node labels, but failed doing more complicated stuff.
>
Isn't that a strong indicator that zippers are an improper abstraction
for your purpose? Perhaps after rolling your own implementation you can
more easily discover how to represent the algrorithm as a zipper.

Olaf

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.