-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Process extras -- -- Extends http://hackage.haskell.org/package/process. Read -- process input and output as ByteStrings or Text, or write your own -- ProcessOutput instance. Lazy process input and output. ProcessMaker -- class for more flexibility in the process creation API. @package process-extras @version 0.4 module System.Process.Common class ProcessMaker a process :: ProcessMaker a => a -> IO (Handle, Handle, Handle, ProcessHandle) class ListLikeIO a c => ListLikeProcessIO a c forceOutput :: ListLikeProcessIO a c => a -> IO a -- | Read from a handle, returning a lazy list of the monoid a. readChunks :: ListLikeProcessIO a c => Handle -> 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 -- | Like readProcessWithExitCode, but with generalized input and -- output type. readProcessWithExitCode :: ListLikeProcessIO a c => FilePath -> [String] -> a -> IO (ExitCode, a, a) readCreateProcessWithExitCode :: (ProcessMaker maker, ListLikeProcessIO a c) => maker -> a -> IO (ExitCode, a, a) readCreateProcess :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b -- | Like readCreateProcess, but the output is read lazily. readCreateProcessLazy :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b instance System.Process.Common.ProcessMaker System.Process.Common.CreateProcess instance System.Process.Common.ProcessMaker (System.Process.Common.CreateProcess, GHC.IO.Handle.Types.BufferMode, GHC.IO.Handle.Types.BufferMode) instance System.Process.Common.ListLikeProcessIO a c => System.Process.Common.ProcessOutput a (GHC.IO.Exception.ExitCode, a, a) instance GHC.Base.Monoid GHC.IO.Exception.ExitCode 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 System.Process.Common.ListLikeProcessIO Data.Text.Internal.Text GHC.Types.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 System.Process.Common.ListLikeProcessIO Data.Text.Internal.Lazy.Text GHC.Types.Char 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 System.Process.Common.ListLikeProcessIO Data.ByteString.Lazy.Internal.ByteString GHC.Word.Word8 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 System.Process.Common.ListLikeProcessIO Data.ByteString.Internal.ByteString GHC.Word.Word8 -- | Re-export all symbols and instances of the process-extras package. -- Adds the Chunk type with a ProcessOutput instance, and a collectOutput -- function to turn a list of chunks into any instance of ProcessOutput, -- such as (ExitCode, String, String). This means you can have -- readCreateProcess output a list of Chunk, operate on it to do progress -- reporting, and finally convert it to the type that -- readProcessWithExitCode woud have returned. module System.Process.ListLike class ProcessMaker a process :: ProcessMaker a => a -> IO (Handle, Handle, Handle, ProcessHandle) 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 :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b -- | Like readCreateProcess, but the output is read lazily. readCreateProcessLazy :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b readCreateProcessWithExitCode :: (ProcessMaker maker, ListLikeProcessIO a c) => maker -> 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 foldOutput :: (ProcessHandle -> r) -> (a -> r) -> (a -> r) -> (SomeException -> r) -> (ExitCode -> r) -> Chunk a -> r -- | Send Stdout chunks to stdout and Stderr chunks to stderr. writeOutput :: ListLikeIO a c => [Chunk a] -> IO () -- | System.Process utility functions. showCreateProcessForUser :: CreateProcess -> String showCmdSpecForUser :: CmdSpec -> String -- | Construct a CreateProcess record for passing to -- createProcess, representing a raw command with arguments. -- -- See RawCommand for precise semantics of the specified -- FilePath. proc :: FilePath -> [String] -> CreateProcess -- | Construct a CreateProcess record for passing to -- createProcess, representing a command to be passed to the -- shell. shell :: String -> CreateProcess instance GHC.Show.Show a => GHC.Show.Show (System.Process.ListLike.Chunk a) instance System.Process.Common.ListLikeProcessIO GHC.Base.String GHC.Types.Char instance GHC.Show.Show System.Process.Common.ProcessHandle instance System.Process.Common.ListLikeProcessIO a c => System.Process.Common.ProcessOutput a [System.Process.ListLike.Chunk a] instance System.Process.Common.ListLikeProcessIO a c => System.Process.Common.ProcessOutput a (GHC.IO.Exception.ExitCode, [System.Process.ListLike.Chunk a])