Stream -package:ghc
A duplex communications channel (results in creation of a duplex
Handle). The standard libraries use this device type when
creating
Handles for open sockets.
A co-recursive type yielding a single element at a time depending on
the internal state it carries.
An instance of
Stream has stream type
s, underlying
monad
m and token type
t determined by the stream
Some rough guidelines for a "correct" instance of Stream:
- unfoldM uncons gives the [t] corresponding to the stream
- A Stream instance is responsible for maintaining the
"position within the stream" in the stream state s. This is
trivial unless you are using the monad in a non-trivial way.
These are stream fusion versions of some of the functions in
Data.Conduit.Combinators. Many functions don't have stream
versions here because instead they have
RULES which inline a
definition that fuses.
A Stream endpoint for a given method emits a stream of encoded values
at a given Content-Type, delimited by a framing
strategy. Type synonyms are provided for standard methods.
Megaparsec's input stream facilities.
You probably do not want to import this module directly because
Text.Megaparsec re-exports it anyway.
Type class for inputs that can be consumed by the library.
Note that the
Stream instances for
Text and
ByteString (strict and lazy) default to "input sharing" (see
ShareInput,
NoShareInput). We plan to move away from
input sharing in a future major release; if you want to retain the
current behaviour and are concerned with maximum performance you
should consider using the
ShareInput wrapper explicitly.
Note: before the version
9.0.0 the class included the
methods from
VisualStream and
TraversableStream.
Transmitting HTTP requests and responses holding
String in
their payload bodies. This is one of the implementation modules for
the
Network.HTTP interface, representing request and response
content as
Strings and transmitting them in non-packed form
(cf.
Network.HTTP.HandleStream and its use of
ByteStrings.) over
Stream handles. It is mostly here
for backwards compatibility, representing how requests and responses
were transmitted up until the 4.x releases of the HTTP package.
For more detailed information about what the individual exports do,
please consult the documentation for
Network.HTTP.
Notice however that the functions here do not perform any kind
of normalization prior to transmission (or receipt); you are
responsible for doing any such yourself, or, if you prefer, just
switch to using
Network.HTTP function instead.
An library for creating abstract streams. Originally part of
Gray's/Bringert's HTTP module.
- Changes by Robin Bate Boerop robin@bateboerop.name:
- Removed unnecessary import statements.
- Moved Debug code to StreamDebugger.hs
- Moved Socket-related code to StreamSocket.hs.
- Changes by Simon Foster:
- Split Network.HTTPmodule up into to separate
Network.[Stream,TCP,HTTP] modules
Streams should make layering of TLS protocol easier in future, they
allow reading/writing to files etc for debugging, they allow use of
protocols other than TCP/IP and they allow customisation.
Instances of this class should not trim the input in any way, e.g.
leave LF on line endings etc. Unless that is exactly the behaviour you
want from your twisted instances ;)
Lightweight abstraction over an input/output stream.
Lightweight abstraction over an input/output stream.
An instance of
Stream has stream type
s, underlying
monad
m and token type
t determined by the stream
Some rough guidelines for a "correct" instance of Stream:
- unfoldM uncons gives the [t] corresponding to the stream
- A Stream instance is responsible for maintaining the
"position within the stream" in the stream state s. This is
trivial unless you are using the monad in a non-trivial way.
output body is a function that writes to a
Builder stream