New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify the structure of XMonad.StackSet.Stack type #486
Clarify the structure of XMonad.StackSet.Stack type #486
Conversation
Add extra comment lines with examples making it more clear how the data is organized.
For what it's worth, the I'll take a closer look at this tomorrow; it's bedtime here. |
So to expand on zippers, the behavior of
Now you move down the zipper:
Now repeat it, and you'll note that
Moving in the other direction is equally easy because of that reversal: push
This is the essence of a zipper: it lets you move a focus through a data structure. Zippers can also be defined for various kinds of trees, supporting move-up, move-down, move-left, and move-right operations (see the example in https://wiki.haskell.org/Zipper). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original ASCII art
+-- master: < '7' > up | [ '2' ] +--------- [ '3' ] focus: < '4' > dn +----------- [ '8' ]
is actually quite clear; what problems did you have with understanding it?
@slotThe like what is this @geekosaur Thanks for explanation. Though I already figured that out. The point of the change is to help others who want to fiddle around with it to have a clear and transparent view on what the data looks like. I think just this piece alone would make it much clearer:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, thanks for your contribution!
@slotThe like what is this +-- master: < '7' >. What <> and [] mean here. What is dn? Is it down? Why then focus is not fs? Is <7> part of of up? Why the order is 7, 2, 3? Why 4 comes after 7 then, etc? IMO this is one of the most confusing ASCII art I’ve ever seen, it leaves so many questions open and doesn’t even answer one to me 🤷
I suggest clarifying the questions and adapting the ASCII explanation instead of creating a new example. So change the art and the surrounding text in a way that you have no more questions.
@unclechu friendly ping :) |
I will close this for now, feel free to reopen when you get back to this! |
Description
Add extra comment lines with examples making it more clear how the data is organized. By looking at the existing comment it wasn’t really clear for me what’s going on. I though adding an example like this would make it much easier to understand.
Checklist
I've read CONTRIBUTING.md
I've confirmed these changes don't belong in xmonad-contrib instead
It’s just a comment for the core type.
I've considered how to best test these changes (property, unit,
manually, ...) and concluded: XXX
Nothing to test, it’s just a comment.
I updated the
CHANGES.md
fileNothing to mention there as the actual code didn’t change at all.