ยค stdinF, stdoutF, et al

Stdio

Types

stdinF :: F b String
stdoutF :: F String a
stdioF :: F String String
stderrF :: F String a
outputF :: String -> F String a
appendChanK :: FudgetIO f => String -> String -> f b ho -> f b ho
appendStdoutK :: FudgetIO f => String -> f b ho -> f b ho
appendStderrK :: FudgetIO f => String -> f b ho -> f b ho
echoK :: FudgetIO f => String -> f b ho -> f b ho
echoStderrK :: FudgetIO f => String -> f b ho -> f b ho
linesSP :: SP Char String
inputLinesSP :: SP String String

Description

These fudgets allow communication through the Haskell channel system.

stdinF reads characters from standard input and delivers them on its output as soon as they become available. It outputs a stream of strings rather than a stream of characters for efficiency reasons. An empty string in the output indicate the end of the stream.

outputF outputs the strings it receives on its input on a channel. stdoutF and stderrF output to the standard output and standard error channels, respectively.

stdioF is a combination of stdinF and stdoutF.

appendChanK provides convenient access to the AppendChan request. But the only possible channels are stdout and stderr, so can always use appendStdoutK or appendStderrK instead.

echoK and echoStderrK output a string and a new line character on stdout and stderr, respectively.

linesSP inputs a stream of characters (including newline characters) and outputs a stream of lines. inputLinesSP inputs arbitrary chunks of characters and outputs lines. This is a useful postprocessor for stdinF.

Equalities

   stdoutF         = outputF stdout
   stderrF         = outputF stderr
   appendStdoutK s = appendChanK stdout s
   appendStderrK s = appendChanK stderr s
   echoK         s = appendStdoutK (s ++ "\n")
   echoStderrK   s = appendStderrK (s ++ "\n")
   inputLinesSP    = linesSP `serCompSP` concatSP

See Also

haskellIO