Murat Kasimov

More about me

Я language (β)

/Я language (β)/Tutorials/Command line-task-manager-2/

Full source codePrevious chapterNext chapter

In previous chapter we just printed a list of all task titles - our next step is to scroll over this list by using Scrolling List. Unfortunately, we cannot transform List into Scrolling List since the latter always has some item focused. However, pretty similar natural transformation does exist:

to : Nonempty List `C'AR` Scrolling List

We can either transform List into Nonempty List using la operator or just reinitialise it - let's choose the latter approach this time:

initial = empty @Maybe `lu` "Apply to that new position" `yi` Exist `lu` "Organize a boardgame session" `yi` Exist `lu` "Buy a water gun for Songkran" `yi` Exist `lu` "Find a way to fix ligatures" `yi` Build `yi` is @( Nonempty List Title ) `ho` to @( Scrolling List )

In this chapter the only thing we have done is just changed data structure and there is no need to touch the rest of the code:

main = initial `yokl` Forth `ha` Await `ha` print