Safe Haskell | Safe-Inferred

CrossPackageDocs

Synopsis

- map :: (a -> b) -> [a] -> [b]
- class IsString a where
  - fromString :: String -> a
- runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (Handle, Handle, Handle, ProcessHandle)

# Documentation

map :: (a -> b) -> [a] -> [b]

`map` `f xs` is the list obtained by applying `f` to each element of `xs`, i.e.,

     map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
     map f [x1, x2, ...] == [f x1, f x2, ...]

class IsString a where

Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).

Methods

fromString :: String -> a

Instances

IsString [Char] |

runInteractiveProcess

Arguments

:: FilePath | Filename of the executable (see `proc` for details)
-> [String] | Arguments to pass to the executable
-> Maybe FilePath | Optional path to the working directory
-> Maybe [(String, String)] | Optional environment (otherwise inherit)
-> IO (Handle, Handle, Handle, ProcessHandle) |

Runs a raw command, and returns `Handle`s that may be used to communicate with the process via its `stdin`, `stdout` and `stderr` respectively.

For example, to start a process and feed a string to its stdin:

       (inp,out,err,pid) <- runInteractiveProcess "..."
       forkIO (hPutStr inp str)

The `Handle`s are initially in binary mode; if you need them to be in text mode then use `hSetBinaryMode`.