chp-1.7.1: An implementation of concurrency ideas from Communicating Sequential Processes



Contains a process for easily using stdin, stdout and stderr as channels.



data ConsoleChans Source

A set of channels to be given to the process to run, containing channels for stdin, stdout and stderr.

consoleProcess :: (ConsoleChans -> CHP ()) -> CHP ()Source

A function for running the given CHP process that wants console channels. When your program finishes, the console channels are automatically poisoned, but it's good practice to poison them yourself when you finish. Only ever run one of these processes at a time, or undefined behaviour will result.

When using this process, due to the way that the console handlers are terminated, you may sometimes see a notice that a thread was killed. This is normal behaviour (unfortunately).