pipes-2.5.0: Compositional pipelines

Safe HaskellSafe
LanguageHaskell98

Control.Proxy.Prelude.IO

Contents

Description

String-based IO operations.

Note that Strings are very inefficient, and I will release future separate packages with ByteString and Text operations. I only provide these to allow users to test simple I/O without requiring additional library dependencies.

Synopsis

Standard I/O

Input

getLineS :: y' -> Proxy x' x y' String IO r Source #

Get input from stdin one line at a time and send 'D'ownstream

getLineC :: y' -> Proxy String x y' y IO r Source #

Get input from stdin one line at a time and send 'U'pstream

readLnS :: Read a => y' -> Proxy x' x y' a IO r Source #

read input from stdin one line at a time and send 'D'ownstream

readLnC :: Read a => y' -> Proxy a x y' y IO r Source #

read input from stdin one line at a time and send 'U'pstream

Output

printB :: (Show a, Show a') => a' -> Proxy a' a a' a IO r Source #

prints all values flowing through it to stdout

Prefixes upstream values with "U: " and downstream values with "D: "

printD :: Show a => x -> Proxy x a x a IO r Source #

prints all values flowing 'D'ownstream to stdout

printU :: Show a' => a' -> Proxy a' x a' x IO r Source #

prints all values flowing 'U'pstream to stdout

putStrLnB :: String -> Proxy String String String String IO r Source #

putStrLns all values flowing through it to stdout

Prefixes upstream values with "U: " and downstream values with "D: "

putStrLnD :: x -> Proxy x String x String IO r Source #

putStrLns all values flowing 'D'ownstream to stdout

putStrLnU :: String -> Proxy String x String x IO r Source #

putStrLns all values flowing 'U'pstream to stdout

Interaction

promptS :: String -> Proxy x' x String String IO r Source #

Convert 'stdin'/'stdout' into a line-based Server

promptC :: y' -> Proxy String String y' y IO r Source #

Convert 'stdin'/'stdout' into a line-based Client

Handle I/O

Input

hGetLineD :: Handle -> y' -> Proxy x' x y' String IO r Source #

Get input from a handle one line at a time and send 'D'ownstream

hGetLineU :: Handle -> y' -> Proxy String x y' y IO r Source #

Get input from a handle one line at a time and send 'U'pstream

Output

hPrintB :: (Show a, Show a') => Handle -> a' -> Proxy a' a a' a IO r Source #

prints all values flowing through it to a Handle

Prefixes upstream values with "U: " and downstream values with "D: "

hPrintD :: Show a => Handle -> x -> Proxy x a x a IO r Source #

prints all values flowing 'D'ownstream to a Handle

hPrintU :: Show a' => Handle -> a' -> Proxy a' x a' x IO r Source #

prints all values flowing 'U'pstream to a Handle

hPutStrLnB :: Handle -> String -> Proxy String String String String IO r Source #

putStrLns all values flowing through it to a Handle

Prefixes upstream values with "U: " and downstream values with "D: "

hPutStrLnD :: Handle -> x -> Proxy x String x String IO r Source #

putStrLns all values flowing 'D'ownstream to a Handle

hPutStrLnU :: Handle -> String -> Proxy String x String x IO r Source #

putStrLns all values flowing 'U'pstream to a Handle