HTTP-3001.0.4ContentsIndex
Network.Stream
Portabilitynon-portable (not tested)
Stabilityexperimental
Maintainerbjorn@bringert.net
Description

An library for creating abstract streams. Originally part of Grayss 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
Synopsis
class Stream x where
readLine :: x -> IO (Result String)
readBlock :: x -> Int -> IO (Result String)
writeBlock :: x -> String -> IO (Result ())
close :: x -> IO ()
data ConnError
= ErrorReset
| ErrorClosed
| ErrorParse String
| ErrorMisc String
type Result a = Either ConnError a
bindE :: Result a -> (a -> Result b) -> Result b
Documentation
class Stream x where

Streams should make layering of TLS protocol easier in future, they allow readingwriting to files etc for debugging, they allow use of protocols other than TCPIP 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 ;)

Methods
readLine :: x -> IO (Result String)
readBlock :: x -> Int -> IO (Result String)
writeBlock :: x -> String -> IO (Result ())
close :: x -> IO ()
show/hide Instances
data ConnError
Constructors
ErrorReset
ErrorClosed
ErrorParse String
ErrorMisc String
show/hide Instances
type Result a = Either ConnError a
This is the type returned by many exported network functions.
bindE :: Result a -> (a -> Result b) -> Result b
Produced by Haddock version 0.8