Comment by emmelaich
9 years ago
More abstractly, I enjoyed a description of a text editor in a Categories for Computer Science class I took waay back.
It's two stacks head to head. Moving the cursor is popping on one and and pushing on the other. All the other operations were given too. There were the category diagrams and everything -- the meat of which I've forgotten but I might be able to find if anyone is interested.
I'd be interested. Using two stacks is a nifty technique.
That technique sounds analogous to using a zipper to traverse a list (I've found a decent looking link for the technique if you're interested - https://ferd.ca/yet-another-article-on-zippers.html)
This is the book. The preview is limited though and I can't find the editor reference directly.
Categories and Computer Science R.F.C Walters, 1992 https://books.google.com.au/books?id=FurEQgAACAAJ&dq=edition...