HTTP-4000.4.1: A library for client-side HTTP

Copyright | See LICENSE file
License | BSD
Maintainer | Ganesh Sittampalam <ganesh@earth.li>
Stability | experimental
Portability | non-portable (not tested)
Safe Haskell | None
Language | Haskell98

Network.StreamDebugger

Description

Implements debugging of `Stream`s. Originally part of Gray's/Bringert's HTTP module.

- Changes by Robin Bate Boerop robin@bateboerop.name:
- Created. Made minor formatting changes.

Synopsis

- data StreamDebugger x
- debugStream :: Stream a => FilePath -> a -> IO (StreamDebugger a)
- debugByteStream :: HStream ty => FilePath -> HandleStream ty -> IO (HandleStream ty)

# Documentation

data StreamDebugger x Source #

Allows stream logging. Refer to `debugStream` below.

#### Instances

Instances details

Stream x => Stream (StreamDebugger x) Source # |
Instance details Defined in Network.StreamDebugger Methods readLine :: StreamDebugger x -> IO (Result String) Source # readBlock :: StreamDebugger x -> Int -> IO (Result String) Source # writeBlock :: StreamDebugger x -> String -> IO (Result ()) Source # close :: StreamDebugger x -> IO () Source # closeOnEnd :: StreamDebugger x -> Bool -> IO () Source #

debugStream :: Stream a => FilePath -> a -> IO (StreamDebugger a) Source #

Wraps a stream with logging I/O. The first argument is a filename which is opened in `AppendMode`.

debugByteStream :: HStream ty => FilePath -> HandleStream ty -> IO (HandleStream ty) Source #