This package provides primitive facilities for separating view and model/state in Standard ML. The idea is to have an interactive program where the user interface remains responsive, even though heavy (and perhaps blocking) computation is taking place in the underlying model. This is done by structuring the program as two processes: a view process and a model process. These communicate via pipes. Some care must be taken to ensure that the view process is never blocked, as this would freeze the user interface.
The facilities here are mostly aimed towards (and exclusively tested with) CLI/TUI interfaces.
-
lib/github.com/diku-dk/sml-model-view/model-view.mlb:
- signature CHANNEL (also the documentation)
- structure Channel
The library is designed for use with smlpkg.
$ make run
Enter lines of input as you wish.