module Data.Streaming.Process.Internal
( StreamingProcessHandle (..)
, InputSource (..)
, OutputSink (..)
) where
import Control.Concurrent.STM (TMVar)
import System.Exit (ExitCode)
import System.IO (Handle)
import System.Process (ProcessHandle, StdStream (CreatePipe))
class InputSource a where
isStdStream :: (Maybe Handle -> IO a, Maybe StdStream)
instance InputSource Handle where
isStdStream = (\(Just h) -> return h, Just CreatePipe)
class OutputSink a where
osStdStream :: (Maybe Handle -> IO a, Maybe StdStream)
instance OutputSink Handle where
osStdStream = (\(Just h) -> return h, Just CreatePipe)
data StreamingProcessHandle = StreamingProcessHandle
ProcessHandle
(TMVar ExitCode)
(IO ())