Previous chapter ⋅ Full source code ⋅ Next chapter
For the sake of simplicity, let our statuses be either TODO
or DONE
:
type Mark = Unit `S` Unit
pattern TODO e = This e
pattern DONE e = That e
But currently we don’t have statuses along task titles - let’s add it:
type Task = Status `P` Title
Since our type for task has changed so initial data should as well:
start = to @(Scrolling List) `ha` Nonempty @List @Task
`ha` Item (it TODO `lu` "Apply to that new position") `ha` Next
`ha` Item (it TODO `lu` "Find a way to fix ligatures") `ha` Next
`ha` Item (it TODO `lu` "Organize a boardgame session") `ha` Next
`ha` Item (it DONE `lu` "Buy a water gun for Songkran") `ha` Last
… and do not forget about rendering:
print cursor (These status task) = enter @World
`yuk___` Run `hv____` hand `yokl` Forth `ha` Run `ha` output
`yuk___` Run `hv____` mark `yokl` Forth `ha` Run `ha` output
`yuk___` Run `hv____` task `yokl` Forth `ha` Run `ha` output
`yuk___` Run `hv____` output `hv` Caret Newline where
hand = is @Title `hv__` " - " `lv` " -> " `li` cursor
mark = is @Title `hv__` "TODO " `lv` "DONE " `li` status
Next time we will allow users to switch task statuses.