chp-1.0.2: An implementation of concurrency ideas from Communicating Sequential ProcessesSource codeContentsIndex
Control.Concurrent.CHP.Console
Description
Contains a process for easily using stdin, stdout and stderr as channels.
Synopsis
data ConsoleChans = ConsoleChans {
cStdin :: Chanin Char
cStdout :: Chanout Char
cStderr :: Chanout Char
}
consoleProcess :: (ConsoleChans -> CHP ()) -> CHP ()
Documentation
data ConsoleChans Source
A set of channels to be given to the process to run, containing channels for stdin, stdout and stderr.
Constructors
ConsoleChans
cStdin :: Chanin Char
cStdout :: Chanout Char
cStderr :: Chanout Char
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).

Produced by Haddock version 2.3.0