stdin -package:io-streams
stdin is a handle managing the programs standard input.
A handle managing input from the Haskell program's standard input
channel.
sourceHandle applied to stdin.
Subject to fusion
Read chunks of bytes from standard input
The chunks are not necessarily aligned to line boundaries
Read lines of
Text from standard input
Read input query from stdin
Source from stdin, yielding bytestrings as they are drawn. If you want
to retrieve each line as a string, see
stdinLines.
Given as the stdin of the spawned process.
This module provides a way in which the Haskell standard input may be
forwarded to the IPython frontend and thus allows the notebook to use
the standard input.
This relies on the implementation of file handles in GHC, and is
generally unsafe and terrible. However, it is difficult to find
another way to do it, as file handles are generally meant to point to
streams and files, and not networked communication protocols.
In order to use this module, it must first be initialized with two
things. First of all, in order to know how to communicate with the
IPython frontend, it must know the kernel profile used for
communication. For this, use recordKernelProfile once the
profile is known. Both this and recordParentHeader take a
directory name where they can store this data.
Finally, the module must know what execute_request message is
currently being replied to (which will request the input). Thus, every
time the language kernel receives an execute_request message,
it should inform this module via recordParentHeader, so that
the module may generate messages with an appropriate parent header
set. If this is not done, the IPython frontends will not recognize the
target of the communication.
Finally, in order to activate this module, fixStdin must be
called once. It must be passed the same directory name as
recordParentHeader and recordKernelProfile. Note
that if this is being used from within the GHC API, fixStdin
must be called from within the GHC session not from the host
code.
In Rhine, event sources are clocks, and so is the console. If this
clock is used, every input line on the console triggers one tick of
the
StdinClock.
Given as the stdin of the spawned process. By default the
stdin is inherited.
sourceHandle applied to stdin.