Is it possible to produce an executable with ocamlc or ocamlopt that acts as an optimized task manager for a small list of tasks, featuring 1) autocompletion
and 2) reacting to keystrokes without having to type “ENTER” ?
Say I have the following :
val transition : state -> char -> state
val action : state -> char -> unit
From those initial data, what code should I write to have my executable start in state 0 when launched, and everytime a key corresponding to character c is pressed and the executable is in state i, I want it to execute action(i,c) and go to state transition(i,c).
I found a lot of material mildly related to this, but nothing dealing with it directly. For example, I know that utop has autocompletion, but I don’t want to spend a lot of time learning about utop’s internals.
How is autocomplete supposed to work? Based on the current state, what should it do? And what about the actions during autocomplete? Based on the interface, there is no way to know which transitions are legal from a state and hence no way to “complete” to another state.
I didn’t elaborate on that because I didn’t need to, and I wanted to keep my question simple and short. But since you ask, here are more specific details : I want to combine autocompletion pretty much as it exists in utop (except that I want uncapitalized module names which I find more natural), combined with a few commands to recompile a module, rename a module, duplicate a module, etc.