Murat Kasimov

More about me

Я language (β)

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

Full source codePrevious chapterNext chapter

If someoune runs program from previous chapters they would'nt see any difference in console output, Scrolling List and Nonempty List would print the same output since those are functors and we handle only items. In this chapter we highlight only a focused item.

The problem is that iterating over items doesn't say anything about their position within data structure:

initial `yokl` Forth `ha` Await `ha` print

Luckily for Scrolling List we can slightly adjust code above by adding co-Kleisli morphism that let us distinguish focused item and non-focused ones:

initial `kyokl` Locus `ha` Forth `ha` Await `ha` print

But to make it work we need to redefine print expression since its domain now is Opted:

print = Cursor `hu` " -> " `lo` is `la_` Bullet `hu` " - " `lo` is `ho__` is @Title `ha` to `ha` Merge @List @(Nonempty List) `ho__'yokl` Forth `ha` Await `ha` output `ho__'yuk` Await `ha` output `ha` Caret `hv'he` Newline