Hi There!
Say I have a gigantic multi-node Tree in Haskell where each node contains HTML content of each page.
Using Yesod, the user will access a web page with the URL /myPage and the Handler
getMyPageR :: Handler Html
will be called.
What I want is the HTML content of the page to be generated by the current tree node.
In the tree, we start off at the root, we extract the HTML content of the current node and show it as the current page. In each page, there's multiple buttons which represents the user's choices. There's one button per child of the current node. Then, depending on the user's choice, the tree will go down one level to the specific child the user chose and new HTML content will appear. The user can then make another choice, the tree again goes down one level and new HTML content appears. So on and so forth.
Essentially, every choice by the user brings the tree down one level until we arrive at a leaf node.
I was thinking of implementing this using Zippers in Haskell so that I can easily travel through the tree and keep Breadcrumbs of where I traveled.
What is a good solution to implement this in Yesod? I would like this good solution to include the use of Zippers.
One solution could be to send the Tree through Sessions using POST/Redirect/GET on the same page, but if the tree is too big, it won't work.
Don't hesitate to ask me to clarity my question if it's not clear enough.
Thanks in advance.