pipes-extra-0.2.0: Various basic utilities for Pipes.

Portabilityportable
Stabilityexperimental
Maintainerjeremy@n-heptane.com
Safe HaskellSafe-Infered

Control.Pipe.Tee

Description

The tee combinators act like idP, but also send a copy of the input to the supplied Consumer (e.g. a file). This is typically done for the purpose of logging a pipeline, showing progress, etc.

Synopsis

Documentation

teeSource

Arguments

:: Monad m 
=> Pipe a Void m r

Consumer that will receive a copy of all the input

-> Pipe a a m r 

Acts like idP, but also passes a copy to the supplied consumer.

teeFileSource

Arguments

:: MonadIO m 
=> (a -> ByteString)

function to convert the value to a ByteString which can be written to the log

-> FilePath

file to log to

-> Pipe a a m () 

Acts like idP, but also writes a copy to a file.

teeFileBSSource

Arguments

:: MonadIO m 
=> FilePath

file to log to

-> Pipe ByteString ByteString m () 

Acts like, idP, but also writes a copy to the specified log file.

This function is equivalent to teeFile id.