module System.Process.ListLike.Classes
( ListLikeLazyIO(..)
, ProcessOutput(..)
) where
import Control.Exception (SomeException)
import Data.ListLike (ListLikeIO(..))
import Data.ListLike.Text.Text ()
import Data.ListLike.Text.TextLazy ()
import Data.Monoid (Monoid(mempty, mappend))
import Prelude hiding (null, length, rem)
import System.Exit (ExitCode(ExitFailure))
import System.IO hiding (hPutStr, hGetContents)
import System.Process (ProcessHandle)
class Monoid b => ProcessOutput a b | b -> a where
pidf :: ProcessHandle -> b
outf :: a -> b
errf :: a -> b
intf :: SomeException -> b
codef :: ExitCode -> b
instance Monoid ExitCode where
mempty = ExitFailure 0
mappend x (ExitFailure 0) = x
mappend _ x = x
class ListLikeIO a c => ListLikeLazyIO a c where
readChunks :: Handle -> IO [a]