-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Process extras -- @package process-extras @version 0.3.1 module System.Process.Common class Monoid b => ProcessOutput a b | b -> a pidf :: ProcessOutput a b => ProcessHandle -> b outf :: ProcessOutput a b => a -> b errf :: ProcessOutput a b => a -> b intf :: ProcessOutput a b => SomeException -> b codef :: ProcessOutput a b => ExitCode -> b -- | A process usually has one ExitCode at the end of its output, -- this Monoid instance lets us build the type returned by -- readProcessWithExitCode. class ListLikeIO a c => ListLikeProcessIO a c forceOutput :: ListLikeProcessIO a c => a -> IO a readChunks :: ListLikeProcessIO a c => Handle -> IO [a] -- | Like readProcessWithExitCode, but with generalized input and -- output type. readProcessWithExitCode :: ListLikeProcessIO a c => FilePath -> [String] -> a -> IO (ExitCode, a, a) readCreateProcessWithExitCode :: ListLikeProcessIO a c => CreateProcess -> a -> IO (ExitCode, a, a) readCreateProcess :: (ProcessOutput a b, ListLikeProcessIO a c) => CreateProcess -> a -> IO b ignoreResourceVanished :: IO () -> IO () -- | Like readCreateProcess, but the output is read lazily. readCreateProcessLazy :: (ProcessOutput a b, ListLikeProcessIO a c) => CreateProcess -> a -> IO b -- | Helper function for readCreateProcessLazy. readInterleaved :: (ListLikeProcessIO a c, ProcessOutput a b) => [(a -> b, Handle)] -> IO b -> IO b readInterleaved' :: (ListLikeProcessIO a c, ProcessOutput a b) => [(a -> b, Handle)] -> IO b -> MVar (Either Handle b) -> IO b -- | Write and flush process input, closing the handle when done. Catch and -- ignore Resource Vanished exceptions, they just mean the process exited -- before all of its output was read. writeInput :: ListLikeProcessIO a c => Handle -> a -> IO () -- | Wrapper for a process that provides a handler for the ResourceVanished -- exception. This is frequently an exception we wish to ignore, because -- many processes will deliberately exit before they have read all of -- their input. resourceVanished :: (IOError -> IO a) -> IOError -> IO a instance Monoid ExitCode instance ListLikeProcessIO a c => ProcessOutput a (ExitCode, a, a) module System.Process.ByteString.Lazy -- | Like readProcessWithExitCode, but using ByteString -- | Specialized version for backwards compatibility. readProcessWithExitCode :: FilePath -> [String] -> ByteString -> IO (ExitCode, ByteString, ByteString) readCreateProcessWithExitCode :: CreateProcess -> ByteString -> IO (ExitCode, ByteString, ByteString) instance ListLikeProcessIO ByteString Word8 module System.Process.Text -- | Like readProcessWithExitCode, but using Text -- | Specialized version for backwards compatibility. readProcessWithExitCode :: FilePath -> [String] -> Text -> IO (ExitCode, Text, Text) readCreateProcessWithExitCode :: CreateProcess -> Text -> IO (ExitCode, Text, Text) instance ListLikeProcessIO Text Char module System.Process.Text.Lazy -- | Like readProcessWithExitCode, but using Text -- | Specialized version for backwards compatibility. readProcessWithExitCode :: FilePath -> [String] -> Text -> IO (ExitCode, Text, Text) readCreateProcessWithExitCode :: CreateProcess -> Text -> IO (ExitCode, Text, Text) instance ListLikeProcessIO Text Char module System.Process.ByteString -- | Like readProcessWithExitCode, but using ByteString -- | Specialized version for backwards compatibility. readProcessWithExitCode :: FilePath -> [String] -> ByteString -> IO (ExitCode, ByteString, ByteString) readCreateProcessWithExitCode :: CreateProcess -> ByteString -> IO (ExitCode, ByteString, ByteString) instance ListLikeProcessIO ByteString Word8 -- | Re-export all symbols and instances of the process-extras package. module System.Process.ListLike class ListLikeIO a c => ListLikeProcessIO a c forceOutput :: ListLikeProcessIO a c => a -> IO a class Monoid b => ProcessOutput a b | b -> a pidf :: ProcessOutput a b => ProcessHandle -> b outf :: ProcessOutput a b => a -> b errf :: ProcessOutput a b => a -> b intf :: ProcessOutput a b => SomeException -> b codef :: ProcessOutput a b => ExitCode -> b readCreateProcess :: (ProcessOutput a b, ListLikeProcessIO a c) => CreateProcess -> a -> IO b -- | Like readCreateProcess, but the output is read lazily. readCreateProcessLazy :: (ProcessOutput a b, ListLikeProcessIO a c) => CreateProcess -> a -> IO b readCreateProcessWithExitCode :: ListLikeProcessIO a c => CreateProcess -> a -> IO (ExitCode, a, a) -- | Like readProcessWithExitCode, but with generalized input and -- output type. readProcessWithExitCode :: ListLikeProcessIO a c => FilePath -> [String] -> a -> IO (ExitCode, a, a) -- | This type is a concrete representation of the methods of class -- ProcessOutput. If you take your process output as this type you could, -- for example, echo all the output and then use collectOutput below to -- convert it to any other instance of ProcessOutput. data Chunk a -- | This will always come first, before any output or exit code. ProcessHandle :: ProcessHandle -> Chunk a Stdout :: a -> Chunk a Stderr :: a -> Chunk a Result :: ExitCode -> Chunk a -- | Note that the instances below do not use this constructor. Exception :: SomeException -> Chunk a -- | Turn a [Chunk a] into any other instance of -- ProcessOutput. collectOutput :: ProcessOutput a b => [Chunk a] -> b -- | System.Process utility functions. showCreateProcessForUser :: CreateProcess -> String showCmdSpecForUser :: CmdSpec -> String instance ListLikeProcessIO a c => ProcessOutput a (ExitCode, [Chunk a]) instance ListLikeProcessIO a c => ProcessOutput a [Chunk a] instance ListLikeProcessIO String Char