Murat Kasimov

More about me

Я language (β)

/Я language (β)/Tutorials/Command line task manager 8/

Full source codePrevious chapterNext chapter

Task statuses have been successfully introduced - then user should be able to switch them.

Before we used Shifter for List as a command, we should add options for task status switchers as well:

type Command = Shifter List `S` Status

In addition we add patterns for commands:

pattern Motion e = This e pattern Status e = That e

Let's distinguish keys for navigation and state transitions with case:

> match = exact `ha` Glyph `ha` Letter `ha` Lower `hv'he` J `ho'yo` ( Motion `ha` Below ) >> `lo'ys'la` exact `ha` Glyph `ha` Letter `ha` Lower `hv'he` K `ho'yo` ( Motion `ha` Above ) `ho` Check >> `lo'ys'la` exact `ha` Glyph `ha` Letter `ha` Upper `hv'he` T `ho'yo` ( Status `ha` TODO ) `ho` Check >> `lo'ys'la` exact `ha` Glyph `ha` Letter `ha` Upper `hv'he` D `ho'yo` ( Status `ha` DONE ) `ho` Check

Challenge: use other group of ASCII symbols for commands.

The last step is updating the state. If we get Status command, to get access to an element under the current cursor we need to narrow Scope from Scrolling List to Alone:

> `yok_____` Apply `ha` State `ha` Event `ha` shift `ho'hu` Unit >> `la_____` Apply `ha` State `ha` Event `ha` relay `ho'hu` Unit >>> `ho__'ha` Scope `hv` at @( Alone Task ) >>>> `ho_'he` Scope `hv` at @ Status

Challenge: update focused item of Scrolling List without Scope.