Skip to content
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

Saving configuration data #7

Open
JeffreyBenjaminBrown opened this issue Oct 3, 2017 · 0 comments
Open

Saving configuration data #7

JeffreyBenjaminBrown opened this issue Oct 3, 2017 · 0 comments

Comments

@JeffreyBenjaminBrown
Copy link
Owner

JeffreyBenjaminBrown commented Oct 3, 2017

Since RSLT is an instance of Read and Show, it can already be saved as plain text:

>>> g <- ui empty -- after executing this, I added the expression "a # b" and then exited the ui
>>> s = show g -- s is g represented as a String
>>> s
"mkGraph [(0,Word \"a\"),(1,Word \"b\"),(2,Tplt [\"\",\"\",\"\"]),(3,Rel)] [(3,0,RelEdge (Mbr 1)),(3,1,RelEdge (Mbr 2)),(3,2,RelEdge TpltRole)]"
>>> writeFile "data.rslt" s
>>> s' <- readFile "data.rslt"
>>> g' = read h :: RSLT
>>> g'
mkGraph [(0,Word "a"),(1,Word "b"),(2,Tplt ["","",""]),(3,Rel)] [(3,0,RelEdge (Mbr 1)),(3,1,RelEdge (Mbr 2)),(3,2,RelEdge TpltRole)]

However, the user cannot yet save configuration details like "decorate tasks by prepending the symbol TODO", "Order expressions by priority", or "Hide anything marked 'boring'."

The configuration data will need to refer to the graph. It would be most naturally encoded as part of the graph. That will require expanding the data model (the number of Expr constructors).

A less elegant but easier alternative would be to store the configuration data as QNodes that match on text. This has the drawback, though, that if the text of the graph changes, the QNodes can become invalid.

@JeffreyBenjaminBrown JeffreyBenjaminBrown changed the title Configuration data, and saving to disk Saving configuration data Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant